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

Continuum model for the 3D heat equation $ \partial_t u = \nabla D \nabla u $. More...

#include <runge_kutta_grid.h>

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

Public Member Functions

 RungeKuttaGrid ()=default
 
 RungeKuttaGrid (int substance_id, std::string substance_name, real_t dc, int resolution=11)
 
void Initialize () override
 
void Update () override
 
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
 
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 (RungeKuttaGrid, 1)
 

Private Attributes

ParallelResizeVector< real_tr1_ = {}
 Buffers for Runge Kutta. More...
 
std::array< real_t, 2 > k_ = {}
 k array for runge-kutta. More...
 
unsigned int diffusion_step_ = 1
 Number of steps for RK diffusion grid;. More...
 

Detailed Description

Continuum model for the 3D heat equation $ \partial_t u = \nabla D \nabla u $.

This alternative solution to the finite difference method is based on an explicit second order Runge-Kutta scheme. Taking a approach which is forward in time and central in space. Due to the more sophisticated time integration, the solution converges better than the EulerGrid. However, this causes a tradeoff leading to increased computational effort.

Definition at line 34 of file runge_kutta_grid.h.

Constructor & Destructor Documentation

◆ RungeKuttaGrid() [1/2]

bdm::RungeKuttaGrid::RungeKuttaGrid ( )
default

◆ RungeKuttaGrid() [2/2]

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

Definition at line 37 of file runge_kutta_grid.h.

Member Function Documentation

◆ BDM_CLASS_DEF_OVERRIDE()

bdm::RungeKuttaGrid::BDM_CLASS_DEF_OVERRIDE ( RungeKuttaGrid  ,
 
)
private

◆ DiffuseWithClosedEdge()

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

Implements bdm::DiffusionGrid.

Definition at line 20 of file runge_kutta_grid.cc.

◆ DiffuseWithOpenEdge()

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

Implements bdm::DiffusionGrid.

Definition at line 79 of file runge_kutta_grid.cc.

◆ Initialize()

void bdm::RungeKuttaGrid::Initialize ( )
inlineoverridevirtual

Reimplemented from bdm::DiffusionGrid.

Definition at line 42 of file runge_kutta_grid.h.

◆ Update()

void bdm::RungeKuttaGrid::Update ( )
inlineoverridevirtual

Updates the grid dimensions, based on the given threshold values. The diffusion grid dimensions need always be larger than the neighbor grid dimensions, so that each simulation object can obtain its local concentration / gradient

Reimplemented from bdm::DiffusionGrid.

Definition at line 50 of file runge_kutta_grid.h.

Member Data Documentation

◆ diffusion_step_

unsigned int bdm::RungeKuttaGrid::diffusion_step_ = 1
private

Number of steps for RK diffusion grid;.

Definition at line 64 of file runge_kutta_grid.h.

◆ k_

std::array<real_t, 2> bdm::RungeKuttaGrid::k_ = {}
private

k array for runge-kutta.

Definition at line 62 of file runge_kutta_grid.h.

◆ r1_

ParallelResizeVector<real_t> bdm::RungeKuttaGrid::r1_ = {}
private

Buffers for Runge Kutta.

Definition at line 60 of file runge_kutta_grid.h.


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