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

Class for managing molecule diffusion in a cell body. 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 with the number of existing molecules. More...
 
void initNbMolecules (int n)
 Initializes the quantities and consumptions. More...
 
double getQuantity (int x, int y, int mol)
 Gets the quantity of a molecule at a specific position. More...
 
double getConsumption (int mol)
 Gets the consumption of a molecule. More...
 
std::vector< double > getConsumptions () const
 Gets the consumptions of all molecules. More...
 
void setConsumption (int mol, double value)
 Sets the consumption of a molecule. More...
 
DiffusionGridgetDiffusionGrid ()
 Gets the diffusion grid. More...
 
void onCellPluginLinking ()
 Hook called when the body is linked to the plugin. More...
 
void setCellPlugin (plugin_t *_cellPlugin)
 

Protected Attributes

plugin_t * cellPlugin
 

Private Attributes

std::vector< double > consumptions
 
int nbMolecules = 0
 

Detailed Description

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

Class for managing molecule diffusion in a cell body.

Template Parameters
cell_tType of the cell.
plugin_tType of the plugin.

Definition at line 30 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.

Definition at line 41 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 with the number of existing molecules.

Parameters
sizeNumber 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

Gets the consumption of a molecule.

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

Definition at line 83 of file BodyDiffusion.hpp.

◆ getConsumptions()

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

Gets the consumptions of all molecules.

Returns
Vector of consumptions.

Definition at line 92 of file BodyDiffusion.hpp.

◆ getDiffusionGrid()

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

Gets the diffusion grid.

Returns
Pointer to the DiffusionGrid.

Definition at line 110 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

Gets the quantity of a molecule at a specific position.

Parameters
xX-coordinate.
yY-coordinate.
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 Diffusion2D::BodyDiffusion< cell_t, plugin_t >::initNbMolecules ( int  n)
inline

Initializes the quantities and consumptions.

Parameters
nNumber of existing molecules.

Definition at line 57 of file BodyDiffusion.hpp.

◆ onCellPluginLinking()

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

Hook called when the body is linked to the plugin.

This hook is called when the body has access to the plugin, which 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 118 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

Sets the consumption of a molecule.

Parameters
molNumber of the molecule.
valueConsumption value.

Definition at line 100 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 >
std::vector<double> Diffusion2D::BodyDiffusion< cell_t, plugin_t >::consumptions
private

Consumption of each molecule per step

Definition at line 33 of file BodyDiffusion.hpp.

◆ nbMolecules

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

Number of diffused molecules

Definition at line 34 of file BodyDiffusion.hpp.


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