36 #ifndef NODESONLYMESH_HPP_
37 #define NODESONLYMESH_HPP_
40 #include <boost/serialization/base_object.hpp>
41 #include <boost/serialization/map.hpp>
45 #include "DistributedBoxCollection.hpp"
46 #include "MutableMesh.hpp"
51 template<
unsigned SPACE_DIM>
56 friend class TestNodesOnlyMesh;
59 friend class boost::serialization::access;
72 template<
class Archive>
73 void save(Archive & archive,
const unsigned int version)
const
79 archive & boost::serialization::base_object<MutableMesh<SPACE_DIM, SPACE_DIM> >(*this);
93 template<
class Archive>
94 void load(Archive & archive,
const unsigned int version)
98 std::vector<unsigned> indices;
100 archive & boost::serialization::base_object<MutableMesh<SPACE_DIM, SPACE_DIM> >(*this);
104 for (
unsigned i=0; i<this->
mNodes.size(); i++)
106 unsigned new_index = indices[i];
107 this->
mNodes[i]->SetIndex(new_index);
113 BOOST_SERIALIZATION_SPLIT_MEMBER()
222 virtual
void SetUpBoxCollection(
double cutOffLength, c_vector<
double, 2*SPACE_DIM> domainSize,
int numLocalRows = PETSC_DECIDE,
bool isPeriodic = false);
233 virtual ~NodesOnlyMesh();
299 bool IsOwned(c_vector<
double, SPACE_DIM>& location);
332 double GetWidth(const
unsigned& rDimension) const;
435 void SetNode(
unsigned nodeIndex,
ChastePoint<SPACE_DIM> point,
bool concreteMove = false);
492 #include "SerializationExportWrapper.hpp"
bool IsANodeCloseToDomainBoundary()
bool mCalculateNodeNeighbours
std::vector< unsigned > & rGetNodesToSendLeft()
virtual unsigned GetMaximumNodeIndex()
std::vector< unsigned > & rGetHaloNodesToSendLeft()
void EnlargeBoxCollection()
void SetNode(unsigned nodeIndex, ChastePoint< SPACE_DIM > point, bool concreteMove=false)
std::vector< bool > & rGetInitiallyOwnedNodes()
Node< SPACE_DIM > * GetNodeOrHaloNode(unsigned index) const
double mMaximumInteractionDistance
std::vector< unsigned > GetAllNodeIndices() const
void ConstructFromMeshReader(AbstractMeshReader< SPACE_DIM, SPACE_DIM > &rMeshReader)
void AddNodeWithFixedIndex(Node< SPACE_DIM > *pNewNode)
void SetUpBoxCollection(const std::vector< Node< SPACE_DIM > * > &rNodes)
std::vector< unsigned > & rGetHaloNodesToSendRight()
void SetCalculateNodeNeighbours(bool calculateNodeNeighbours)
void AddHaloNodesToBoxes()
void CalculateInteriorNodePairs(std::vector< std::pair< Node< SPACE_DIM > *, Node< SPACE_DIM > * > > &rNodePairs)
std::vector< Node< SPACE_DIM > * > mNodes
#define EXPORT_TEMPLATE_CLASS_SAME_DIMS(CLASS)
void DeleteNode(unsigned index)
double GetWidth(const unsigned &rDimension) const
double GetMaximumInteractionDistance()
void DeleteMovedNode(unsigned index)
unsigned GetNextAvailableIndex()
void RemoveDeletedNodes(NodeMap &map)
void ResizeBoxCollection()
void load(Archive &archive, const unsigned int version)
unsigned SolveNodeMapping(unsigned index) const
void SetInitialBoxCollection(const c_vector< double, 2 *SPACE_DIM > domainSize, double maxInteractionDistance)
DistributedBoxCollection< SPACE_DIM > * mpBoxCollection
void SetMaximumInteractionDistance(double maxDistance)
void save(Archive &archive, const unsigned int version) const
void UpdateBoxCollection()
void AddHaloNode(boost::shared_ptr< Node< SPACE_DIM > > pNewNode)
void CalculateNodesOutsideLocalDomain()
std::vector< unsigned > mNodesToSendLeft
void ConstructNodesWithoutMesh(const std::vector< Node< SPACE_DIM > * > &rNodes, double maxInteractionDistance)
void SetMinimumNodeDomainBoundarySeparation(double separation)
unsigned AddNode(Node< SPACE_DIM > *pNewNode)
DistributedBoxCollection< SPACE_DIM > * GetBoxCollection()
std::vector< unsigned > & rGetNodesToSendRight()
unsigned mMaxAddedNodeIndex
std::vector< boost::shared_ptr< Node< SPACE_DIM > > > mHaloNodes
std::vector< bool > mLocalInitialNodes
double mMinimumNodeDomainBoundarySeparation
std::vector< unsigned > mDeletedGlobalNodeIndices
void CalculateBoundaryNodePairs(std::vector< std::pair< Node< SPACE_DIM > *, Node< SPACE_DIM > * > > &rNodePairs)
std::map< unsigned, unsigned > mNodesMapping
bool IsOwned(c_vector< double, SPACE_DIM > &location)
void ClearBoxCollection()
void AddMovedNode(boost::shared_ptr< Node< SPACE_DIM > > pMovedNode)
std::map< unsigned, unsigned > mHaloNodesMapping
unsigned GetNumNodes() const
std::vector< unsigned > mNodesToSendRight