45 template<
unsigned SPACE_DIM>
49 mIsBoundaryNode = isBoundaryNode;
52 mpNodeAttributes = NULL;
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;
133 template<
unsigned SPACE_DIM>
139 template<
unsigned SPACE_DIM>
151 template<
unsigned SPACE_DIM>
158 template<
unsigned SPACE_DIM>
164 template<
unsigned SPACE_DIM>
167 return mIsBoundaryNode;
170 template<
unsigned SPACE_DIM>
173 ConstructNodeAttributes();
175 mpNodeAttributes->AddAttribute(attribute);
178 template<
unsigned SPACE_DIM>
181 CheckForNodeAttributes();
183 return mpNodeAttributes->rGetAttributes();
186 template<
unsigned SPACE_DIM>
189 unsigned num_attributes;
190 if (!mpNodeAttributes)
196 num_attributes = mpNodeAttributes->rGetAttributes().size();
199 return num_attributes;
202 template<
unsigned SPACE_DIM>
205 return (mpNodeAttributes != NULL);
208 template<
unsigned SPACE_DIM>
211 CheckForNodeAttributes();
213 return mpNodeAttributes->rGetAppliedForce();
216 template<
unsigned SPACE_DIM>
219 ConstructNodeAttributes();
221 mpNodeAttributes->ClearAppliedForce();
224 template<
unsigned SPACE_DIM>
227 ConstructNodeAttributes();
229 mpNodeAttributes->AddAppliedForceContribution(forceContribution);
232 template<
unsigned SPACE_DIM>
235 CheckForNodeAttributes();
237 return mpNodeAttributes->IsParticle();
240 template<
unsigned SPACE_DIM>
243 ConstructNodeAttributes();
245 mpNodeAttributes->SetIsParticle(isParticle);
248 template<
unsigned SPACE_DIM>
251 CheckForNodeAttributes();
253 return mpNodeAttributes->GetRadius();
256 template<
unsigned SPACE_DIM>
259 ConstructNodeAttributes();
261 mpNodeAttributes->SetRadius(radius);
268 template<
unsigned SPACE_DIM>
271 mElementIndices.insert(index);
274 template<
unsigned SPACE_DIM>
277 unsigned count = mElementIndices.erase(index);
280 EXCEPTION(
"Tried to remove an index which was not in the set");
284 template<
unsigned SPACE_DIM>
287 unsigned count = mBoundaryElementIndices.erase(index);
290 EXCEPTION(
"Tried to remove an index which was not in the set");
294 template<
unsigned SPACE_DIM>
297 mBoundaryElementIndices.insert(index);
300 template<
unsigned SPACE_DIM>
303 return mElementIndices;
306 template<
unsigned SPACE_DIM>
309 return mBoundaryElementIndices;
312 template<
unsigned SPACE_DIM>
315 return mElementIndices.size();
318 template<
unsigned SPACE_DIM>
321 return mBoundaryElementIndices.size();
328 template<
unsigned SPACE_DIM>
331 if (mpNodeAttributes == NULL)
333 EXCEPTION(
"Node has no attributes associated with it. Construct attributes first");
337 template<
unsigned SPACE_DIM>
340 if (mpNodeAttributes == NULL)
346 template<
unsigned SPACE_DIM>
352 template<
unsigned SPACE_DIM>
358 template<
unsigned SPACE_DIM>
364 template<
unsigned SPACE_DIM>
370 template<
unsigned SPACE_DIM>
373 ConstructNodeAttributes();
374 mpNodeAttributes->SetRegion(region);
377 template<
unsigned SPACE_DIM>
382 if (mpNodeAttributes)
384 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 AddAppliedForceContribution(c_vector< double, SPACE_DIM > &forceContribution)
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 SetIsParticle(bool isParticle)
std::set< unsigned > & rGetContainingBoundaryElementIndices()
void SetRegion(unsigned region)
const c_vector< double, SPACE_DIM > & rGetLocation() const
void AddElement(unsigned index)
ChastePoint< SPACE_DIM > GetPoint() const
void AddBoundaryElement(unsigned index)
c_vector< double, SPACE_DIM > & rGetAppliedForce()
unsigned GetNumContainingElements() const
unsigned GetIndex() const
c_vector< double, SPACE_DIM > & rGetModifiableLocation()