36 #include "VesselSegment.hpp" 37 #include "DensityMap.hpp" 38 #include "GeometryTools.hpp" 39 #include "UnitCollection.hpp" 41 template<
unsigned DIM>
48 template<
unsigned DIM>
55 template<
unsigned DIM>
61 template<
unsigned DIM>
69 unsigned number_of_points = this->
mpRegularGrid->GetNumberOfPoints();
73 units::quantity<unit::length> spacing = this->
mpRegularGrid->GetSpacing();
74 double dimensionless_spacing = spacing/this->
mpRegularGrid->GetReferenceLengthScale();
76 std::vector<double> vessel_solution(number_of_points, 0.0);
77 std::vector<boost::shared_ptr<VesselSegment<DIM> > > segments;
80 segments = this->
mpNetwork->GetVesselSegments();
81 for (
unsigned i = 0; i < extents_z; i++)
83 for (
unsigned j = 0; j < extents_y; j++)
85 for (
unsigned k = 0; k < extents_x; k++)
87 unsigned grid_index = this->
mpRegularGrid->Get1dGridIndex(k, j, i);
88 for (
unsigned idx = 0; idx < segments.size(); idx++)
90 vessel_solution[grid_index] += LengthOfLineInBox(segments[idx]->GetNode(0)->rGetLocation(),
91 segments[idx]->GetNode(1)->rGetLocation(),
94 vessel_solution[grid_index] /= std::pow(dimensionless_spacing,3);
boost::shared_ptr< RegularGrid< DIM > > mpRegularGrid
vtkSmartPointer< vtkImageData > mpVtkSolution
virtual void UpdateSolution(std::vector< double > &rData)
static boost::shared_ptr< DensityMap< DIM > > Create()
boost::shared_ptr< VesselNetwork< DIM > > mpNetwork