The HemoCell API#
This page is a task-oriented guide to the hemo::HemoCell class — the object
you drive from a case’s main(). It groups the most commonly used methods by
what you do with them. For full signatures, overloads, and the rest of the C++
API, see the auto-generated Doxygen reference.
A minimal case follows the same skeleton in every example (see Creating your own HemoCell Case for the full walk-through):
HemoCell hemocell(argv[1], argc, argv); // 1. construct
hemocell.initializeLattice(management); // 2. set up the fluid
hemocell.initializeCellfield(); // 3. set up the cells
hemocell.addCellType<RbcHighOrderModel>("RBC", RBC_FROM_SPHERE);
hemocell.setOutputs("RBC", { /* ... */ });
hemocell.setFluidOutputs({ /* ... */ });
hemocell.loadParticles(); // 4. place the cells
while (hemocell.iter < tmax) { // 5. run
hemocell.iterate();
if (hemocell.iter % tmeas == 0) hemocell.writeOutput();
}
Construction and lifecycle#
Member |
Purpose |
|---|---|
|
Construct the simulation from a |
|
Same, but for when MPI is initialised outside HemoCell (HemoCell then
skips |
|
The current iteration counter (read it to drive your main loop). |
|
The parsed configuration; read values with
|
Setting up the fluid#
Member |
Purpose |
|---|---|
|
Create the fluid lattice from a Palabos |
|
The underlying Palabos |
|
Initialise every fluid node to a density and velocity (lattice units). |
|
Make the whole system periodic along an axis. |
|
Limit how many times a particle may wrap around a periodic axis. |
Setting up the cells#
Member |
Purpose |
|---|---|
|
Create the cell-fields / particle-field container. Call before adding cell types. |
|
Register a cell type with a mechanical model and a
construction method. The
|
|
Load the initial cell positions from the |
|
Keep cells at least |
Controlling cost (time-scale separation)#
See Time-scale separation for the concept.
Member |
Purpose |
|---|---|
|
Re-evaluate this cell type’s mechanical model every |
|
Interpolate fluid velocity to particles every |
|
Update cell–cell repulsion every |
|
Update interior viscosity every |
Optional physics#
Member |
Purpose |
|---|---|
|
Enable and parameterise short-range cell–cell repulsion. See Repulsive forces. |
|
Enable repulsion between cells and solid boundaries. |
|
Enable solidification (clotting) for a cell type. Requires the
|
Output and checkpointing#
Member |
Purpose |
|---|---|
|
Choose which per-cell fields to write for a cell type. See Output fields. |
|
Choose which fluid fields to write. |
|
Choose outputs for the advection–diffusion (CEPAC) field, when used. |
|
|
|
Write the requested HDF5/CSV output for the current iteration. |
|
Write / restore a full checkpoint (see Resuming from a checkpoint). |
Running and load balancing#
Member |
Purpose |
|---|---|
|
Advance the coupled fluid + cells by one fluid time step. If you drive
the flow with an external force vector, re-apply it after every
|
|
Check whether an exit signal (e.g. from the scheduler) was caught. |
|
Return the current fractional load imbalance across processes. |
|
Rebalance / restructure the domain across processes. See Load balancing. |