36 #include "VolumeDependentAveragedSourceEllipticPde.hpp"
37 #include "ApoptoticCellProperty.hpp"
39 template<
unsigned DIM>
47 template<
unsigned DIM>
51 this->mCellDensityOnCoarseElements.resize(rCoarseMesh.
GetNumElements());
52 for (
unsigned elem_index=0; elem_index<this->mCellDensityOnCoarseElements.size(); elem_index++)
54 this->mCellDensityOnCoarseElements[elem_index] = 0.0;
59 cell_iter != this->mrCellPopulation.End();
62 unsigned elem_index = 0;
63 const ChastePoint<DIM>& r_position_of_cell = this->mrCellPopulation.GetLocationOfCellCentre(*cell_iter);
65 if (pCellPdeElementMap !=
nullptr)
67 elem_index = (*pCellPdeElementMap)[*cell_iter];
74 unsigned node_index = this->mrCellPopulation.GetLocationIndexUsingCell(*cell_iter);
76 Node<DIM>* p_node = this->mrCellPopulation.GetNode(node_index);
80 double cell_weight = radius*radius;
82 bool cell_is_apoptotic = cell_iter->template HasCellProperty<ApoptoticCellProperty>();
83 if (!cell_is_apoptotic)
85 this->mCellDensityOnCoarseElements[elem_index] += cell_weight;
90 c_matrix<double, DIM, DIM> jacobian;
92 for (
unsigned elem_index=0; elem_index<this->mCellDensityOnCoarseElements.size(); elem_index++)
94 rCoarseMesh.
GetElement(elem_index)->CalculateJacobian(jacobian, det);
95 this->mCellDensityOnCoarseElements[elem_index] /= rCoarseMesh.
GetElement(elem_index)->GetVolume(det);
virtual unsigned GetNumElements() const
Element< ELEMENT_DIM, SPACE_DIM > * GetElement(unsigned index) const
#define EXPORT_TEMPLATE_CLASS_SAME_DIMS(CLASS)
AbstractCellPopulation< DIM > & mrCellPopulation
void SetupSourceTerms(TetrahedralMesh< DIM, DIM > &rCoarseMesh, std::map< CellPtr, unsigned > *pCellPdeElementMap=nullptr)
unsigned GetContainingElementIndex(const ChastePoint< SPACE_DIM > &rTestPoint, bool strict=false, std::set< unsigned > testElements=std::set< unsigned >(), bool onlyTryWithTestElements=false)
NodeBasedCellPopulation< DIM > * mpStaticCastCellPopulation
VolumeDependentAveragedSourceEllipticPde(AbstractCellPopulation< DIM > &rCellPopulation, double coefficient=0.0)