SurfaceMeshOfTriangles Class Reference

#include <SurfaceMeshOfTriangles.hpp>

Inheritance diagram for SurfaceMeshOfTriangles:

Inheritance graph
[legend]
Collaboration diagram for SurfaceMeshOfTriangles:

Collaboration graph
[legend]

List of all members.

Public Types

typedef Triangle CellType
typedef Edge FaceType
typedef SurfaceMeshOfTriangles Transformed
enum  { family = Mesh::surface }
enum  Type {
  cartesianHexahedraMesh, hexahedraMesh, octreeMesh, tetrahedraMesh,
  trianglesMesh, spectralMesh, surfaceMeshTriangles, surfaceMeshQuadrangles
}
enum  Family { volume, surface, plane }
 Family. More...

Public Member Functions

bool hasBorderMesh () const
ConstReferenceCounting< MeshborderBaseMesh () const
std::string typeName () const
void buildEdges ()
const Connectivity
< SurfaceMeshOfTriangles > & 
connectivity () const
Connectivity
< SurfaceMeshOfTriangles > & 
connectivity ()
bool inside (const real_t &x, const real_t &y, const real_t &z) const
 Returns true if the point p is inside the mesh.
bool inside (const TinyVector< 3 > &p) const
 Returns true if the point p is inside the mesh.
void computesFictitiousCells () const
Trianglecell (size_t i)
const Trianglecell (size_t i) const
void setNumberOfCells (const int n)
const size_t & numberOfCells () const
size_t cellNumber (const Triangle &t) const
const FaceTypeface (const size_t &i) const
 SurfaceMeshOfTriangles (const size_t theNumberOfCells)
 SurfaceMeshOfTriangles (ReferenceCounting< VerticesSet > vertices, ReferenceCounting< VerticesCorrespondance > correspondances, ReferenceCounting< Vector< Triangle > > triangles)
 SurfaceMeshOfTriangles ()
 ~SurfaceMeshOfTriangles ()
const Mesh::Familyfamily () const
void buildFaces ()
bool isAssociatedTo (const Mesh &m) const
void setBackgroundMesh (const Mesh *m)
const MeshbackgroundMesh () const
bool hasFaces () const
const size_t & numberOfFaces () const
virtual bool isPeriodic () const
virtual bool inside (const TinyVector< 3, real_t > &p) const =0
const Mesh::Typetype () const
const size_t & id () const
size_t vertexNumber (const Vertex &v) const
bool hasEdges () const
size_t edgeNumber (const Edge &e) const
const size_t & numberOfVertices () const
void setNumberOfVertices (const size_t &size)
size_t numberOfEdges () const
ReferenceCounting< VerticesSetverticesSet ()
ConstReferenceCounting
< VerticesSet
verticesSet () const
ReferenceCounting
< VerticesCorrespondance
verticesCorrespondance ()
ConstReferenceCounting
< VerticesCorrespondance
verticesCorrespondance () const
const Vertexvertex (const size_t &i) const
Vertexvertex (const size_t &i)
const size_t & correspondance (const size_t &i) const
const Edgeedge (const size_t &i) const
Edgeedge (const size_t &i)

Protected Member Functions

template<typename CellType>
void __computesFictitiousCells (const Vector< CellType > &cells) const

Protected Attributes

const Mesh__backgroundMesh
ReferenceCounting< VerticesSet__verticesSet
ReferenceCounting
< VerticesCorrespondance
__verticesCorrespondance
ReferenceCounting< EdgesSet__edgesSet

Private Attributes

ReferenceCounting< Vector
< Triangle > > 
__cells
Connectivity
< SurfaceMeshOfTriangles
__connectivity

Classes

struct  BorderMeshType
class  const_iterator
class  iterator


Detailed Description

Definition at line 44 of file SurfaceMeshOfTriangles.hpp.


Member Typedef Documentation

Definition at line 48 of file SurfaceMeshOfTriangles.hpp.

Definition at line 49 of file SurfaceMeshOfTriangles.hpp.

Definition at line 51 of file SurfaceMeshOfTriangles.hpp.


Member Enumeration Documentation

anonymous enum [inherited]

Enumerator:
family 

Definition at line 38 of file SurfaceMesh.hpp.

00038        {
00039     family = Mesh::surface
00040   };

enum Mesh::Type [inherited]

Enumerator:
cartesianHexahedraMesh 
hexahedraMesh 
octreeMesh 
tetrahedraMesh 
trianglesMesh 
spectralMesh 
surfaceMeshTriangles 
surfaceMeshQuadrangles 

Definition at line 43 of file Mesh.hpp.

enum Mesh::Family [inherited]

Family.

Enumerator:
volume 
surface 
plane 

Definition at line 55 of file Mesh.hpp.

00055                {
00056     volume,
00057     surface,
00058     plane
00059   } Family;


Constructor & Destructor Documentation

SurfaceMeshOfTriangles::SurfaceMeshOfTriangles ( const size_t  theNumberOfCells  )  [inline]

Definition at line 323 of file SurfaceMeshOfTriangles.hpp.

00324     : SurfaceMesh(Mesh::surfaceMeshTriangles),
00325       __cells(new Vector<Triangle>(theNumberOfCells)),
00326       __connectivity(*this)
00327   {
00328     ;
00329   }

SurfaceMeshOfTriangles::SurfaceMeshOfTriangles ( ReferenceCounting< VerticesSet vertices,
ReferenceCounting< VerticesCorrespondance correspondances,
ReferenceCounting< Vector< Triangle > >  triangles 
) [inline]

Definition at line 331 of file SurfaceMeshOfTriangles.hpp.

00334     : SurfaceMesh(Mesh::surfaceMeshTriangles,
00335                   vertices,
00336                   correspondances),
00337       __cells(triangles),
00338       __connectivity(*this)
00339   {
00340     ;
00341   }

SurfaceMeshOfTriangles::SurfaceMeshOfTriangles (  )  [inline]

Default constructor

Definition at line 347 of file SurfaceMeshOfTriangles.hpp.

00348     : SurfaceMesh(Mesh::surfaceMeshTriangles),
00349       __connectivity(*this)
00350   {
00351     ;
00352   }

SurfaceMeshOfTriangles::~SurfaceMeshOfTriangles (  )  [inline]

Destructor

Definition at line 358 of file SurfaceMeshOfTriangles.hpp.

00359   {
00360     ;
00361   }


Member Function Documentation

bool SurfaceMeshOfTriangles::hasBorderMesh (  )  const [inline, virtual]

Implements Mesh.

Definition at line 192 of file SurfaceMeshOfTriangles.hpp.

00193   {
00194     return false;
00195   }

ConstReferenceCounting<Mesh> SurfaceMeshOfTriangles::borderBaseMesh (  )  const [inline, virtual]

Implements Mesh.

Definition at line 197 of file SurfaceMeshOfTriangles.hpp.

References ErrorHandler::unexpected.

00198   {
00199     throw ErrorHandler(__FILE__,__LINE__,
00200                        "not implemented yet",
00201                        ErrorHandler::unexpected);
00202 
00203     return 0;
00204   }

std::string SurfaceMeshOfTriangles::typeName (  )  const [inline, virtual]

Returns the typename of the mesh

Returns:
type name of the mesh

Implements Mesh.

Definition at line 206 of file SurfaceMeshOfTriangles.hpp.

00207   {
00208     return "surface mesh of triangles";
00209   }

void SurfaceMeshOfTriangles::buildEdges (  )  [inline, virtual]

builds the edges of a mesh

Implements Mesh.

Definition at line 211 of file SurfaceMeshOfTriangles.hpp.

References Mesh::__edgesSet, and EdgesBuilder< MeshType >::edgesSet().

00212   {
00213     EdgesBuilder<SurfaceMeshOfTriangles> edgesBuilder(*this);
00214     __edgesSet = edgesBuilder.edgesSet();
00215   }

Here is the call graph for this function:

const Connectivity<SurfaceMeshOfTriangles>& SurfaceMeshOfTriangles::connectivity (  )  const [inline]

Read only access to the mesh connectivity

Returns:
the connectivity

Definition at line 222 of file SurfaceMeshOfTriangles.hpp.

References __connectivity.

Referenced by SurfaceMeshGenerator::Internals::__putRefByFront().

00223   {
00224     return __connectivity;
00225   }

Connectivity<SurfaceMeshOfTriangles>& SurfaceMeshOfTriangles::connectivity (  )  [inline]

Access to the mesh connectivity

Returns:
the connectivity

Definition at line 232 of file SurfaceMeshOfTriangles.hpp.

References __connectivity.

00233   {
00234     return __connectivity;
00235   }

bool SurfaceMeshOfTriangles::inside ( const real_t &  x,
const real_t &  y,
const real_t &  z 
) const [inline, virtual]

Returns true if the point p is inside the mesh.

Implements Mesh.

Definition at line 238 of file SurfaceMeshOfTriangles.hpp.

References ErrorHandler::normal.

Referenced by inside().

00239   {
00240     throw ErrorHandler(__FILE__,__LINE__,
00241                        "Trying to find 3d point on a surface mesh",
00242                        ErrorHandler::normal);
00243     return false;
00244   }

bool SurfaceMeshOfTriangles::inside ( const TinyVector< 3 > &  p  )  const [inline]

Returns true if the point p is inside the mesh.

Definition at line 247 of file SurfaceMeshOfTriangles.hpp.

References inside().

00248   {
00249     return this->inside(p[0], p[1], p[2]);
00250   }

Here is the call graph for this function:

void SurfaceMeshOfTriangles::computesFictitiousCells (  )  const [inline, virtual]

Computes fictitious cells of the mesh

Implements SurfaceMesh.

Definition at line 256 of file SurfaceMeshOfTriangles.hpp.

00257   {
00258     this->__computesFictitiousCells<Triangle>(*__cells);
00259   }

Triangle& SurfaceMeshOfTriangles::cell ( size_t  i  )  [inline]

Access to the ith cell

Parameters:
i 
Returns:
the ith cell

Definition at line 268 of file SurfaceMeshOfTriangles.hpp.

References __cells.

Referenced by SurfaceMeshGenerator::Internals::__constructionFinalMesh(), and SurfaceMeshGenerator::Internals::__putRefByFront().

00269   {
00270     return (*__cells)[i];
00271   }

const Triangle& SurfaceMeshOfTriangles::cell ( size_t  i  )  const [inline]

RO-Access to the ith cell

Parameters:
i 
Returns:
the ith cell

Definition at line 280 of file SurfaceMeshOfTriangles.hpp.

References __cells.

00281   {
00282     return (*__cells)[i];
00283   }

void SurfaceMeshOfTriangles::setNumberOfCells ( const int  n  )  [inline]

Reserves storage for n surface elements.

Note:
the content is lost!
Parameters:
n number of elements

Definition at line 290 of file SurfaceMeshOfTriangles.hpp.

References __cells.

Referenced by SurfaceMeshGenerator::Internals::__constructionFinalMesh().

00291   {
00292     __cells = new Vector<Triangle>(n);
00293   }

const size_t& SurfaceMeshOfTriangles::numberOfCells (  )  const [inline, virtual]

Returns the number of cells

Returns:
number of cells

Implements Mesh.

Definition at line 301 of file SurfaceMeshOfTriangles.hpp.

Referenced by SurfaceMeshGenerator::Internals::__constructionFinalMesh(), and SurfaceMeshGenerator::Internals::__putRefByFront().

00302   {
00303     return (*__cells).size();
00304   }

size_t SurfaceMeshOfTriangles::cellNumber ( const Triangle t  )  const [inline]

Definition at line 306 of file SurfaceMeshOfTriangles.hpp.

00307   {
00308     return (*__cells).number(t);
00309   }

const FaceType& SurfaceMeshOfTriangles::face ( const size_t &  i  )  const [inline]

Read-only access to a face

Parameters:
i the face number
Returns:
the i th face

Definition at line 318 of file SurfaceMeshOfTriangles.hpp.

References Mesh::__edgesSet.

00319   {
00320     return (*__edgesSet)[i];
00321   }

const Mesh::Family& Mesh::family (  )  const [inline, inherited]

Read-only access to the family of the mesh

Returns:
__family

Definition at line 287 of file Mesh.hpp.

References Mesh::__family.

Referenced by RealExpressionIntegrate::execute(), and BoundaryExpressionSurfaceMesh::execute().

00288   {
00289     return __family;
00290   }

template<typename CellType>
void SurfaceMesh::__computesFictitiousCells ( const Vector< CellType > &  cells  )  const [inline, protected, inherited]

Definition at line 46 of file SurfaceMesh.hpp.

References Vector< T >::size().

00047   {
00048     for (size_t i=0; i<cells.size(); ++i) {
00049       cells[i].setFictitious(cells[i].mother().isFictitious());
00050     }
00051   }

Here is the call graph for this function:

void SurfaceMesh::buildFaces (  )  [inline, virtual, inherited]

Faces and edges are treated as the same for surfaces meshes

Implements Mesh.

Definition at line 60 of file SurfaceMesh.hpp.

References Mesh::buildEdges().

00061   {
00062     this->buildEdges();
00063   }

Here is the call graph for this function:

bool SurfaceMesh::isAssociatedTo ( const Mesh m  )  const [inline, inherited]

tests if a given mesh is the mesh associated to the surface mesh

Parameters:
m a given mesh
Returns:
true if m is the one!

Definition at line 79 of file SurfaceMesh.hpp.

References SurfaceMesh::__backgroundMesh.

Referenced by BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__checkBoundaryMeshAssociation().

00080   {
00081     return &m == __backgroundMesh;
00082   }

void SurfaceMesh::setBackgroundMesh ( const Mesh m  )  [inline, inherited]

Sets the background mesh

Parameters:
m a pointer to a given background mesh

Definition at line 89 of file SurfaceMesh.hpp.

References SurfaceMesh::__backgroundMesh.

Referenced by CopyBackgroundMesh< SurfaceMeshOfQuadrangles >::copy(), CopyBackgroundMesh< SurfaceMeshOfTriangles >::copy(), and SurfaceMeshGenerator::generateSurfacicMesh().

00090   {
00091     __backgroundMesh = m;
00092   }

const Mesh* SurfaceMesh::backgroundMesh (  )  const [inline, inherited]

gets the pointer to the background mesh

Returns:
__backgroundMesh

Definition at line 99 of file SurfaceMesh.hpp.

References SurfaceMesh::__backgroundMesh.

Referenced by CopyBackgroundMesh< SurfaceMeshOfQuadrangles >::copy(), and CopyBackgroundMesh< SurfaceMeshOfTriangles >::copy().

00100   {
00101     return __backgroundMesh;
00102   }

bool SurfaceMesh::hasFaces (  )  const [inline, virtual, inherited]

Returns true if the faces set has been built

Returns:
true if __edgesSet is not NULL

Implements Mesh.

Definition at line 122 of file SurfaceMesh.hpp.

References Mesh::__edgesSet.

00123   {
00124     return __edgesSet != 0;
00125   }

const size_t& SurfaceMesh::numberOfFaces (  )  const [inline, inherited]

Returns the number of faces

Returns:
number of faces

Definition at line 133 of file SurfaceMesh.hpp.

References Mesh::__edgesSet.

00134   {
00135     return __edgesSet->numberOfEdges();
00136   }

virtual bool Mesh::isPeriodic (  )  const [inline, virtual, inherited]

Checks if a mesh has a periodic topology

Returns:
true if the mesh is periodic

Reimplemented in OctreeMesh.

Definition at line 238 of file Mesh.hpp.

References Mesh::__verticesCorrespondance, and Mesh::__verticesSet.

00239   {
00240     return __verticesSet->numberOfVertices() != __verticesCorrespondance->numberOfCorrespondances();
00241   }

virtual bool Mesh::inside ( const TinyVector< 3, real_t > &  p  )  const [pure virtual, inherited]

Checks if a point is inside the mesh

Parameters:
p the point to localize
Returns:
true if the point p is inside the mesh.

const Mesh::Type& Mesh::type (  )  const [inline, inherited]

Read-only access to the type of the mesh

