#include <Cylindrical2dVertexMesh.hpp>
Public Member Functions | |
Cylindrical2dVertexMesh (double width, std::vector< Node< 2 > * > nodes, std::vector< VertexElement< 2, 2 > * > vertexElements, double cellRearrangementThreshold=0.01, double t2Threshold=0.001) | |
~Cylindrical2dVertexMesh () | |
c_vector< double, 2 > | GetVectorFromAtoB (const c_vector< double, 2 > &rLocation1, const c_vector< double, 2 > &rLocation2) |
void | SetNode (unsigned nodeIndex, ChastePoint< 2 > point) |
double | GetWidth (const unsigned &rDimension) const |
unsigned | AddNode (Node< 2 > *pNewNode) |
double | GetVolumeOfElement (unsigned index) |
c_vector< double, 2 > | GetCentroidOfElement (unsigned index) |
Private Member Functions | |
template<class Archive> | |
void | serialize (Archive &archive, const unsigned int version) |
Cylindrical2dVertexMesh () | |
Private Attributes | |
double | mWidth |
Friends | |
class | TestCylindrical2dVertexMesh |
class | boost::serialization::access |
The class works by overriding calls such as ReMesh() and GetVectorFromAtoB() so that simulation classes can treat this class in exactly the same way as a MutableMesh<2,2>.
Definition at line 44 of file Cylindrical2dVertexMesh.hpp.
Cylindrical2dVertexMesh::Cylindrical2dVertexMesh | ( | ) | [private] |
Constructor - used for serialization only.
Definition at line 42 of file Cylindrical2dVertexMesh.cpp.
Cylindrical2dVertexMesh::Cylindrical2dVertexMesh | ( | double | width, | |
std::vector< Node< 2 > * > | nodes, | |||
std::vector< VertexElement< 2, 2 > * > | vertexElements, | |||
double | cellRearrangementThreshold = 0.01 , |
|||
double | t2Threshold = 0.001 | |||
) |
Default constructor.
width | the width (circumference) of the mesh | |
nodes | vector of pointers to nodes | |
vertexElements | vector of pointers to VertexElements | |
cellRearrangementThreshold | the minimum threshold distance for element rearrangment (defaults to 0.01) | |
t2Threshold | the maximum threshold distance for Type 2 swaps (defaults to 0.001) |
Definition at line 30 of file Cylindrical2dVertexMesh.cpp.
References MutableVertexMesh< 2, 2 >::ReMesh().
Cylindrical2dVertexMesh::~Cylindrical2dVertexMesh | ( | ) |
Destructor.
Definition at line 46 of file Cylindrical2dVertexMesh.cpp.
void Cylindrical2dVertexMesh::serialize | ( | Archive & | archive, | |
const unsigned int | version | |||
) | [inline, private] |
Archives the member variables of the object which have to be preserved during its lifetime.
The remaining member variables are re-initialised before being used by each ReMesh() call so they do not need to be archived.
archive | the archive | |
version | the current version of this class |
Reimplemented from MutableVertexMesh< 2, 2 >.
Definition at line 66 of file Cylindrical2dVertexMesh.hpp.
References mWidth.
c_vector< double, 2 > Cylindrical2dVertexMesh::GetVectorFromAtoB | ( | const c_vector< double, 2 > & | rLocation1, | |
const c_vector< double, 2 > & | rLocation2 | |||
) |
Overridden GetVectorFromAtoB() method. This method evaluates the (surface) distance between two points in a 2D cylindrical geometry.
rLocation1 | the x and y co-ordinates of point 1 | |
rLocation2 | the x and y co-ordinates of point 2 |
Definition at line 50 of file Cylindrical2dVertexMesh.cpp.
References mWidth.
Referenced by GetCentroidOfElement(), and GetVolumeOfElement().
void Cylindrical2dVertexMesh::SetNode | ( | unsigned | nodeIndex, | |
ChastePoint< 2 > | point | |||
) |
Overridden SetNode() method.
If the location should be set outside a cylindrical boundary move it back onto the cylinder.
nodeIndex | is the index of the node to be moved | |
point | is the new target location of the node |
Definition at line 69 of file Cylindrical2dVertexMesh.cpp.
References mWidth, ChastePoint< DIM >::rGetLocation(), ChastePoint< DIM >::SetCoordinate(), and MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::SetNode().
Referenced by AddNode().
double Cylindrical2dVertexMesh::GetWidth | ( | const unsigned & | rDimension | ) | const [virtual] |
Overridden GetWidth() method.
Calculate the 'width' of any dimension of the mesh, taking periodicity into account.
rDimension | a dimension (0 or 1) |
Reimplemented from AbstractMesh< ELEMENT_DIM, SPACE_DIM >.
Definition at line 89 of file Cylindrical2dVertexMesh.cpp.
References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetWidth(), and mWidth.
unsigned Cylindrical2dVertexMesh::AddNode | ( | Node< 2 > * | pNewNode | ) |
Overridden AddNode() method.
pNewNode | the node to be added to the mesh |
Definition at line 104 of file Cylindrical2dVertexMesh.cpp.
References MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::AddNode(), Node< SPACE_DIM >::GetPoint(), and SetNode().
double Cylindrical2dVertexMesh::GetVolumeOfElement | ( | unsigned | index | ) | [virtual] |
Overridden GetVolumeOfElement() method.
index | the global index of a specified vertex element |
Reimplemented from VertexMesh< ELEMENT_DIM, SPACE_DIM >.
Definition at line 115 of file Cylindrical2dVertexMesh.cpp.
References VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and GetVectorFromAtoB().
Referenced by GetCentroidOfElement().
c_vector< double, 2 > Cylindrical2dVertexMesh::GetCentroidOfElement | ( | unsigned | index | ) | [virtual] |
Overridden GetCentroidOfElement() method.
index | the global index of a specified vertex element |
Reimplemented from VertexMesh< ELEMENT_DIM, SPACE_DIM >.
Definition at line 150 of file Cylindrical2dVertexMesh.cpp.
References VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), GetVectorFromAtoB(), and GetVolumeOfElement().
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented from MutableVertexMesh< 2, 2 >.
Definition at line 54 of file Cylindrical2dVertexMesh.hpp.
double Cylindrical2dVertexMesh::mWidth [private] |
The circumference of the cylinder.
Definition at line 51 of file Cylindrical2dVertexMesh.hpp.
Referenced by GetVectorFromAtoB(), GetWidth(), serialize(), and SetNode().