VPTissue Reference Manual
CellDivider.h
Go to the documentation of this file.
1 #ifndef CELL_DIVIDER_H_INCLUDED
2 #define CELL_DIVIDER_H_INCLUDED
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
27 #include "sim/CoreData.h"
28 
29 #include <array>
30 #include <functional>
31 #include <list>
32 #include <memory>
33 #include <vector>
34 
35 namespace SimPT_Sim {
36 
37 class Cell;
38 class Edge;
39 class Mesh;
40 class Node;
41 class Sim;
42 class Wall;
43 using boost::property_tree::ptree;
44 
49 {
50 public:
54  CellDivider(const CoreData& cd);
55 
59  CellDivider(Mesh* mesh);
60 
64  unsigned int DivideCells();
65 
72  void DivideOverAxis(Cell* cell, const std::array<double, 3>& axis);
73 
77  std::list<Cell*> GeometricSplitCell(Cell* cell, Node* node1, Node* node2);
78 
85  void Initialize(Mesh* mesh);
86 
92  void Initialize(const CoreData& cd);
93 
94 private:
96  void AddSharedWallNodes(std::array<std::array<double, 3>, 2>& new_node_vector,
97  std::array<Node*, 2>& new_node_index,
98  std::vector<Node*>& parent_nodes, std::vector<Node*>& daughter_nodes);
99 
101  void AddSplitWalls(Cell* this_cell, Cell* neighbor_cell, int i,
102  std::array<Node*, 2>& new_node_index,
103  std::array<Wall*, 4>& div_wall, std::array<double, 2>& orig_length,
104  std::array<double, 2>& orig_rest_length,
105  std::array<double, 2>& orig_rest_length_init);
106 
108  void ComputeIntersection(Cell* cell, std::vector<Node*> intersect_indexes,
109  const std::array<double, 3>& from, const std::array<double, 3>& to,
110  std::array<std::array<double, 3>, 2>& new_node_vector,
111  std::array<Node*, 2>& new_node_index, std::array<int, 2>& new_node_flag,
112  std::array<Edge, 2>& divided_edges);
113 
115  Node* InsertNewNodeAtIntersect(Cell* this_cell, Cell* neighbor_cell,
116  std::array<double, 3> node_vec, const Edge& intrsct_edge);
117 
119  Cell* SplitCell(Cell* this_cell, std::vector<Node*> intersect_indexes,
120  const std::array<double, 3>& from, const std::array<double, 3>& to);
121 
122 private:
123  CoreData m_cd;
124  CellDaughtersComponent m_cell_daughters;
125  CellSplitComponent m_cell_split;
126  double m_collapse_node_threshold;
127  bool m_copy_wall;
128  Mesh* m_mesh;
129  std::string m_model_name;
130  double m_target_node_distance;
131  std::function<double()> m_uniform_generator;
132 };
133 
134 } // namespace
135 
136 #endif // end_of_include_guard
Core data with mesh, parameters, random engine and time data.
Definition: CoreData.h:38
A cell contains walls and nodes.
Definition: Cell.h:48
Node in cell wall.
Definition: Node.h:39
Core data used during model execution.
std::function< std::tuple< bool, bool, std::array< double, 3 >>(Cell *)> CellSplitComponent
CellSplit component interface.
Interface of Model Components.
unsigned int DivideCells()
Execute cell divisions.
std::list< Cell * > GeometricSplitCell(Cell *cell, Node *node1, Node *node2)
A geometric split of cell (see tissue editor's EditableMesh class).
std::function< void(Cell *, Cell *)> CellDaughtersComponent
CellDaughters component interface.
Namespace for the core simulator.
An Edge connects two nodes and is ambidextrous.
Definition: Edge.h:31
Class for handling cell division.
Definition: CellDivider.h:48
void Initialize(Mesh *mesh)
Initializes based on the values of a given mesh.
CellDivider(const CoreData &cd)
Constructor initializes with CoreData.
Structure of cells; key data structure.
Definition: Mesh.h:62
void DivideOverAxis(Cell *cell, const std::array< double, 3 > &axis)
Divide cell over a pre-defined axis (only when this object has been initialized with core data)...