37 #include "Cylindrical2dNodesOnlyMesh.hpp"
49 if (fmod(
mWidth,cutOffLength ) > 1e-14)
51 EXCEPTION(
"The periodic width must be a multiple of cut off length.");
53 else if (
mWidth/cutOffLength == 2.0)
56 EXCEPTION(
"The periodic domain width cannot be 2*CutOffLength." );
71 assert(rDimension==0 || rDimension==1);
87 assert(!concreteMove);
97 else if (x_coord < 0.0)
99 double new_x_coord = x_coord +
mWidth;
100 double fudge_factor = 1e-14;
103 if (new_x_coord > mWidth-fudge_factor)
105 new_x_coord = mWidth-fudge_factor;
111 this->
GetNode(nodeIndex)->SetPoint(point);
121 SetNode(node_index, new_node_point);
129 c_vector<double, 2> vector = rLocation2 - rLocation1;
130 vector[0] = fmod(vector[0],
mWidth);
136 if (vector[0] > 0.5*
mWidth)
140 else if (vector[0] < -0.5*
mWidth)
152 unsigned num_nodes =
mNodes.size();
153 for (
unsigned i=0; i<num_nodes; i++)
155 double& x_location = (
mNodes[i]->rGetModifiableLocation())[0];
156 if (x_location < 0.0)
160 else if (x_location >=
mWidth)
162 x_location = fmod(x_location,
mWidth);
void SetNode(unsigned nodeIndex, ChastePoint< 2 > point, bool concreteMove=false)
c_vector< double, DIM > & rGetLocation()
unsigned AddNode(Node< 2 > *pNewNode)
Node< SPACE_DIM > * GetNode(unsigned index) const
#define EXCEPTION(message)
virtual void SetUpBoxCollection(double cutOffLength, c_vector< double, 2 *2 > domainSize, int numLocalRows=PETSC_DECIDE, bool isPeriodic=true)
void SetUpBoxCollection(const std::vector< Node< SPACE_DIM > * > &rNodes)
std::vector< Node< SPACE_DIM > * > mNodes
void SetCoordinate(unsigned i, double value)
unsigned AddNode(Node< SPACE_DIM > *pNewNode)
ChastePoint< SPACE_DIM > GetPoint() const
virtual double GetWidth(const unsigned &rDimension) const
double GetWidth(const unsigned &rDimension) const
#define CHASTE_CLASS_EXPORT(T)
Cylindrical2dNodesOnlyMesh(double width)
c_vector< double, 2 > GetVectorFromAtoB(const c_vector< double, 2 > &rLocation1, const c_vector< double, 2 > &rLocation2)