Skip to content
Snippets Groups Projects
Commit fd8e8641 authored by Thomas Toulorge's avatar Thomas Toulorge
Browse files

Fixed compilation problem due to changes not committed.

parent ebe05746
No related branches found
No related tags found
No related merge requests found
...@@ -57,6 +57,15 @@ MFace::MFace(std::vector<MVertex*> v) ...@@ -57,6 +57,15 @@ MFace::MFace(std::vector<MVertex*> v)
sortVertices(_v,_si); sortVertices(_v,_si);
} }
double MFace::approximateArea() const
{
SPoint3 p0 = _v[0]->point(), p1 = _v[1]->point(), p2 = _v[2]->point();
double a = triangle_area(p0, p1, p2);
if (_v.size() == 3) return a;
a += triangle_area(p0, p2, _v[3]->point());
return a;
}
SVector3 MFace::normal() const SVector3 MFace::normal() const
{ {
double n[3]; double n[3];
......
...@@ -43,6 +43,7 @@ class MFace { ...@@ -43,6 +43,7 @@ class MFace {
for(int i = 0; i < getNumVertices(); i++) for(int i = 0; i < getNumVertices(); i++)
verts[i] = getSortedVertex(i); verts[i] = getSortedVertex(i);
} }
double approximateArea() const;
SVector3 normal() const; SVector3 normal() const;
SVector3 tangent(int num) const SVector3 tangent(int num) const
{ {
......
...@@ -317,13 +317,13 @@ void getOppositeFacePrism(MElement *el, const MFace &elBaseFace, ...@@ -317,13 +317,13 @@ void getOppositeFacePrism(MElement *el, const MFace &elBaseFace,
elTopFace = MFace(topVert); elTopFace = MFace(topVert);
// Compute min. (side faces) and max. (top face) face areas // Compute min. (side faces) and max. (top face) face areas
faceSurfMax = elTopFace.area(); faceSurfMax = elTopFace.approximateArea();
MFace sideFace0 = el->getFace(2); MFace sideFace0 = el->getFace(2);
faceSurfMin = sideFace0.area(); faceSurfMin = sideFace0.approximateArea();
MFace sideFace1 = el->getFace(3); MFace sideFace1 = el->getFace(3);
faceSurfMin = std::min(faceSurfMin, sideFace1.area()); faceSurfMin = std::min(faceSurfMin, sideFace1.approximateArea());
MFace sideFace2 = el->getFace(4); MFace sideFace2 = el->getFace(4);
faceSurfMin = std::min(faceSurfMin, sideFace2.area()); faceSurfMin = std::min(faceSurfMin, sideFace2.approximateArea());
} }
...@@ -364,15 +364,15 @@ void getOppositeFaceHex(MElement *el, const MFace &elBaseFace, MFace &elTopFace, ...@@ -364,15 +364,15 @@ void getOppositeFaceHex(MElement *el, const MFace &elBaseFace, MFace &elTopFace,
elTopFace = MFace(topVert); elTopFace = MFace(topVert);
// Compute min. (side faces) and max. (top face) face areas // Compute min. (side faces) and max. (top face) face areas
faceSurfMax = elTopFace.area(); faceSurfMax = elTopFace.approximateArea();
MFace sideFace0 = el->getFace(sideFace[0]); MFace sideFace0 = el->getFace(sideFace[0]);
faceSurfMin = sideFace0.area(); faceSurfMin = sideFace0.approximateArea();
MFace sideFace1 = el->getFace(sideFace[1]); MFace sideFace1 = el->getFace(sideFace[1]);
faceSurfMin = std::min(faceSurfMin, sideFace1.area()); faceSurfMin = std::min(faceSurfMin, sideFace1.approximateArea());
MFace sideFace2 = el->getFace(sideFace[2]); MFace sideFace2 = el->getFace(sideFace[2]);
faceSurfMin = std::min(faceSurfMin, sideFace2.area()); faceSurfMin = std::min(faceSurfMin, sideFace2.approximateArea());
MFace sideFace3 = el->getFace(sideFace[3]); MFace sideFace3 = el->getFace(sideFace[3]);
faceSurfMin = std::min(faceSurfMin, sideFace3.area()); faceSurfMin = std::min(faceSurfMin, sideFace3.approximateArea());
} }
...@@ -392,7 +392,7 @@ void getOppositeFaceTet(MElement *el, const MFace &elBaseFace, MFace &elTopFace, ...@@ -392,7 +392,7 @@ void getOppositeFaceTet(MElement *el, const MFace &elBaseFace, MFace &elTopFace,
for (int iElFace = 0; iElFace < el->getNumFaces(); iElFace++) { for (int iElFace = 0; iElFace < el->getNumFaces(); iElFace++) {
if (iElFace != iElBaseFace) { if (iElFace != iElBaseFace) {
MFace faceTest = el->getFace(iElFace); MFace faceTest = el->getFace(iElFace);
const double faceSurfTest = faceTest.area(); const double faceSurfTest = faceTest.approximateArea();
if (faceSurfTest < faceSurfMin) faceSurfMin = faceSurfTest; if (faceSurfTest < faceSurfMin) faceSurfMin = faceSurfTest;
if (faceSurfTest > faceSurfMax) { if (faceSurfTest > faceSurfMax) {
faceSurfMax = faceSurfTest; faceSurfMax = faceSurfTest;
......
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