36 #include "DiffusionForce.hpp" 37 #include "NodeBasedCellPopulation.hpp" 40 template<
unsigned DIM>
43 template<
unsigned DIM>
46 mAbsoluteTemperature(296.0),
51 template<
unsigned DIM>
56 template<
unsigned DIM>
59 assert(newValue > 0.0);
63 template<
unsigned DIM>
69 template<
unsigned DIM>
72 assert(newValue > 0.0);
76 template<
unsigned DIM>
82 template<
unsigned DIM>
88 template<
unsigned DIM>
99 unsigned node_index = node_iter->GetIndex();
100 double node_radius = node_iter->GetRadius();
103 if (node_radius == 0.0)
106 EXCEPTION(
"SetRadius() must be called on each Node before calling DiffusionForce::AddForceContribution() to avoid a division by zero error");
120 double diffusion_constant = diffusion_const_scaling/node_radius;
122 c_vector<double, DIM> force_contribution;
123 for (
unsigned i=0; i<DIM; i++)
136 force_contribution[i] = (nu*sqrt(2.0*diffusion_constant*dt)/dt)*xi;
138 node_iter->AddAppliedForceContribution(force_contribution);
142 template<
unsigned DIM>
145 *rParamsFile <<
"\t\t\t<AbsoluteTemperature>" <<
mAbsoluteTemperature <<
"</AbsoluteTemperature> \n";
146 *rParamsFile <<
"\t\t\t<Viscosity>" <<
mViscosity <<
"</Viscosity> \n";
#define EXCEPTION(message)
static SimulationTime * Instance()
double GetAbsoluteTemperature()
NodeIterator GetNodeIteratorEnd()
double GetTimeStep() const
#define EXPORT_TEMPLATE_CLASS_SAME_DIMS(CLASS)
static RandomNumberGenerator * Instance()
NodeIterator GetNodeIteratorBegin(bool skipDeletedNodes=true)
double GetDiffusionScalingConstant()
static const double msBoltzmannConstant
double mAbsoluteTemperature
AbstractMesh< ELEMENT_DIM, SPACE_DIM > & rGetMesh()
void AddForceContribution(AbstractCellPopulation< DIM > &rCellPopulation)
void SetViscosity(double viscosity)
double StandardNormalRandomDeviate()
void OutputForceParameters(out_stream &rParamsFile)
virtual void OutputForceParameters(out_stream &rParamsFile)=0
void SetAbsoluteTemperature(double absoluteTemperature)