PixCells
This project is a Cellular Potts Model (CPM) simulator. It was developped during a Master's degree in Physics as a master project.
Loading...
Searching...
No Matches
math.hpp File Reference
#include <vector>
#include "Simulation.hpp"
#include <eigen3/Eigen/Eigenvalues>
Include dependency graph for math.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::pair< float, float > calculate_center_of_mass_cell (const std::vector< std::pair< int, int > > &m_position)
 
std::array< float, 3 > calculate_inertia_tensor_cell (const std::vector< std::pair< int, int > > &m_position)
 Calculate the inertia tensor of a cell.
 
std::array< std::array< float, 2 >, 2 > calculate_eigenvectors_inertia_tensor_cell (const std::vector< std::pair< int, int > > &m_position)
 Calculate the eigenvectors of the inertia tensor of a cell.
 
std::pair< float, float > calculate_projection_on_principal_axis (const std::vector< std::pair< int, int > > &m_position)
 Calculate the projection of a cell on its principal axis.
 
float get_length_cell (const std::vector< std::pair< int, int > > &m_position)
 Calculate the length of a cell.
 
void initializeGrid (std::vector< std::vector< double > > &grid, double initConc)
 Function to initialize the grid with a given initial concentration.
 
void applyBoundaryConditions (std::vector< std::vector< double > > &grid, double boundaryConc)
 Function to apply the boundary conditions to the grid.
 
double secretionTerm (double secretionRate, int id_cell)
 Function to define the secretion term S(x, y, t)
 
double decayTerm (double decayRate, int id_cell)
 Function to define the decay term D(x, y, t)
 
void solve_aStepOfDiffusionSecretionDecay (std::vector< std::vector< double > > &grid, double dx, double dy, double dt, double D, double boundaryConc, double secretionRate, double decayRate, std::vector< std::vector< int > > lattice)
 Solve a step of the diffusion-secretion-decay PDE.
 

Detailed Description

Math functions

Date
28/11/2024
Version
1.0
Author
Lucas BOISTAY

Function Documentation

◆ applyBoundaryConditions()

void applyBoundaryConditions ( std::vector< std::vector< double > > &  grid,
double  boundaryConc 
)

Function to apply the boundary conditions to the grid.

Parameters
gridthe grid to apply the boundary conditions
boundaryConcthe boundary concentration value

◆ calculate_eigenvectors_inertia_tensor_cell()

std::array< std::array< float, 2 >, 2 > calculate_eigenvectors_inertia_tensor_cell ( const std::vector< std::pair< int, int > > &  m_position)

Calculate the eigenvectors of the inertia tensor of a cell.

Parameters
m_positionAll the positions of the cell
Returns
the eigenvectors of the inertia tensor of the cell

◆ calculate_inertia_tensor_cell()

std::array< float, 3 > calculate_inertia_tensor_cell ( const std::vector< std::pair< int, int > > &  m_position)

Calculate the inertia tensor of a cell.

Parameters
m_positionAll the positions of the cell
Returns
the inertia tensor of the cell

◆ calculate_projection_on_principal_axis()

std::pair< float, float > calculate_projection_on_principal_axis ( const std::vector< std::pair< int, int > > &  m_position)

Calculate the projection of a cell on its principal axis.

Parameters
m_positionAll the positions of the cell
Returns
the projection of the cell on its 2 principal axis

◆ decayTerm()

double decayTerm ( double  decayRate,
int  id_cell 
)

Function to define the decay term D(x, y, t)

Parameters
decayRatethe decay rate
id_cellthe id of the cell
Returns
double the value of the decay term

◆ get_length_cell()

float get_length_cell ( const std::vector< std::pair< int, int > > &  m_position)

Calculate the length of a cell.

Parameters
m_positionAll the positions of the cell
Returns
the max length of the cell

◆ initializeGrid()

void initializeGrid ( std::vector< std::vector< double > > &  grid,
double  initConc 
)

Function to initialize the grid with a given initial concentration.

Parameters
gridthe grid to initialize
initConcthe initial concentration value

◆ secretionTerm()

double secretionTerm ( double  secretionRate,
int  id_cell 
)

Function to define the secretion term S(x, y, t)

Parameters
secretionRatethe secretion rate
id_cellthe id of the cell
Returns
double the value of the secretion term

◆ solve_aStepOfDiffusionSecretionDecay()

void solve_aStepOfDiffusionSecretionDecay ( std::vector< std::vector< double > > &  grid,
double  dx,
double  dy,
double  dt,
double  D,
double  boundaryConc,
double  secretionRate,
double  decayRate,
std::vector< std::vector< int > >  lattice 
)

Solve a step of the diffusion-secretion-decay PDE.

Parameters
gridthe grid to solve
dxthe x step
dythe y step (usually equal to dx)
dtthe time step
Dthe diffusion coefficient
boundaryConcthe boundary concentration value
secretionRatethe secretion rate
decayRatethe decay rate
latticethe lattice of the cells