BoundaryMeshAssociation Class Reference

#include <BoundaryMeshAssociation.hpp>

List of all members.

Public Types

typedef
MapBoundaryToMesh::const_iterator 
const_iterator

Public Member Functions

const_iterator begin () const
const_iterator end () const
const bool & hasPOVReferences () const
void setPOVMeshes (const Domain &omega, ConstReferenceCounting< SurfaceMeshOfTriangles > mesh)
ConstReferenceCounting
< SurfaceMesh
operator[] (const Boundary &b) const
template<typename MeshType>
 BoundaryMeshAssociation (const Problem &P, MeshType &M)
 ~BoundaryMeshAssociation ()

Private Types

typedef std::map< const
Boundary
*, ConstReferenceCounting
< SurfaceMesh > > 
MapBoundaryToMesh

Private Member Functions

template<typename MeshType>
void __storesBoundariesAndMeshes (const BoundaryConditionSet &bc, const MeshType &M)
template<typename MeshType>
void __storesBoundariesAndMeshes (const VariationalBorderOperator &borderOperator, const MeshType &M)

Private Attributes

bool __hasPOVReference
MapBoundaryToMesh __boundaryMesh


Detailed Description

Definition at line 58 of file BoundaryMeshAssociation.hpp.


Member Typedef Documentation

Definition at line 64 of file BoundaryMeshAssociation.hpp.

typedef MapBoundaryToMesh::const_iterator BoundaryMeshAssociation::const_iterator

Definition at line 164 of file BoundaryMeshAssociation.hpp.


Constructor & Destructor Documentation

template<typename MeshType>
BoundaryMeshAssociation::BoundaryMeshAssociation ( const Problem P,
MeshType &  M 
) [inline]

Constructor

Parameters:
P the problem
M the 3d mesh

Definition at line 249 of file BoundaryMeshAssociation.hpp.

References __storesBoundariesAndMeshes(), VariationalProblem::beginBilinearBorderOperator(), VariationalProblem::beginLinearBorderOperator(), Problem::boundaryConditionSet(), VariationalProblem::endBilinearBorderOperator(), VariationalProblem::endLinearBorderOperator(), VariationalProblem::numberOfUnknown(), PDESystem::numberOfUnknown(), Problem::pde, Problem::type(), and Problem::variational.

00251     : __hasPOVReference(false)
00252   {
00253     switch (P.type()) {
00254     case Problem::pde: {
00255       const PDESystem& system = static_cast<const PDESystem&>(P);
00256       for (size_t i=0; i<system.numberOfUnknown(); ++i) {
00257         this->__storesBoundariesAndMeshes(P.boundaryConditionSet(i), M);
00258       }
00259       break;
00260     }
00261     case Problem::variational: {
00262       const VariationalProblem& V = static_cast<const VariationalProblem&>(P);
00263       for (size_t i=0; i<V.numberOfUnknown(); ++i) {
00264         this->__storesBoundariesAndMeshes(P.boundaryConditionSet(i), M);
00265       }
00266       for (VariationalProblem::bilinearBorderOperatorConst_iterator i
00267              = V.beginBilinearBorderOperator();
00268            i != V.endBilinearBorderOperator(); ++i) {
00269         this->__storesBoundariesAndMeshes(**i, M);
00270       }
00271       for (VariationalProblem::linearBorderOperatorConst_iterator i
00272              = V.beginLinearBorderOperator();
00273            i != V.endLinearBorderOperator(); ++i) {
00274         this->__storesBoundariesAndMeshes(**i, M);
00275       }
00276       break;
00277     }
00278     }
00279   }

Here is the call graph for this function:

BoundaryMeshAssociation::~BoundaryMeshAssociation (  )  [inline]

The destructor

Definition at line 285 of file BoundaryMeshAssociation.hpp.

00286   {
00287     ;
00288   }


Member Function Documentation