Returns:
__type

Definition at line 277 of file Mesh.hpp.

References Mesh::__type.

Referenced by BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__meshWrapper(), BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__StandardDirichletBorderLinearOperator(), BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__StandardGetDiagonalVariationalBorderBilinearOperator(), BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__StandardVariationalBorderBilinearOperator(), BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__StandardVariationalBorderBilinearOperatorTimesX(), BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__StandardVariationalBorderBilinearOperatorTransposedTimesX(), BoundaryConditionCommonFEMDiscretization< MeshType, TypeOfDiscretization >::__StandardVariationalBorderLinearOperator(), ScalarDegreeOfFreedomPositionsSet::Builder::build(), FEMFunctionBuilder::build(), DGFunctionBuilder::build(), SpectralFEMPreconditioner::Internal::computes(), SpectralFEMPreconditioner::Internal::computesTransposed(), DegreeOfFreedomSetBuilder::DegreeOfFreedomSetBuilder(), RealExpressionIntegrate::execute(), FunctionExpressionConvection::execute(), BoundaryExpressionSurfaceMesh::execute(), SurfaceMeshGenerator::generateSurfacicMesh(), BoundaryConditionDiscretizationSpectralNonConform::getDiagonal(), MeshSimplifier::MeshSimplifier(), MultiGrid::MultiGrid(), ScalarFunctionIntegrate::operator()(), BoundaryConditionDiscretizationSpectralNonConform::setSecondMember(), BoundaryConditionDiscretizationSpectralNonConform::timesX(), and BoundaryConditionDiscretizationSpectralNonConform::transposedTimesX().

00278   {
00279     return __type;
00280   }

const size_t& Mesh::id (  )  const [inline, inherited]

Read-only access to the id of the mesh

Returns:
__meshId

Definition at line 297 of file Mesh.hpp.

References Mesh::__meshId.

00298   {
00299     return __meshId;
00300   }

size_t Mesh::vertexNumber ( const Vertex v  )  const [inline, inherited]

Returns the number of the vertex v in the list

Parameters:
v a vertex
Returns:
the vertex v number
Note:
polymorphism is not used for clarity reason

Definition at line 311 of file Mesh.hpp.

References Mesh::__verticesSet.

Referenced by MeshOfTetrahedra::buildLocalizationTools(), OctreeMeshBuilder::buildMesh(), and MeshDomainTetrahedrizor::run().

00312   {
00313     return __verticesSet->number(v);
00314   }

bool Mesh::hasEdges (  )  const [inline, inherited]

tests if the EdgesSet has been built

Returns:
true if __edgesSet is not NULL

Definition at line 321 of file Mesh.hpp.

References Mesh::__edgesSet.

00322   {
00323     return __edgesSet != 0;
00324   }

size_t Mesh::edgeNumber ( const Edge e  )  const [inline, inherited]

Returns the number of the Edge e in the list

Parameters:
e an Edge
Returns:
the edge E number
Note:
polymorphism is not used for clarity reason

Definition at line 353 of file Mesh.hpp.

References Mesh::__edgesSet, and ASSERT.

00354   {
00355     ASSERT(__edgesSet != 0);
00356     return __edgesSet->number(e);
00357   }

const size_t& Mesh::numberOfVertices (  )  const [inline, inherited]

void Mesh::setNumberOfVertices ( const size_t &  size  )  [inline, inherited]

Changes the size of the vertices container.

Parameters:
size vertices set new size
Bug:
this function should not be allowed!

Definition at line 375 of file Mesh.hpp.

References Mesh::__verticesCorrespondance, and Mesh::__verticesSet.

Referenced by SurfaceMeshGenerator::Internals::__constructionFinalMesh().

00376   {
00377     if (__verticesSet == 0) {
00378       __verticesSet = new VerticesSet(size);
00379       __verticesCorrespondance = new VerticesCorrespondance(size);
00380     } else {
00381       __verticesSet->setNumberOfVertices(size);
00382       __verticesCorrespondance = new VerticesCorrespondance(size);
00383     }
00384   }

size_t Mesh::numberOfEdges (  )  const [inline, inherited]

