mesh bisection with onlyonce option. otherwise, tet-bisection performs three bisection steps to obtain h/2

This commit is contained in:
Joachim Schoeberl 2021-02-19 15:06:13 +01:00
parent 75e6c8217f
commit 28c4b78410
4 changed files with 7 additions and 5 deletions

View File

@ -347,7 +347,7 @@ namespace netgen
void EnableTable (string name, bool set);
void Refine (NG_REFINEMENT_TYPE reftype,
void Refine (NG_REFINEMENT_TYPE reftype, bool onlyonce,
void (*taskmanager)(function<void(int,int)>) = &DummyTaskManager2,
void (*tracer)(string, bool) = &DummyTracer2);

View File

@ -1156,7 +1156,7 @@ namespace netgen
mesh->VolumeElement(elnr+1).SetRefinementFlag(flag);
}
void Ngx_Mesh :: Refine (NG_REFINEMENT_TYPE reftype,
void Ngx_Mesh :: Refine (NG_REFINEMENT_TYPE reftype, bool onlyonce,
void (*task_manager)(function<void(int,int)>),
NgTracer tracer)
{
@ -1166,6 +1166,7 @@ namespace netgen
biopt.usemarkedelements = 1;
biopt.refine_p = 0;
biopt.refine_hp = 0;
biopt.onlyonce = onlyonce;
if (reftype == NG_REFINE_P)
biopt.refine_p = 1;
if (reftype == NG_REFINE_HP)

View File

@ -3019,7 +3019,7 @@ namespace netgen
{
cnttet++;
mtets.Elem(cnttet).marked =
3 * mesh.VolumeElement(i).TestRefinementFlag();
(opt.onlyonce ? 3 : 1) * mesh.VolumeElement(i).TestRefinementFlag();
if (mtets.Elem(cnttet).marked)
cntm++;
}
@ -3038,7 +3038,7 @@ namespace netgen
for (int i = 1; i <= mtets.Size(); i++)
{
mtets.Elem(i).marked =
3 * mesh.VolumeElement(i).TestRefinementFlag();
(opt.onlyonce ? 1 : 3) * mesh.VolumeElement(i).TestRefinementFlag();
if (mtets.Elem(i).marked)
cntm++;
}
@ -3068,7 +3068,7 @@ namespace netgen
{
cnttrig++;
mtris.Elem(cnttrig).marked =
mesh.SurfaceElement(i).TestRefinementFlag() ? 2 : 0;
mesh.SurfaceElement(i).TestRefinementFlag() ? (opt.onlyonce ? 1 : 2) : 0;
// mtris.Elem(cnttrig).marked = 0;
if (mtris.Elem(cnttrig).marked)
cntm++;

View File

@ -12,6 +12,7 @@ public:
int usemarkedelements;
bool refine_hp;
bool refine_p;
bool onlyonce = false;
NgTaskManager task_manager = &DummyTaskManager;
NgTracer tracer = &DummyTracer;
DLL_HEADER BisectionOptions ();