template<typename MeshType>
void BoundaryMeshAssociation::__storesBoundariesAndMeshes ( const BoundaryConditionSet bc,
const MeshType &  M 
) [inline, private]

Stores boundaries and meshes from a given boudary condition set and a given mesh

Parameters:
bc the boundary condition set
M the given mesh

Definition at line 77 of file BoundaryMeshAssociation.hpp.

References __boundaryMesh, __hasPOVReference, BoundaryConditionSet::nbBoundaryCondition(), Boundary::povRay, BoundaryReferences::references(), Boundary::references, BoundarySurfaceMesh::surfaceMesh(), Boundary::surfaceMesh, and ErrorHandler::unexpected.

Referenced by BoundaryMeshAssociation().

00079   {
00080     for (size_t i=0; i<bc.nbBoundaryCondition(); ++i) {
00081       if (__boundaryMesh.find(bc[i].boundary())
00082           == __boundaryMesh.end()) {
00083         switch(bc[i].boundary()->type()) {
00084         case Boundary::povRay: {
00085           __boundaryMesh[bc[i].boundary()] = 0;
00086           __hasPOVReference = true;
00087           break;
00088         }
00089         case Boundary::surfaceMesh: {
00090           const BoundarySurfaceMesh& b
00091             = dynamic_cast<const BoundarySurfaceMesh&>(*bc[i].boundary());
00092           const SurfaceMesh* t = b.surfaceMesh();
00093           __boundaryMesh[bc[i].boundary()] = t;
00094           break;
00095         }
00096         case Boundary::references: {
00097           const BoundaryReferences& b
00098             = dynamic_cast<const BoundaryReferences&>(*bc[i].boundary());
00099           
00100           MeshExtractor<typename MeshType::BorderMeshType>
00101             extractor(M.borderMesh());
00102 
00103           __boundaryMesh[bc[i].boundary()]
00104             = extractor(b.references());
00105           break;
00106         }
00107         default: {
00108           throw ErrorHandler(__FILE__,__LINE__,
00109                              "unknown boundary type",
00110                              ErrorHandler::unexpected);
00111         }
00112         }
00113       }
00114     }
00115   }

Here is the call graph for this function:

template<typename MeshType>
void BoundaryMeshAssociation::__storesBoundariesAndMeshes ( const VariationalBorderOperator borderOperator,
const MeshType &  M 
) [inline, private]

Stores boundaries and meshes from a given border operator and a given mesh

Parameters:
borderOperator the border operator
M the given mesh

Definition at line 125 of file BoundaryMeshAssociation.hpp.

References __boundaryMesh, __hasPOVReference, VariationalBorderOperator::boundary(), Boundary::povRay, BoundaryReferences::references(), Boundary::references, BoundarySurfaceMesh::surfaceMesh(), Boundary::surfaceMesh, and ErrorHandler::unexpected.

00127   {
00128     if (__boundaryMesh.find(borderOperator.boundary())
00129         == __boundaryMesh.end()) {
00130       switch(borderOperator.boundary()->type()) {
00131       case Boundary::povRay: {
00132         __boundaryMesh[borderOperator.boundary()] = 0;
00133         __hasPOVReference = true;
00134         break;
00135       }
00136       case Boundary::surfaceMesh: {
00137         const BoundarySurfaceMesh& b
00138           = dynamic_cast<const BoundarySurfaceMesh&>(*borderOperator.boundary());
00139         const SurfaceMesh* t = b.surfaceMesh();
00140         __boundaryMesh[borderOperator.boundary()] = t;
00141         break;
00142       }
00143       case Boundary::references: {
00144         const BoundaryReferences& b
00145           = dynamic_cast<const BoundaryReferences&>(*borderOperator.boundary());
00146           
00147         MeshExtractor<typename MeshType::BorderMeshType>
00148           extractor(M.borderMesh());
00149 
00150         __boundaryMesh[borderOperator.boundary()]
00151           = extractor(b.references());
00152         break;
00153       }
00154       default: {
00155         throw ErrorHandler(__FILE__,__LINE__,
00156                            "unknown boundary type",
00157                            ErrorHandler::unexpected);
00158       }
00159       }
00160     }
00161   }

Here is the call graph for this function:

const_iterator BoundaryMeshAssociation::begin (  )  const [inline]

const_iterator BoundaryMeshAssociation::end (  )  const [inline]

const bool& BoundaryMeshAssociation::hasPOVReferences (  )  const [inline]

Read only access to the pov-ray boundary presence

Returns:
__hasPOVReference

Definition at line 191 of file BoundaryMeshAssociation.hpp.

References __hasPOVReference.

Referenced by BoundaryConditionFDMDiscretization< MeshType, TypeOfDiscretization >::associatesMeshesToBoundaryConditions().

00192   {
00193     return __hasPOVReference;
00194   }

void BoundaryMeshAssociation::setPOVMeshes ( const Domain omega,
ConstReferenceCounting< SurfaceMeshOfTriangles mesh 
) [inline]

Set meshes related to POV-Ray references

Parameters:
omega the computational domain (needed for reference translation)
mesh the complete domain mesh

Definition at line 202 of file BoundaryMeshAssociation.hpp.

References __boundaryMesh, ASSERT, BoundaryPOVRay::numberOfPOVReferences(), Boundary::povRay, BoundaryPOVRay::povReference(), Domain::reference(), and Boundary::type().

Referenced by BoundaryConditionFDMDiscretization< MeshType, TypeOfDiscretization >::associatesMeshesToBoundaryConditions().

00204   {
00205     for (MapBoundaryToMesh::iterator i = __boundaryMesh.begin();
00206          i != __boundaryMesh.end(); ++i) {
00207       const Boundary& b = (*(i->first));
00208       if (b.type() == Boundary::povRay) {
00209         ASSERT(i->second == 0);
00210         const BoundaryPOVRay& pov = dynamic_cast<const BoundaryPOVRay&>(b);
00211         std::set<size_t> references;
00212         for (size_t n=0; n<pov.numberOfPOVReferences(); ++n) {
00213           references.insert(omega.reference(pov.povReference(n)));
00214         }
00215         MeshExtractor<SurfaceMeshOfTriangles> extractor(mesh);
00216         __boundaryMesh[i->first] = extractor(references);
00217       }
00218     }
00219   }

Here is the call graph for this function:

ConstReferenceCounting<SurfaceMesh> BoundaryMeshAssociation::operator[] ( const Boundary b  )  const [inline]

Access to the mesh related to a given boundary

Parameters:
b the boundary
Returns:
the mesh

Definition at line 228 of file BoundaryMeshAssociation.hpp.

References __boundaryMesh, ErrorHandler::normal, and stringify().

00229   {
00230     MapBoundaryToMesh::const_iterator i = __boundaryMesh.find(&b);
00231     if (i != __boundaryMesh.end()) {
00232       return i->second;
00233     } else {
00234       const std::string errorMsg
00235         = "the boundary "+stringify(b)+" was unexpected\n";
00236       throw ErrorHandler(__FILE__,__LINE__,
00237                          errorMsg,
00238                          ErrorHandler::normal);
00239     }
00240   }

Here is the call graph for this function:


Member Data Documentation

indicates if pov-ray boundaries are present

Definition at line 61 of file BoundaryMeshAssociation.hpp.

Referenced by __storesBoundariesAndMeshes(), and hasPOVReferences().

Correspondance between boundaries and meshes

Definition at line 66 of file BoundaryMeshAssociation.hpp.

Referenced by __storesBoundariesAndMeshes(), begin(), end(), operator[](), and setPOVMeshes().


The documentation for this class was generated from the following file:

Generated on Wed Nov 19 00:04:57 2008 for FreeFEM3D (aka ff3d) by  doxygen 1.5.6