1 #ifndef MESH_H_INCLUDED
2 #define MESH_H_INCLUDED
27 #include <boost/property_tree/ptree.hpp>
66 Mesh(
unsigned int num_chemicals);
71 Cell* BuildBoundaryPolygon(
const std::vector<unsigned int>& node_ids);
75 Cell* BuildCell(
const std::vector<unsigned int>& node_ids);
77 Cell* BuildCell(
unsigned int id,
const std::vector<unsigned int>& node_ids);
79 Node* BuildNode(
const std::array<double, 3>& vec,
bool at_boundary);
81 Node* BuildNode(
unsigned int id,
const std::array<double, 3>& vec,
bool at_boundary);
108 const std::vector<Cell*>&
GetCells()
const {
return m_cells; }
136 const std::vector<Node*>&
GetNodes()
const {
return m_nodes; }
142 unsigned int GetNumChemicals()
const {
return m_num_chemicals; }
148 const std::vector<Wall*>&
GetWalls()
const {
return m_walls; }
163 std::ostream&
Print(std::ostream& os)
const;
173 boost::property_tree::ptree
ToPtree()
const;
213 Node* FindNextBoundaryNode(
Node*)
const;
229 Cell* m_boundary_polygon;
235 std::vector<Cell*> m_cells;
238 unsigned int m_cell_next_id;
244 std::vector<Node*> m_nodes;
247 unsigned int m_node_next_id;
250 std::map<Node*, std::list<NeighborNodes>> m_node_owning_neighbors;
253 std::map<Node*, std::list<Wall*>> m_node_owning_walls;
256 const unsigned int m_num_chemicals;
262 std::vector<Wall*> m_walls;
265 unsigned int m_wall_next_id;
268 std::map<Cell*, std::list<Cell*>> m_wall_neighbors;
273 #endif // end_of_include_guard
Cell * FindEdgeNeighbor(Cell *cell, Edge edge) const
Find the neighbor to this cell with respect to the given edge.
void getValues(double *values)
Used for interacting with ODE-solvers.
bool IsAtBoundary(const Edge *e) const
True iff the edge is on the mesh boundary.
A cell contains walls and nodes.
void RemoveNodeFromOwnerLists(Node *node)
Removes the node from the 'node owning neighbors' and 'node owning walls' lists.
Namespace for SimPT tissue editor package.
std::list< Wall * > & GetNodeOwningWalls(Node *n)
The walls that contain the given node somewhere on the wall.
MeshState GetState() const
The current state of the mesh as a self-contained object.
std::vector< Wall * > & GetWalls()
The walls of this mesh.
void UpdateNodeOwningWalls(Wall *wall)
Set ownerships of node <-> cell or update them after cell division.
void UpdateNodeOwningNeighbors(Cell *cell)
Set ownerships of node <-> cell or update them after cell division.
Interface for NeighborNodes.
const std::vector< Cell * > & GetCells() const
The cells of this mesh, EXCLUDING the boundary polygon.
The Copy-Based Mesh Builder directs the Mesh building process using another mesh. ...
const std::list< Wall * > & GetNodeOwningWalls(Node *n) const
The walls that contain the given node somewhere on the wall.
Namespace for the core simulator.
void ConstructNeighborList(Cell *cell)
Constructs neighbor list by looping over walls and registering adjoining cell for that wall...
An Edge connects two nodes and is ambidextrous.
std::list< Cell * > const & GetNeighbors(Cell *c) const
Get the adjacent cells to the given cell (i.e. sharing a wall).
std::ostream & Print(std::ostream &os) const
Solely for debugging purposes.
std::vector< NeighborNodes > GetEdgeOwners(const Edge &edge) const
Find the intersecting neighbors of the end points of the edge.
std::vector< Node * > & GetNodes()
The nodes of the mesh.
void setValues(double x, double *y)
Used for interacting with ODE-solvers.
std::list< Cell * > & GetNeighbors(Cell *c)
Get the adjacent cells to the given cell (i.e. sharing a wall).
void AddNodeToCell(Cell *c, Node *n, Node *nb1, Node *nb2)
Add node to cell between existing neighbor nodes.
const std::list< NeighborNodes > & GetNodeOwningNeighbors(Node *n) const
Get the neighbors associated with this node.
Mesh(unsigned int num_chemicals)
Constructs empty Mesh.
Cell * GetBoundaryPolygon() const
Get the boundary polygon of the mesh.
void RemoveFromNeighborList(Cell *cell)
Removes the cell from the neighbor list (only do this when deleting this cell).
bool IsInBoundaryPolygon(Node *n) const
True iff the node is one of the nodes of the boundary polygon.
const std::vector< Node * > & GetNodes() const
The nodes of the mesh.
std::list< NeighborNodes > & GetNodeOwningNeighbors(Node *n)
Get the neighbors associated with this node.
void Derivatives(double *derivs)
Constructs neighbor list by looping over walls and registering.
boost::property_tree::ptree ToPtree() const
Convert the mesh to a ptree.
Interface and implementation for SegmentedVector class.
Structure of cells; key data structure.
std::vector< Cell * > & GetCells()
The cells of this mesh, EXCLUDING the boundary polygon.
Wall * FindWall(const Edge &edge) const
Find the wall including the edge.
const std::vector< Wall * > & GetWalls() const
The walls of this mesh.
An editable mesh with actions to alter the construction of the mesh.
A cell wall, runs between cell corner points and consists of wall elements.
Container that stores objects "almost contiguously" and guarantees that pointers/iterators are not in...