35#ifndef PAPILLARYFIBRECALCULATOR_HPP_
36#define PAPILLARYFIBRECALCULATOR_HPP_
39#include "TetrahedralMesh.hpp"
49friend 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;
BoundaryNodeIterator GetBoundaryNodeIteratorBegin() const
std::vector< Node< SPACE_DIM > * >::const_iterator BoundaryNodeIterator
Node< SPACE_DIM > * GetNode(unsigned index) const
BoundaryNodeIterator GetBoundaryNodeIteratorEnd() const
ElementIterator GetElementIteratorBegin(bool skipDeletedElements=true)
ElementIterator GetElementIteratorEnd()
Element< ELEMENT_DIM, SPACE_DIM > * GetElement(unsigned index) const
virtual unsigned GetNumElements() const
void ConstructStructureTensors()
void SmoothStructureTensors()
PapillaryFibreCalculator(TetrahedralMesh< 3, 3 > &rMesh)
std::vector< c_matrix< double, 3, 3 > > mSmoothedStructureTensors
std::vector< c_matrix< double, 3, 3 > > mStructureTensors
c_vector< double, 3 > GetRadiusVectorForOneElement(unsigned elementIndex)
std::vector< c_vector< double, 3 > > CalculateFibreOrientations()
TetrahedralMesh< 3, 3 > & mrMesh
std::vector< c_vector< double, 3 > > mRadiusVectors