39 #include "AbstractStructuralAdaptationSolver.hpp" 40 #include "BaseUnits.hpp" 42 template<
unsigned DIM>
45 mTimeIncrement(1.e-4 *
unit::seconds),
46 mReferenceTimeScale(
BaseUnits::Instance()->GetReferenceTimeScale()),
55 template<
unsigned DIM>
61 template<
unsigned DIM>
67 template<
unsigned DIM>
73 template<
unsigned DIM>
79 template<
unsigned DIM>
85 template<
unsigned DIM>
91 template<
unsigned DIM>
97 template<
unsigned DIM>
103 template<
unsigned DIM>
109 template<
unsigned DIM>
115 template<
unsigned DIM>
120 double max_radius_relative_change = 1.0;
121 unsigned iteration = 0;
122 units::quantity<unit::time> time = 0.0 * unit::seconds;
128 out <<
"#Iteration Maximum relative change in radius in network\n\n";
131 std::vector<boost::shared_ptr<VesselSegment<DIM> > > segments =
mpVesselNetwork->GetVesselSegments();
132 std::vector<units::quantity<unit::length> > previous_radii(segments.size());
133 for (
unsigned segment_index = 0; segment_index < segments.size(); segment_index++)
135 previous_radii[segment_index] = segments[segment_index]->GetRadius();
145 std::vector<double> relative_change(segments.size());
146 for (
unsigned segment_index = 0; segment_index < segments.size(); segment_index++)
148 units::quantity<unit::length> current_radius = segments[segment_index]->GetRadius();
149 relative_change[segment_index] = fabs(1.0 - current_radius / previous_radii[segment_index]);
150 previous_radii[segment_index] = current_radius;
153 max_radius_relative_change = *(std::max_element(relative_change.begin(), relative_change.end()));
156 out << std::setw(6) << iteration << std::setw(20) << max_radius_relative_change <<
"\n";
165 template<
unsigned DIM>
171 template<
unsigned DIM>
178 out <<
"\nModule: AbstractStructuralAdaptationSolver\n";
179 out <<
"\n---------------\n";
void SetOutputFileName(const std::string &rFilename)
std::string mOutputFileName
AbstractStructuralAdaptationSolver()
void SetVesselNetwork(boost::shared_ptr< VesselNetwork< DIM > > pNetwork)
units::quantity< unit::time > mTimeIncrement
void SetTimeIncrement(units::quantity< unit::time > timeIncrement)
bool GetWriteOutput() const
std::string GetOutputFileName() const
virtual ~AbstractStructuralAdaptationSolver()
units::quantity< unit::time > GetTimeIncrement() const
double GetTolerance() const
boost::shared_ptr< VesselNetwork< DIM > > mpVesselNetwork
void SetMaxIterations(unsigned iterations)
void SetWriteOutput(bool writeFlag)
void SetTolerance(double tolerance)
units::quantity< unit::time > mReferenceTimeScale