CellModules
Diffusion2D::BodyDiffusion< cell_t, plugin_t > Class Template Reference

molecules diffusion body class More...

#include <BodyDiffusion.hpp>

Inheritance diagram for Diffusion2D::BodyDiffusion< cell_t, plugin_t >:
BaseBody< plugin_t >

Public Member Functions

 BodyDiffusion ()
 default constructor More...
 
 BodyDiffusion (int size)
 constructor More...
 
void initNbMolecules (int n)
 quantities & consumptions initializer More...
 
double getQuantity (int x, int y, int mol)
 quantities getter More...
 
double getConsumption (int mol)
 consumption getter More...
 
vector< double > getConsumptions () const
 consumptions getter More...
 
void setConsumption (int mol, double value)
 consumption setter More...
 
DiffusionGridgetDiffusionGrid ()
 grid getter More...
 
void onCellPluginLinking ()
 plugin linking hook More...
 
void setCellPlugin (plugin_t *_cellPlugin)
 

Protected Attributes

plugin_t * cellPlugin
 

Private Attributes

vector< double > consumptions
 
int nbMolecules = 0
 

Detailed Description

template<typename cell_t, class plugin_t>
class Diffusion2D::BodyDiffusion< cell_t, plugin_t >

molecules diffusion body class

Template Parameters
cell_t

Definition at line 31 of file BodyDiffusion.hpp.

Constructor & Destructor Documentation

◆ BodyDiffusion() [1/2]

template<typename cell_t , class plugin_t >
Diffusion2D::BodyDiffusion< cell_t, plugin_t >::BodyDiffusion ( )
inline

default constructor

number of diffused molecules

Definition at line 42 of file BodyDiffusion.hpp.

◆ BodyDiffusion() [2/2]

template<typename cell_t , class plugin_t >
Diffusion2D::BodyDiffusion< cell_t, plugin_t >::BodyDiffusion ( int  size)
inlineexplicit

constructor

Parameters
size: number of existing molecules

Definition at line 48 of file BodyDiffusion.hpp.

Member Function Documentation

◆ getConsumption()

template<typename cell_t , class plugin_t >
double Diffusion2D::BodyDiffusion< cell_t, plugin_t >::getConsumption ( int  mol)
inline

consumption getter

Parameters
mol: number of the molecule
Returns
double

Definition at line 80 of file BodyDiffusion.hpp.

◆ getConsumptions()

template<typename cell_t , class plugin_t >
vector< double > Diffusion2D::BodyDiffusion< cell_t, plugin_t >::getConsumptions ( ) const
inline

consumptions getter

Returns
vector<double>

Definition at line 89 of file BodyDiffusion.hpp.

◆ getDiffusionGrid()

template<typename cell_t , class plugin_t >
DiffusionGrid * Diffusion2D::BodyDiffusion< cell_t, plugin_t >::getDiffusionGrid ( )
inline

grid getter

Returns
DiffusionGrid*

Definition at line 106 of file BodyDiffusion.hpp.

◆ getQuantity()

template<typename cell_t , class plugin_t >
double Diffusion2D::BodyDiffusion< cell_t, plugin_t >::getQuantity ( int  x,
int  y,
int  mol 
)
inline

quantities getter

Parameters
x: x pos
y: y pos
mol: number of the molecule
Returns
double

Definition at line 70 of file BodyDiffusion.hpp.

◆ initNbMolecules()

template<typename cell_t , class plugin_t >
void Diffusion2D::BodyDiffusion< cell_t, plugin_t >::initNbMolecules ( int  n)
inline

quantities & consumptions initializer

Parameters
n: number of existing molecules

Definition at line 56 of file BodyDiffusion.hpp.

◆ onCellPluginLinking()

template<typename cell_t , class plugin_t >
void Diffusion2D::BodyDiffusion< cell_t, plugin_t >::onCellPluginLinking ( )
inline

plugin linking hook

hook called when the body has access to the plugin, this happens when the cell is added to the world ( w.addCell(c) ). This hook can be useful for setting up Body properties based on elements from the Plugin part.

Definition at line 116 of file BodyDiffusion.hpp.

◆ setCellPlugin()

void BaseBody< plugin_t >::setCellPlugin ( plugin_t *  _cellPlugin)
inlineinherited

Definition at line 14 of file BaseBody.hpp.

◆ setConsumption()

template<typename cell_t , class plugin_t >
void Diffusion2D::BodyDiffusion< cell_t, plugin_t >::setConsumption ( int  mol,
double  value 
)
inline

consumption setter

Parameters
mol: number of the molecule
value

Definition at line 96 of file BodyDiffusion.hpp.

Member Data Documentation

◆ cellPlugin

plugin_t * BaseBody< plugin_t >::cellPlugin
protectedinherited

Definition at line 9 of file BaseBody.hpp.

◆ consumptions

template<typename cell_t , class plugin_t >
vector<double> Diffusion2D::BodyDiffusion< cell_t, plugin_t >::consumptions
private

Definition at line 34 of file BodyDiffusion.hpp.

◆ nbMolecules

template<typename cell_t , class plugin_t >
int Diffusion2D::BodyDiffusion< cell_t, plugin_t >::nbMolecules = 0
private

consumption of each molecules per step

Definition at line 35 of file BodyDiffusion.hpp.


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