hemocell
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
hemo::HemoCell Class Reference

#include <hemocell.h>

Collaboration diagram for hemo::HemoCell:
Collaboration graph
[legend]

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.
 
PreInletpreInlet = 0
 
bool partOfpreInlet = false
 
map< plint, plintBlockToMpi
 
LoadBalancerloadBalancer = 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
 
Configcfg = 0
 
HemoCellFieldscellfields = 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.
 

Detailed Description

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.

Member Enumeration Documentation

◆ MPIHandle

enum class hemo::HemoCell::MPIHandle
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 

Constructor & Destructor Documentation

◆ HemoCell() [1/2]

hemo::HemoCell::HemoCell ( char *  configFileName,
int  argc,
char *  argv[] 
)
inline

Creates an hemocell object

Parameters
configFileNamethe location of the main config file

Unfortunately, due to palabos regulations, it is required to pass the commandline arguments

◆ HemoCell() [2/2]

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().

Parameters
mpi_handlethe MPIHanndle indicator.

◆ ~HemoCell()

HemoCell::~HemoCell ( )

Member Function Documentation

◆ addCellType()

template<class Mechanics >
void hemo::HemoCell::addCellType ( string  name,
int  constructType 
)
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 ...

◆ calculateFractionalLoadImbalance()

T HemoCell::calculateFractionalLoadImbalance ( )

Calculate and return the fractional load imbalance.

◆ checkExitSignals()

void HemoCell::checkExitSignals ( )

Check if any exis signal was caught.

◆ doLoadBalance()

void hemo::HemoCell::doLoadBalance ( )

Load balance the domain (only necessary with nAtomic blocks > nMpi processors, also checkpoints.

◆ doRestructure()

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!

◆ enableBoundaryParticles()

void HemoCell::enableBoundaryParticles ( T  boundaryRepulsionConstant,
T  boundaryRepulsionCutoff,
unsigned int  timestep = 1 
)

◆ enableSolidifyMechanics()

void hemo::HemoCell::enableSolidifyMechanics ( string  name)
inline

◆ initializeCellfield()

void HemoCell::initializeCellfield ( )

Initialice the cellfields structure (and thus also the particlefield)

◆ initializeLattice()

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.

◆ iterate()

void HemoCell::iterate ( )

Do an iteration, If the system is driven by an external vector, you must set it again after calling iterate

◆ latticeEquilibrium()

void HemoCell::latticeEquilibrium ( T  rho,
hemo::Array< T, 3 >  vel 
)

Set all the fluid nodes to these values

Parameters
rhothe desired density in lbm units
velthe desired macroscopic velocity of each node

◆ loadCheckPoint()

void HemoCell::loadCheckPoint ( )

Load a checkpoint.

◆ loadParticles()

void HemoCell::loadParticles ( )

Load the particles from their .pos files.

◆ sanityCheck()

void HemoCell::sanityCheck ( )
private

To be run right before the first iteration, all checking should move here.

◆ saveCheckPoint()

void HemoCell::saveCheckPoint ( )

Save a checkpoint.

◆ setCEPACOutputs()

void HemoCell::setCEPACOutputs ( vector< int >  outputs)

◆ setFluidOutputs()

void HemoCell::setFluidOutputs ( vector< int >  outputs)

◆ setInitialMinimumDistanceFromSolid()

void HemoCell::setInitialMinimumDistanceFromSolid ( string  name,
T  distance 
)

◆ setInteriorViscosityTimeScaleSeperation()

void HemoCell::setInteriorViscosityTimeScaleSeperation ( unsigned int  separation,
unsigned int  separation_entire_grid 
)

◆ setMaterialTimeScaleSeparation()

void HemoCell::setMaterialTimeScaleSeparation ( string  name,
unsigned int  separation 
)

◆ setOutputs()

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

Parameters
outputsa vector of constants that define the desired output
namethe name of the CellType ("RBC", "PLT")

◆ setParticleVelocityUpdateTimeScaleSeparation()

void HemoCell::setParticleVelocityUpdateTimeScaleSeparation ( unsigned int  separation)

◆ setRepulsion()

void HemoCell::setRepulsion ( T  repulsionConstant,
T  repulsionCutoff 
)

◆ setRepulsionTimeScaleSeperation()

void HemoCell::setRepulsionTimeScaleSeperation ( unsigned int  separation)

◆ setSolidifyTimeScaleSeperation()

void HemoCell::setSolidifyTimeScaleSeperation ( unsigned int  separation)

◆ setSystemPeriodicity()

void HemoCell::setSystemPeriodicity ( unsigned int  axis,
bool  bePeriodic 
)

◆ setSystemPeriodicityLimit()

void HemoCell::setSystemPeriodicityLimit ( unsigned int  axis,
int  limit 
)

◆ writeOutput()

void HemoCell::writeOutput ( )

Write the specified output to hdf5 files.

Member Data Documentation

◆ BlockToMpi

map<plint,plint> hemo::HemoCell::BlockToMpi

◆ boundaryRepulsionEnabled

bool hemo::HemoCell::boundaryRepulsionEnabled = false

◆ cellfields

HemoCellFields* hemo::HemoCell::cellfields = 0

The cellfields contains the particle field and all celltypes.

◆ cfg

Config* hemo::HemoCell::cfg = 0

◆ documentXML

XMLreader* hemo::HemoCell::documentXML = 0

◆ domain_lattice

MultiBlockLattice3D<T, DESCRIPTOR> * hemo::HemoCell::domain_lattice = 0

◆ domain_lattice_management

MultiBlockManagement3D * hemo::HemoCell::domain_lattice_management = 0

◆ iter

unsigned int hemo::HemoCell::iter = 0

◆ lastOutput

std::chrono::high_resolution_clock::duration hemo::HemoCell::lastOutput = std::chrono::high_resolution_clock::duration::zero()
private

◆ lastOutputAt

unsigned int hemo::HemoCell::lastOutputAt = 0
private

Store the last time (iteration) output occured.

◆ lattice

MultiBlockLattice3D<T, DESCRIPTOR>* hemo::HemoCell::lattice = 0

The fluid lattice.

◆ LEcurrentDisplacement

double* hemo::HemoCell::LEcurrentDisplacement

◆ leesEdwardsBC

bool hemo::HemoCell::leesEdwardsBC = false

◆ loadBalancer

LoadBalancer* hemo::HemoCell::loadBalancer = 0

◆ loadParticlesIsCalled

bool hemo::HemoCell::loadParticlesIsCalled = false
private

◆ outputInSiUnits

bool hemo::HemoCell::outputInSiUnits = true

Specify whether the output is in SI or LBM units.

◆ partOfpreInlet

bool hemo::HemoCell::partOfpreInlet = false

◆ preInlet

PreInlet* hemo::HemoCell::preInlet = 0

◆ preinlet_lattice

MultiBlockLattice3D<T, DESCRIPTOR> * hemo::HemoCell::preinlet_lattice = 0

◆ preinlet_lattice_management

MultiBlockManagement3D* hemo::HemoCell::preinlet_lattice_management = 0

◆ repulsionEnabled

bool hemo::HemoCell::repulsionEnabled = false

◆ sanityCheckDone

bool hemo::HemoCell::sanityCheckDone = false
private

Checked in iteration, do sanity check when not yet done.