45 template<
unsigned SPACE_DIM>
49 mIsBoundaryNode = isBoundaryNode;
52 mpNodeAttributes =
nullptr;
55 template<
unsigned SPACE_DIM>
59 CommonConstructor(index, isBoundaryNode);
62 template<
unsigned SPACE_DIM>
65 for (
unsigned i=0; i<SPACE_DIM; i++)
67 mLocation(i) = coords.at(i);
69 CommonConstructor(index, isBoundaryNode);
72 template<
unsigned SPACE_DIM>
76 CommonConstructor(index, isBoundaryNode);
79 template<
unsigned SPACE_DIM>
91 CommonConstructor(index, isBoundaryNode);
94 template<
unsigned SPACE_DIM>
97 for (
unsigned i=0; i<SPACE_DIM; i++)
99 mLocation(i) = location[i];
101 CommonConstructor(index, isBoundaryNode);
104 template<
unsigned SPACE_DIM>
107 delete mpNodeAttributes;
114 template<
unsigned SPACE_DIM>
120 template<
unsigned SPACE_DIM>
126 template<
unsigned SPACE_DIM>
129 mIsBoundaryNode = value;
132 template<
unsigned SPACE_DIM>
138 template<
unsigned SPACE_DIM>
150 template<
unsigned SPACE_DIM>
157 template<
unsigned SPACE_DIM>
163 template<
unsigned SPACE_DIM>
166 return mIsBoundaryNode;
169 template<
unsigned SPACE_DIM>
172 ConstructNodeAttributes();
174 mpNodeAttributes->AddAttribute(attribute);
177 template<
unsigned SPACE_DIM>
180 CheckForNodeAttributes();
182 return mpNodeAttributes->rGetAttributes();
185 template<
unsigned SPACE_DIM>
188 unsigned num_attributes;
189 if (!mpNodeAttributes)
195 num_attributes = mpNodeAttributes->rGetAttributes().size();
198 return num_attributes;
201 template<
unsigned SPACE_DIM>
204 return (mpNodeAttributes !=
nullptr);
207 template<
unsigned SPACE_DIM>
210 CheckForNodeAttributes();
212 return mpNodeAttributes->rGetAppliedForce();
215 template<
unsigned SPACE_DIM>
218 ConstructNodeAttributes();
220 mpNodeAttributes->ClearAppliedForce();
223 template<
unsigned SPACE_DIM>
226 ConstructNodeAttributes();
228 mpNodeAttributes->AddAppliedForceContribution(rForceContribution);
231 template<
unsigned SPACE_DIM>
234 CheckForNodeAttributes();
236 return mpNodeAttributes->IsParticle();
239 template<
unsigned SPACE_DIM>
242 ConstructNodeAttributes();
244 mpNodeAttributes->SetIsParticle(isParticle);
247 template<
unsigned SPACE_DIM>
250 CheckForNodeAttributes();
252 return mpNodeAttributes->GetRadius();
255 template<
unsigned SPACE_DIM>
258 ConstructNodeAttributes();
260 mpNodeAttributes->SetRadius(radius);
267 template<
unsigned SPACE_DIM>
270 mElementIndices.insert(index);
273 template<
unsigned SPACE_DIM>
276 unsigned count = mElementIndices.erase(index);
279 EXCEPTION(
"Tried to remove an index which was not in the set");
283 template<
unsigned SPACE_DIM>
286 unsigned count = mBoundaryElementIndices.erase(index);
289 EXCEPTION(
"Tried to remove an index which was not in the set");
293 template<
unsigned SPACE_DIM>
296 mBoundaryElementIndices.insert(index);
299 template<
unsigned SPACE_DIM>
302 return mElementIndices;
305 template<
unsigned SPACE_DIM>
308 return mBoundaryElementIndices;
311 template<
unsigned SPACE_DIM>
314 return mElementIndices.size();
317 template<
unsigned SPACE_DIM>
320 return mBoundaryElementIndices.size();
327 template<
unsigned SPACE_DIM>
330 ConstructNodeAttributes();
332 return mpNodeAttributes->AddNeighbour(index);
335 template<
unsigned SPACE_DIM>
338 ConstructNodeAttributes();
340 mpNodeAttributes->ClearNeighbours();
343 template<
unsigned SPACE_DIM>
346 CheckForNodeAttributes();
348 mpNodeAttributes->RemoveDuplicateNeighbours();
351 template<
unsigned SPACE_DIM>
354 CheckForNodeAttributes();
356 return mpNodeAttributes->NeighboursIsEmpty();
359 template<
unsigned SPACE_DIM>
362 ConstructNodeAttributes();
364 mpNodeAttributes->SetNeighboursSetUp(flag);
367 template<
unsigned SPACE_DIM>
370 CheckForNodeAttributes();
372 return mpNodeAttributes->GetNeighboursSetUp();
375 template<
unsigned SPACE_DIM>
378 CheckForNodeAttributes();
380 return mpNodeAttributes->rGetNeighbours();
387 template<
unsigned SPACE_DIM>
390 if (mpNodeAttributes ==
nullptr)
392 EXCEPTION(
"Node has no attributes associated with it. Construct attributes first");
396 template<
unsigned SPACE_DIM>
399 if (mpNodeAttributes ==
nullptr)
405 template<
unsigned SPACE_DIM>
411 template<
unsigned SPACE_DIM>
417 template<
unsigned SPACE_DIM>
423 template<
unsigned SPACE_DIM>
429 template<
unsigned SPACE_DIM>
432 ConstructNodeAttributes();
433 mpNodeAttributes->SetRegion(region);
436 template<
unsigned SPACE_DIM>
441 if (mpNodeAttributes)
443 region = mpNodeAttributes->GetRegion();
void CheckForNodeAttributes() const
void SetPoint(ChastePoint< SPACE_DIM > point)
Node(unsigned index, ChastePoint< SPACE_DIM > point, bool isBoundaryNode=false)
void ConstructNodeAttributes()
c_vector< double, DIM > & rGetLocation()
void SetAsBoundaryNode(bool value=true)
void RemoveElement(unsigned index)
void CommonConstructor(unsigned index, bool isBoundaryNode)
void AddNodeAttribute(double attribute)
void SetRadius(double radius)
bool IsBoundaryNode() const
#define EXCEPTION(message)
unsigned GetNumBoundaryElements() const
void RemoveBoundaryElement(unsigned index)
std::set< unsigned > & rGetContainingElementIndices()
void SetIndex(unsigned index)
std::vector< double > & rGetNodeAttributes()
unsigned GetNumNodeAttributes()
unsigned GetRegion() const
void SetNeighboursSetUp(bool flag)
void AddAppliedForceContribution(const c_vector< double, SPACE_DIM > &rForceContribution)
void SetIsParticle(bool isParticle)
std::set< unsigned > & rGetContainingBoundaryElementIndices()
void AddNeighbour(unsigned index)
void SetRegion(unsigned region)
std::vector< unsigned > & rGetNeighbours()
const c_vector< double, SPACE_DIM > & rGetLocation() const
void AddElement(unsigned index)
bool GetNeighboursSetUp()
ChastePoint< SPACE_DIM > GetPoint() const
void RemoveDuplicateNeighbours()
void AddBoundaryElement(unsigned index)
c_vector< double, SPACE_DIM > & rGetAppliedForce()
unsigned GetNumContainingElements() const
unsigned GetIndex() const
c_vector< double, SPACE_DIM > & rGetModifiableLocation()