Commit 62dcf4fb authored by Alexis SALZMAN's avatar Alexis SALZMAN

[xFEM] hopefully simplifying xMesh source

Has we are in the middle of a big change the modify state stuff were
appearing in xMesh despite their AOMD nature. To simplify, comments are
removed and  xinterface::aomd::modifyAllState function is use in replacement
of the ugly set of  12 calls to modifyState method. This will certainly
disappear in the future

Remove comment regarding printMesh/printEntity. A future commit will
bring them back alive.
parent 953b8f8d
......@@ -21,6 +21,7 @@
#include "OctreeCreate2.h"
#include "mAOMD.h"
#include "mEntity.h"
#include "xMeshToolAOMD.h"
// xfem
#include "xDebug.h"
......@@ -252,19 +253,7 @@ xMesh::xMesh(const string& filename, MPI_Comm world) : part_man(world), RegularG
xmeshtool::xMshReader(meshfile, mesh);
meshfile.close();
// modifyAllState();
mesh.modifyState(3, 2, true);
mesh.modifyState(3, 1, true);
mesh.modifyState(3, 0, true);
mesh.modifyState(2, 1, true);
mesh.modifyState(2, 0, true);
mesh.modifyState(1, 0, true);
mesh.modifyState(0, 1, true);
mesh.modifyState(0, 2, true);
mesh.modifyState(0, 3, true);
mesh.modifyState(1, 2, true);
mesh.modifyState(1, 3, true);
mesh.modifyState(2, 3, true);
xinterface::aomd::modifyAllState(mesh);
int proc_id;
MPI_Comm_rank(part_man.getComm(), &proc_id);
......@@ -285,20 +274,7 @@ xMesh::xMesh(const string& filename, xinterface::aomd::xAttachedDataManagerAOMD<
}
xmeshtool::xMshReader(meshfile, mesh, entities_id);
meshfile.close();
// modifyAllState();
mesh.modifyState(3, 2, true);
mesh.modifyState(3, 1, true);
mesh.modifyState(3, 0, true);
mesh.modifyState(2, 1, true);
mesh.modifyState(2, 0, true);
mesh.modifyState(1, 0, true);
mesh.modifyState(0, 1, true);
mesh.modifyState(0, 2, true);
mesh.modifyState(0, 3, true);
mesh.modifyState(1, 2, true);
mesh.modifyState(1, 3, true);
mesh.modifyState(2, 3, true);
xinterface::aomd::modifyAllState(mesh);
int proc_id;
MPI_Comm_rank(part_man.getComm(), &proc_id);
......@@ -450,42 +426,6 @@ void xMesh::copyMeshInternal(const xMesh& other,
throw -4567;
}
}
/*
void xMesh::modifyAllState()
{
modifyState(3, 2, true);
modifyState(3, 1, true);
modifyState(3, 0, true);
modifyState(2, 1, true);
modifyState(2, 0, true);
modifyState(1, 0, true);
modifyState(0, 1, true);
modifyState(0, 2, true);
modifyState(0, 3, true);
modifyState(1, 2, true);
modifyState(1, 3, true);
modifyState(2, 3, true);
}
void xMesh::modifyAllStateFalse()
{
modifyState(3, 2, false);
modifyState(3, 1, false);
modifyState(2, 1, false);
modifyState(2, 0, false);
modifyState(0, 1, false);
modifyState(0, 2, false);
modifyState(1, 2, false);
modifyState(1, 3, false);
modifyState(2, 3, false);
modifyState(2, 1, false);
modifyState(2, 0, false);
modifyState(1, 0, false);
modifyState(0, 1, false);
modifyState(0, 2, false);
modifyState(1, 2, false);
}
*/
void xMesh::compute_bounding_box(xtensor::xPoint& min, xtensor::xPoint& max) const
{
if (!size(0))
......@@ -808,29 +748,29 @@ void xMesh::lookupSupport(mEntity* pe, std::set<mEntity*>& l)
else if (size(1))
if (pe->getLevel() < 1) domirror = true;
/*
if (domirror)
{
try
{
lookupForMirrorEntities(pe, mirrors);
}
catch (...)
{
cout << "Some problem in lookupForMirrorEntities(), catch in" << __FILE__ << ":" << __LINE__ << endl;
cout << "e " << pe << "type " << pe->getType() << endl;
throw;
}
if (domirror)
{
/*
try
{
lookupForMirrorEntities(pe, mirrors);
}
catch (...)
{
cout << "Some problem in lookupForMirrorEntities(), catch in" << __FILE__ << ":" << __LINE__ << endl;
cout << "e " << pe << "type " << pe->getType() << endl;
throw;
}
std::list<mEntity*>::const_iterator it;
for (mEntity* pe : mirrors)
{
std::set<mEntity*> lmir;
lookupSupportBasic(pe, lmir);
l.insert(lmir.begin(), lmir.end());
}
}
*/
std::list<mEntity*>::const_iterator it;
for (mEntity* pe : mirrors)
{
std::set<mEntity*> lmir;
lookupSupportBasic(pe, lmir);
l.insert(lmir.begin(), lmir.end());
}
*/
}
return;
}
......
......@@ -252,137 +252,6 @@ class xMesh //: public AOMD::mMesh
};
////////////////////////////////// end class xMesh //////////////////////////////////////////////////
/// fill out with a hard copy of in.
/*!
link between elements of in and out are made using attached Entity with tags xMesh::has_a_copy_tag, and
xMesh::is_the_copy_of_tag. by defaults, so that the source mesh is not modifyied at all on exit, the attached entity to get the
copied element on the source mesh are deleted. Setting the flag clean_tag_on_source_mesh to false permit to keep then
*/
// void xCopyMesh(const xMesh& in, xMesh& out);
/*void xCopyMesh(const xMesh& in, xMesh& out,
xMesh::datamanager_t<AOMD::mEntity*>& is_copied_to,
xMesh::datamanager_t<AOMD::mEntity*>& is_the_copy_of);*/
/*! A crud function which print in given stream all topological information of an AOMD mEntity using node ID.
* If deep argument is true all declared adjacency of the given entity is also printed by using a recursive call
* to this function.
* Adress and ID of given entity are also printed
*/
/*
inline void printEntity(std::ostream& os, const AOMD::mEntity* e, bool deep)
{
if (deep) os << std::endl;
int n;
switch (e->getLevel())
{
case 0:
{
os << "node " << e << " " << e->getId() << std::endl;
for (int i = 1; deep && i < 4; ++i)
{
if (e->isAdjacencyCreated(i))
{
os << " adjancy " << i << std::endl;
for (int k = 0, m = e->size(i); k < m; ++k) printEntity(os, e->get(i, k), false);
}
}
break;
}
case 1:
{
n = 2;
os << "edge " << e << " " << e->getId();
if (e->isAdjacencyCreated(0))
{
if (e->size(0) == n)
{
os << " (" << e->get(0, 0)->getId();
for (int k = 1; k < n; ++k) os << "-" << e->get(0, k)->getId();
os << ")" << std::endl;
}
else
os << " (wrong number of nodes !! sould be " << n << " but is " << e->size(0) << ")" << std::endl;
}
for (int i = 1; deep && i < 4; ++i)
{
if (e->isAdjacencyCreated(i))
{
os << " adjancy " << i << std::endl;
for (int k = 0, m = e->size(i); k < m; ++k) printEntity(os, e->get(i, k), false);
}
}
break;
}
case 2:
{
n = 3;
os << "tria " << e << " " << e->getId();
if (e->isAdjacencyCreated(0))
{
if (e->size(0) == n)
{
os << " (" << e->get(0, 0)->getId();
for (int k = 1; k < n; ++k) os << "-" << e->get(0, k)->getId();
os << ")" << std::endl;
}
else
os << " (wrong number of nodes !! sould be " << n << " but is " << e->size(0) << ")" << std::endl;
}
for (int i = 1; deep && i < 4; ++i)
{
if (e->isAdjacencyCreated(i))
{
os << " adjancy " << i << std::endl;
for (int k = 0, m = e->size(i); k < m; ++k) printEntity(os, e->get(i, k), false);
}
}
break;
}
case 3:
{
n = 4;
os << "tet " << e << " " << e->getId();
if (e->isAdjacencyCreated(0))
{
if (e->size(0) == n)
{
os << " (" << e->get(0, 0)->getId();
for (int k = 1; k < n; ++k) os << "-" << e->get(0, k)->getId();
os << ")" << std::endl;
}
else
os << " (wrong number of nodes !! sould be " << n << " but is " << e->size(0) << ")" << std::endl;
}
for (int i = 1; deep && i < 4; ++i)
{
if (e->isAdjacencyCreated(i))
{
os << " adjancy " << i << std::endl;
for (int k = 0, m = e->size(i); k < m; ++k) printEntity(os, e->get(i, k), false);
}
}
break;
}
}
}
*/
/*! A crud function which print a mesh using printEntity function. Only topological information are given.
* If deep argument is true all declared adjacency of all entities are also printed by calling printEntity
* with its deep parameter to true.
*/
/*
inline void printMesh(std::ostream& os, xfem::xMesh& mesh, bool deep)
{
os << std::endl << "Export mesh" << std::endl;
for (int i = 0; i < 4; ++i)
for (AOMD::mEntity* pe : mesh.range(i)) printEntity(os, pe, deep);
}
*/
} // namespace xfem
#endif
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