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

Template class for a molecule diffusion body. More...

#include <BodyDiffusion.hpp>

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

Public Member Functions

 BodyDiffusion ()
 Default constructor. More...
 
 BodyDiffusion (int size)
 Constructor with size parameter. More...
 
void initNbMolecules (int n)
 Initializes the number of molecules. More...
 
double getQuantity (MecaCell::Vec v, int mol) const
 Gets the quantity of a molecule. More...
 
double getConsumption (int mol) const
 Gets the consumption of a molecule. More...
 
double getConsumptionByIndex (int i) const
 Gets the consumption of a molecule by index. More...
 
void setConsumption (int mol, double value)
 Sets the consumption of a molecule. More...
 
DiffusionGridgetDiffusionGrid ()
 Gets the diffusion grid. More...
 
void setDiffusionGrid (DiffusionGrid *g)
 Sets the diffusion grid. More...
 
void onCellPluginLinking ()
 Hook called when the body has access to the plugin. More...
 

Private Member Functions

void setCellPlugin (plugin_t *_cellPlugin)
 

Private Attributes

vector< double > consumptions
 
DiffusionGridgrid = nullptr
 
int nbMolecules = 0
 
plugin_t * cellPlugin
 

Detailed Description

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

Template class for a molecule diffusion body.

Template Parameters
cell_tType of the cell used in the grid
plugin_tType of the plugin used

Definition at line 32 of file BodyDiffusion.hpp.

Constructor & Destructor Documentation

◆ BodyDiffusion() [1/2]

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

Default constructor.

Definition at line 44 of file BodyDiffusion.hpp.

◆ BodyDiffusion() [2/2]

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

Constructor with size parameter.

Parameters
sizeNumber of existing molecules.

Definition at line 51 of file BodyDiffusion.hpp.

Member Function Documentation

◆ getConsumption()

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

Gets the consumption of a molecule.

Parameters
molNumber of the molecule.
Returns
Consumption of the molecule.

Definition at line 82 of file BodyDiffusion.hpp.

◆ getConsumptionByIndex()

template<typename cell_t , class plugin_t >
double Diffusion::BodyDiffusion< cell_t, plugin_t >::getConsumptionByIndex ( int  i) const
inline

Gets the consumption of a molecule by index.

Parameters
iIndex of the molecule.
Returns
Consumption of the molecule.

Definition at line 92 of file BodyDiffusion.hpp.

◆ getDiffusionGrid()

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

Gets the diffusion grid.

Returns
Pointer to the diffusion grid.

Definition at line 110 of file BodyDiffusion.hpp.

◆ getQuantity()

template<typename cell_t , class plugin_t >
double Diffusion::BodyDiffusion< cell_t, plugin_t >::getQuantity ( MecaCell::Vec  v,
int  mol 
) const
inline

Gets the quantity of a molecule.

Parameters
vPosition vector.
molNumber of the molecule.
Returns
Quantity of the molecule.

Definition at line 72 of file BodyDiffusion.hpp.

◆ initNbMolecules()

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

Initializes the number of molecules.

Parameters
nNumber of existing molecules.

Definition at line 59 of file BodyDiffusion.hpp.

◆ onCellPluginLinking()

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

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 131 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 Diffusion::BodyDiffusion< cell_t, plugin_t >::setConsumption ( int  mol,
double  value 
)
inline

Sets the consumption of a molecule.

Parameters
molNumber of the molecule.
valueConsumption value.

Definition at line 101 of file BodyDiffusion.hpp.

◆ setDiffusionGrid()

template<typename cell_t , class plugin_t >
void Diffusion::BodyDiffusion< cell_t, plugin_t >::setDiffusionGrid ( DiffusionGrid g)
inline

Sets the diffusion grid.

Parameters
gPointer to the diffusion grid.

Definition at line 116 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> Diffusion::BodyDiffusion< cell_t, plugin_t >::consumptions
private

consumption of each molecules in µm^3/(ng.s)

Definition at line 35 of file BodyDiffusion.hpp.

◆ grid

template<typename cell_t , class plugin_t >
DiffusionGrid* Diffusion::BodyDiffusion< cell_t, plugin_t >::grid = nullptr
private

Definition at line 36 of file BodyDiffusion.hpp.

◆ nbMolecules

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

Definition at line 37 of file BodyDiffusion.hpp.


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