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