cellNormal[2] = a[0] * b[1] - a[1] * b[0];
}
+double NodeCurvatureCalculator::computeAverageDistance(mcIdType nodeId, const std::vector<mcIdType> &neighborIds) const
+{
+ double distance = 0.0;
+ std::array<double, 3>
+ nodeCoords = nodes->getCoordinates(nodeId);
+ for (size_t i = 0; i < neighborIds.size(); ++i)
+ {
+ std::array<double, 3> neighborCoords = nodes->getCoordinates(neighborIds[i]);
+ double distanceToNeighbor = 0.0;
+ for (size_t j = 0; j < 3; ++j)
+ distanceToNeighbor += pow(neighborCoords[j] - nodeCoords[j], 2);
+ distance += sqrt(distanceToNeighbor);
+ }
+ return distance / (double)neighborIds.size();
+}
+
std::vector<double> NodeCurvatureCalculator::computeDiscreteCurvatures(
mcIdType nodeId,
const std::vector<mcIdType> &neighborIds) const
const std::array<double, 3> &normal,
const std::array<double, 3> &e1) const;
void computeCellNormal(const std::vector<mcIdType> &nodeIds, std::array<double, 3> &cellNormal) const;
+ double computeAverageDistance(mcIdType nodeId, const std::vector<mcIdType> &neighborIds) const;
std::vector<double> computeDiscreteCurvatures(mcIdType nodeId, const std::vector<mcIdType> &neighborIds) const;
double computeDiscreteCurvature(mcIdType nodeId, mcIdType neighborId) const;
std::vector<double> computeTangentDirections(mcIdType nodeId, const std::vector<mcIdType> &neighborIds) const;