hemocell
Loading...
Searching...
No Matches
helper
cellInfo.h
Go to the documentation of this file.
1
/*
2
This file is part of the HemoCell library
3
4
HemoCell is developed and maintained by the Computational Science Lab
5
in the University of Amsterdam. Any questions or remarks regarding this library
6
can be sent to: info@hemocell.eu
7
8
When using the HemoCell library in scientific work please cite the
9
corresponding paper: https://doi.org/10.3389/fphys.2017.00563
10
11
The HemoCell library is free software: you can redistribute it and/or
12
modify it under the terms of the GNU Affero General Public License as
13
published by the Free Software Foundation, either version 3 of the
14
License, or (at your option) any later version.
15
16
The library is distributed in the hope that it will be useful,
17
but WITHOUT ANY WARRANTY; without even the implied warranty of
18
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
GNU Affero General Public License for more details.
20
21
You should have received a copy of the GNU Affero General Public License
22
along with this program. If not, see <http://www.gnu.org/licenses/>.
23
*/
24
#ifndef CELLINFORMATION_H
25
#define CELLINFORMATION_H
26
27
#include "
hemocell.h
"
28
#include "
hemoCellFunctional.h
"
29
#include "
array.h
"
30
31
/* THIS CLASS IS NOT THREAD SAFE!*/
32
/* Calculate and store Cell-Specific Information
33
*
34
* call the static members for the information you need
35
* (eg. CellInformationFunctionals::getCellVolume(hemocell))
36
* then the information will be available in the map:
37
* CellInformationFunctionals::info_per_cell
38
* Clean the old cell results afterwards with
39
* CellInformationFunctionals::clear_list()
40
*
41
*/
42
namespace
hemo
{
43
44
struct
CellInformation
{
45
hemo::Array<T, 3>
position
= {};
46
hemo::Array<T, 3>
velocity
= {};
47
T
volume
= 0;
48
T
area
= 0;
49
T
stretch
= 0;
50
hemo::Array<T, 6>
bbox
= {};
51
pluint
blockId
= UINTMAX_MAX;
52
pluint
cellType
= UINTMAX_MAX;
53
bool
centerLocal
=
false
;
54
plint
base_cell_id
= 0;
55
};
56
57
class
CellInformationFunctionals
{
58
class
CellVolume
:
public
HemoCellFunctional
{
59
public
:
60
explicit
CellVolume
(
HemoCell
* hemocell_) :
hemocell
(hemocell_) {}
61
62
private
:
63
void
processGenericBlocks
(plb::Box3D, std::vector<plb::AtomicBlock3D *>);
64
CellVolume
*
clone
()
const
;
65
HemoCell
*
hemocell
;
66
};
67
class
CellArea
:
public
HemoCellFunctional
{
68
public
:
69
explicit
CellArea
(
HemoCell
* hemocell_) :
hemocell
(hemocell_) {}
70
71
private
:
72
void
processGenericBlocks
(plb::Box3D, std::vector<plb::AtomicBlock3D *>);
73
CellArea
*
clone
()
const
;
74
HemoCell
*
hemocell
;
75
};
76
class
CellPosition
:
public
HemoCellFunctional
{
77
void
processGenericBlocks
(plb::Box3D, std::vector<plb::AtomicBlock3D *>);
78
CellPosition
*
clone
()
const
;
79
};
80
class
CellStretch
:
public
HemoCellFunctional
{
81
void
processGenericBlocks
(plb::Box3D, std::vector<plb::AtomicBlock3D *>);
82
CellStretch
*
clone
()
const
;
83
};
84
class
CellBoundingBox
:
public
HemoCellFunctional
{
85
void
processGenericBlocks
(plb::Box3D, std::vector<plb::AtomicBlock3D *>);
86
CellBoundingBox
*
clone
()
const
;
87
};
88
class
CellAtomicBlock
:
public
HemoCellFunctional
{
89
void
processGenericBlocks
(plb::Box3D, std::vector<plb::AtomicBlock3D *>);
90
CellAtomicBlock
*
clone
()
const
;
91
};
92
class
CellType
:
public
HemoCellFunctional
{
93
void
processGenericBlocks
(plb::Box3D, std::vector<plb::AtomicBlock3D *>);
94
CellType
*
clone
()
const
;
95
};
96
//end legacy interface
97
98
class
allCellInformation
:
public
HemoCellFunctional
{
99
HemoCell
*
hemocell
;
100
std::map<plint, CellInformation> &
info_per_cell
;
101
102
public
:
103
allCellInformation
(
HemoCell
* hemocell_, std::map<plint, CellInformation> & info_per_cell_)
104
:
hemocell
(hemocell_),
info_per_cell
(info_per_cell_) {}
105
106
private
:
107
void
processGenericBlocks
(plb::Box3D, std::vector<plb::AtomicBlock3D *>);
108
allCellInformation
*
clone
()
const
;
109
};
110
111
112
public
:
113
// Legacy interface, should become private at some point.
114
static
std::map<plint, CellInformation>
info_per_cell
;
115
static
void
clear_list
();
116
static
void
calculate_vol_pos_area
(
HemoCell
*);
/*This excludes Stretch, since it is compute intensive!*/
117
static
void
calculateCellVolume
(
HemoCell
*);
118
static
void
calculateCellArea
(
HemoCell
*);
119
static
void
calculateCellPosition
(
HemoCell
*);
120
static
void
calculateCellStretch
(
HemoCell
*);
121
static
void
calculateCellBoundingBox
(
HemoCell
*);
122
static
void
calculateCellAtomicBlock
(
HemoCell
*);
123
static
void
calculateCellType
(
HemoCell
*);
124
static
void
calculateCellVelocity
(
HemoCell
*);
125
126
//Interface that should be used, less error prone at the cost of some extra computation and memory usage
127
static
pluint
getTotalNumberOfCells
(
HemoCell
*);
128
static
pluint
getNumberOfCellsFromType
(
HemoCell
*, std::string type);
130
static
void
calculateCellInformation
(
HemoCell
*, std::map<plint, CellInformation> &);
131
};
132
}
133
#endif
array.h
hemo::CellInformationFunctionals::CellArea
Definition
cellInfo.h:67
hemo::CellInformationFunctionals::CellArea::processGenericBlocks
void processGenericBlocks(plb::Box3D, std::vector< plb::AtomicBlock3D * >)
Definition
cellInfo.cpp:67
hemo::CellInformationFunctionals::CellArea::CellArea
CellArea(HemoCell *hemocell_)
Definition
cellInfo.h:69
hemo::CellInformationFunctionals::CellArea::clone
CellArea * clone() const
Definition
cellInfo.cpp:367
hemo::CellInformationFunctionals::CellArea::hemocell
HemoCell * hemocell
Definition
cellInfo.h:74
hemo::CellInformationFunctionals::CellAtomicBlock
Definition
cellInfo.h:88
hemo::CellInformationFunctionals::CellAtomicBlock::processGenericBlocks
void processGenericBlocks(plb::Box3D, std::vector< plb::AtomicBlock3D * >)
Definition
cellInfo.cpp:153
hemo::CellInformationFunctionals::CellAtomicBlock::clone
CellAtomicBlock * clone() const
Definition
cellInfo.cpp:379
hemo::CellInformationFunctionals::CellBoundingBox
Definition
cellInfo.h:84
hemo::CellInformationFunctionals::CellBoundingBox::clone
CellBoundingBox * clone() const
Definition
cellInfo.cpp:376
hemo::CellInformationFunctionals::CellBoundingBox::processGenericBlocks
void processGenericBlocks(plb::Box3D, std::vector< plb::AtomicBlock3D * >)
Definition
cellInfo.cpp:124
hemo::CellInformationFunctionals::CellPosition
Definition
cellInfo.h:76
hemo::CellInformationFunctionals::CellPosition::clone
CellPosition * clone() const
Definition
cellInfo.cpp:370
hemo::CellInformationFunctionals::CellPosition::processGenericBlocks
void processGenericBlocks(plb::Box3D, std::vector< plb::AtomicBlock3D * >)
Definition
cellInfo.cpp:85
hemo::CellInformationFunctionals::CellStretch
Definition
cellInfo.h:80
hemo::CellInformationFunctionals::CellStretch::processGenericBlocks
void processGenericBlocks(plb::Box3D, std::vector< plb::AtomicBlock3D * >)
Definition
cellInfo.cpp:105
hemo::CellInformationFunctionals::CellStretch::clone
CellStretch * clone() const
Definition
cellInfo.cpp:373
hemo::CellInformationFunctionals::CellType
Definition
cellInfo.h:92
hemo::CellInformationFunctionals::CellType::processGenericBlocks
void processGenericBlocks(plb::Box3D, std::vector< plb::AtomicBlock3D * >)
Definition
cellInfo.cpp:163
hemo::CellInformationFunctionals::CellType::clone
CellType * clone() const
Definition
cellInfo.cpp:382
hemo::CellInformationFunctionals::CellVolume
Definition
cellInfo.h:58
hemo::CellInformationFunctionals::CellVolume::hemocell
HemoCell * hemocell
Definition
cellInfo.h:65
hemo::CellInformationFunctionals::CellVolume::processGenericBlocks
void processGenericBlocks(plb::Box3D, std::vector< plb::AtomicBlock3D * >)
Definition
cellInfo.cpp:42
hemo::CellInformationFunctionals::CellVolume::CellVolume
CellVolume(HemoCell *hemocell_)
Definition
cellInfo.h:60
hemo::CellInformationFunctionals::CellVolume::clone
CellVolume * clone() const
Definition
cellInfo.cpp:364
hemo::CellInformationFunctionals::allCellInformation
Definition
cellInfo.h:98
hemo::CellInformationFunctionals::allCellInformation::processGenericBlocks
void processGenericBlocks(plb::Box3D, std::vector< plb::AtomicBlock3D * >)
Definition
cellInfo.cpp:173
hemo::CellInformationFunctionals::allCellInformation::clone
allCellInformation * clone() const
Definition
cellInfo.cpp:385
hemo::CellInformationFunctionals::allCellInformation::allCellInformation
allCellInformation(HemoCell *hemocell_, std::map< plint, CellInformation > &info_per_cell_)
Definition
cellInfo.h:103
hemo::CellInformationFunctionals::allCellInformation::info_per_cell
std::map< plint, CellInformation > & info_per_cell
Definition
cellInfo.h:100
hemo::CellInformationFunctionals::allCellInformation::hemocell
HemoCell * hemocell
Definition
cellInfo.h:99
hemo::CellInformationFunctionals
Definition
cellInfo.h:57
hemo::CellInformationFunctionals::getNumberOfCellsFromType
static pluint getNumberOfCellsFromType(HemoCell *, std::string type)
Definition
cellInfo.cpp:329
hemo::CellInformationFunctionals::getTotalNumberOfCells
static pluint getTotalNumberOfCells(HemoCell *)
Definition
cellInfo.cpp:313
hemo::CellInformationFunctionals::calculate_vol_pos_area
static void calculate_vol_pos_area(HemoCell *)
Definition
cellInfo.cpp:36
hemo::CellInformationFunctionals::calculateCellAtomicBlock
static void calculateCellAtomicBlock(HemoCell *)
Definition
cellInfo.cpp:301
hemo::CellInformationFunctionals::calculateCellVolume
static void calculateCellVolume(HemoCell *)
Definition
cellInfo.cpp:270
hemo::CellInformationFunctionals::calculateCellInformation
static void calculateCellInformation(HemoCell *, std::map< plint, CellInformation > &)
Calculate all possible macroscopic information and return it within the reference.
Definition
cellInfo.cpp:352
hemo::CellInformationFunctionals::info_per_cell
static std::map< plint, CellInformation > info_per_cell
Definition
cellInfo.h:114
hemo::CellInformationFunctionals::calculateCellStretch
static void calculateCellStretch(HemoCell *)
Definition
cellInfo.cpp:289
hemo::CellInformationFunctionals::clear_list
static void clear_list()
Definition
cellInfo.cpp:33
hemo::CellInformationFunctionals::calculateCellPosition
static void calculateCellPosition(HemoCell *)
Definition
cellInfo.cpp:283
hemo::CellInformationFunctionals::calculateCellArea
static void calculateCellArea(HemoCell *)
Definition
cellInfo.cpp:277
hemo::CellInformationFunctionals::calculateCellType
static void calculateCellType(HemoCell *)
Definition
cellInfo.cpp:307
hemo::CellInformationFunctionals::calculateCellVelocity
static void calculateCellVelocity(HemoCell *)
hemo::CellInformationFunctionals::calculateCellBoundingBox
static void calculateCellBoundingBox(HemoCell *)
Definition
cellInfo.cpp:295
hemo::HemoCellFunctional
Definition
hemoCellFunctional.h:37
hemo::HemoCell
Definition
hemocell.h:66
T
double T
Definition
constant_defaults.h:137
plint
long int plint
Definition
constant_defaults.h:149
pluint
long unsigned int pluint
Definition
constant_defaults.h:152
hemoCellFunctional.h
hemocell.h
hemo
Definition
config.cpp:37
hemo::Array
Definition
array.h:40
hemo::CellInformation
Definition
cellInfo.h:44
hemo::CellInformation::area
T area
Definition
cellInfo.h:48
hemo::CellInformation::volume
T volume
Definition
cellInfo.h:47
hemo::CellInformation::velocity
hemo::Array< T, 3 > velocity
Definition
cellInfo.h:46
hemo::CellInformation::cellType
pluint cellType
Definition
cellInfo.h:52
hemo::CellInformation::blockId
pluint blockId
Definition
cellInfo.h:51
hemo::CellInformation::position
hemo::Array< T, 3 > position
Definition
cellInfo.h:45
hemo::CellInformation::centerLocal
bool centerLocal
Definition
cellInfo.h:53
hemo::CellInformation::bbox
hemo::Array< T, 6 > bbox
Definition
cellInfo.h:50
hemo::CellInformation::base_cell_id
plint base_cell_id
Definition
cellInfo.h:54
hemo::CellInformation::stretch
T stretch
Definition
cellInfo.h:49
Generated by
1.9.8