Commit 4ba05f8e authored by Benoît LÉ's avatar Benoît LÉ

Bug correction following removing of xMesh::del + bug correction

In TLSGeomInterfaceSignedVectorDistanceFunction, the link-on-front-based modes
merging uses an xAttachedDataManagerAOMD (called mode_cut_edge in the code) to store, for each iso-zero node of the
Fast Marching mesh, the parent edge (or node) of the computing mesh. This xAttachedDataManagerAOMD
is created at the begining of the FM mesh creation, when the iso-zero nodes are
copied into the FM mesh. Then the FM mesh is created, and after that the modes
are merged.

The problem is that during the FM mesh creation, some nodes are merged, which
may in some cases delete some mEntity*, which are keys in mode_cut_edge. Before
the commit on xMesh::del, it was not a problem, probably because in the previous
version, the pointer to mEntity was not deleted after calling xMesh::del.
However after this commit the computation abort in mode_cut_edge destructor (probably because we try to call
a delete on an mEntity which does not exists anymore).

This has been fixed by properly deleting data from mode_cut_edge before deleting
the associated key.

Also, minor fix when dealing with warped nodes.
parent 0685530e
......@@ -1055,6 +1055,13 @@ void TLSGeomInterfaceSignedVectorDistanceFunction::updateDomain(
known_to_update.deleteData(*other);
if (!known_to_update.getData(*cur)) known_to_update.setData(*cur) = 0.;
}
#if NEWMERGING == 3
if (mode_cut_edge.getData(*other))
{
if (!mode_cut_edge.getData(*cur)) mode_cut_edge.setData(*cur) = *(mode_cut_edge.getData(*other));
mode_cut_edge.deleteData(*other);
}
#endif
FM_mesh->clear(other);
FM_mesh->getMesh().DEL(other);
}
......@@ -1136,6 +1143,13 @@ void TLSGeomInterfaceSignedVectorDistanceFunction::updateDomain(
known_to_update.deleteData(*other);
if (!known_to_update.getData(*cur)) known_to_update.setData(*cur) = 0.;
}
#if NEWMERGING == 3
if (mode_cut_edge.getData(*other))
{
if (!mode_cut_edge.getData(*cur)) mode_cut_edge.setData(*cur) = *(mode_cut_edge.getData(*other));
mode_cut_edge.deleteData(*other);
}
#endif
FM_mesh->clear(other);
FM_mesh->getMesh().DEL(other);
break;
......@@ -1924,7 +1938,7 @@ void TLSGeomInterfaceSignedVectorDistanceFunction::updateDomain(
{
int i1 = data->first;
int i2 = data->second;
if (i1)
if (i1 > -1)
{
if (weigth.find(i1) == weigth.end())
{
......@@ -1937,7 +1951,7 @@ void TLSGeomInterfaceSignedVectorDistanceFunction::updateDomain(
total_weigth += nd;
}
}
if (i2)
if (i2 > -1)
{
if (weigth.find(i2) == weigth.end())
{
......@@ -2015,6 +2029,7 @@ void TLSGeomInterfaceSignedVectorDistanceFunction::updateDomain(
Pi_gamain_g.clear();
Pi_gamain_diag.AoperB(0, 0, *P, *P_gamain, [](double a, double b) { return (b) ? b : a; });
}
#endif
#ifdef TIMING_MONITORING_XTLS
dte.end(iddt0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment