Class representing a grid for molecule diffusion.
More...
#include <DiffusionGrid.hpp>
Class representing a grid for molecule diffusion.
Definition at line 80 of file DiffusionGrid.hpp.
◆ DiffusionGrid() [1/2]
Diffusion::DiffusionGrid::DiffusionGrid |
( |
| ) |
|
|
default |
◆ DiffusionGrid() [2/2]
Diffusion::DiffusionGrid::DiffusionGrid |
( |
double |
dx, |
|
|
double |
accuracy |
|
) |
| |
|
inline |
◆ addMolecule()
void Diffusion::DiffusionGrid::addMolecule |
( |
int |
n, |
|
|
Molecule |
m |
|
) |
| |
|
inline |
◆ allCellEmpty()
void Diffusion::DiffusionGrid::allCellEmpty |
( |
| ) |
|
|
inlineprivate |
◆ cleanCellOutBoundary()
void Diffusion::DiffusionGrid::cleanCellOutBoundary |
( |
| ) |
|
|
inlineprivate |
◆ computeMolecules()
template<typename world_t >
void Diffusion::DiffusionGrid::computeMolecules |
( |
world_t * |
w | ) |
|
|
inline |
Updates the quantities of molecules in the grid.
- Template Parameters
-
- Parameters
-
Definition at line 324 of file DiffusionGrid.hpp.
◆ computeStep()
double Diffusion::DiffusionGrid::computeStep |
( |
int |
i | ) |
|
|
inlineprivate |
Updates the quantity of a molecule for each cell and returns the total amount of this molecule.
- Parameters
-
- Returns
- Total quantity of the molecule
Definition at line 153 of file DiffusionGrid.hpp.
◆ deriv2nd()
double Diffusion::DiffusionGrid::deriv2nd |
( |
double |
xm1, |
|
|
double |
x, |
|
|
double |
xp1 |
|
) |
| |
|
inlineprivate |
Calculates the second derivative.
- Parameters
-
xm1 | Value at x-1 |
x | Value at x |
xp1 | Value at x+1 |
- Returns
- Approximate second derivative at x
Definition at line 98 of file DiffusionGrid.hpp.
◆ getCellSize()
double Diffusion::DiffusionGrid::getCellSize |
( |
| ) |
const |
|
inline |
◆ getDt()
double Diffusion::DiffusionGrid::getDt |
( |
double |
D | ) |
const |
|
inlineprivate |
◆ getDx()
double Diffusion::DiffusionGrid::getDx |
( |
| ) |
const |
|
inline |
◆ getGrid()
◆ getIndexFromPosition()
Gets the grid index from a position.
- Parameters
-
- Returns
- Grid index of the position
Definition at line 216 of file DiffusionGrid.hpp.
◆ getMolecule()
double Diffusion::DiffusionGrid::getMolecule |
( |
MecaCell::Vec |
v, |
|
|
int |
m |
|
) |
| |
|
inline |
Gets the quantity of a molecule at a position.
- Parameters
-
- Returns
- Quantity of the molecule at the position
Definition at line 227 of file DiffusionGrid.hpp.
◆ getMoleculeRealPos()
double Diffusion::DiffusionGrid::getMoleculeRealPos |
( |
const MecaCell::Vec & |
v, |
|
|
int |
mol |
|
) |
| |
|
inline |
Gets the quantity of a molecule at a real position.
- Parameters
-
- Returns
- Quantity of the molecule at the position
Definition at line 347 of file DiffusionGrid.hpp.
◆ getMolecules()
◆ isOutBoundary()
bool Diffusion::DiffusionGrid::isOutBoundary |
( |
const MecaCell::Vec & |
v | ) |
|
|
inlineprivate |
Checks if a position is out of boundaries.
- Parameters
-
- Returns
- True if the position is out of boundaries, false otherwise
Definition at line 137 of file DiffusionGrid.hpp.
◆ nextStep()
void Diffusion::DiffusionGrid::nextStep |
( |
int |
i | ) |
|
|
inlineprivate |
Initializes the next step for a molecule.
- Parameters
-
Definition at line 104 of file DiffusionGrid.hpp.
◆ setAccuracy()
void Diffusion::DiffusionGrid::setAccuracy |
( |
double |
a | ) |
|
|
inline |
◆ setDx()
void Diffusion::DiffusionGrid::setDx |
( |
double |
_dx | ) |
|
|
inline |
◆ size()
size_t Diffusion::DiffusionGrid::size |
( |
| ) |
const |
|
inline |
Gets the size of the grid.
- Returns
- Size of the grid
Definition at line 238 of file DiffusionGrid.hpp.
◆ updateBoundary()
template<typename world_t >
void Diffusion::DiffusionGrid::updateBoundary |
( |
world_t * |
w | ) |
|
|
inline |
Updates the grid boundaries and consumptions.
- Template Parameters
-
- Parameters
-
Definition at line 274 of file DiffusionGrid.hpp.
◆ accuracy
double Diffusion::DiffusionGrid::accuracy = 0.1 |
|
private |
◆ dx
double Diffusion::DiffusionGrid::dx = 5. |
|
private |
◆ grid
◆ maxBoundary
◆ minBoundary
◆ molecules
◆ moleculesDict
unordered_map<int,int> Diffusion::DiffusionGrid::moleculesDict |
The documentation for this class was generated from the following file: