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

Call setVolumePositive during initial meshing and mesh optimization, as they...

Call setVolumePositive during initial meshing and mesh optimization, as they can be performed independently
parent e736aaac
No related branches found
No related tags found
No related merge requests found
...@@ -671,6 +671,9 @@ static void Mesh3D(GModel *m) ...@@ -671,6 +671,9 @@ static void Mesh3D(GModel *m)
} }
} }
// Ensure that all volume Jacobians are positive
m->setAllVolumesPositive();
double t2 = Cpu(); double t2 = Cpu();
CTX::instance()->meshTimer[2] = t2 - t1; CTX::instance()->meshTimer[2] = t2 - t1;
Msg::StatusBar(true, "Done meshing 3D (%g s)", CTX::instance()->meshTimer[2]); Msg::StatusBar(true, "Done meshing 3D (%g s)", CTX::instance()->meshTimer[2]);
...@@ -683,6 +686,9 @@ void OptimizeMeshNetgen(GModel *m) ...@@ -683,6 +686,9 @@ void OptimizeMeshNetgen(GModel *m)
std::for_each(m->firstRegion(), m->lastRegion(), optimizeMeshGRegionNetgen()); std::for_each(m->firstRegion(), m->lastRegion(), optimizeMeshGRegionNetgen());
// Ensure that all volume Jacobians are positive
m->setAllVolumesPositive();
double t2 = Cpu(); double t2 = Cpu();
Msg::StatusBar(true, "Done optimizing 3D mesh with Netgen (%g s)", t2 - t1); Msg::StatusBar(true, "Done optimizing 3D mesh with Netgen (%g s)", t2 - t1);
} }
...@@ -694,6 +700,9 @@ void OptimizeMesh(GModel *m) ...@@ -694,6 +700,9 @@ void OptimizeMesh(GModel *m)
std::for_each(m->firstRegion(), m->lastRegion(), optimizeMeshGRegionGmsh()); std::for_each(m->firstRegion(), m->lastRegion(), optimizeMeshGRegionGmsh());
// Ensure that all volume Jacobians are positive
m->setAllVolumesPositive();
double t2 = Cpu(); double t2 = Cpu();
Msg::StatusBar(true, "Done optimizing 3D mesh (%g s)", t2 - t1); Msg::StatusBar(true, "Done optimizing 3D mesh (%g s)", t2 - t1);
} }
...@@ -782,8 +791,6 @@ void GenerateMesh(GModel *m, int ask) ...@@ -782,8 +791,6 @@ void GenerateMesh(GModel *m, int ask)
} }
} }
m->setAllVolumesPositive();
// Subdivide into quads or hexas // Subdivide into quads or hexas
if(m->getMeshStatus() == 2 && CTX::instance()->mesh.algoSubdivide == 1) if(m->getMeshStatus() == 2 && CTX::instance()->mesh.algoSubdivide == 1)
RefineMesh(m, CTX::instance()->mesh.secondOrderLinear, true); RefineMesh(m, CTX::instance()->mesh.secondOrderLinear, true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment