QuadraticMesh< DIM > Class Template Reference

#include <QuadraticMesh.hpp>

Inherits TetrahedralMesh< DIM, DIM >.

Collaboration diagram for QuadraticMesh< DIM >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 QuadraticMesh ()
 QuadraticMesh (double spaceStep, double width, double height=0, double depth=0)
void ConstructFromMeshReader (AbstractMeshReader< DIM, DIM > &rMeshReader)
void ConstructFromLinearMeshReader (AbstractMeshReader< DIM, DIM > &rMeshReader)
unsigned GetNumVertices () const

Protected Member Functions

void CountVertices ()
template<class Archive >
void serialize (Archive &archive, const unsigned int version)
void ConstructLinearMesh (unsigned numElemX)
void ConstructRectangularMesh (unsigned numElemX, unsigned numElemY, bool stagger=true)
void ConstructCuboid (unsigned numElemX, unsigned numElemY, unsigned numElemZ)
Node< DIM > * MakeNewInternalNode (unsigned &rIndex, c_vector< double, DIM > &rLocation, c_vector< double, DIM > &rTop)
unsigned LookupInternalNode (unsigned globalIndex1, unsigned globalIndex2, std::map< std::pair< unsigned, unsigned >, unsigned > &rEdgeMap)

Protected Attributes

unsigned mNumVertices

Friends

class TestQuadraticMesh
class boost::serialization::access

Detailed Description

template<unsigned DIM>
class QuadraticMesh< DIM >

A concrete quadratic mesh class that inherits from TetrahedralMesh.

Definition at line 51 of file QuadraticMesh.hpp.


Constructor & Destructor Documentation

template<unsigned DIM>
QuadraticMesh< DIM >::QuadraticMesh (  )  [inline]

Constructor

Definition at line 152 of file QuadraticMesh.hpp.

References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mMeshIsLinear.

template<unsigned DIM>
QuadraticMesh< DIM >::QuadraticMesh ( double  spaceStep,
double  width,
double  height = 0,
double  depth = 0 
) [inline]

Create a quadratic mesh on a slab (on a line in 1D, rectangle in 2d, cuboid in 3D), with the given widths and given space step. In 1D height and depth need to be passed in as 0 (the default value); in 2D depth must be zero

Parameters:
spaceStep The spatial stepsize
width the width of the cuboid
height the height of the cuboid
depth the depth of the cuboid

Definition at line 65 of file QuadraticMesh.cpp.

References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructRegularSlabMesh().


Member Function Documentation

template<unsigned DIM>
void QuadraticMesh< DIM >::ConstructCuboid ( unsigned  numElemX,
unsigned  numElemY,
unsigned  numElemZ 
) [inline, protected, virtual]

Create a quadratic mesh on a cuobid from (0,0,0) to (numElemX,numElemY,numElemZ) with that number of elements in each direction. The method overloads the equivalent method in AbstractTetrahedralMesh. This is private, users should call ConstructRegularSlabMesh();

Parameters:
numElemX Number of elements in x-direction (also, the width of the final mesh)
numElemY Number of elements in y-direction (also, the height of the final mesh)
numElemZ Number of elements in y-direction (also, the depth of the final mesh)

Reimplemented from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.

Definition at line 247 of file QuadraticMesh.cpp.

References QuadraticMesh< DIM >::CountVertices(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElementIteratorEnd(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorEnd(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), QuadraticMesh< DIM >::LookupInternalNode(), QuadraticMesh< DIM >::MakeNewInternalNode(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mMeshIsLinear, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, and TetrahedralMesh< DIM, DIM >::RefreshMesh().

template<unsigned DIM>
void QuadraticMesh< DIM >::ConstructFromLinearMeshReader ( AbstractMeshReader< DIM, DIM > &  rMeshReader  )  [inline]
template<unsigned DIM>
void QuadraticMesh< DIM >::ConstructFromMeshReader ( AbstractMeshReader< DIM, DIM > &  rMeshReader  )  [inline]
template<unsigned DIM>
void QuadraticMesh< DIM >::ConstructLinearMesh ( unsigned  numElemX  )  [inline, protected, virtual]

Create a quadratic mesh on the interval [0,numElemX] with numElemX elements in each direction. This is private, users should call ConstructRegularSlabMesh();

Very badly named. This creates a QUADRATIC mesh, the linear just refers to the fact the mesh is a line in 1D. The name is inherited from the parent class.

Parameters:
numElemX Number of elements in x-direction (also, the width of the final mesh)

Reimplemented from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.

Definition at line 76 of file QuadraticMesh.cpp.

References Node< SPACE_DIM >::AddElement(), QuadraticMesh< DIM >::MakeNewInternalNode(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mElements, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, QuadraticMesh< DIM >::mNumVertices, and TetrahedralMesh< DIM, DIM >::RefreshMesh().

template<unsigned DIM>
void QuadraticMesh< DIM >::ConstructRectangularMesh ( unsigned  numElemX,
unsigned  numElemY,
bool  stagger = true 
) [inline, protected, virtual]

Create a quadratic mesh on a rectangle from (0,0) to (numElemX,numElemY) with that number of elements in each direction.

The method overloads the equivalent method in AbstractTetrahedralMesh. This is private, users should call ConstructRegularSlabMesh();

Parameters:
numElemX Number of elements in x-direction (also, the width of the final mesh)
numElemY Number of elements in y-direction (also, the height of the final mesh)
stagger is the same as the over-ridden method with same name in AbstractTetrahedralMesh. stagger = false gives all back-slash diagonals stagger = true check-boards the diagonals as forward and back slashes

Reimplemented from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.

Definition at line 107 of file QuadraticMesh.cpp.

References QuadraticMesh< DIM >::CountVertices(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetBoundaryElementIteratorEnd(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorEnd(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), QuadraticMesh< DIM >::LookupInternalNode(), QuadraticMesh< DIM >::MakeNewInternalNode(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::mMeshIsLinear, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, and TetrahedralMesh< DIM, DIM >::RefreshMesh().

template<unsigned DIM>
void QuadraticMesh< DIM >::CountVertices (  )  [inline, protected]
template<unsigned DIM>
unsigned QuadraticMesh< DIM >::GetNumVertices (  )  const [inline, virtual]
Returns:
the number of vertices, ie non-internal (non-quadratic), nodes.

Reimplemented from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.

Definition at line 412 of file QuadraticMesh.cpp.

References QuadraticMesh< DIM >::mNumVertices.

template<unsigned DIM>
unsigned QuadraticMesh< DIM >::LookupInternalNode ( unsigned  globalIndex1,
unsigned  globalIndex2,
std::map< std::pair< unsigned, unsigned >, unsigned > &  rEdgeMap 
) [inline, protected]

A helper method used in the private structured mesh constructors (ConstructRectangularMesh etc).

Gets the internal node index between two vertex node indices assuming ordered pairs have been used as keys in the map

Parameters:
globalIndex1 is the index of one of the vertex nodes
globalIndex2 is the index of the other vertex node (ordering is unimportant)
rEdgeMap the map from ordered pairs of vertex indices to internal node index
Returns:
global node index of the internal node between globalIndex1 and globalIndex2

Definition at line 229 of file QuadraticMesh.cpp.

Referenced by QuadraticMesh< DIM >::ConstructCuboid(), and QuadraticMesh< DIM >::ConstructRectangularMesh().

template<unsigned DIM>
Node< DIM > * QuadraticMesh< DIM >::MakeNewInternalNode ( unsigned rIndex,
c_vector< double, DIM > &  rLocation,
c_vector< double, DIM > &  rTop 
) [inline, protected]

A helper method used in the private structured mesh constructors (ConstructRectangularMesh etc).

Method uses top (and the zero vector) to calculate if the node should be designated as a boundary node. Method uses top to determine if the node is outside the cuboid -- this allows for simpler loops in the caller Method creates node, pushes node onto mNodes and marks it as an internal node.

Returns:
pointer to new node
Parameters:
rIndex is the index in the mesh which this node should take. Note: this method increments rIndex
rLocation the position of the node in space (coordinates should be integers or multiples of 1/2)
rTop the position of top-most node in the line/slab/cuboid

Definition at line 200 of file QuadraticMesh.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mBoundaryNodes, and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes.

Referenced by QuadraticMesh< DIM >::ConstructCuboid(), QuadraticMesh< DIM >::ConstructLinearMesh(), and QuadraticMesh< DIM >::ConstructRectangularMesh().

template<unsigned DIM>
template<class Archive >
void QuadraticMesh< DIM >::serialize ( Archive &  archive,
const unsigned int  version 
) [inline, protected]

Serialize the mesh.

Parameters:
archive the archive
version the current version of this class

Reimplemented from TetrahedralMesh< DIM, DIM >.

Definition at line 73 of file QuadraticMesh.hpp.


Friends And Related Function Documentation

template<unsigned DIM>
friend class boost::serialization::access [friend]

Needed for serialization.

Reimplemented from TetrahedralMesh< DIM, DIM >.

Definition at line 65 of file QuadraticMesh.hpp.


Member Data Documentation

template<unsigned DIM>
unsigned QuadraticMesh< DIM >::mNumVertices [protected]

Number of vertices, ie non-internal (non-quadratic), nodes.

Definition at line 57 of file QuadraticMesh.hpp.

Referenced by QuadraticMesh< DIM >::ConstructLinearMesh(), QuadraticMesh< DIM >::CountVertices(), and QuadraticMesh< DIM >::GetNumVertices().


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

Generated by  doxygen 1.6.2