mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 05:50:32 +05:00
Ensure sequential/parallel consistency in generated mesh
This commit is contained in:
parent
4d04dcd97d
commit
f603fef130
@ -546,9 +546,6 @@ double MeshOptimize3d :: SplitImproveEdge (Table<ElementIndex,PointIndex> & elem
|
||||
if (!mesh.LegalTet (oldel)) bad1 += GetLegalPenalty();
|
||||
if (!mesh.LegalTet (newel1)) bad2 += GetLegalPenalty();
|
||||
if (!mesh.LegalTet (newel2)) bad2 += GetLegalPenalty();
|
||||
|
||||
if( newel1.Volume(mesh.Points()) < 0.0 || newel2.Volume(mesh.Points()) < 0.0)
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
d_badness = bad2-bad1;
|
||||
@ -567,9 +564,6 @@ double MeshOptimize3d :: SplitImproveEdge (Table<ElementIndex,PointIndex> & elem
|
||||
Element newel1 = oldel;
|
||||
Element newel2 = oldel;
|
||||
|
||||
oldel.Touch();
|
||||
oldel.Delete();
|
||||
|
||||
newel1.Touch();
|
||||
newel2.Touch();
|
||||
|
||||
@ -579,6 +573,12 @@ double MeshOptimize3d :: SplitImproveEdge (Table<ElementIndex,PointIndex> & elem
|
||||
if (newel2[l] == pi1) newel2[l] = pinew;
|
||||
}
|
||||
|
||||
if( newel1.Volume(mesh.Points()) < 0.0 || newel2.Volume(mesh.Points()) < 0.0)
|
||||
return 0.0;
|
||||
|
||||
oldel.Touch();
|
||||
oldel.Delete();
|
||||
|
||||
mesh.AddVolumeElement (newel1);
|
||||
mesh.AddVolumeElement (newel2);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user