35 #ifndef PAPILLARYFIBRECALCULATOR_HPP_
36 #define PAPILLARYFIBRECALCULATOR_HPP_
39 #include "TetrahedralMesh.hpp"
49 friend class TestPapillaryFibreCalculator;
131 for(
unsigned i=0; i<fibre_orientations.size(); i++)
136 return fibre_orientations;
142 c_vector<double, 3> centroid = (
mrMesh.
GetElement(elementIndex))->CalculateCentroid();
144 c_vector<double,3> coordinates;
146 double nearest_r_squared=DBL_MAX;
147 unsigned nearest_face_node = 0;
152 unsigned bound_node_index = (*bound_node_iter)->GetIndex();
153 coordinates=
mrMesh.
GetNode(bound_node_index)->rGetLocation();
156 double r_squared = norm_2(centroid-coordinates);
158 if (r_squared < nearest_r_squared)
160 nearest_r_squared = r_squared;
161 nearest_face_node = bound_node_index;
166 coordinates =
mrMesh.
GetNode(nearest_face_node)->rGetLocation();
167 c_vector<double,3> radial_vector = coordinates-centroid;
168 return radial_vector;
178 unsigned element_index = iter->GetIndex();
193 const double sigma = 0.05;
194 const double r_max = 0.1;
195 double g_factor_sum = 0;
204 c_vector<double, 3> centroid = elem_iter->CalculateCentroid();
211 c_vector<double, 3> centroid_2 = iter_2->CalculateCentroid();
212 double r = norm_2(centroid-centroid_2);
215 g_factor = exp(-r/(2*sigma*sigma));
217 g_factor_sum += g_factor;
ElementIterator GetElementIteratorBegin(bool skipDeletedElements=true)
ElementIterator GetElementIteratorEnd()
c_vector< double, 3 > CalculateEigenvectorForSmallestNonzeroEigenvalue(c_matrix< double, 3, 3 > &rA)
Node< SPACE_DIM > * GetNode(unsigned index) const
virtual unsigned GetNumElements() const
Element< ELEMENT_DIM, SPACE_DIM > * GetElement(unsigned index) const
BoundaryNodeIterator GetBoundaryNodeIteratorBegin() const
c_vector< double, 3 > GetRadiusVectorForOneElement(unsigned elementIndex)
std::vector< c_matrix< double, 3, 3 > > mSmoothedStructureTensors
void ConstructStructureTensors()
std::vector< c_vector< double, 3 > > CalculateFibreOrientations()
std::vector< c_matrix< double, 3, 3 > > mStructureTensors
PapillaryFibreCalculator(TetrahedralMesh< 3, 3 > &rMesh)
void SmoothStructureTensors()
BoundaryNodeIterator GetBoundaryNodeIteratorEnd() const
TetrahedralMesh< 3, 3 > & mrMesh
std::vector< c_vector< double, 3 > > mRadiusVectors