Commit b1fc814e authored by Benoît LÉ's avatar Benoît LÉ

[xTLS] Added frontExist function to TLSGeomInterface

This function tells if front (iso-zero mesh) exists or not. The implementation
is exactly the same as the crackExist function, using iso-zero mesh instead of
iso-lc mesh.
parent 4ba05f8e
......@@ -557,6 +557,8 @@ xIntegrationRule *TLSGeomInterfacev0::getIntegrationRuleNew(filter_enum f, int o
return p;
}
bool TLSGeomInterfacev0::frontExist() { return frontmesh->size(0); }
bool TLSGeomInterfacev0::crackExist() { return frontmeshout->size(0); }
void TLSGeomInterfacev0::exportCrack(xexport::xExport *pexport, const std::string &filename)
......
......@@ -114,6 +114,8 @@ class TLSGeomInterface
virtual std::function<bool(AOMD::mEntity *)> getFilter(filter_enum f) const = 0;
/// Return a string associated to the filter f.
std::string getFilterName(filter_enum f) const;
/// tell if front exist or not.
virtual bool frontExist() = 0;
/// tell if crack exist or not. At least partially damaged zone should exist but fully damaged zone is not always present.
virtual bool crackExist() = 0;
......@@ -196,6 +198,7 @@ class TLSGeomInterfacev0 : public TLSGeomInterface
xfem::xIntegrationRule *getIntegrationRule(filter_enum f, int order) override;
xfem::xIntegrationRule *getIntegrationRuleNew(filter_enum f, int order) override;
std::function<bool(AOMD::mEntity *)> getFilter(filter_enum f) const override;
bool frontExist() override;
bool crackExist() override;
void exportCrack(xexport::xExport *, const std::string &) override;
void exportFront(xexport::xExport *, const std::string &) override;
......
......@@ -2580,6 +2580,26 @@ void TLSGeomInterfaceSignedVectorDistanceFunction::exportSVLS(iter_filter_t itb,
Export(svlsgsshift, pexport_ascii, itb, ite, fn);
return;
}
bool TLSGeomInterfaceSignedVectorDistanceFunction::frontExist()
{
const xMesh *bnd = physsurf_ls_0->getIsoZeroMesh();
// if nodes are present look more precisely if it's not the case of node without element (cut on edge alone in 3D)
if (bnd->size(0))
{
const int bnd_dim = bnd->dim();
if (bnd_dim)
{
assert(bnd_dim == dim - 1);
return true;
}
// if mesh only with node there is no front (cut on edge alone in 3D)
else
return false;
}
// if no node, no ambiguity. There is no front.
else
return false;
}
bool TLSGeomInterfaceSignedVectorDistanceFunction::crackExist()
{
const xMesh *bnd = physsurf_svls_lc->getIsoZeroMesh();
......
......@@ -103,6 +103,8 @@ class TLSGeomInterfaceSignedVectorDistanceFunction : public TLSGeomInterface
iso_iterator_t beginCrack();
iso_iterator_t endCrack();
/// tell if front exist or not.
bool frontExist() override;
/// tell if crack exist or not. At least partially damaged zone should exist but fully damaged zone is not always present.
bool crackExist() override;
......
......@@ -688,6 +688,26 @@ void TLSGeomInterfaceSignedVectorLevelSet::exportSVLS(iter_filter_t itb, iter_fi
Export(svlsgsshift, pexport_ascii, itb, ite, fn);
return;
}
bool TLSGeomInterfaceSignedVectorLevelSet::frontExist()
{
const xMesh *bnd = physsurf_ls_0->getIsoZeroMesh();
// if nodes are present look more precisely if it's not the case of node without element (cut on edge alone in 3D)
if (bnd->size(0))
{
const int bnd_dim = bnd->dim();
if (bnd_dim)
{
assert(bnd_dim == dim - 1);
return true;
}
// if mesh only with node there is no front (cut on edge alone in 3D)
else
return false;
}
// if no node, no ambiguity. There is no front.
else
return false;
}
bool TLSGeomInterfaceSignedVectorLevelSet::crackExist()
{
const xMesh *bnd = physsurf_svls_lc->getIsoZeroMesh();
......
......@@ -91,6 +91,8 @@ class TLSGeomInterfaceSignedVectorLevelSet : public TLSGeomInterface
iso_iterator_t beginCrack();
iso_iterator_t endCrack();
/// tell if front exist or not.
bool frontExist() override;
/// tell if crack exist or not. At least partially damaged zone should exist but fully damaged zone is not always present.
bool crackExist() override;
......
......@@ -222,15 +222,19 @@ std::function<bool(mEntity *)> TLSGeomInterfaceVectorLevelSet::getFilter(filter_
return xAcceptIntersectionBinary(getFilter(MATTER),
std::bind1st(std::mem_fun(&xcut::xPhysSurfByTagging::noTouchingIn), physsurf_ls_0));
case DIRICHLETBC: //####
// return xAcceptAll();
cout << "DIRICHLETBC filter not implemented in TLSGeomInterfaceVectorLevelSet yet ! " << endl;
throw;
}
case DIRICHLETBC: //####
{
// return xAcceptAll();
cout << "DIRICHLETBC filter not implemented in TLSGeomInterfaceVectorLevelSet yet ! " << endl;
throw;
}
default:
throw;
}
}
bool TLSGeomInterfaceVectorLevelSet::frontExist() { return physsurf_ls_0->getMesh_bnd()->size(0); }
bool TLSGeomInterfaceVectorLevelSet::crackExist() { return physsurf_vls_lc->getIsoZeroMesh()->size(0); }
void TLSGeomInterfaceVectorLevelSet::exportCrack(xexport::xExport *pexport, const std::string &filename)
......
......@@ -55,6 +55,8 @@ class TLSGeomInterfaceVectorLevelSet : public TLSGeomInterface
/// return an xphysSurf representing the iso lc. This is a Hack for compatibility purpose, this function should desapear at
/// some point.
xcut::xPhysSurfByTagging *HACK_get_front_out() override;
/// tell if front exist or not.
bool frontExist() override;
/// tell if crack exist or not. At least partially damaged zone should exist but fully damaged zone is not always present.
bool crackExist() override;
......
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