36 #include "CellStateDependentDiscreteSource.hpp" 37 #include "AbstractCellPopulation.hpp" 38 #include "VesselNetwork.hpp" 40 template<
unsigned DIM>
44 mStateRateThresholdMap(),
45 mConsumptionRatePerUnitConcentration(1.0*
unit::metre_cubed_per_second)
50 template<
unsigned DIM>
56 template<
unsigned DIM>
63 template<
unsigned DIM>
66 EXCEPTION(
"This source does not yet support meshes.");
69 template<
unsigned DIM>
72 EXCEPTION(
"This source does not yet support meshes.");
75 template<
unsigned DIM>
80 EXCEPTION(
"A regular grid is required for this type of source");
85 std::vector<units::quantity<unit::concentration_flow_rate> > values(this->
mpRegularGrid->GetNumberOfPoints(), 0.0*unit::mole_per_metre_cubed_per_second);
87 boost::shared_ptr<ApoptoticCellProperty> apoptotic_property(
new ApoptoticCellProperty);
88 unsigned apoptotic_label = apoptotic_property->GetColour();
91 std::vector<std::vector<CellPtr> > point_cell_map = this->
mpRegularGrid->GetPointCellMap();
92 for(
unsigned idx=0; idx<point_cell_map.size(); idx++)
94 for(
unsigned jdx=0; jdx<point_cell_map[idx].size(); jdx++)
99 std::map<unsigned, units::quantity<unit::concentration_flow_rate> >::iterator it;
101 if (point_cell_map[idx][jdx]->
template HasCellProperty<ApoptoticCellProperty>())
106 values[idx] += it->second;
111 it =
mStateRateMap.find(point_cell_map[idx][jdx]->GetMutationState()->GetColour());
118 units::quantity<unit::concentration> threshold = 0.0 * unit::mole_per_metre_cubed;
121 std::map<unsigned, units::quantity<unit::concentration> >::iterator it_threshold;
125 threshold = it_threshold->second;
130 if(threshold>0.0* unit::mole_per_metre_cubed)
132 if(point_cell_map[idx][jdx]->GetCellData()->GetItem(this->
mLabel)>threshold.value())
134 values[idx] += it->second;
139 values[idx] += it->second;
144 values[idx] += it->second;
158 template<
unsigned DIM>
162 return std::vector<units::quantity<unit::rate> >(this->
mpRegularGrid->GetNumberOfPoints(), 0.0*unit::per_second);
165 template<
unsigned DIM>
171 template<
unsigned DIM>
std::vector< units::quantity< unit::concentration_flow_rate > > GetConstantInUMeshValues()
virtual ~CellStateDependentDiscreteSource()
boost::shared_ptr< RegularGrid< DIM > > mpRegularGrid
std::map< unsigned, units::quantity< unit::concentration > > mStateRateThresholdMap
CellStateDependentDiscreteSource()
void SetStateRateMap(std::map< unsigned, units::quantity< unit::concentration_flow_rate > > stateRateMap)
std::map< unsigned, units::quantity< unit::concentration_flow_rate > > mStateRateMap
std::vector< units::quantity< unit::concentration_flow_rate > > GetConstantInURegularGridValues()
static boost::shared_ptr< CellStateDependentDiscreteSource< DIM > > Create()
std::vector< units::quantity< unit::rate > > GetLinearInUMeshValues()
units::quantity< unit::concentration_flow_rate > mConstantInUValue
void SetStateRateThresholdMap(std::map< unsigned, units::quantity< unit::concentration > > stateThresholdMap)
std::vector< units::quantity< unit::rate > > GetLinearInURegularGridValues()