36 #include "VesselFlowProperties.hpp" 38 template<
unsigned DIM>
41 mUndergoingRegression(false),
42 mRemoveViaRegression(false),
43 mRegressionTime(DBL_MAX*
unit::seconds)
47 template<
unsigned DIM>
52 template<
unsigned DIM>
57 EXCEPTION(
"No vessel segments have been set for vessel flow property calculation.");
61 template<
unsigned DIM>
66 units::quantity<unit::dimensionless> value = 0.0;
67 for (
unsigned i = 0; i <
mSegments.size(); i++)
69 value +=
mSegments[i]->GetFlowProperties()->GetHaematocrit() / double(
mSegments.size());
74 template<
unsigned DIM>
79 units::quantity<unit::flow_rate> value = 0.0 * unit::metre_cubed_per_second;
80 for (
unsigned i = 0; i <
mSegments.size(); i++)
87 template<
unsigned DIM>
92 units::quantity<unit::flow_impedance> value = 0.0 * unit::pascal_second_per_metre_cubed;
93 for (
unsigned i = 0; i <
mSegments.size(); i++)
95 value +=
mSegments[i]->GetFlowProperties()->GetImpedance();
100 template<
unsigned DIM>
105 units::quantity<unit::dynamic_viscosity> value = 0.0 * unit::poiseuille;
106 for (
unsigned i = 0; i <
mSegments.size(); i++)
113 template<
unsigned DIM>
118 units::quantity<unit::pressure> value = 0.0 * unit::pascals;
119 for (
unsigned i = 0; i <
mSegments.size(); i++)
121 value +=
mSegments[i]->GetFlowProperties()->GetWallShearStress()/ double(
mSegments.size());
126 template<
unsigned DIM>
131 units::quantity<unit::rate> value = 0.0 * unit::per_second;
132 for (
unsigned i = 0; i <
mSegments.size(); i++)
134 value +=
mSegments[i]->GetFlowProperties()->GetGrowthStimulus()/ double(
mSegments.size());
139 template<
unsigned DIM>
142 std::map<std::string, double> output_data;
143 output_data[
"Vessel Impedance kg/m^4/s"] = this->
GetImpedance() / unit::pascal_second_per_metre_cubed;
145 output_data[
"Vessel Flow Rate m^3/s"] = this->
GetFlowRate() / unit::metre_cubed_per_second;
146 output_data[
"Absolute Vessel Flow Rate m^3/s"] = fabs(this->
GetFlowRate()) / unit::metre_cubed_per_second;
147 output_data[
"Vessel Viscosity Pa.s"] = this->
GetViscosity() / unit::poiseuille;
148 output_data[
"Vessel Wall Shear Stress Pa"] = this->
GetWallShearStress() / unit::pascals;
149 output_data[
"Vessel Growth Stimulus s^-1"] = this->
GetGrowthStimulus() / unit::per_second;
150 output_data[
"Vessel Time Until Regression s"] = this->
mRegressionTime / unit::seconds;
154 template<
unsigned DIM>
160 template<
unsigned DIM>
163 if (SimulationTime::Instance()->GetTime()*simulationReferenceTime >= this->
mRegressionTime)
176 template<
unsigned DIM>
181 for (
unsigned i = 0; i <
mSegments.size(); i++)
183 mSegments[i]->GetFlowProperties()->SetHaematocrit(haematocrit);
187 template<
unsigned DIM>
192 for (
unsigned i = 0; i <
mSegments.size(); i++)
194 mSegments[i]->GetFlowProperties()->SetFlowRate(haematocrit);
199 template<
unsigned DIM>
204 for (
unsigned i = 0; i <
mSegments.size(); i++)
210 template<
unsigned DIM>
215 for (
unsigned i = 0; i <
mSegments.size(); i++)
217 mSegments[i]->GetFlowProperties()->SetViscosity(value);
221 template<
unsigned DIM>
226 for (
unsigned i = 0; i <
mSegments.size(); i++)
228 mSegments[i]->GetFlowProperties()->SetWallShearStress(value);
232 template<
unsigned DIM>
237 for (
unsigned i = 0; i <
mSegments.size(); i++)
239 mSegments[i]->GetFlowProperties()->SetGrowthStimulus(value);
243 template<
unsigned DIM>
250 EXCEPTION(
"SetTimeUntilRegression(time) called when already undergoing regression");
254 this->
mRegressionTime = SimulationTime::Instance()->GetTime()*simulationReferenceTime + time;
257 template<
unsigned DIM>
261 if(time<DBL_MAX*unit::seconds)
267 template<
unsigned DIM>
273 template<
unsigned DIM>
281 template<
unsigned DIM>
std::map< std::string, double > GetOutputData() const
bool mRemoveViaRegression
void UpdateSegments(std::vector< boost::shared_ptr< VesselSegment< DIM > > > segments)
void SetWallShearStress(units::quantity< unit::pressure > wallShear)
void SetHaematocrit(units::quantity< unit::dimensionless > haematocrit)
units::quantity< unit::flow_impedance > GetImpedance() const
units::quantity< unit::pressure > GetWallShearStress() const
bool HasVesselRegressed(units::quantity< unit::time > simulationReferenceTime)
void SetGrowthStimulus(units::quantity< unit::rate > stimulus)
void CheckSegments() const
void SetTimeUntilRegression(units::quantity< unit::time > time, units::quantity< unit::time > simulationReferenceTime)
void SetViscosity(units::quantity< unit::dynamic_viscosity > viscosity)
void SetRegressionTime(units::quantity< unit::time > time)
units::quantity< unit::time > GetRegressionTime() const
bool HasRegressionTimerStarted()
bool mUndergoingRegression
units::quantity< unit::dimensionless > GetHaematocrit() const
std::vector< boost::shared_ptr< VesselSegment< DIM > > > mSegments
void ResetRegressionTimer()
units::quantity< unit::time > mRegressionTime
units::quantity< unit::dynamic_viscosity > GetViscosity() const
units::quantity< unit::rate > GetGrowthStimulus() const
units::quantity< unit::flow_rate > GetFlowRate() const
void SetImpedance(units::quantity< unit::flow_impedance > impedance)
void SetFlowRate(units::quantity< unit::flow_rate > flowRate)