38#include "NodeAttributes.hpp"
41template<
unsigned SPACE_DIM>
43 : mAttributes(std::vector<
double>()),
45 mAppliedForce(zero_vector<
double>(SPACE_DIM)),
47 mNeighbourIndices(std::vector<
unsigned>()),
48 mNeighboursSetUp(false),
53template<
unsigned SPACE_DIM>
59template<
unsigned SPACE_DIM>
62 mAttributes.push_back(attribute);
65template<
unsigned SPACE_DIM>
71template<
unsigned SPACE_DIM>
77template<
unsigned SPACE_DIM>
83template<
unsigned SPACE_DIM>
86 mAppliedForce += rForceContribution;
89template<
unsigned SPACE_DIM>
92 for (
unsigned d = 0; d < SPACE_DIM; d++)
94 mAppliedForce[d] = 0.0;
98template<
unsigned SPACE_DIM>
101 mNeighbourIndices.push_back(index);
104template<
unsigned SPACE_DIM>
107 mNeighbourIndices.clear();
110template<
unsigned SPACE_DIM>
113 sort( mNeighbourIndices.begin(), mNeighbourIndices.end() );
114 mNeighbourIndices.erase( unique( mNeighbourIndices.begin(), mNeighbourIndices.end() ), mNeighbourIndices.end() );
117template<
unsigned SPACE_DIM>
120 return mNeighbourIndices.empty();
123template<
unsigned SPACE_DIM>
126 mNeighboursSetUp = flag;
129template<
unsigned SPACE_DIM>
132 return mNeighboursSetUp;
135template<
unsigned SPACE_DIM>
138 return mNeighbourIndices;
142template<
unsigned SPACE_DIM>
148template<
unsigned SPACE_DIM>
151 mIsParticle = isParticle;
154template<
unsigned SPACE_DIM>
160template<
unsigned SPACE_DIM>
165 EXCEPTION(
"Trying to set node attributes mRadius to a negative value.");
#define EXCEPTION(message)
bool GetNeighboursSetUp()
std::vector< double > & rGetAttributes()
void SetRegion(unsigned region)
void RemoveDuplicateNeighbours()
void SetNeighboursSetUp(bool flag)
std::vector< unsigned > & rGetNeighbours()
void SetRadius(double radius)
void AddAttribute(double attribute)
void AddAppliedForceContribution(const c_vector< double, SPACE_DIM > &rForceContribution)
void SetIsParticle(bool isParticle)
c_vector< double, SPACE_DIM > & rGetAppliedForce()
void AddNeighbour(unsigned index)