Skip to content
Snippets Groups Projects
Commit 71132611 authored by Tom Fischer's avatar Tom Fischer
Browse files

[MeshLib/NumLib] MathLib::calcTriangleArea() -> GeoLib::calcTriangleArea().

parent 2e764574
No related branches found
No related tags found
No related merge requests found
......@@ -90,8 +90,8 @@ TemplateQuad<NNODES,CELLQUADTYPE>::~TemplateQuad()
template <unsigned NNODES, CellType CELLQUADTYPE>
double TemplateQuad<NNODES,CELLQUADTYPE>::computeVolume()
{
return MathLib::calcTriangleArea(_nodes[0]->getCoords(), _nodes[1]->getCoords(), _nodes[2]->getCoords())
+ MathLib::calcTriangleArea(_nodes[2]->getCoords(), _nodes[3]->getCoords(), _nodes[0]->getCoords());
return GeoLib::calcTriangleArea(*_nodes[0], *_nodes[1], *_nodes[2])
+ GeoLib::calcTriangleArea(*_nodes[2], *_nodes[3], *_nodes[0]);
}
template <unsigned NNODES, CellType CELLQUADTYPE>
......
......@@ -22,6 +22,7 @@
#include "MeshEnums.h"
#include "MathTools.h"
#include "AnalyticalGeometry.h"
namespace MeshLib {
......@@ -121,7 +122,7 @@ protected:
/// Calculates the area of the triangle by returning half of the area of the corresponding parallelogram.
double computeVolume()
{
return MathLib::calcTriangleArea(_nodes[0]->getCoords(), _nodes[1]->getCoords(), _nodes[2]->getCoords());
return GeoLib::calcTriangleArea(*_nodes[0], *_nodes[1], *_nodes[2]);
}
protected:
......
......@@ -70,10 +70,10 @@ double LinearInterpolationOnSurface::interpolateInTri(const GeoLib::Triangle &tr
std::vector<GeoLib::Point*> p_pnts = {{&pnts[0], &pnts[1], &pnts[2]}};
GeoLib::rotatePointsToXY(p_pnts);
const double* v1 = pnts[0].getCoords();
const double* v2 = pnts[1].getCoords();
const double* v3 = pnts[2].getCoords();
const double area = MathLib::calcTriangleArea(v1, v2, v3);
GeoLib::Point const& v1(pnts[0]);
GeoLib::Point const& v2(pnts[1]);
GeoLib::Point const& v3(pnts[2]);
const double area = GeoLib::calcTriangleArea(v1, v2, v3);
if (area==.0) {
// take average if all points have the same coordinates
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment