#include <BoundaryMeshAssociation.hpp>
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 |
Definition at line 58 of file BoundaryMeshAssociation.hpp.
typedef std::map<const Boundary*, ConstReferenceCounting<SurfaceMesh> > BoundaryMeshAssociation::MapBoundaryToMesh [private] |
Definition at line 64 of file BoundaryMeshAssociation.hpp.
| typedef MapBoundaryToMesh::const_iterator BoundaryMeshAssociation::const_iterator |
Definition at line 164 of file BoundaryMeshAssociation.hpp.
| BoundaryMeshAssociation::BoundaryMeshAssociation | ( | const Problem & | P, | |
| MeshType & | M | |||
| ) | [inline] |
Constructor
| 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 }

| BoundaryMeshAssociation::~BoundaryMeshAssociation | ( | ) | [inline] |
| 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
| 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 }

| void BoundaryMeshAssociation::__storesBoundariesAndMeshes | ( | const VariationalBorderOperator & | borderOperator, | |
| const MeshType & | M | |||
| ) | [inline, private] |
Stores boundaries and meshes from a given border operator and a given mesh
| 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 }

| const_iterator BoundaryMeshAssociation::begin | ( | ) | const [inline] |
returns begin iterator on association
Definition at line 171 of file BoundaryMeshAssociation.hpp.
References __boundaryMesh.
Referenced by BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__checkBoundaryMeshAssociation(), and BoundaryConditionFDMDiscretization< MeshType, TypeOfDiscretization >::__markFictitiousCells().
00172 { 00173 return __boundaryMesh.begin(); 00174 }
| const_iterator BoundaryMeshAssociation::end | ( | ) | const [inline] |
returns the end off the association
Definition at line 181 of file BoundaryMeshAssociation.hpp.
References __boundaryMesh.
Referenced by BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__checkBoundaryMeshAssociation(), and BoundaryConditionFDMDiscretization< MeshType, TypeOfDiscretization >::__markFictitiousCells().
00182 { 00183 return __boundaryMesh.end(); 00184 }
| const bool& BoundaryMeshAssociation::hasPOVReferences | ( | ) | const [inline] |
Read only access to the pov-ray boundary presence
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
| 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 }

| ConstReferenceCounting<SurfaceMesh> BoundaryMeshAssociation::operator[] | ( | const Boundary & | b | ) | const [inline] |
Access to the mesh related to a given boundary
| b | the boundary |
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 }

bool BoundaryMeshAssociation::__hasPOVReference [private] |
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().
1.5.6