#include <Toroidal2dVertexMesh.hpp>
Inherits MutableVertexMesh< 2, 2 >.
Public Member Functions | |
Toroidal2dVertexMesh (double width, double height, std::vector< Node< 2 > * > nodes, std::vector< VertexElement< 2, 2 > * > vertexElements, double cellRearrangementThreshold=0.01, double t2Threshold=0.001) | |
~Toroidal2dVertexMesh () | |
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) |
MutableVertexMesh< 2, 2 > * | GetMeshForVtk () |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &archive, const unsigned int version) |
Toroidal2dVertexMesh () | |
Private Attributes | |
double | mWidth |
double | mHeight |
Friends | |
class | TestToroidal2dVertexMesh |
class | boost::serialization::access |
A subclass of MutableVertexMesh<2,2> for a rectangular mesh with periodic left and right boundaries and top and bottom boundaries, representing a toroidal geometry.
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 53 of file Toroidal2dVertexMesh.hpp.
Toroidal2dVertexMesh::Toroidal2dVertexMesh | ( | ) | [private] |
Constructor - used for serialization only.
Definition at line 52 of file Toroidal2dVertexMesh.cpp.
Toroidal2dVertexMesh::Toroidal2dVertexMesh | ( | double | width, | |
double | height, | |||
std::vector< Node< 2 > * > | nodes, | |||
std::vector< VertexElement< 2, 2 > * > | vertexElements, | |||
double | cellRearrangementThreshold = 0.01 , |
|||
double | t2Threshold = 0.001 | |||
) |
Default constructor.
width | the width of the mesh | |
height | the height of the mesh | |
nodes | vector of pointers to nodes | |
vertexElements | vector of pointers to VertexElements | |
cellRearrangementThreshold | the minimum threshold distance for element rearrangement (defaults to 0.01) | |
t2Threshold | the maximum threshold distance for Type 2 swaps (defaults to 0.001) |
Definition at line 38 of file Toroidal2dVertexMesh.cpp.
References MutableVertexMesh< 2, 2 >::ReMesh().
Toroidal2dVertexMesh::~Toroidal2dVertexMesh | ( | ) |
Destructor.
Definition at line 56 of file Toroidal2dVertexMesh.cpp.
Overridden AddNode() method.
pNewNode | the node to be added to the mesh |
Definition at line 135 of file Toroidal2dVertexMesh.cpp.
References Node< SPACE_DIM >::GetPoint(), and SetNode().
MutableVertexMesh< 2, 2 > * Toroidal2dVertexMesh::GetMeshForVtk | ( | ) |
Return a pointer to an extended mesh that is a 'non-periodic' version of our mesh. This can then be used when writing to VTK.
Definition at line 146 of file Toroidal2dVertexMesh.cpp.
References VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorEnd(), Node< SPACE_DIM >::GetIndex(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), MutableVertexMesh< 2, 2 >::GetNumNodes(), MutableVertexMesh< 2, 2 >::mCellRearrangementThreshold, mHeight, MutableVertexMesh< 2, 2 >::mT2Threshold, and mWidth.
c_vector< double, 2 > Toroidal2dVertexMesh::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 toroidal geometry.
rLocation1 | the x and y co-ordinates of point 1 | |
rLocation2 | the x and y co-ordinates of point 2 |
Definition at line 60 of file Toroidal2dVertexMesh.cpp.
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 122 of file Toroidal2dVertexMesh.cpp.
void Toroidal2dVertexMesh::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 78 of file Toroidal2dVertexMesh.hpp.
void Toroidal2dVertexMesh::SetNode | ( | unsigned | nodeIndex, | |
ChastePoint< 2 > | point | |||
) |
Overridden SetNode() method.
If the location should be set outside a toroidal 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 91 of file Toroidal2dVertexMesh.cpp.
References mHeight, mWidth, ChastePoint< DIM >::rGetLocation(), and ChastePoint< DIM >::SetCoordinate().
Referenced by AddNode().
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented from MutableVertexMesh< 2, 2 >.
Definition at line 66 of file Toroidal2dVertexMesh.hpp.
double Toroidal2dVertexMesh::mHeight [private] |
The height of the mesh, taking account of top-bottom periodicity.
Definition at line 63 of file Toroidal2dVertexMesh.hpp.
Referenced by GetMeshForVtk(), GetVectorFromAtoB(), GetWidth(), serialize(), and SetNode().
double Toroidal2dVertexMesh::mWidth [private] |
The width of the mesh, taking account of left-right periodicity.
Definition at line 60 of file Toroidal2dVertexMesh.hpp.
Referenced by GetMeshForVtk(), GetVectorFromAtoB(), GetWidth(), serialize(), and SetNode().