Chaste  Build::
SegmentFlowProperties.cpp
1 /*
2 
3 Copyright (c) 2005-2016, University of Oxford.
4  All rights reserved.
5 
6  University of Oxford means the Chancellor, Masters and Scholars of the
7  University of Oxford, having an administrative office at Wellington
8  Square, Oxford OX1 2JD, UK.
9 
10  This file is part of Chaste.
11 
12  Redistribution and use in source and binary forms, with or without
13  modification, are permitted provided that the following conditions are met:
14  * Redistributions of source code must retain the above copyright notice,
15  this list of conditions and the following disclaimer.
16  * Redistributions in binary form must reproduce the above copyright notice,
17  this list of conditions and the following disclaimer in the documentation
18  and/or other materials provided with the distribution.
19  * Neither the name of the University of Oxford nor the names of its
20  contributors may be used to endorse or promote products derived from this
21  software without specific prior written permission.
22 
23  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 
34  */
35 
36 #include "SegmentFlowProperties.hpp"
37 
38 template<unsigned DIM>
40  mHaematocrit(0.0),
41  mFlowRate(0.0*unit::metre_cubed_per_second),
42  mImpedance(0.0*unit::pascal_second_per_metre_cubed),
43  mViscosity(0.0*unit::poiseuille),
44  mWallShearStress(0.0*unit::pascals),
45  mStimulus(0.0*unit::per_second)
46 {
47 }
48 
49 template<unsigned DIM>
51 {
52 }
53 
54 template<unsigned DIM>
55 units::quantity<unit::dimensionless> SegmentFlowProperties<DIM>::GetHaematocrit() const
56 {
57  return mHaematocrit;
58 }
59 
60 template<unsigned DIM>
61 units::quantity<unit::flow_rate> SegmentFlowProperties<DIM>::GetFlowRate() const
62 {
63  return mFlowRate;
64 }
65 
66 template<unsigned DIM>
67 units::quantity<unit::flow_impedance> SegmentFlowProperties<DIM>::GetImpedance() const
68 {
69  return mImpedance;
70 }
71 
72 template<unsigned DIM>
73 units::quantity<unit::dynamic_viscosity> SegmentFlowProperties<DIM>::GetViscosity() const
74 {
75  return mViscosity;
76 }
77 
78 template<unsigned DIM>
79 units::quantity<unit::pressure> SegmentFlowProperties<DIM>::GetWallShearStress() const
80 {
81  return mWallShearStress;
82 }
83 
84 template<unsigned DIM>
85 units::quantity<unit::rate> SegmentFlowProperties<DIM>::GetGrowthStimulus() const
86 {
87  return mStimulus;
88 }
89 
90 template<unsigned DIM>
91 std::map<std::string, double> SegmentFlowProperties<DIM>::GetOutputData() const
92 {
93  std::map<std::string, double> output_data;
94  output_data["Segment Haematocrit"] = this->GetHaematocrit();
95  output_data["Segment Flow Rate m^3/s"] = this->GetFlowRate() / unit::metre_cubed_per_second;
96  output_data["Segment Impedance kg/m^4/s"] = this->GetImpedance() / unit::pascal_second_per_metre_cubed;
97  output_data["Segment Viscosity Pa.s"] = this->GetViscosity() / unit::poiseuille;
98  output_data["Segment Wall Shear Stress Pa"] = this->GetWallShearStress() / unit::pascals;
99  output_data["Segment Growth Stimulus s^-1"] = this->GetGrowthStimulus() / unit::per_second;
100  return output_data;
101 }
102 
103 template<unsigned DIM>
104 void SegmentFlowProperties<DIM>::SetHaematocrit(units::quantity<unit::dimensionless> haematocrit)
105 {
106  mHaematocrit = haematocrit;
107 }
108 
109 template<unsigned DIM>
110 void SegmentFlowProperties<DIM>::SetFlowRate(units::quantity<unit::flow_rate> flowRate)
111 {
112  mFlowRate = flowRate;
113 }
114 
115 template<unsigned DIM>
116 void SegmentFlowProperties<DIM>::SetImpedance(units::quantity<unit::flow_impedance> impedance)
117 {
118  mImpedance = impedance;
119 }
120 
121 template<unsigned DIM>
122 void SegmentFlowProperties<DIM>::SetViscosity(units::quantity<unit::dynamic_viscosity> viscosity)
123 {
124  mViscosity = viscosity;
125 }
126 
127 template<unsigned DIM>
128 void SegmentFlowProperties<DIM>::SetWallShearStress(units::quantity<unit::pressure> value)
129 {
130  mWallShearStress = value;
131 }
132 
133 template<unsigned DIM>
134 void SegmentFlowProperties<DIM>::SetGrowthStimulus(units::quantity<unit::rate> value)
135 {
136  mStimulus = value;
137 }
138 
139 // Explicit instantiation
140 template class SegmentFlowProperties<2>;
141 template class SegmentFlowProperties<3>;
142 
143 #include "SerializationExportWrapperForCpp.hpp"
144 EXPORT_TEMPLATE_CLASS1(SegmentFlowProperties, 2)
145 EXPORT_TEMPLATE_CLASS1(SegmentFlowProperties, 3)
units::quantity< unit::rate > GetGrowthStimulus() const
units::quantity< unit::flow_rate > GetFlowRate() const
units::quantity< unit::flow_impedance > GetImpedance() const
units::quantity< unit::pressure > GetWallShearStress() const
void SetWallShearStress(units::quantity< unit::pressure > wallShear)
units::quantity< unit::flow_rate > mFlowRate
void SetGrowthStimulus(units::quantity< unit::rate > stimulus)
units::quantity< unit::dynamic_viscosity > mViscosity
void SetFlowRate(units::quantity< unit::flow_rate > flowRate)
units::quantity< unit::dimensionless > GetHaematocrit() const
units::quantity< unit::flow_impedance > mImpedance
units::quantity< unit::pressure > mWallShearStress
void SetViscosity(units::quantity< unit::dynamic_viscosity > viscosity)
void SetHaematocrit(units::quantity< unit::dimensionless > haematocrit)
void SetImpedance(units::quantity< unit::flow_impedance > impedance)
std::map< std::string, double > GetOutputData() const
units::quantity< unit::dimensionless > mHaematocrit
units::quantity< unit::dynamic_viscosity > GetViscosity() const
units::quantity< unit::rate > mStimulus