Mesh Class Reference

#include <Mesh.hpp>

Inheritance diagram for Mesh:

Inheritance graph
[legend]
Collaboration diagram for Mesh:

Collaboration graph
[legend]

List of all members.

Public Types

enum  Type {
  cartesianHexahedraMesh, hexahedraMesh, octreeMesh, tetrahedraMesh,
  trianglesMesh, spectralMesh, surfaceMeshTriangles, surfaceMeshQuadrangles
}
enum  Family { volume, surface, plane }
 Family. More...

Public Member Functions

virtual bool hasBorderMesh () const =0
virtual ConstReferenceCounting
< Mesh
borderBaseMesh () const =0
virtual bool isPeriodic () const
virtual std::string typeName () const =0
virtual bool inside (const real_t &x, const real_t &y, const real_t &z) const =0
virtual bool inside (const TinyVector< 3, real_t > &p) const =0
const Mesh::Typetype () const
const Mesh::Familyfamily () const
const size_t & id () const
size_t vertexNumber (const Vertex &v) const
bool hasEdges () const
virtual void buildFaces ()=0
virtual bool hasFaces () const =0
virtual void buildEdges ()=0
size_t edgeNumber (const Edge &e) const
const size_t & numberOfVertices () const
void setNumberOfVertices (const size_t &size)
virtual const size_t & numberOfCells () const =0
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)
 Mesh (const Mesh::Type &type, const Mesh::Family &family, const size_t &numberOfVertices)
 Mesh (const Mesh::Type &type, const Mesh::Family &family, ReferenceCounting< VerticesSet > vertices, ReferenceCounting< VerticesCorrespondance > correspondance)
virtual ~Mesh ()

Protected Member Functions

 Mesh (const Mesh &mesh)

Protected Attributes

ReferenceCounting< VerticesSet__verticesSet
ReferenceCounting
< VerticesCorrespondance
__verticesCorrespondance
ReferenceCounting< EdgesSet__edgesSet

Static Private Member Functions

static size_t __getNextMeshId ()

Private Attributes

const Type __type
const Family __family
const size_t __meshId

Friends

class MeshExtractor
 Mesh extractors are friends.

Classes

class  T_iterator


Detailed Description

Definition at line 40 of file Mesh.hpp.


Member Enumeration Documentation

enum Mesh::Type

Enumerator:
cartesianHexahedraMesh 
hexahedraMesh 
octreeMesh 
tetrahedraMesh 
trianglesMesh 
spectralMesh 
surfaceMeshTriangles 
surfaceMeshQuadrangles 

Definition at line 43 of file Mesh.hpp.

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

Mesh::Mesh ( const Mesh mesh  )  [inline, protected]

Copy constructor

Note:
copies of meshes are almost forbidden
Parameters:
mesh given mesh

Definition at line 217 of file Mesh.hpp.

00218     : __type(mesh.__type),
00219       __family(mesh.__family),
00220       __meshId(mesh.__meshId),
00221       __verticesSet(mesh.__verticesSet)
00222   {
00223     ;
00224   }

Mesh::Mesh ( const Mesh::Type type,
const Mesh::Family family,
const size_t &  numberOfVertices 
) [inline]

Constructor

Parameters:
type the type of the mesh
family the family of the mesh
numberOfVertices the number of vertices

Definition at line 513 of file Mesh.hpp.

Mesh::Mesh ( const Mesh::Type type,
const Mesh::Family family,
ReferenceCounting< VerticesSet vertices,
ReferenceCounting< VerticesCorrespondance correspondance 
) [inline]

Constructor

Parameters:
type the type of the mesh
family the family of the mesh
vertices set of vertices
correspondance correspondance table for periodic meshes

Definition at line 534 of file Mesh.hpp.

00538     : __type(type),
00539       __family(family),
00540       __meshId(Mesh::__getNextMeshId()),
00541       __verticesSet(vertices),
00542       __verticesCorrespondance(correspondance),
00543       __edgesSet(0)
00544   {
00545     ;
00546   }

virtual Mesh::~Mesh (  )  [inline, virtual]

Destructor

Definition at line 552 of file Mesh.hpp.

00553   {
00554     ;
00555   }


Member Function Documentation

static size_t Mesh::__getNextMeshId (  )  [inline, static, private]

Definition at line 66 of file Mesh.hpp.

00067   {
00068     static size_t nextId = 0;
00069     return nextId++;
00070   }

virtual bool Mesh::hasBorderMesh (  )  const [pure virtual]

virtual ConstReferenceCounting<Mesh> Mesh::borderBaseMesh (  )  const [pure virtual]

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

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 __verticesCorrespondance, and __verticesSet.

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

virtual std::string Mesh::typeName (  )  const [pure virtual]

Returns the typename of the mesh

Returns:
type name of the mesh

Implemented in MeshOfHexahedra, MeshOfTetrahedra, MeshOfTriangles, OctreeMesh, SpectralMesh, Structured3DMesh, SurfaceMeshOfQuadrangles, and SurfaceMeshOfTriangles.

virtual bool Mesh::inside ( const real_t &  x,
const real_t &  y,
const real_t &  z 
) const [pure virtual]

Checks if $ (x,y,z) $ is inside the mesh

Parameters:
x $ x $
y $ y $
z $ z $
Returns:
true if $ (x,y,z) $ is inside the mesh.

Implemented in MeshOfHexahedra, MeshOfTetrahedra, MeshOfTriangles, OctreeMesh, SpectralMesh, Structured3DMesh, SurfaceMeshOfQuadrangles, and SurfaceMeshOfTriangles.

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

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]

Read-only access to the type of the mesh

Returns:
__type

Definition at line 277 of file Mesh.hpp.

References __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 Mesh::Family& Mesh::family (  )  const [inline]

Read-only access to the family of the mesh

Returns:
__family

Definition at line 287 of file Mesh.hpp.

References __family.

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

00288   {
00289     return __family;
00290   }

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

Read-only access to the id of the mesh

Returns:
__meshId

Definition at line 297 of file Mesh.hpp.

References __meshId.

00298   {
00299     return __meshId;
00300   }

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

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 __verticesSet.

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

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

bool Mesh::hasEdges (  )  const [inline]

tests if the EdgesSet has been built

Returns:
true if __edgesSet is not NULL

Definition at line 321 of file Mesh.hpp.

References __edgesSet.

00322   {
00323     return __edgesSet != 0;
00324   }

virtual void Mesh::buildFaces (  )  [pure virtual]

virtual bool Mesh::hasFaces (  )  const [pure virtual]

virtual void Mesh::buildEdges (  )  [pure virtual]

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

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 __edgesSet, and ASSERT.

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

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

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

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 __verticesCorrespondance, and __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   }

virtual const size_t& Mesh::numberOfCells (  )  const [pure virtual]

Read-only access to the number of cells

Returns:
number of cells

Implemented in MeshOfHexahedra, MeshOfTetrahedra, MeshOfTriangles, OctreeMesh, SpectralMesh, Structured3DMesh, SurfaceMeshOfQuadrangles, and SurfaceMeshOfTriangles.

size_t Mesh::numberOfEdges (  )  const [inline]

Read-only access to the number of edges

Returns:
number of edges

Definition at line 398 of file Mesh.hpp.

References __edgesSet, and ASSERT.

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

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

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

Access to the vertices set of the mesh

Returns:
__verticesSet

Definition at line 409 of file Mesh.hpp.

References __verticesSet.

00410   {
00411     return __verticesSet;
00412   }

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

Read only access to the vertices set of the mesh

Returns:
__verticesSet

Definition at line 419 of file Mesh.hpp.

References __verticesSet.

00420   {
00421     return __verticesSet;
00422   }

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

Access to the vertices correspondance table

Returns:
__verticesCorrespondance

Definition at line 429 of file Mesh.hpp.

References __verticesCorrespondance.

00430   {
00431     return __verticesCorrespondance;
00432   }

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

Read only access to the vertices correspondance table

Returns:
__verticesCorrespondance

Definition at line 439 of file Mesh.hpp.

References __verticesCorrespondance.

00440   {
00441     return __verticesCorrespondance;
00442   }

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

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

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 __verticesSet.

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

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

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 __verticesCorrespondance.

Referenced by MeshDomainTetrahedrizor::run().

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

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

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 __edgesSet.

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

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

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

access to the ith edge

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

Definition at line 501 of file Mesh.hpp.

References __edgesSet.

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


Friends And Related Function Documentation

friend class MeshExtractor [friend]

Mesh extractors are friends.

Definition at line 64 of file Mesh.hpp.


Member Data Documentation

const Type Mesh::__type [private]

type of the mesh

Definition at line 72 of file Mesh.hpp.

Referenced by type().

const Family Mesh::__family [private]

family of the mesh

Definition at line 73 of file Mesh.hpp.

Referenced by family().

const size_t Mesh::__meshId [private]

identifier of the mesh

Definition at line 74 of file Mesh.hpp.

Referenced by id().

Container for vertices correspondances

Definition at line 204 of file Mesh.hpp.

Referenced by correspondance(), isPeriodic(), setNumberOfVertices(), SpectralMesh::SpectralMesh(), Structured3DMesh::Structured3DMesh(), and verticesCorrespondance().


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

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