Ensure sequential/parallel consistency in generated mesh

This commit is contained in:
Matthias Hochsteger 2024-09-13 13:18:58 +02:00
parent 4d04dcd97d
commit f603fef130

View File

@ -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);
}