hemocell
Loading...
Searching...
No Matches
constant_defaults.h
Go to the documentation of this file.
1/*
2This file is part of the HemoCell library
3
4HemoCell is developed and maintained by the Computational Science Lab
5in the University of Amsterdam. Any questions or remarks regarding this library
6can be sent to: info@hemocell.eu
7
8When using the HemoCell library in scientific work please cite the
9corresponding paper: https://doi.org/10.3389/fphys.2017.00563
10
11The HemoCell library is free software: you can redistribute it and/or
12modify it under the terms of the GNU Affero General Public License as
13published by the Free Software Foundation, either version 3 of the
14License, or (at your option) any later version.
15
16The library is distributed in the hope that it will be useful,
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19GNU Affero General Public License for more details.
20
21You should have received a copy of the GNU Affero General Public License
22along with this program. If not, see <http://www.gnu.org/licenses/>.
23*/
24
25#include <iomanip>
26
27#ifndef CONSTANT_DEFAULTS_H
28#define CONSTANT_DEFAULTS_H
29// ============== Compile time options - Set these
30//
31// This file is the one place for HemoCell's compile-time configuration; every
32// library and every case is compiled with it. The effective configuration of a
33// run is printed at the top of its log and stored in its checkpoints
34// (HEMOCELL_BUILD_CONFIGURATION below), and a case compiled with another
35// configuration than the library it links is rejected at start-up.
36
37/*
38 * Which version are we at (CMake and the documentation read it from here).
39 */
40#define VERSION_MAJOR 3
41#define VERSION_MINOR "0"
42
43/*
44 * Optional features. They are off by default, i.e. in the base library
45 * `hemocell`. The library variants switch one on for themselves and for the
46 * cases that link them (CMakeLists.txt): hemocell_solidify_mechanics defines
47 * SOLIDIFY_MECHANICS, hemocell_interior_viscosity INTERIOR_VISCOSITY. To
48 * change a default for every library, uncomment its #define here.
49 */
50// Solidification of platelets near binding sites (cases/solidify_example).
51#ifndef SOLIDIFY_MECHANICS
52//#define SOLIDIFY_MECHANICS
53#endif
54
55// Interior viscosity of cells; adds data to every particle, performance impact.
56#ifndef INTERIOR_VISCOSITY
57//#define INTERIOR_VISCOSITY
58#endif
59
60/*
61Choose material integration method.
62Euler [1], Adams-Bashforth [2]
63*/
64#ifndef HEMOCELL_MATERIAL_INTEGRATION
65#define HEMOCELL_MATERIAL_INTEGRATION 1
66#endif
67
68/*
69Select BGK dynamics with Guo's forcing method.
70*/
71#ifndef DESCRIPTOR
72#include "latticeBoltzmann/nearestNeighborLattices3D.h"
73#define DESCRIPTOR plb::descriptors::ForcedD3Q19Descriptor
74#endif
75
76#ifndef CEPAC_DESCRIPTOR
77#include "latticeBoltzmann/advectionDiffusionLattices.h"
78#define CEPAC_DESCRIPTOR plb::descriptors::AdvectionDiffusionD3Q19Descriptor
79#endif
80
81/*
82Force unconditional stability on the material model. Note: it will not make the model magically correct, only stable!
83FORCE_LIMIT sets the allowed maximal force per surface particle, in [pN]. It is
84converted to lattice units in Parameters (param::f_limit) and applied to the
85total membrane force when spreading it to the fluid; a quarter of it caps the
86membrane-viscosity force per edge. Define FORCE_LIMIT differently (or remove
87this default) at compile time to change or disable the cap.
88*/
89#ifndef FORCE_LIMIT
90#define FORCE_LIMIT 50.0
91#endif
92
93namespace hemo {
94/*
95 * Shape of the reference mesh of a cell type (HemoCell::addCellType(),
96 * constructMeshElement()). Constants in namespace hemo (formerly macros).
97 */
98constexpr int WBC_SPHERE = 0;
99constexpr int RBC_FROM_SPHERE = 1;
100constexpr int MESH_FROM_STL = 2;
101constexpr int ELLIPSOID_FROM_SPHERE = 6;
102constexpr int STRING_FROM_VERTEXES = 7;
103
104/*
105 * Output fields per cell type (HemoCell::setOutputs()) and of the fluid
106 * (HemoCell::setFluidOutputs(), setCEPACOutputs()); see
107 * doc/user_guide/reference/outputs.rst. Constants in namespace hemo
108 * (formerly macros).
109 */
110constexpr int OUTPUT_POSITION = 1;
111constexpr int OUTPUT_FORCE = 2;
112constexpr int OUTPUT_FORCE_VOLUME = 21;
113constexpr int OUTPUT_FORCE_BENDING = 22;
114constexpr int OUTPUT_FORCE_AREA = 23;
115constexpr int OUTPUT_FORCE_LINK = 24;
116constexpr int OUTPUT_FORCE_VISC = 25;
117constexpr int OUTPUT_FORCE_INNER_LINK = 26;
118constexpr int OUTPUT_FORCE_REPULSION = 27;
119constexpr int OUTPUT_TRIANGLES = 3;
120constexpr int OUTPUT_VELOCITY = 4;
121constexpr int OUTPUT_DENSITY = 5;
122constexpr int OUTPUT_VERTEX_ID = 7;
123constexpr int OUTPUT_CELL_ID = 8;
124constexpr int OUTPUT_CELL_DENSITY = 9;
125constexpr int OUTPUT_SHEAR_STRESS = 10;
126constexpr int OUTPUT_INNER_LINKS = 11;
127constexpr int OUTPUT_OMEGA = 12;
128constexpr int OUTPUT_BOUNDARY = 13;
129constexpr int OUTPUT_BINDING_SITES = 14;
130constexpr int OUTPUT_INTERIOR_POINTS = 15;
131constexpr int OUTPUT_SHEAR_RATE = 16;
132constexpr int OUTPUT_STRAIN_RATE = 17;
133constexpr int OUTPUT_RES_TIME = 18;
134} // namespace hemo
135
136#ifndef T
137typedef double T;
138#define HEMOCELL_CONFIGURATION_T "double"
139#else
140#define HEMOCELL_CONFIGURATION_T HEMOCELL_STRINGIFY(T)
141#endif
142
143#ifndef PI
144#define PI 3.14159265358979323846
145#endif
146
147//Define signed and unsigned ints
148#ifndef plint
149typedef long int plint;
150#endif
151#ifndef pluint
152typedef long unsigned int pluint;
153#endif
154
179constexpr T MaxCellVolumetricChange = 0.01;
186constexpr T MaxCellBendingAngle = 0.0555;
191constexpr T MaxPLTBendingAngle = 2.467;
196
// end of the cell group constants
198
199/*
200 * The compile-time configuration above as a string, e.g.
201 * "version=3.0,T=double,DESCRIPTOR=...,MATERIAL_INTEGRATION=1,FORCE_LIMIT=50.0".
202 * It is expanded where it is used, so the HemoCell constructor's default
203 * argument carries the configuration of the case and the library compares it
204 * with its own (HemoCell::HemoCell()). No spaces (Palabos' XML reader stops at
205 * the first space).
206 */
207#define HEMOCELL_STRINGIFY_(x) #x
208#define HEMOCELL_STRINGIFY(x) HEMOCELL_STRINGIFY_(x)
209#ifdef FORCE_LIMIT
210#define HEMOCELL_CONFIGURATION_FORCE_LIMIT ",FORCE_LIMIT=" HEMOCELL_STRINGIFY(FORCE_LIMIT)
211#else
212#define HEMOCELL_CONFIGURATION_FORCE_LIMIT ",FORCE_LIMIT=none"
213#endif
214#ifdef SOLIDIFY_MECHANICS
215#define HEMOCELL_CONFIGURATION_SOLIDIFY ",SOLIDIFY_MECHANICS"
216#else
217#define HEMOCELL_CONFIGURATION_SOLIDIFY ""
218#endif
219#ifdef INTERIOR_VISCOSITY
220#define HEMOCELL_CONFIGURATION_INTERIOR ",INTERIOR_VISCOSITY"
221#else
222#define HEMOCELL_CONFIGURATION_INTERIOR ""
223#endif
224#ifdef HEMO_PARMETIS
225#define HEMOCELL_CONFIGURATION_PARMETIS ",HEMO_PARMETIS"
226#else
227#define HEMOCELL_CONFIGURATION_PARMETIS ""
228#endif
229#define HEMOCELL_CONFIGURATION_VERSION "version=" HEMOCELL_STRINGIFY(VERSION_MAJOR) "." VERSION_MINOR
230#define HEMOCELL_CONFIGURATION_TYPES ",T=" HEMOCELL_CONFIGURATION_T ",DESCRIPTOR=" HEMOCELL_STRINGIFY(DESCRIPTOR)
231#define HEMOCELL_CONFIGURATION_INTEGRATION ",MATERIAL_INTEGRATION=" HEMOCELL_STRINGIFY(HEMOCELL_MATERIAL_INTEGRATION)
232// clang-format off
233#define HEMOCELL_BUILD_CONFIGURATION \
234 HEMOCELL_CONFIGURATION_VERSION HEMOCELL_CONFIGURATION_TYPES \
235 HEMOCELL_CONFIGURATION_INTEGRATION HEMOCELL_CONFIGURATION_FORCE_LIMIT \
236 HEMOCELL_CONFIGURATION_SOLIDIFY HEMOCELL_CONFIGURATION_INTERIOR \
237 HEMOCELL_CONFIGURATION_PARMETIS
238// clang-format on
239
240namespace hemo {
243 char value;
245 // do nothing
246 static_assert(sizeof *this == sizeof value, "invalid size");
247 static_assert(__alignof * this == __alignof value, "invalid alignment");
248 }
250};
251}
252
253#endif
double T
Definition constant_defaults.h:137
long int plint
Definition constant_defaults.h:149
long unsigned int pluint
Definition constant_defaults.h:152
constexpr T MaxCellSurfaceAreaChange
The maximum change of the cells surface area is limited to 30%.
Definition constant_defaults.h:181
constexpr T MaxCellVolumetricChange
The maximum volumetric change of an cell to maintain quasi-incompressibility.
Definition constant_defaults.h:179
constexpr T MaxCellBendingAngle
The maximum bending angle for red/white blood cells. The bending angle of the RBC/WBC are changed to ...
Definition constant_defaults.h:186
constexpr T MaxPLTBendingAngle
The maximum bending angle for platelets. Approximately (pi/2)^2 as derived from the smallest represen...
Definition constant_defaults.h:191
constexpr T MaxCellPersistenceLength
The maximum link force derived from persistence lengths. This maximum cell persistence length allows ...
Definition constant_defaults.h:195
Definition config.cpp:37
constexpr int OUTPUT_FORCE_LINK
Definition constant_defaults.h:115
constexpr int OUTPUT_VELOCITY
Definition constant_defaults.h:120
constexpr int OUTPUT_RES_TIME
Definition constant_defaults.h:133
constexpr int MESH_FROM_STL
Definition constant_defaults.h:100
constexpr int OUTPUT_FORCE_AREA
Definition constant_defaults.h:114
constexpr int OUTPUT_SHEAR_RATE
Definition constant_defaults.h:131
constexpr int OUTPUT_DENSITY
Definition constant_defaults.h:121
constexpr int OUTPUT_FORCE
Definition constant_defaults.h:111
constexpr int OUTPUT_BOUNDARY
Definition constant_defaults.h:128
constexpr int OUTPUT_CELL_DENSITY
Definition constant_defaults.h:124
constexpr int OUTPUT_FORCE_REPULSION
Definition constant_defaults.h:118
constexpr int OUTPUT_FORCE_VISC
Definition constant_defaults.h:116
constexpr int RBC_FROM_SPHERE
Definition constant_defaults.h:99
constexpr int OUTPUT_BINDING_SITES
Definition constant_defaults.h:129
constexpr int OUTPUT_CELL_ID
Definition constant_defaults.h:123
constexpr int OUTPUT_POSITION
Definition constant_defaults.h:110
constexpr int OUTPUT_SHEAR_STRESS
Definition constant_defaults.h:125
constexpr int OUTPUT_OMEGA
Definition constant_defaults.h:127
constexpr int OUTPUT_INNER_LINKS
Definition constant_defaults.h:126
constexpr int OUTPUT_VERTEX_ID
Definition constant_defaults.h:122
constexpr int OUTPUT_STRAIN_RATE
Definition constant_defaults.h:132
constexpr int WBC_SPHERE
Definition constant_defaults.h:98
constexpr int OUTPUT_FORCE_INNER_LINK
Definition constant_defaults.h:117
constexpr int OUTPUT_FORCE_BENDING
Definition constant_defaults.h:113
constexpr int OUTPUT_TRIANGLES
Definition constant_defaults.h:119
constexpr int ELLIPSOID_FROM_SPHERE
Definition constant_defaults.h:101
constexpr int OUTPUT_FORCE_VOLUME
Definition constant_defaults.h:112
constexpr int OUTPUT_INTERIOR_POINTS
Definition constant_defaults.h:130
constexpr int STRING_FROM_VERTEXES
Definition constant_defaults.h:102
Used to circumvent buffer initialization of characters.
Definition constant_defaults.h:242
char value
Definition constant_defaults.h:243
NoInitChar()
Definition constant_defaults.h:244
~NoInitChar()
Definition constant_defaults.h:249