36#ifndef ABSTRACTMESH_HPP_
37#define ABSTRACTMESH_HPP_
50#include "DistributedVectorFactory.hpp"
51#include "ProcessSpecificArchive.hpp"
52#include "ChasteCuboid.hpp"
54#include <boost/utility.hpp>
59template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
62 friend class TestDistributedTetrahedralMesh;
86 template<
class Archive>
87 void serialize(Archive & archive,
const unsigned int version)
96 std::vector<Node<SPACE_DIM> *>
mNodes;
306 virtual c_vector<double, SPACE_DIM>
GetVectorFromAtoB(
const c_vector<double, SPACE_DIM>& rLocationA,
307 const c_vector<double, SPACE_DIM>& rLocationB);
330 virtual double GetWidth(
const unsigned& rDimension)
const;
362 virtual void Scale(
const double xFactor=1.0,
const double yFactor=1.0,
const double zFactor=1.0);
371 virtual void Translate(
const c_vector<double, SPACE_DIM>& rDisplacement);
380 void Translate(
const double xMovement=0.0,
const double yMovement=0.0,
const double zMovement=0.0);
389 virtual void Rotate(c_matrix<double , SPACE_DIM, SPACE_DIM> rotationMatrix);
397 void Rotate(c_vector<double,3> axis,
double angle);
404 void RotateX(
const double theta);
411 void RotateY(
const double theta);
418 void RotateZ(
const double theta);
425 void Rotate(
double theta);
499 bool skipDeletedNodes=
true);
505 typename std::vector<Node<SPACE_DIM> *>::iterator
mNodeIter;
530template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
532 bool skipDeletedNodes)
534 return NodeIterator(*
this, mNodes.begin(), skipDeletedNodes);
537template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
545template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
552template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
559template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
565template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
572 while (!IsAtEnd() && !IsAllowedNode());
577template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
581 bool skipDeletedNodes)
584 mSkipDeletedNodes(skipDeletedNodes)
601template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
604 return mNodeIter == mrMesh.mNodes.end();
607template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
610 return !(mSkipDeletedNodes && (*this)->IsDeleted());
#define TEMPLATED_CLASS_IS_ABSTRACT_2_UNSIGNED(T)
NodeIterator(AbstractMesh< ELEMENT_DIM, SPACE_DIM > &rMesh, typename std::vector< Node< SPACE_DIM > * >::iterator nodeIter, bool skipDeletedNodes=true)
std::vector< Node< SPACE_DIM > * >::iterator mNodeIter
Node< SPACE_DIM > & operator*()
Node< SPACE_DIM > * operator->()
bool operator!=(const typename AbstractMesh< ELEMENT_DIM, SPACE_DIM >::NodeIterator &rOther)
NodeIterator & operator++()
virtual unsigned GetNumAllNodes() const
void RotateZ(const double theta)
virtual DistributedVectorFactory * GetDistributedVectorFactory()
void RotateY(const double theta)
virtual void Translate(const c_vector< double, SPACE_DIM > &rDisplacement)
virtual Node< SPACE_DIM > * GetNodeOrHaloNode(unsigned index) const
bool mMeshChangesDuringSimulation
void serialize(Archive &archive, const unsigned int version)
virtual void RefreshMesh()
BoundaryNodeIterator GetBoundaryNodeIteratorBegin() const
virtual void SetElementOwnerships()
bool IsMeshChanging() const
virtual void SetDistributedVectorFactory(DistributedVectorFactory *pFactory)
void RotateX(const double theta)
std::string GetMeshFileBaseName() const
std::vector< Node< SPACE_DIM > * >::const_iterator BoundaryNodeIterator
virtual unsigned GetNumNodes() const
virtual ChasteCuboid< SPACE_DIM > CalculateBoundingBox() const
NodeIterator GetNodeIteratorEnd()
virtual void ReadNodesPerProcessorFile(const std::string &rNodesPerProcessorFile)
std::vector< Node< SPACE_DIM > * > mBoundaryNodes
virtual double GetWidth(const unsigned &rDimension) const
virtual c_vector< double, SPACE_DIM > GetVectorFromAtoB(const c_vector< double, SPACE_DIM > &rLocationA, const c_vector< double, SPACE_DIM > &rLocationB)
virtual void PermuteNodes()
double GetDistanceBetweenNodes(unsigned indexA, unsigned indexB)
std::vector< unsigned > mNodePermutation
std::string mMeshFileBaseName
bool IsMeshOnDisk() const
Node< SPACE_DIM > * GetNode(unsigned index) const
BoundaryNodeIterator GetBoundaryNodeIteratorEnd() const
virtual void Rotate(c_matrix< double, SPACE_DIM, SPACE_DIM > rotationMatrix)
virtual unsigned GetNearestNodeIndex(const ChastePoint< SPACE_DIM > &rTestPoint)
std::vector< Node< SPACE_DIM > * > mNodes
virtual void Scale(const double xFactor=1.0, const double yFactor=1.0, const double zFactor=1.0)
const std::vector< unsigned > & rGetNodePermutation() const
unsigned GetNumNodeAttributes() const
unsigned CalculateMaximumContainingElementsPerProcess() const
friend class boost::serialization::access
virtual unsigned SolveNodeMapping(unsigned index) const =0
DistributedVectorFactory * mpDistributedVectorFactory
unsigned GetNumBoundaryNodes() const
NodeIterator GetNodeIteratorBegin(bool skipDeletedNodes=true)
void SetMeshHasChangedSinceLoading()
Node< SPACE_DIM > * GetNodeFromPrePermutationIndex(unsigned index) const
static Archive * Get(void)