35 #ifndef PAPILLARYFIBRECALCULATOR_HPP_
36 #define PAPILLARYFIBRECALCULATOR_HPP_
39 #include "TetrahedralMesh.hpp"
49 friend class TestPapillaryFibreCalculator;
130 for (
unsigned i=0; i<fibre_orientations.size(); i++)
135 return fibre_orientations;
141 c_vector<double, 3> centroid = (
mrMesh.
GetElement(elementIndex))->CalculateCentroid();
143 c_vector<double,3> coordinates;
145 double nearest_r_squared=DBL_MAX;
146 unsigned nearest_face_node = 0;
151 unsigned bound_node_index = (*bound_node_iter)->GetIndex();
152 coordinates=
mrMesh.
GetNode(bound_node_index)->rGetLocation();
155 double r_squared = norm_2(centroid-coordinates);
157 if (r_squared < nearest_r_squared)
159 nearest_r_squared = r_squared;
160 nearest_face_node = bound_node_index;
165 coordinates =
mrMesh.
GetNode(nearest_face_node)->rGetLocation();
166 c_vector<double,3> radial_vector = coordinates-centroid;
167 return radial_vector;
177 unsigned element_index = iter->GetIndex();
192 const double sigma = 0.05;
193 const double r_max = 0.1;
194 double g_factor_sum = 0;
203 c_vector<double, 3> centroid = elem_iter->CalculateCentroid();
210 c_vector<double, 3> centroid_2 = iter_2->CalculateCentroid();
211 double r = norm_2(centroid-centroid_2);
214 g_factor = exp(-r/(2*sigma*sigma));
216 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