CellModules
Diffusion::PluginDiffusion< cell_t > Class Template Reference

Template class for a grid diffusion-based plugin. More...

#include <PluginDiffusion.hpp>

Public Member Functions

 PluginDiffusion ()=default
 Default constructor. More...
 
 PluginDiffusion (double dx, double accuracy)
 Constructor with grid parameters. More...
 
void setDx (double dx)
 Sets the grid cell size. More...
 
void setAccuracy (double a)
 Sets the diffusion accuracy. More...
 
DiffusionGridgetGrid ()
 Gets the diffusion grid. More...
 
void addMolecule (int n, Molecule m)
 Adds a new molecule to the grid. More...
 
template<typename world_t >
void onAddCell (world_t *w)
 Hook called when a cell is added to the world. More...
 
template<typename world_t >
void preBehaviorUpdate (world_t *w)
 Hook called before the behavior update of the world. More...
 

Private Attributes

DiffusionGrid grid
 

Detailed Description

template<typename cell_t>
class Diffusion::PluginDiffusion< cell_t >

Template class for a grid diffusion-based plugin.

Template Parameters
cell_tType of the cell used in the grid.

Definition at line 29 of file PluginDiffusion.hpp.

Constructor & Destructor Documentation

◆ PluginDiffusion() [1/2]

template<typename cell_t >
Diffusion::PluginDiffusion< cell_t >::PluginDiffusion ( )
default

Default constructor.

◆ PluginDiffusion() [2/2]

template<typename cell_t >
Diffusion::PluginDiffusion< cell_t >::PluginDiffusion ( double  dx,
double  accuracy 
)
inline

Constructor with grid parameters.

Parameters
dxGrid cell size
accuracyDiffusion accuracy

Definition at line 46 of file PluginDiffusion.hpp.

Member Function Documentation

◆ addMolecule()

template<typename cell_t >
void Diffusion::PluginDiffusion< cell_t >::addMolecule ( int  n,
Molecule  m 
)
inline

Adds a new molecule to the grid.

Parameters
nMolecule index
mMolecule to be added

Definition at line 71 of file PluginDiffusion.hpp.

◆ getGrid()

template<typename cell_t >
DiffusionGrid * Diffusion::PluginDiffusion< cell_t >::getGrid ( )
inline

Gets the diffusion grid.

Returns
Pointer to the diffusion grid

Definition at line 64 of file PluginDiffusion.hpp.

◆ onAddCell()

template<typename cell_t >
template<typename world_t >
void Diffusion::PluginDiffusion< cell_t >::onAddCell ( world_t *  w)
inline

Hook called when a cell is added to the world.

Template Parameters
world_tType of the world
Parameters
wPointer to the world

Definition at line 79 of file PluginDiffusion.hpp.

◆ preBehaviorUpdate()

template<typename cell_t >
template<typename world_t >
void Diffusion::PluginDiffusion< cell_t >::preBehaviorUpdate ( world_t *  w)
inline

Hook called before the behavior update of the world.

Computes and updates the molecule quantities for each cell.

Template Parameters
world_tType of the world
Parameters
wPointer to the world

Definition at line 94 of file PluginDiffusion.hpp.

◆ setAccuracy()

template<typename cell_t >
void Diffusion::PluginDiffusion< cell_t >::setAccuracy ( double  a)
inline

Sets the diffusion accuracy.

Parameters
aDiffusion accuracy

Definition at line 58 of file PluginDiffusion.hpp.

◆ setDx()

template<typename cell_t >
void Diffusion::PluginDiffusion< cell_t >::setDx ( double  dx)
inline

Sets the grid cell size.

Parameters
dxGrid cell size

Definition at line 52 of file PluginDiffusion.hpp.

Member Data Documentation

◆ grid

template<typename cell_t >
DiffusionGrid Diffusion::PluginDiffusion< cell_t >::grid
private

Grid for diffusion calculations

Definition at line 32 of file PluginDiffusion.hpp.


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