mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 22:00:33 +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 (oldel)) bad1 += GetLegalPenalty();
|
||||||
if (!mesh.LegalTet (newel1)) bad2 += GetLegalPenalty();
|
if (!mesh.LegalTet (newel1)) bad2 += GetLegalPenalty();
|
||||||
if (!mesh.LegalTet (newel2)) 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;
|
d_badness = bad2-bad1;
|
||||||
@ -567,9 +564,6 @@ double MeshOptimize3d :: SplitImproveEdge (Table<ElementIndex,PointIndex> & elem
|
|||||||
Element newel1 = oldel;
|
Element newel1 = oldel;
|
||||||
Element newel2 = oldel;
|
Element newel2 = oldel;
|
||||||
|
|
||||||
oldel.Touch();
|
|
||||||
oldel.Delete();
|
|
||||||
|
|
||||||
newel1.Touch();
|
newel1.Touch();
|
||||||
newel2.Touch();
|
newel2.Touch();
|
||||||
|
|
||||||
@ -579,6 +573,12 @@ double MeshOptimize3d :: SplitImproveEdge (Table<ElementIndex,PointIndex> & elem
|
|||||||
if (newel2[l] == pi1) newel2[l] = pinew;
|
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 (newel1);
|
||||||
mesh.AddVolumeElement (newel2);
|
mesh.AddVolumeElement (newel2);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user