hemocell
Loading...
Searching...
No Matches
HemoCell Changelog

In this changelog, we consider the following classes of changes:

  • Features: any new features that are added to HemoCell.
  • Structure: any changes to the structure of HemoCell that may break existing cases.
  • Fixes: (small) changes that do not fall in the other categories.

3.0 (unreleased)

  • Fixes that change simulation results
    • WBC model with interior viscosity: the vertex normals (normalDirection) were never computed for WBC model (only the RBC model did it), so the membrane update marked every node near a WBC membrane as outside. The WBC model now computes them as the RBC model does. Only runs with interior viscosity enabled for WBCs are affected.
    • Repulsion: particle pairs within the same lattice node received twice the force of pairs in neighbouring nodes; every pair is now counted once.
    • Repulsion: particle pairs within the same lattice node received twice the force of pairs in neighbouring nodes; every pair is now counted once.
    • Membrane viscosity cap: the per-edge cap compared a lattice-unit force to FORCE_LIMIT in pN and therefore never acted; it now uses param::f_limit / 4 (12.5 pN with the default limit). Only material files with non-zero eta_m (the WBC templates) are affected.
    • setInitialMinimumDistanceFromSolid() stored the distance in an integer, so fractional micrometres (e.g. the 0.5 used by pipeflow) were truncated to 0. The distance is now honoured, which removes more cells near walls at initialisation.
    • Writing output no longer alters the simulation: the fluid OUTPUT_FORCE reset the lattice force (removing a body force set before writeOutput()), and output recomputed repulsion and constitutive forces. Results are now independent of the output interval.
    • Output and statistics no longer change the trajectory at all. writeOutput() and the CellInformationFunctionals re-synchronised the particle envelopes, which reordered the particles (and with them the summation order of force spreading) and deleted incomplete cells: runs with and without output differed at round-off level, growing over time. They now read complete cells from a copy of the particles (HemoCellFields::CompleteCellsScope) that is discarded afterwards; a pipeflow run with output and statistics every 37 steps ends bit for bit in the same state as one without (stored residence times aside, which output brings up to date). Output is also faster (one synchronisation instead of several). Cells that lose a vertex (to a wall or open boundary, or through a non-finite force) are now deleted by iterate() at the next particle update; before, they were deleted only at output or statistics steps (or with <cellsDeletedInfo>), and in between their remaining vertices kept moving and, with a material time-scale separation, spreading their last forces. Runs in which no cell breaks are unchanged without output.
    • Repulsion: the constants of setRepulsion() and enableBoundaryParticles() are in pN (they were used as lattice forces, so the shipped kRep = 2e-22 was about 1e-18 pN and had no effect). The shipped configurations now use kRep = 5 pN, a low value chosen to have an effect (not a validated one); runs that enable repulsion (examples/flowaroundsphere, the wall repulsion of cases/CEPAC) change. The repulsion force of a vertex (particle and wall repulsion together) is capped at FORCE_LIMIT, once per repulsion update, separately from the membrane force; k * r_c / d grew without bound before. Drivers that passed tuned lattice-force values must convert them to pN (multiply by param::df * 1e12); the setup log prints both.
    • Pressure outlets of the pre-inlet drivers: nine drivers set the Zou/He pressure condition on a slab three nodes thick, which Palabos accepts only without PLB_DEBUG (the debug preset aborted at set-up). They now use one plane: the domain face for examples/pipeflow_with_preinlet, cases/stl_preinlet, cases/preinlet_shear and cases/fc_solidified_stenosis (the outlet moves two nodes downstream: same flux, pressure field shifted by two nodes), and the first plane the voxeliser opens (x0 + 1) for cases/AR2, cases/AR2_pulsatile, cases/AR2_stiff and cases/injured_vessel, whose x0 plane keeps most of the STL's end cap. examples/curvedflow_with_preinlet had its outlet on the +x face with the orientation of a -x face (0N); with a 0P plane the outflow equals the inflow (to 1 % after 2000 steps; it was 81 % and, after 3000 steps, 94 %).
  • Fixes
    • Particle neighbour grid: replaced the fixed 10-particles-per-node grid (unchecked heap overflow) by a compact cell list without a capacity limit.
    • syncEnvelopes() uses a private MPI communicator and receives requests per known source rank, so messages of consecutive calls cannot be mismatched.
    • Default periodicity limits are {100,100,100} (the y and z limits were 0).
    • Checkpoints additionally store the number of cells, the last output iteration (residence time) and the CEPAC field; restarts no longer depend on unchanged .pos files. Older checkpoints still load.
    • Load balancing (ParMETIS build): keep domain_lattice valid after the lattice is replaced, rebuild the particle communication structure, read the checkpoint from the directory it is written to, and refuse combinations with a pre-inlet or the CEPAC field. doRestructure() warns instead of silently doing nothing without ParMETIS.
    • Configuration: invalid, empty or partially numeric values (e.g. 1e6 for an integer) raise std::invalid_argument instead of silently becoming 0 (or 1); malformed XML is reported; XML without a <?xml?> prolog is read correctly; booleans accept true/false; strings keep inner spaces.
    • FORCE_LIMIT can be undefined again without breaking compilation.
    • A warning is printed when a repulsion cutoff exceeds one lattice spacing (the neighbour search only covers adjacent nodes).
    • Exit signals (SIGINT, SIGTERM, SIGHUP, SIGQUIT, SIGUSR1/2) are handled collectively every exitSignalCheckInterval (100) iterations: all ranks save a checkpoint and exit, instead of one rank exiting and the others hanging. SIGABRT is no longer intercepted.
    • Log messages written before the log file is opened (e.g. all setup output of a restarted run) are printed and kept, instead of being dropped.
    • Pre-inlet: velocities are exchanged with one message per rank pair per step from a plan built once (previously one blocking message per inlet node, tagged with the node index, which can exceed MPI's tag range), the inlet nodes are selected by their fluid flag (previously isBoundary() was evaluated at unrelated nodes), particles are sent as one message per rank pair (several blocks per rank were mismatched), received blocks no longer shift a shared buffer twice, and the three global barriers per step are gone. Results of the examples are bit-identical.
    • hemo::Array no longer uses libstdc++ internals (portability) or writes past its end for long initialiser lists; += Dot3D adds the offset once.
    • Particles have move semantics (no deep copies on reallocation/removal); copy assignment copies force_total; HemoCellParticleField::operator= copies particles instead of deleting itself (Palabos uses it when copying a MultiParticleField3D). The Adams-Bashforth integration option compiles.
    • Debug (PLB_DEBUG) builds compile again; non-standard VLAs removed.
    • deleteIncompleteCells(ctype) only deletes cells of that type; getNumberOfCells_Global() returns the actual count (was 0).
    • The binding-field and interior-viscosity helpers are owned by HemoCellFields instead of being process-wide singletons that outlived it.
  • Build system and CI
    • Palabos is compiled once (object library) instead of once per HemoCell library variant; the patched parallelBlockCommunicator3D.cpp, which calls HemoCell code, is compiled with the HemoCell sources.
    • The build type is honoured (default Release); new options HEMOCELL_NATIVE_ARCH, HEMOCELL_DEBUG_INFO, HEMOCELL_PALABOS_DEBUG, HEMOCELL_SANITIZERS, HEMOCELL_WERROR; CMakePresets.json with release, portable, debug and sanitize configurations.
    • MPI and HDF5 via imported/interface targets, with MPI's include directories before HDF5's (an HDF5 prefix may contain another MPI's mpi.h); the ineffective switch to the MPI compiler wrapper was removed.
    • Warnings only for HemoCell code; Palabos and tinyxml2 are compiled quietly.
    • CTest: unit, validation, unit_mpi, validation_mpi run in the repository root (the old entry ran in tests/ and could not find its inputs); hemocell_test is written to the build directory.
    • Aggregate targets hemocell_examples and hemocell_cases.
    • GoogleTest pinned by commit, an installed GoogleTest >= 1.17 is used when found; requires CMake >= 3.16 (presets: 3.21).
    • GitHub Actions: GCC (-Werror) and Clang builds of everything, unit and validation tests on 1 and 2 ranks, unit tests under ASan/UBSan, and the user guide. Performance tests moved to a manual self-hosted workflow.
    • Debug builds work: fixed a const-correctness error that only appeared with Palabos assertions, and platelet inner-link lengths no longer use Palabos' edge-length function (which asserts that the vertices share an edge).
    • UBSan findings fixed: unaligned record access in the gathering functional, indexing an empty receive buffer.
  • Formatting and documentation
    • .clang-format (derived from the prevailing style), .editorconfig, scripts/format.sh; CI checks the formatting of the lines a pull request changes.
    • All HemoCell sources reformatted (Palabos, external/ and legacy/ untouched); the library, variants, examples and cases compile to identical code. The commit is listed in .git-blame-ignore-revs.
    • New Developer Guide in the user guide: architecture and internals, coding conventions (including performance rules), extending HemoCell, known limitations. CONTRIBUTING.md; contribution workflow targets dev.
    • Units, preconditions and collectiveness documented for the public HemoCell setters; the repulsion page states the actual units.
  • Fixes found while documenting
    • Wall repulsion without cell-cell repulsion accumulated in force_repulsion at every update (it was never reset); it now resets the field itself. Cell-cell and wall repulsion must use the same update interval (checked at start-up).
  • Performance (results bit-identical; cube benchmark on 4 ranks: iterate -5 %, spreadParticleForce -22 %, advanceParticles -35 %)
    • IBM kernel (phi2): only the 2x2x2 nodes with non-zero weight are visited instead of 27 candidates, with the same products and summation order.
    • Force spreading skips particle copies whose kernel lies outside the bulk and the collided envelope layer; the force sum is formed once per particle.
    • Velocity interpolation skips particle copies (the following syncEnvelopes() replaces their velocity anyway).
    • advanceParticles() only runs the removal pass when a particle entered a boundary node.
    • Cell-information CSV output gathers to rank 0 instead of to all ranks.
    • .pos files are read by rank 0 and broadcast, and parsed once per rank instead of once per atomic block (with several XML reads per cell). A missing file is reported once, not by every rank for every block; a file with fewer complete rows than its declared count uses those rows with a warning (previously the missing cells were placed at the origin).
  • Reproducibility
    • Multi-rank runs are bit-for-bit reproducible: both particle exchanges of syncEnvelopes() unpack the received particles in ascending source rank instead of MPI arrival order. The arrival order decided the order of particles in a block, and with it the summation order of force spreading and repulsion, so identical runs differed at round-off level (relative 1e-8 in forces after 100 steps of pipeflow on 4 ranks), growing over time. The envelope exchange, previously Palabos' duplicateOverlaps(modif::hemocell), is done by HemoCell (exchangeEnvelopes()) over the same communication structure. No measurable cost.
    • Checkpoints of identical runs are byte-identical: the padding bytes of the particle records are zeroed (they held uninitialised memory).
  • Output (simulation results unchanged; what the files contain changes). HDF5 output of a 4-rank pipeflow step: 6.1 MB -> 4.2 MB.
    • Every cell is written once, by the block whose bulk holds its vertex 0. Previously each block holding part of a cell wrote all of it, including both images of a cell crossing a periodic boundary (55 copies of 30 RBCs in that run), so analyses of the HDF5 files counted cells several times.
    • Fluid and CEPAC files hold the bulk nodes of their block only (previously one extra node layer around each block); relativePosition is the lower corner of the first node's cell (first node - dx/2). Each node is one cell of a regular grid, so the blocks tile the domain without overlap.
    • Datasets are byte-shuffled and deflated at level 4 (was level 7 without shuffle): about 10 % smaller and half the compression time.
    • SI output: OUTPUT_DENSITY is in kg/m^3 (it was multiplied by df/dx^2, giving three times a pressure); OUTPUT_OMEGA is dimensionless (was multiplied by df/dx^2); the CEPAC density (a concentration) is written unscaled.
    • OUTPUT_CELL_DENSITY used the block-local node index as array index, which placed the counts one node off per direction (with fluidEnvelope 2); the dataset is named CellDensity_<name> with the cell type's output name.
    • Cell types registered with a directory in their name (e.g. addCellType("cells/RBC")) wrote no HDF5 or CSV output (the files were created in non-existent subdirectories); output now uses the name without the directory (HemoCellField::getIdentifier()).
    • HemoCell writes XDMF 3 files at every output: <name>.<iteration>.xmf per step and <name>.xmf with all steps and their time. ParaView's XDMF3 and legacy readers load them (tested with 5.11 and 6.0). Previously batchPostProcess.sh generated them afterwards, and only the legacy reader could open them.
    • scripts/batchPostProcess.sh runs the new scripts/HDF5toXDMF.py (Python 3, h5py), which writes the same files for output of older versions. Removed: FluidHDF5.py, CellHDF5toXMF.py, FluidHDF5toXMF.py, batchPostProcess_py2.sh and the *_py2.py converters, CellInfoMergeCSV.sh (the CSV output is already one file per cell type and step). convert_xmf_to_x3d.py converts the per-step cell files only.
    • HDF5 property lists are closed (one leaked per dataset written).
    • Cell Id is stored as a 64-bit integer (it was a 32-bit float, exact only up to 2^24, while IDs grow with every periodic crossing). The XDMF files describe it as NumberType="Int" Precision="8" (read as integers by ParaView 5.11's XDMF and XDMF3 readers), and scripts/HDF5toXDMF.py takes each dataset's number type and precision from the file, so it describes old and new output correctly.
  • Hardening (results bit-identical)
    • Fatal errors go through hemo::fatal() (config/error.h) instead of 42 exit(1) calls: the message is printed with the MPI rank on whichever rank detects the error (previously mostly through hlog, which prints on rank 0 only, so errors found on other ranks were silent) and the job ends with MPI_Abort. hemo::warning() reports from any rank; FatalErrorsThrow makes fatal() throw, for tests of error paths.
    • A vertex with a non-finite force (e.g. from a degenerate triangle) is no longer spread into the fluid, where it made the whole lattice NaN: it is removed with a warning, which deletes its cell. The FORCE_LIMIT check catches it at no extra cost. Particle and wall repulsion skip coincident points instead of dividing by a zero distance.
    • Checkpoints: checkpoint.xml is written last, under a temporary name, so a save that is interrupted leaves no checkpoint.xml next to partial data files (the previous checkpoint is complete in the .old files). It records the particle record layout, the cell types (name and vertex count, in addCellType() order), dx and dt; a restart with a different library variant, cell types or resolution is a fatal error instead of misreading the raw particle data. Older checkpoints load with a warning. renameFileToDotOld() reports failed renames (its status was shadowed).
    • Initial positions: a missing <name>.pos file is a fatal error (it was a warning, and the case ran without those cells; examples/microcontraction, cases/stentflow and cases/stent_strut (whose files are named .POS) did so). loadParticles() logs how many cells of each type were placed out of those in the file, with a warning when cells were dropped.
    • Cells of a .pos file that cross a periodic boundary were dropped without notice. They are still skipped by default (results unchanged), but counted in the log with a pointer to the new HemoCell::setPlaceCellsAcrossPeriodicBoundaries(true), which places them as during a run: as periodic images on both sides of the boundary (cell IDs shifted as by a crossing). It is off by default because it is correct only for .pos files packed periodically for the domain; the shipped files were packed for other box sizes, and their cells at opposite ends would overlap (the pipeflow test file: 7 more cells, 3 of them overlapping).
    • Cell IDs are 64-bit (plint) throughout. An ID grows by a multiple of the number of cells at every periodic crossing and is never folded back, but the lookup maps, the statistics and the cell ID requests of syncEnvelopes() (sent as int) used int: with 200,000 cells an ID overflowed after about 640 laps in x, the periodic transfer then reset it to the base ID, and the cell was most likely deleted. This also lifts the limit of about 212,000 cells with the default periodicity limits; sanityCheck() requires room for at least 10^6 crossings per cell.
    • Structure: CellMechanics::ParticleMechanics() and solidifyMechanics() take maps keyed by plint, as do get_particles_per_cell(), get_lpc(), CellInformationFunctionals::info_per_cell and calculateCellInformation(); getOutputCells() returns plint IDs. Custom cell models need the new signatures; a solidifyMechanics() override with the old signature (not marked override) would silently no longer be called. HemoCellGatheringFunctional::gather() and gatherToRoot() accept maps with any integer key.
    • Destroying a HemoCell object resets the process-wide state it set: the param:: values, the global settings and profiler, HemoCellParticleField::cellFields and CellInformationFunctionals::info_per_cell (resetGlobalState() in core/hemoCell.cpp). Before, a setting such as <cellsDeletedInfo> or a param:: value carried over to the next simulation in the same process (as in the test suite), the profiler kept accumulating, and the vertices pulled by HemoCellStretch were added to those of the next stretch (the stretch tests cleared them by hand).
    • Inner edges (<InnerEdges> of a material file) are checked once when the cell type is added: a pair that is not two distinct vertices of the cell type's mesh, or that cannot be read, is a fatal error naming the vertex count. Before, a material file made for another mesh resolution (e.g. the 642-vertex WBC template with another minNumTriangles) read vertex positions out of bounds, and an unreadable pair reused the previous one. All shipped material files pass.
    • Pre-inlet with several atomic blocks per rank: the ranks that exchange cells are chosen from all of a rank's blocks at the interface (only the last one was used, so cells could miss the blocks of a rank), and every block of the domain and the pre-inlet is assigned to a rank of its own lattice when mAB*/pAB* ask for more blocks than ranks (the extra blocks went to the rank equal to their block ID: a pre-inlet rank or no rank at all). Without a pre-inlet, mAB* with more blocks than ranks distributes the blocks over all ranks the same way. A pre-inlet that would take every rank is a fatal error. ~HemoCell also deletes the second lattice of a pre-inlet run. Results with at most one block per rank are bit-identical (pre-inlet example on 4 and 8 ranks).
    • Configuration errors name the file, the line and the element path (e.g. (Config) config.xml, line 34: hemocell/sim has no element <tmax>.), and sanityCheck() no longer requires <sim><tmax> (drivers that use it read it themselves). Solidification reads its two thresholds once per cell type and step instead of from the XML tree for every particle near a binding site.
    • Compile-time configuration: config/constant_defaults.h stays the one place for it, and is now also the only place for the version (CMake and the documentation read it). SOLIDIFY_MECHANICS is off by default there (it was always on, so hemocell_solidify_mechanics equalled hemocell); the variants switch their feature on. The effective configuration is printed at the top of the log and stored in checkpoints (a restart with a different one warns), and a case compiled with another configuration than the library it links (e.g. linked against the wrong variant) is a fatal error at start-up instead of corrupting memory.
  • Structure (case files may need changes; results bit-identical)
    • Cases that use solidification must link hemocell_solidify_mechanics (cases/fc_solidified_stenosis linked hemocell); the base library no longer has it. Checkpoints written by the base library of earlier versions of this branch carry SOLIDIFY_MECHANICS in their particle layout and are rejected by the new base library (the particle records themselves are unchanged).
    • The HemoCell constructor has one more, defaulted parameter that carries the case's compile-time configuration; leave it out. The three-argument form is the same constructor with defaults.
    • New helpers for the setup most cases repeated: getFlagMatrixFromSTL(*cfg, voxelizedDomain, flagMatrix) voxelises <domain><geometry> with the related <domain> settings, and HemoCell::initializeLatticeFromFlagMatrix() creates the lattice with bounce-back walls, without periodicity and at rest. The pipe and pre-inlet examples and cases use them (results bit-identical).
    • No HemoCell header contains a using namespace directive any more: hemocell.h imported hemo and plb into case files (making Array ambiguous), and library headers imported all of std and plb into namespace hemo (and std into plb). A case file declares what it uses unqualified; all examples and cases now start with using namespace hemo; using namespace plb; using namespace std;. Palabos names written with hemo:: (e.g. hemo::BounceBack) need plb::.
    • The OUTPUT_* and cell-shape constants (RBC_FROM_SPHERE, ...) are constexpr int in namespace hemo instead of macros, and param is a typedef of hemo::Parameters instead of a macro (which renamed every identifier called param). Case files with using namespace hemo are unaffected; elsewhere write hemo::OUTPUT_POSITION. DESCRIPTOR and CEPAC_DESCRIPTOR remain macros (compile-time options).
    • getFlagMatrixFromSTL() takes std::unique_ptr instead of std::auto_ptr (removed in C++17; it compiled only with libstdc++).
    • The HemoCell constructor takes the configuration file name as const std::string & (was char *); existing calls compile unchanged.
    • HemoCellStretch keeps its pulled vertices, force and scale per object instead of in static members: HemoCellStretch::scale = x becomes cellStretch.scale = x. Blocks without the cell are skipped (they threw std::out_of_range), and the vertices are selected once per process.
    • LeesEdwardsBC keeps its displacement and boundary populations per object instead of in static members, and cannot be copied (its data processors point into it): it must live as long as the lattice is iterated. Its constructor no longer assigns the lattice to itself (a full copy).
    • NoOp (mechanics/NoOp.h), the null cell model, compiles and works (it had no matching CellMechanics constructor and did not override ParticleMechanics()). It is a passive tracer, not a rigid particle as documented before.
    • Removed unused code: HemoCellFields::HemoSyncEnvelopes (applying it would have brought back arrival-order communication), HemoCellFields::envelope_communicator, HemoCellParticleField::syncEnvelopes() (it only deleted the particles outside the block), and the placeholder test Dummy.foobar.
  • Tests
    • Unit tests for the particle grid/repulsion, the configuration reader, hemo::Array, particle copy/move and log buffering; an integration test for checkpoint/restart.
    • Integration test for the output: every cell written once, every lattice node once, consistent cell density and XDMF files (1 and 2 ranks).
    • Tests for fatal() and fatal configuration errors, for a non-finite vertex force (fluid stays finite, the cell is removed), and for the checkpoint write order and fingerprint checks.
    • Tests that output and statistics leave the trajectory unchanged, that cell IDs beyond 2^32 give the same trajectory, that iterate() deletes a broken cell, and of HemoCellGatheringFunctional with 64-bit keys (1 and 2 ranks).
    • Tests that destroying a HemoCell object resets the process-wide state, and that cells of the NoOp model carry no membrane force (1 and 2 ranks).
    • Tests that cells across a periodic boundary are counted, or placed as complete cells with their reference volume on request, and that cell IDs beyond 2^32 are written exactly as 64-bit integers (1 and 2 ranks).
    • Tests that configuration errors name file, line and path, that sanityCheck() runs without <sim><tmax>, that a configuration mismatch between case and library is fatal, and that checkpoints record the configuration.
    • Tests that out-of-mesh or unreadable inner edges are fatal, that the repulsion constant is converted from pN and the repulsion force capped (1 and 2 ranks), and that every pre-inlet and domain block belongs to a rank of its lattice (2 ranks).
    • Membrane forces of every cell model (RBC, PLT, WBC, malaria) on its reference mesh: no force at the rest shape, zero net force, forces that rotate and translate with the cell, and zero net torque of all terms but bending (whose torque is bounded at the measured level, see the known limitations).
    • Cells crossing the periodic boundary and the block boundary between two ranks while the simulation runs stay complete and keep their volume; the pre-inlet passes its cells into the domain; identical runs write byte-identical checkpoints (1 and 2 ranks); nearestNode().
    • The tests' simulations write into one temporary directory per run (removed afterwards; HEMOCELL_KEEP_TEST_OUTPUT keeps it) instead of tmp, tmp_0, ... in the repository root. The configuration, error, log-file, mechanics and inner-edge tests write their files there too (they were left in the system's temporary directory).
  • Tools and scripts
    • scripts/ci/smoke_drivers.py runs every built example and case for 20 steps with output and a checkpoint; CI runs it (gcc release job) for all but the five large drivers (microcontraction, stent_strut, stent_strut_crossings, flowchamber_stenosis, unbounded: --slow). The microcontraction README and the examples page say where its initial positions are.
    • cases/flowchamber_stenosis, cases/injured_vessel and cases/stent_strut/stent_strut_crossings are built (hemocell_cases) and smoke-tested; they did not compile (missing using namespace std and includes, a stand-alone CMake file). stent_strut_crossings has a README (it uses the parent case's cell files).
    • The eight Python 2 scripts (scripts/hemocell_h5utils.py, scripts/ParticleField3D_HDF5toXMF.py, scripts/conficsion.py, scripts/storage/*.py) run under Python 3; two of them were broken by an old search-and-replace (np.hemo::Array). CI compiles all Python files.
    • tools/packCells: the packing is periodic with the requested box size (the box was rounded up to whole collision-check cells, e.g. 56 x 28 x 28 um for a requested 51.5 x 26.5 x 26.5 um, so cells were placed beyond the requested box and the hematocrit was lower than requested), and cells repel across the box faces (the periodic shift of the neighbour search was computed but not applied, so cells overlapped across the faces). It needs CMake >= 3.16, and its help describes the periodic packing.
    • tools/packCells: the contact search and the rotation step use the largest diameter of the cells (they used the x diameter, of the first type given for the rotation step), so cells elongated along y or z are no longer packed overlapping (vRBCs reported clear at scale 1.53 still overlapped at scale 1). The platelet and mouse ellipsoids enclose the cells HemoCell builds from tools/cell_templates with the RBC's margin (the meshes fit at about 0.93 of the ellipsoid): PLT 2.7 x 1.17 x 2.7 um (was 2.4 x 1.05 x 2.4, smaller than the 2.50 x 1.09 um platelet), PLT_m 2.05 x 1.17 x 2.05 (was 1.84 x 1.05 x 1.84), PLT_mko 3.68 um (was 1.71 um, the radius taken as the diameter) and RBC_m 6.23 x 3.26 x 6.23 (was 5.8 x 3.4 x 5.8, no margin). The command line is checked before packing (exit status 1 with a message): domain sizes may be fractional (they were truncated to integers), and invalid or missing numbers, a trailing --cell, -s (both crashed), no cells (looped forever), a type given twice (overwrote its file) and --plt_ratio without --hematocrit (ignored) are refused. A packing that is not finished within --maxiter exits with status 2. --seed makes a packing reproducible (with one thread); the seed is printed. The help lists the ellipsoid of every type and describes --cell, the output and the effective RBC volume behind --hematocrit.
    • tools/packCells: the ellipsoids start at --start_scale times their nominal size (default 1) and shrink until they no longer overlap; below 1 the cells start within each other's IBM interaction range, a relaxation for high volume fractions. The packing stops (exit status 3) once the scale falls below --min_scale, by default the scale at which every ellipsoid still contains its cell's mesh (0.93 for RBCs and PLTs, 0.95 for WBCs; 1.09 for vRBCs, whose ellipsoid is smaller than the mesh, so they start at 1.14), and it reports the final scale. --scale is removed: it set the collision-check grid, but also the starting scale (scale * (mean dx * dy * dz)^(1/3)), so by default RBCs started at 0.97, a mixture of 200 RBCs and 150 PLTs at 0.81 (with RBC meshes intersecting) and vRBCs at 0.67, while larger values were slow (79,000 iterations from 1.69). The grid is now set from the largest diameter. A 40 um cube at Ht 0.3 packs at scale 1.00 in about 120 iterations (< 0.1 s), Ht 0.45 at 0.96 (7,500 iterations, 4 s on 24 threads); Ht 0.5 reaches the RBC's 0.93 and stops. The progress columns are the volume fraction and the scale of the ellipsoids. The cube example's preprocess/weakscaling.py no longer passes the removed --allowRotate.
    • tools/packCells gives the same packing on any number of threads: the parallel contact search ran while the collision-check cell lists were being built (each cell was added after its own search), with the contact range in variables shared by all threads, the forces of both cells of a pair updated by different threads at once and the force sum of the stop criterion unsynchronised, so which contacts a thread saw depended on timing. The cell lists are now complete before the search, every thread collects the contacts of its own cells, and they are applied in a fixed order, as one thread did before (byte-identical to the earlier code on one thread when both are built without FMA contraction; with -march=native the compiler fuses multiply-adds differently, which changes the last bits and, in long runs, the packing). Pairs whose bounding spheres are apart skip the contact function, and the contact search is shared out in small chunks: on 24 threads Ht 0.45 packs in 0.7 s instead of 4.4 s in a 40 um cube and in 2.9 s instead of 22.5 s in a 100 x 50 x 50 um box (85 and 352 instead of 578 and 2,768 us per iteration); one thread is now about as fast as 24 threads were.
    • tools/packCells starts the cells with uniformly random orientations (spheres and --noRotate keep theirs). All cells started with the same orientation and turned only in collisions, so dilute packings came out aligned: at Ht 0.1, 10 to 19 of 66 RBCs were not rotated at all and the thin axes stayed close to y (mean |cos| 0.74 to 0.83, isotropic is 0.5; now 0.50 / 0.47 / 0.52 along x / y / z). The run time and the final scale do not change (Ht 0.45: 7,850-8,060 iterations over four seeds, against 7,840-8,020). Quaternion::random(), unused before, drew its vector part from the positive octant without normalising; it now follows Shoemake (uniform rotations).
    • tools/packCells packs for walls: --walls <axes> closes the box along those axes and --cylinder <axis> <R> confines the cells to a pipe (the ellipsoids touch a wall as they touch each other: the force and the turning grow as the scale at which they would touch falls below the current one; for the cylinder from the farthest point of the cell's cross-section, exact to the brute-force check), and --offset moves the positions onto the fluid region. The user guide gives the box, radius and offset for walls at given nodes; with them HemoCell placed every cell of examples/parallelplanes and examples/pipeflow, where periodic packings of the whole domain lost 8 % of the cells and 70 % of the RBCs at the walls. --hematocrit counts the cylinder's volume. A box thinner than twice the reach of a cell along a periodic axis checks every image, and a cell against its own (it took the nearest image only).
    • tools/packCells reports, per cell type, the number of cells and their volume fraction by the mesh volume, and for RBCs the hematocrit by the effective volume of 97 um^3 (the 81 um^3 mesh plus the IBM interaction range) that --hematocrit counts with.
    • tools/packCells is built without FMA contraction (-ffp-contract=off): the compiler fused multiply-adds differently with and without OpenMP, with -march=native or not and after small code changes, and the packing is chaotic, so a seed gave a different packing with every build. Now the documented, -Werror, portable and single-thread (no OpenMP) builds give the same files, at no cost in speed. The CMake file uses the build type (default Release), finds OpenMP (without it, one thread) and has PACKCELLS_NATIVE_ARCH and PACKCELLS_WERROR; it no longer forces g++-7 on macOS, and -DCMAKE_RUNTIME_OUTPUT_DIRECTORY moves the binary (build trees sharing tools/packCells/packCells overwrite each other's and may take another's as up to date). The code compiles as C++17 and C++20 (register removed); savePov(), getOutput(), scene.pov and compile.sh are removed.
    • tools/packCells: a packing whose overlaps balanced each other was reported done, e.g. a cell pressed into both walls of a slab it was too tall for (zero net force; the turning, which would have freed it, was not counted). It now also requires that nothing overlaps; other packings are unchanged. Cell centres stay in [0, L) along the periodic axes (a tiny negative coordinate plus L gave L) and are written with 9 significant digits (with 6, a centre just below L was written as L, outside the domain for the loader).
    • tools/packCells is documented in the user guide (Initial cell positions: the ellipsoids and their scale, the hematocrit, file names, positions and rotations, periodic axes, walls and pipes, run time) and its README; the QuickStart gave a wrong path and build steps. tools/packCells/check_packing.py checks a packing independently (Perram-Wertheim contacts through the periodic images, walls and cylinder), and a CI job builds packCells with gcc and clang (-Werror) and packs and checks a periodic box, a slab with walls and the pipe of examples/pipeflow.
  • Rounding to the nearest lattice node (nearestNode()) rounds negative coordinates down; plint(x + 0.5) gave a node one too high for x < -0.5 (particle grid, wall removal in advanceParticles(), nearestCell(), the wall check of the cell loader). It affected only particle copies outside a block's lattice. Results change at round-off level where the loader places periodic copies of cells into a block's envelope: copies just beyond the fluid block, which the old rounding checked against its outermost envelope node and dropped, are now kept until the first envelope synchronisation (examples/pipeflow on 2 ranks: relative differences of 1e-16 growing to 1e-7 in the forces after 444 iterations; the pre-inlet example unchanged).

2.6 (July 15 2022)

  • Features
    • Added functionality to hemocell.initializeLattice() to define domain decomposition. It can be read from the config xml (xml tags: mABx, mABy, mABz).
    • Added weak-scaling test config generator for the case cube. The config template contains an example for the previous domain decomposition tags.
    • The cell packing tool has been improved significantly with better automatic resolution to avoid cell overlapping.
    • Added mouse blood cell types to the cell packing tool.
    • The cell templates (along with the new mouse cells) are available under tools/cell_templates.
    • New module shell script for Cirrus (EPCC).
  • Fixes
    • Various comment fixes in the code.
    • Better error messages.
    • Improved sanity-check function.
    • tools/pos_to_vtk can now be used without installation.
    • Changes to the cellPacking default values and messages to make it easier to use.

2.5 (Jan 27 2022)

  • Features
    • Added tools/pos_to_vtk for simple cell visualisation.
    • Included section Common mistakes in documentation.
  • Structure
    • Changed default make target to HemoCell library only.
    • Replaces the macro #HEMOCELL_PARTICLE_FIELD with the class directly.
    • Moved to Palabos library version v2.3.0.
    • Reduced Palabos patch size.
  • Fixes
    • Removed packing Palabos source, now pulled from their remote by setup.sh.
    • Updated preinlet communication to use a local buffer as temporary storage to avoid velocity artefacts due to reuse of the same velocity buffer for communication.
    • Updated preinlet communication structure to reduce the number of messages send by only considering overlapping and neighbouring atomic blocks as targets to send messages.
    • Preliminary fix for solidification mechanics on multi-core machines.

2.4 (Sep 23 2021)

  • Features
    • Added two capillary flow examples.
    • Added, updated, and extended documentation of most example cases.
    • Added helper functions in helper/geometry.h for boolean operations on domain functionals.
    • Added script to convert HDF5 to the X3D format to enable rendering with Blender.
    • Added validation tests based on cell stretching and pipe flow.
  • Structure
    • Cell mechanics constants are moved to config/constant_defaults.h.
    • The Doxygen pages are automatically generated when building the Sphinx documentation.
    • The continuous integration pipeline is split into four stages: build, test, validation, and documentation.
  • Fixes
    • Added guard statement to prevent reading uninitialised Lees-Edwards displacement values.

2.3 (Jun 1 2021)

  • Features
    • Rebuilt the build environment. For more details, please see the quickstart guide in the documentation.
    • Added the cube example in which a cubic domain is subjected to a shear flow on the top/bottom planes.
  • Structure
    • HemoCell now depends on Palabos 2.2.1 as the older version used previously is no longer available. The patch and setup.sh file has been updated to reflect this.
  • Fixes
    • Remove some useless output in the cellStretch example

2.2 (Dec 7 2020)

  • Features
    • Added support for Lees-Edwards boundary conditions (single core only for now, example soon to come with publication).
    • Significantly improved and updated the documentation.
    • Publications using HemoCell added to documentation.
    • Updated the website with more examples in the gallery.
    • Added further output fields: e.g. shear rate, strain rate, shear stress.
    • Several small updates and QoL improvements in the otput processing scripts.
  • Fixes
    • Fix a bug in the velocity output when SI units were used

2.1 (Feb 6 2020)

  • Features
    • Added support for binding sites
    • Added support for interior viscosity
    • Added velocity output for hemoCellParticleField
    • Added curved pipeflow with pre-inlet example
    • Added microcontraction and flowaroundsphere examples
    • Added support for pulsatility
  • Structure
    • Rename HemoCell::setMinimumDistanceFromSolid to HemoCell::setInitialMinimumDistanceFromSolid
    • Rename all occurences of RBC_HO to RBC, both in filenames and source code
    • Merge csv and hdf5 reader for scripts
    • The preinlet setup now adjusts the preinlet to always be on the lattice, if the lattice is set up before the preinlet (a warning is given otherwise)
  • Fixes
    • Do not override interrupt handlers until the first iteration has started
    • Added missing AGPL license header to several files
    • Added profiler statements to preInlet.cpp
    • Log an error message whenever a nonexisting cell type is requested
    • Fix checkpointing so that it works with the pre-inlet
    • Update scripts so that they are compatible with the new RBC output
    • Fix outputStrainRate in IO/FluidHdf5IO.hh
    • Fix bug in the pre-inlet when a block boundary is spanned
    • Fix computation of the Tresca value
    • Fix location of Palabos download page
    • Fix for the environment script on Cartesius
    • Set the driving force at the warmup part for the pipeflow example

2.0b (Feb 12 2019)

to be added

2.0 (Dec 17 2018)

  • Added compile time constants PREINLET_MECHANICS and SOLIDIFY_MECHANICS to constant_defaults
  • Added runtime preinlets, see stl_preinlet for examples, instead of preinletFromSlice() you can call autoPreinletFromBoundary() if the boundary happens to be the inlet as well
  • Interior viscosity edge tracking works again, enable interior viscosity through CELL.xml file, see cases/RBC_template.xml for an example
  • Output is saved in a seperate folder for each run, see pipeflow/config.xml for the options
  • CSV output is already concatenated in csv folder, now also includes base_cell_id, correct cell_id and velocity

1.4 (Jul 9 2018)

  • Added hemocell.statistics as an advanced (fully recursive) profiling tool
  • Added OUTPUT_INNER_LINKS to output possibility

0.5

  • Inner links are specified in the <CellType>.xml file through "CellMechanics"->"InnerEdges"->"Edge"
  • Added MESH_FROM_STL for addCellType. Takes a triangulized STL file from xml-file->"MaterialModel"->"StlFile".
  • Added "Volume" option for Celltype xml files
  • Added Celdensity output for fluid field
  • Added preInlet possibility and cases
  • Default is now HDF5 with openmpi support, if not present, using a preInlet will generate an error when using multiple processors
  • variables checkpointDirectory and outputdirectory can now be specified in the config.xml

0.4

  • Periodicity limit can now be set (hemocell::setSystemPeriodicityLimit) per axis, default is 100, this means that a cell can wrap around a maximum of 100 times over a given axis
  • Loadbalancer now reloads the old (smallest possible) atomic blocks before load balancing, this means timing information is not available as weight, only the number of lsps (or any other measure you come up with)
  • The CmakeFile for a case can be generated from cases/CMakeLists_template.txt by the makefile (cases/Makefile). running make in ./cases will create and build all cases.