hemocell
|
#include <hemocell.h>
Public Types | |
enum class | MPIHandle { Internal , External } |
Switch to indicate if the MPI instance is managed externally. The MPI instance is typically invoked when initialising the HemoCell class through the plb::plbInit routine. However, in some scenarios we might want to manually control the MPI environment and do not want HemoCell to setup MPI environment. More... | |
Public Member Functions | |
HemoCell (char *configFileName, int argc, char *argv[]) | |
HemoCell (char *configFileName, int argc, char *argv[], HemoCell::MPIHandle mpi_handle) | |
~HemoCell () | |
void | latticeEquilibrium (T rho, hemo::Array< T, 3 > vel) |
void | initializeCellfield () |
template<class Mechanics > | |
void | addCellType (string name, int constructType) |
void | setOutputs (string name, vector< int > outputs) |
void | setRepulsion (T repulsionConstant, T repulsionCutoff) |
void | setMaterialTimeScaleSeparation (string name, unsigned int separation) |
void | enableSolidifyMechanics (string name) |
void | setParticleVelocityUpdateTimeScaleSeparation (unsigned int separation) |
void | setRepulsionTimeScaleSeperation (unsigned int separation) |
void | setSolidifyTimeScaleSeperation (unsigned int separation) |
void | setInteriorViscosityTimeScaleSeperation (unsigned int separation, unsigned int separation_entire_grid) |
void | enableBoundaryParticles (T boundaryRepulsionConstant, T boundaryRepulsionCutoff, unsigned int timestep=1) |
void | setInitialMinimumDistanceFromSolid (string name, T distance) |
void | setFluidOutputs (vector< int > outputs) |
void | setCEPACOutputs (vector< int > outputs) |
void | setSystemPeriodicity (unsigned int axis, bool bePeriodic) |
void | setSystemPeriodicityLimit (unsigned int axis, int limit) |
void | loadParticles () |
Load the particles from their .pos files. | |
void | loadCheckPoint () |
Load a checkpoint. | |
void | saveCheckPoint () |
Save a checkpoint. | |
void | writeOutput () |
Write the specified output to hdf5 files. | |
void | iterate () |
void | checkExitSignals () |
Check if any exis signal was caught. | |
T | calculateFractionalLoadImbalance () |
Calculate and return the fractional load imbalance. | |
void | doLoadBalance () |
Load balance the domain (only necessary with nAtomic blocks > nMpi processors, also checkpoints. | |
void | doRestructure (bool checkpoint_avail=true) |
Restructure the grid, has an optional argument to specify whether a checkpoint from this iteration is available, default is YES! | |
void | initializeLattice (MultiBlockManagement3D const &management) |
Initialize the fluid field with the given management, should be done after specifing the pre inlets and before initializing the cellfields. | |
Public Attributes | |
bool | repulsionEnabled = false |
bool | boundaryRepulsionEnabled = false |
bool | leesEdwardsBC = false |
double * | LEcurrentDisplacement |
bool | outputInSiUnits = true |
Specify whether the output is in SI or LBM units. | |
PreInlet * | preInlet = 0 |
bool | partOfpreInlet = false |
map< plint, plint > | BlockToMpi |
LoadBalancer * | loadBalancer = 0 |
MultiBlockLattice3D< T, DESCRIPTOR > * | lattice = 0 |
The fluid lattice. | |
MultiBlockLattice3D< T, DESCRIPTOR > * | preinlet_lattice = 0 |
MultiBlockLattice3D< T, DESCRIPTOR > * | domain_lattice = 0 |
MultiBlockManagement3D * | preinlet_lattice_management = 0 |
MultiBlockManagement3D * | domain_lattice_management = 0 |
Config * | cfg = 0 |
HemoCellFields * | cellfields = 0 |
The cellfields contains the particle field and all celltypes. | |
unsigned int | iter = 0 |
XMLreader * | documentXML = 0 |
Private Member Functions | |
void | sanityCheck () |
To be run right before the first iteration, all checking should move here. | |
Private Attributes | |
bool | loadParticlesIsCalled = false |
unsigned int | lastOutputAt = 0 |
Store the last time (iteration) output occured. | |
std::chrono::high_resolution_clock::duration | lastOutput = std::chrono::high_resolution_clock::duration::zero() |
bool | sanityCheckDone = false |
Checked in iteration, do sanity check when not yet done. | |
The HemoCell class contains all the information, data and methods to set up a basic HemoCell simulation.
Most importantly:
After everything is set HemoCell::iterate() is used to iterate the simulation.
|
strong |
Switch to indicate if the MPI instance is managed externally. The MPI instance is typically invoked when initialising the HemoCell class through the plb::plbInit
routine. However, in some scenarios we might want to manually control the MPI environment and do not want HemoCell to setup MPI environment.
Enumerator | |
---|---|
Internal | |
External |
|
inline |
Creates an hemocell object
configFileName | the location of the main config file |
Unfortunately, due to palabos regulations, it is required to pass the commandline arguments
HemoCell::HemoCell | ( | char * | configFileName, |
int | argc, | ||
char * | argv[], | ||
HemoCell::MPIHandle | mpi_handle | ||
) |
Creates an HemoCell object and allows to indicate the MPI environment is managed externally. If so, this constructor avoids plb::plbInit().
mpi_handle | the MPIHanndle indicator. |
HemoCell::~HemoCell | ( | ) |
|
inline |
Add a celltype valid options for constructType are: RBC_FROM_SPHERE <- RBC ELLIPSOID_FROM_SPHERE <- platelet STRING_FROM_VERTEXES ->von willibrand factor use as addCelltype<RbcHO>("RBC", RBC_FROM_SPHERE) for example Since it is a template, it must be in the header class, maybe move to .hh file for readability ...
T HemoCell::calculateFractionalLoadImbalance | ( | ) |
Calculate and return the fractional load imbalance.
void HemoCell::checkExitSignals | ( | ) |
Check if any exis signal was caught.
void hemo::HemoCell::doLoadBalance | ( | ) |
Load balance the domain (only necessary with nAtomic blocks > nMpi processors, also checkpoints.
void HemoCell::doRestructure | ( | bool | checkpoint_avail = true | ) |
Restructure the grid, has an optional argument to specify whether a checkpoint from this iteration is available, default is YES!
void HemoCell::enableBoundaryParticles | ( | T | boundaryRepulsionConstant, |
T | boundaryRepulsionCutoff, | ||
unsigned int | timestep = 1 |
||
) |
|
inline |
void HemoCell::initializeCellfield | ( | ) |
Initialice the cellfields structure (and thus also the particlefield)
void HemoCell::initializeLattice | ( | MultiBlockManagement3D const & | management | ) |
Initialize the fluid field with the given management, should be done after specifing the pre inlets and before initializing the cellfields.
void HemoCell::iterate | ( | ) |
Do an iteration, If the system is driven by an external vector, you must set it again after calling iterate
void HemoCell::latticeEquilibrium | ( | T | rho, |
hemo::Array< T, 3 > | vel | ||
) |
Set all the fluid nodes to these values
rho | the desired density in lbm units |
vel | the desired macroscopic velocity of each node |
void HemoCell::loadCheckPoint | ( | ) |
Load a checkpoint.
void HemoCell::loadParticles | ( | ) |
Load the particles from their .pos files.
|
private |
To be run right before the first iteration, all checking should move here.
void HemoCell::saveCheckPoint | ( | ) |
Save a checkpoint.
void HemoCell::setCEPACOutputs | ( | vector< int > | outputs | ) |
void HemoCell::setFluidOutputs | ( | vector< int > | outputs | ) |
void HemoCell::setInitialMinimumDistanceFromSolid | ( | string | name, |
T | distance | ||
) |
void HemoCell::setInteriorViscosityTimeScaleSeperation | ( | unsigned int | separation, |
unsigned int | separation_entire_grid | ||
) |
void HemoCell::setMaterialTimeScaleSeparation | ( | string | name, |
unsigned int | separation | ||
) |
void HemoCell::setOutputs | ( | string | name, |
vector< int > | outputs | ||
) |
Set the output of a celltype the outputs string should contain constants like VELOCITY_OUTPUT defined in the constants_defaults file
outputs | a vector of constants that define the desired output |
name | the name of the CellType ("RBC", "PLT") |
void HemoCell::setParticleVelocityUpdateTimeScaleSeparation | ( | unsigned int | separation | ) |
void HemoCell::setRepulsionTimeScaleSeperation | ( | unsigned int | separation | ) |
void HemoCell::setSolidifyTimeScaleSeperation | ( | unsigned int | separation | ) |
void HemoCell::setSystemPeriodicity | ( | unsigned int | axis, |
bool | bePeriodic | ||
) |
void HemoCell::setSystemPeriodicityLimit | ( | unsigned int | axis, |
int | limit | ||
) |
void HemoCell::writeOutput | ( | ) |
Write the specified output to hdf5 files.
bool hemo::HemoCell::boundaryRepulsionEnabled = false |
HemoCellFields* hemo::HemoCell::cellfields = 0 |
The cellfields contains the particle field and all celltypes.
Config* hemo::HemoCell::cfg = 0 |
XMLreader* hemo::HemoCell::documentXML = 0 |
MultiBlockLattice3D<T, DESCRIPTOR> * hemo::HemoCell::domain_lattice = 0 |
MultiBlockManagement3D * hemo::HemoCell::domain_lattice_management = 0 |
unsigned int hemo::HemoCell::iter = 0 |
|
private |
|
private |
Store the last time (iteration) output occured.
MultiBlockLattice3D<T, DESCRIPTOR>* hemo::HemoCell::lattice = 0 |
The fluid lattice.
double* hemo::HemoCell::LEcurrentDisplacement |
bool hemo::HemoCell::leesEdwardsBC = false |
LoadBalancer* hemo::HemoCell::loadBalancer = 0 |
|
private |
bool hemo::HemoCell::outputInSiUnits = true |
Specify whether the output is in SI or LBM units.
bool hemo::HemoCell::partOfpreInlet = false |
PreInlet* hemo::HemoCell::preInlet = 0 |
MultiBlockLattice3D<T, DESCRIPTOR> * hemo::HemoCell::preinlet_lattice = 0 |
MultiBlockManagement3D* hemo::HemoCell::preinlet_lattice_management = 0 |
bool hemo::HemoCell::repulsionEnabled = false |
|
private |
Checked in iteration, do sanity check when not yet done.