BioDynaMo  v1.03.58-27764645
Public Member Functions | Private Member Functions | List of all members
bdm::EulerGrid Class Reference

Continuum model for the 3D heat equation with exponential decay $ \partial_t u = \nabla D \nabla u - \mu u $. More...

#include <euler_grid.h>

Inheritance diagram for bdm::EulerGrid:
[legend]
Collaboration diagram for bdm::EulerGrid:
[legend]

Public Member Functions

 EulerGrid ()=default
 
 EulerGrid (int substance_id, std::string substance_name, real_t dc, real_t mu, int resolution=11)
 
void DiffuseWithClosedEdge (real_t dt) override
 
void DiffuseWithOpenEdge (real_t dt) override
 
- Public Member Functions inherited from bdm::DiffusionGrid
 DiffusionGrid ()=default
 
 DiffusionGrid (TRootIOCtor *p)
 
 DiffusionGrid (int substance_id, std::string substance_name, real_t dc, real_t mu, int resolution=11)
 
virtual ~DiffusionGrid ()=default
 
virtual void Initialize ()
 
virtual void Update ()
 
void Diffuse (real_t dt)
 
void CalculateGradient ()
 
void RunInitializers ()
 Initialize the diffusion grid according to the initialization functions. More...
 
void ChangeConcentrationBy (const Real3 &position, real_t amount)
 Increase the concentration at specified box with specified amount. More...
 
void ChangeConcentrationBy (size_t idx, real_t amount)
 Increase the concentration at specified box with specified amount. More...
 
real_t GetConcentration (const Real3 &position) const
 Get the concentration at specified position. More...
 
virtual void GetGradient (const Real3 &position, Real3 *gradient, bool normalize=true) const
 
std::array< uint32_t, 3 > GetBoxCoordinates (const Real3 &position) const
 
size_t GetBoxIndex (const std::array< uint32_t, 3 > &box_coord) const
 
size_t GetBoxIndex (const Real3 &position) const
 Calculates the box index of the substance at specified position. More...
 
void SetDecayConstant (real_t mu)
 
real_t GetLastTimestep ()
 Return the last timestep dt that was used to run Diffuse(dt) More...
 
void SetUpperThreshold (real_t t)
 
real_t GetUpperThreshold () const
 
void SetLowerThreshold (real_t t)
 
real_t GetLowerThreshold () const
 
const real_tGetAllConcentrations () const
 
const real_tGetAllGradients () const
 
std::array< size_t, 3 > GetNumBoxesArray () const
 
size_t GetNumBoxes () const
 
real_t GetBoxLength () const
 
int GetSubstanceId () const
 
const std::string & GetSubstanceName () const
 
real_t GetDecayConstant () const
 
const int32_t * GetDimensionsPtr () const
 
std::array< int32_t, 6 > GetDimensions () const
 
std::array< int32_t, 3 > GetGridSize () const
 
const std::array< real_t, 7 > & GetDiffusionCoefficients () const
 
size_t GetResolution () const
 
real_t GetBoxVolume () const
 
template<typename F >
void AddInitializer (F function)
 
bool IsFixedSubstance ()
 

Private Member Functions

 BDM_CLASS_DEF_OVERRIDE (EulerGrid, 1)
 

Detailed Description

Continuum model for the 3D heat equation with exponential decay $ \partial_t u = \nabla D \nabla u - \mu u $.

We use a forward in time and central in space finite difference method for modelling (FTCS). This method, however, is not iherently stable and thus we must impose a stability condition. $ \frac{D \Delta t}{\Delta x^2} < \frac{1}{6} $. The error of this method scaling linearly with time (forward difference of first-order) and quadratic with the spatial discretization (central difference of second-order). The method derives its name, Euler, from the time step length of the integration.

Further infomation:

Definition at line 43 of file euler_grid.h.

Constructor & Destructor Documentation

◆ EulerGrid() [1/2]

bdm::EulerGrid::EulerGrid ( )
default

◆ EulerGrid() [2/2]

bdm::EulerGrid::EulerGrid ( int  substance_id,
std::string  substance_name,
real_t  dc,
real_t  mu,
int  resolution = 11 
)
inline

Definition at line 46 of file euler_grid.h.

Member Function Documentation

◆ BDM_CLASS_DEF_OVERRIDE()

bdm::EulerGrid::BDM_CLASS_DEF_OVERRIDE ( EulerGrid  ,
 
)
private

◆ DiffuseWithClosedEdge()

void bdm::EulerGrid::DiffuseWithClosedEdge ( real_t  dt)
overridevirtual

Implements bdm::DiffusionGrid.

Definition at line 19 of file euler_grid.cc.

◆ DiffuseWithOpenEdge()

void bdm::EulerGrid::DiffuseWithOpenEdge ( real_t  dt)
overridevirtual

Implements bdm::DiffusionGrid.

Definition at line 62 of file euler_grid.cc.


The documentation for this class was generated from the following files: