36 #include "CellBasedDiscreteSource.hpp" 37 #include "AbstractCellPopulation.hpp" 38 #include "VesselNetwork.hpp" 39 #include "GeometryTools.hpp" 40 #include "Element.hpp" 42 template<
unsigned DIM>
45 mCellConstantInUValue(0.0*
unit::mole_per_second),
46 mCellLinearInUValue(0.0*
unit::per_second)
51 template<
unsigned DIM>
57 template<
unsigned DIM>
64 template<
unsigned DIM>
69 EXCEPTION(
"A mesh is required for this type of source");
72 std::vector<units::quantity<unit::concentration_flow_rate> > values(this->
mpMesh->GetNumElements(), 0.0*unit::mole_per_metre_cubed_per_second);
73 std::vector<std::vector<CellPtr> > element_cell_map = this->
mpMesh->GetElementCellMap();
74 for(
unsigned idx=0; idx<element_cell_map.size(); idx++)
76 Element<DIM, DIM>* p_element = this->
mpMesh->GetElement(idx);
77 double determinant = 0.0;
78 c_matrix<double, DIM, DIM> jacobian;
79 p_element->CalculateJacobian(jacobian, determinant);
80 units::quantity<unit::volume> element_volume = p_element->GetVolume(determinant) * units::pow<3>(this->
mpMesh->GetReferenceLengthScale());
86 template<
unsigned DIM>
91 EXCEPTION(
"A mesh is required for this type of source");
93 std::vector<units::quantity<unit::rate> > values(this->
mpMesh->GetNumElements(), 0.0*unit::per_second);
94 std::vector<std::vector<CellPtr> > element_cell_map = this->
mpMesh->GetElementCellMap();
96 for(
unsigned idx=0; idx<element_cell_map.size(); idx++)
103 template<
unsigned DIM>
108 EXCEPTION(
"A regular grid is required for this type of source");
111 std::vector<units::quantity<unit::concentration_flow_rate> > values(this->
mpRegularGrid->GetNumberOfPoints(), 0.0*unit::mole_per_metre_cubed_per_second);
112 units::quantity<unit::length> grid_spacing = this->
mpRegularGrid->GetSpacing();
113 units::quantity<unit::volume> grid_volume = units::pow<3>(grid_spacing);
115 std::vector<std::vector<CellPtr> > point_cell_map = this->
mpRegularGrid->GetPointCellMap();
116 for(
unsigned idx=0; idx<point_cell_map.size(); idx++)
124 template<
unsigned DIM>
129 EXCEPTION(
"A regular grid is required for this type of source");
132 std::vector<units::quantity<unit::rate> > values(this->
mpRegularGrid->GetNumberOfPoints(), 0.0*unit::per_second);
133 std::vector<std::vector<CellPtr> > point_cell_map = this->
mpRegularGrid->GetPointCellMap();
134 for(
unsigned idx=0; idx<point_cell_map.size(); idx++)
141 template<
unsigned DIM>
147 template<
unsigned DIM>
CellBasedDiscreteSource()
std::vector< units::quantity< unit::rate > > GetLinearInUMeshValues()
static boost::shared_ptr< CellBasedDiscreteSource< DIM > > Create()
units::quantity< unit::rate > mCellLinearInUValue
boost::shared_ptr< RegularGrid< DIM > > mpRegularGrid
void SetConstantInUConsumptionRatePerCell(units::quantity< unit::molar_flow_rate > value)
std::vector< units::quantity< unit::concentration_flow_rate > > GetConstantInUMeshValues()
std::vector< units::quantity< unit::rate > > GetLinearInURegularGridValues()
units::quantity< unit::molar_flow_rate > mCellConstantInUValue
boost::shared_ptr< DiscreteContinuumMesh< DIM, DIM > > mpMesh
virtual ~CellBasedDiscreteSource()
std::vector< units::quantity< unit::concentration_flow_rate > > GetConstantInURegularGridValues()
void SetLinearInUConsumptionRatePerCell(units::quantity< unit::rate > value)