Skip to content
Snippets Groups Projects
Commit e051f352 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

try to fix crash on MSVC

parent 6c7a5b0d
Branches
Tags
No related merge requests found
...@@ -2679,14 +2679,17 @@ double GFaceCompound::checkAspectRatio() const ...@@ -2679,14 +2679,17 @@ double GFaceCompound::checkAspectRatio() const
for(int k = 0; k < 3; k++){ for(int k = 0; k < 3; k++){
v[k] = t->getVertex(k); v[k] = t->getVertex(k);
} }
std::map<MVertex*,SPoint3>::const_iterator it0 = coordinates.find(v[0]);
std::map<MVertex*,SPoint3>::const_iterator it1 = coordinates.find(v[1]);
std::map<MVertex*,SPoint3>::const_iterator it2 = coordinates.find(v[2]);
double p0[3] = {v[0]->x(), v[0]->y(), v[0]->z()}; double p0[3] = {v[0]->x(), v[0]->y(), v[0]->z()};
double p1[3] = {v[1]->x(), v[1]->y(), v[1]->z()}; double p1[3] = {v[1]->x(), v[1]->y(), v[1]->z()};
double p2[3] = {v[2]->x(), v[2]->y(), v[2]->z()}; double p2[3] = {v[2]->x(), v[2]->y(), v[2]->z()};
double a_3D = fabs(triangle_area(p0, p1, p2)); double a_3D = fabs(triangle_area(p0, p1, p2));
area3D += a_3D; area3D += a_3D;
std::map<MVertex*,SPoint3>::const_iterator it0 = coordinates.find(v[0]);
std::map<MVertex*,SPoint3>::const_iterator it1 = coordinates.find(v[1]);
std::map<MVertex*,SPoint3>::const_iterator it2 = coordinates.find(v[2]);
if(it0 != coordinates.end() &&
it1 != coordinates.end() &&
it2 != coordinates.end()){
double q0[3] = {it0->second.x(), it0->second.y(), 0.0}; double q0[3] = {it0->second.x(), it0->second.y(), 0.0};
double q1[3] = {it1->second.x(), it1->second.y(), 0.0}; double q1[3] = {it1->second.x(), it1->second.y(), 0.0};
double q2[3] = {it2->second.x(), it2->second.y(), 0.0}; double q2[3] = {it2->second.x(), it2->second.y(), 0.0};
...@@ -2695,6 +2698,7 @@ double GFaceCompound::checkAspectRatio() const ...@@ -2695,6 +2698,7 @@ double GFaceCompound::checkAspectRatio() const
areaMin = std::min(areaMin, a_2D); areaMin = std::min(areaMin, a_2D);
} }
} }
}
std::list<GEdge*>::const_iterator it0 = _U0.begin(); std::list<GEdge*>::const_iterator it0 = _U0.begin();
double tot_length = 0.0; double tot_length = 0.0;
...@@ -2704,7 +2708,7 @@ double GFaceCompound::checkAspectRatio() const ...@@ -2704,7 +2708,7 @@ double GFaceCompound::checkAspectRatio() const
double AR = M_PI*area3D/(tot_length*tot_length); double AR = M_PI*area3D/(tot_length*tot_length);
if (areaMin > 0 && areaMin < limit && nb > 3) { if (nb > 3 && areaMin > 0 && areaMin < limit) {
Msg::Warning("Too small triangles in mapping (a_2D=%g)", areaMin); Msg::Warning("Too small triangles in mapping (a_2D=%g)", areaMin);
} }
else { else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment