36 #include "CellPopulationElementWriter.hpp"
37 #include "AbstractCellPopulation.hpp"
38 #include "MeshBasedCellPopulation.hpp"
39 #include "CaBasedCellPopulation.hpp"
40 #include "NodeBasedCellPopulation.hpp"
41 #include "PottsBasedCellPopulation.hpp"
42 #include "VertexBasedCellPopulation.hpp"
44 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
50 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
57 bool element_contains_dead_cells_or_deleted_nodes =
false;
60 for (
unsigned i=0; i<ELEMENT_DIM+1; i++)
62 unsigned node_index = elem_iter->GetNodeGlobalIndex(i);
64 if (pCellPopulation->
GetNode(node_index)->IsDeleted())
66 element_contains_dead_cells_or_deleted_nodes =
true;
73 element_contains_dead_cells_or_deleted_nodes =
true;
78 if (!element_contains_dead_cells_or_deleted_nodes)
80 for (
unsigned i=0; i<ELEMENT_DIM+1; i++)
82 *this->mpOutStream << elem_iter->GetNodeGlobalIndex(i) <<
" ";
88 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
93 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
98 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
103 cell_iter != pCellPopulation->
End();
109 bool elem_corresponds_to_dead_cell =
false;
117 if (!(pCellPopulation->
GetElement(elem_index)->IsDeleted()) && !elem_corresponds_to_dead_cell)
120 unsigned num_nodes_in_element = p_element->
GetNumNodes();
123 *this->mpOutStream << num_nodes_in_element <<
" ";
126 for (
unsigned i=0; i<num_nodes_in_element; i++)
134 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
139 cell_iter != pCellPopulation->
End();
145 bool elem_corresponds_to_dead_cell =
false;
153 if (!(pCellPopulation->
GetElement(elem_index)->IsDeleted()) && !elem_corresponds_to_dead_cell)
156 unsigned num_nodes_in_element = p_element->
GetNumNodes();
159 *this->mpOutStream << num_nodes_in_element <<
" ";
162 for (
unsigned i=0; i<num_nodes_in_element; i++)
ElementIterator GetElementIteratorBegin(bool skipDeletedElements=true)
virtual void Visit(MeshBasedCellPopulation< ELEMENT_DIM, SPACE_DIM > *pCellPopulation)
virtual CellPtr GetCellUsingLocationIndex(unsigned index)
unsigned GetLocationIndexUsingCell(CellPtr pCell)
unsigned GetNodeGlobalIndex(unsigned localIndex) const
ElementIterator GetElementIteratorEnd()
PottsMesh< DIM > & rGetMesh()
CellPopulationElementWriter()
bool IsCellAttachedToLocationIndex(unsigned index)
VertexElement< ELEMENT_DIM, SPACE_DIM > * GetElement(unsigned index) const
MutableMesh< ELEMENT_DIM, SPACE_DIM > & rGetMesh()
MutableVertexMesh< DIM, DIM > & rGetMesh()
unsigned GetNumNodes() const
#define EXPORT_TEMPLATE_CLASS_ALL_DIMS(CLASS)
Node< SPACE_DIM > * GetNode(unsigned index)
PottsElement< DIM > * GetElement(unsigned elementIndex)
VertexElement< DIM, DIM > * GetElement(unsigned elementIndex)