-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cell.h
172 lines (136 loc) · 7.2 KB
/
Cell.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
#ifndef DIPOLECELL_CELL_H
#define DIPOLECELL_CELL_H
#include "CellBase.h"
#include "CommonTypes.h"
#include "ModelCellParameter.h"
#include <Eigen/Core>
#include <memory>
#include <optional>
#include <utility>
class CellContracting : public CellBase {
private:
void initializeCellCurrentVector(Eigen::Ref<CellVector> cell_current_vector) final;
public:
explicit CellContracting(Eigen::Ref<CellVector> cell_current_vector) noexcept;
public:
CellCycleStageEnum getCellCycleStage() const final;
char getCellCycleStageRepr() const final;
private:
static void
computeODEdydt_(const Eigen::Ref<const CellVector> &cell_current_vector,
const Eigen::Ref<const Vector4F> &external_force_labxy,
Eigen::Ref<CellVector> cell_dydt_vector, FloatingType cell_elastic_coeff,
FloatingType free_contraction_speed, FloatingType stall_tension,
FloatingType friction_coeff_front, FloatingType friction_coeff_back,
FloatingType accum_rate_cil, FloatingType confront_force_threshold_cil,
FloatingType decay_rate_cil, FloatingType accum_rate_division,
FloatingType tension_threshold_division, FloatingType decay_rate_division);
public:
void computeODEdydt(const Eigen::Ref<const CellVector> &cell_current_vector,
const Eigen::Ref<const Vector4F> &external_force_labxy,
Eigen::Ref<CellVector> cell_dydt_vector) const final;
private:
static std::optional<CellCycleStageEnum>
updateCycleStage_(Eigen::Ref<CellVector> cell_current_vector, FloatingType cell_elastic_l0_min,
bool cell_cil_enabled = ModelSwitch::cell_cil_uturn_enabled,
bool cell_division_enabled = ModelSwitch::cell_division_enabled);
// Only for CellContracting: this function also probabilistically does CIL.
public:
std::optional<CellCycleStageEnum> updateCycleStage(Eigen::Ref<CellVector> cell_current_vector,
FloatingType dt_full_step) final;
std::unique_ptr<CellBase>
updateStageState(Eigen::Ref<CellVector> cell_current_vector,
std::vector<std::unique_ptr<CellBase>> &states_of_newborn_cell_current,
CellColonyMatrix &cols_of_newborn_cell_current,
FloatingType dt_full_step) final;
};
class CellNonContracting : public CellBase {
protected:
static void computeODEdydt_(const Eigen::Ref<const CellVector> &cell_current_vector,
const Eigen::Ref<const Vector4F> &external_force_labxy,
Eigen::Ref<CellVector> cell_dydt_vector,
FloatingType cell_elastic_coeff, FloatingType cell_elastic_l0_in,
FloatingType friction_coeff_front,
FloatingType friction_coeff_back);
};
class CellExpanding : public CellNonContracting {
protected:
static std::optional<CellCycleStageEnum>
updateCycleStage_(Eigen::Ref<CellVector> cell_current_vector,
FloatingType cell_expand_target_length);
// returns contraction state if cell has expanded enough, i.e. has expanded to >=
// cell_expand_target_length
};
class CellProtruding : public CellExpanding {
private:
void initializeCellCurrentVector(Eigen::Ref<CellVector> cell_current_vector) final;
public:
explicit CellProtruding(Eigen::Ref<CellVector> cell_current_vector) noexcept;
public:
CellCycleStageEnum getCellCycleStage() const final;
char getCellCycleStageRepr() const final;
public:
void computeODEdydt(const Eigen::Ref<const CellVector> &cell_current_vector,
const Eigen::Ref<const Vector4F> &external_force_labxy,
Eigen::Ref<CellVector> cell_dydt_vector) const final;
std::optional<CellCycleStageEnum> updateCycleStage(Eigen::Ref<CellVector> cell_current_vector,
FloatingType dt_full_step) final;
std::unique_ptr<CellBase>
updateStageState(Eigen::Ref<CellVector> cell_current_vector,
std::vector<std::unique_ptr<CellBase>> &states_of_newborn_cell_current,
CellColonyMatrix &cols_of_newborn_cell_current,
FloatingType dt_full_step) final;
};
class CellDividing : public CellExpanding {
private:
void initializeCellCurrentVector(Eigen::Ref<CellVector> cell_current_vector) final;
public:
explicit CellDividing(Eigen::Ref<CellVector> cell_current_vector) noexcept;
public:
CellCycleStageEnum getCellCycleStage() const final;
char getCellCycleStageRepr() const final;
public:
void computeODEdydt(const Eigen::Ref<const CellVector> &cell_current_vector,
const Eigen::Ref<const Vector4F> &external_force_labxy,
Eigen::Ref<CellVector> cell_dydt_vector) const final;
std::optional<CellCycleStageEnum> updateCycleStage(Eigen::Ref<CellVector> cell_current_vector,
FloatingType dt_full_step) final;
std::unique_ptr<CellBase>
updateStageState(Eigen::Ref<CellVector> cell_current_vector,
std::vector<std::unique_ptr<CellBase>> &states_of_newborn_cell_current,
CellColonyMatrix &cols_of_newborn_cell_current,
FloatingType dt_full_step) final;
private:
void slideSubCellAfterReplication(Eigen::Ref<Vector4F> position_of_cell_to_slide_front,
Eigen::Ref<Vector4F> position_of_cell_to_slide_back) const;
// At the last step of cell division, two child cells initially have
// exactly the same state and position. This function adjusts cell length
// by sliding the subcells. It slides a subcell along the cell
// orientation while fixing the other subcell, so the cell gets to the
// target length.
};
class CellNonMotile : public CellNonContracting {
private:
void initializeCellCurrentVector(Eigen::Ref<CellVector> cell_current_vector) final;
public:
explicit CellNonMotile(Eigen::Ref<CellVector> cell_current_vector) noexcept;
public:
CellCycleStageEnum getCellCycleStage() const final;
char getCellCycleStageRepr() const final;
public:
void computeODEdydt(const Eigen::Ref<const CellVector> &cell_current_vector,
const Eigen::Ref<const Vector4F> &external_force_labxy,
Eigen::Ref<CellVector> cell_dydt_vector) const final;
private:
static std::optional<CellCycleStageEnum>
updateCycleStage_(Eigen::Ref<CellVector> cell_current_vector);
public:
std::optional<CellCycleStageEnum> updateCycleStage(Eigen::Ref<CellVector> cell_current_vector,
FloatingType dt_full_step) final;
std::unique_ptr<CellBase>
updateStageState(Eigen::Ref<CellVector> cell_current_vector,
std::vector<std::unique_ptr<CellBase>> &states_of_newborn_cell_current,
CellColonyMatrix &cols_of_newborn_cell_current,
FloatingType dt_full_step) final;
};
#endif // DIPOLECELL_CELL_H