Read-only access to the number of edges

Returns:
number of edges

Definition at line 398 of file Mesh.hpp.

References Mesh::__edgesSet, and ASSERT.

Referenced by SurfaceMeshGenerator::Internals::__createSurface().

00399   {
00400     ASSERT(__edgesSet != 0);
00401     return __edgesSet->numberOfEdges();
00402   }

ReferenceCounting<VerticesSet> Mesh::verticesSet (  )  [inline, inherited]

Access to the vertices set of the mesh

Returns:
__verticesSet

Definition at line 409 of file Mesh.hpp.

References Mesh::__verticesSet.

00410   {
00411     return __verticesSet;
00412   }

ConstReferenceCounting<VerticesSet> Mesh::verticesSet (  )  const [inline, inherited]

Read only access to the vertices set of the mesh

Returns:
__verticesSet

Definition at line 419 of file Mesh.hpp.

References Mesh::__verticesSet.

00420   {
00421     return __verticesSet;
00422   }

ReferenceCounting<VerticesCorrespondance> Mesh::verticesCorrespondance (  )  [inline, inherited]

Access to the vertices correspondance table

Returns:
__verticesCorrespondance

Definition at line 429 of file Mesh.hpp.

References Mesh::__verticesCorrespondance.

00430   {
00431     return __verticesCorrespondance;
00432   }

ConstReferenceCounting<VerticesCorrespondance> Mesh::verticesCorrespondance (  )  const [inline, inherited]

Read only access to the vertices correspondance table

Returns:
__verticesCorrespondance

Definition at line 439 of file Mesh.hpp.

References Mesh::__verticesCorrespondance.

00440   {
00441     return __verticesCorrespondance;
00442   }

const Vertex& Mesh::vertex ( const size_t &  i  )  const [inline, inherited]

Vertex& Mesh::vertex ( const size_t &  i  )  [inline, inherited]

Access to the ith vertex of the mesh

Parameters:
i the number of the vertex to access
Returns:
the ith vertex

Reimplemented in SpectralMesh, and Structured3DMesh.

Definition at line 463 of file Mesh.hpp.

References Mesh::__verticesSet.

00464   {
00465     return (*__verticesSet)[i];
00466   }

const size_t& Mesh::correspondance ( const size_t &  i  )  const [inline, inherited]

Read only access to the ith vertex "real" number (ie: when dealing with periodic boundaries)

Parameters:
i the number of the vertex
Returns:
the vertex "real" number

Definition at line 476 of file Mesh.hpp.

References Mesh::__verticesCorrespondance.

Referenced by MeshDomainTetrahedrizor::run().

00477   {
00478     return (*__verticesCorrespondance)[i];
00479   }

const Edge& Mesh::edge ( const size_t &  i  )  const [inline, inherited]

read-only access to the ith edge

Parameters:
i the number of the edge
Returns:
ith edge

Definition at line 489 of file Mesh.hpp.

References Mesh::__edgesSet.

Referenced by SurfaceMeshGenerator::Internals::__createSurface().

00490   {
00491     return (*__edgesSet)[i];
00492   }

Edge& Mesh::edge ( const size_t &  i  )  [inline, inherited]

access to the ith edge

Parameters:
i the number of the edge
Returns:
ith edge

Definition at line 501 of file Mesh.hpp.

References Mesh::__edgesSet.

00502   {
00503     return (*__edgesSet)[i];
00504   }


Member Data Documentation

The set of cells

Definition at line 187 of file SurfaceMeshOfTriangles.hpp.

Referenced by cell(), and setNumberOfCells().

Connectivity

Definition at line 189 of file SurfaceMeshOfTriangles.hpp.

Referenced by connectivity().

const Mesh* SurfaceMesh::__backgroundMesh [protected, inherited]

Sets which is background mesh

Definition at line 43 of file SurfaceMesh.hpp.

Referenced by SurfaceMesh::backgroundMesh(), SurfaceMesh::isAssociatedTo(), and SurfaceMesh::setBackgroundMesh().

ReferenceCounting<EdgesSet> Mesh::__edgesSet [protected, inherited]


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

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