Commit 3fb4eab2 authored by Gilles MARCKMANN's avatar Gilles MARCKMANN

Remove xFEM dependency on mAttachableData dependency. Move class definitions:

    	- xAttachableString.cc 		-> xDoubleCut
    	- xAttachableChar			-> xInterface/AOMD 	(still used in TLSImplicit)
    	- xAttachableGP			-> xInterface/AOMD 	(still used in TLSElementBased)
    	- xAttachableEntitiesVector	-> xTLS 				(still used in TLSExplicit)
    	- xAttachableEntitiesSet		-> attic
parent 1a4cd3f6
/*
This file is a part of eXlibris C++ Library
under the GNU Lesser General Public License.
See the NOTICE.md & LICENSE.md files for terms
and conditions.
*/
#include "xAttachableString.h"
// AOMD
#include <mEntity.h>
namespace xfem
{
// get attached data of type xAttachableString
std::string &getAttachedString(AOMD::mEntity *e, unsigned int tag)
{
xAttachableString *a = (xAttachableString *)(e->getData(tag));
if (!a)
{
a = new xAttachableString;
e->attachData(tag, a);
}
return a->s;
}
// set attached data of type xAttachableString
void attachString(AOMD::mEntity *e, unsigned int tag, const std::string &s)
{
xAttachableString *a = (xAttachableString *)(e->getData(tag));
if (!a)
{
a = new xAttachableString;
e->attachData(tag, a);
}
a->s = s;
return;
}
} // namespace xfem
/*
This file is a part of eXlibris C++ Library
under the GNU Lesser General Public License.
See the NOTICE.md & LICENSE.md files for terms
and conditions.
*/
#ifndef XCUT__XATTACHABLESTRING_H
#define XCUT__XATTACHABLESTRING_H
// std
#include <string>
// AOMD
#include "mAttachableDataContainer.h"
namespace AOMD
{
class mEntity;
}
namespace xfem
{
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// xAttachableString class
///////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class xAttachableString : public AOMD::mAttachableData
{
public:
xAttachableString() __attribute__((deprecated)) = default;
~xAttachableString() override = default;
std::string s;
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// End xAttachableString class
///////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// get attached data of type xAttachableString
std::string& getAttachedString(AOMD::mEntity* e, unsigned int tag) __attribute__((deprecated));
// set attached data of type xAttachableString
void attachString(AOMD::mEntity* e, unsigned int tag, const std::string& s) __attribute__((deprecated));
} // namespace xfem
#endif
......@@ -16,8 +16,10 @@
#include <boost/graph/connected_components.hpp>
// AOMD
#include "mEntity.h"
// xfem
// xinterface::aomd
#include "xAttachableChar.h"
// xfem
#include "xAttachableString.h"
#include "xExportGmsh.h"
#include "xGetSupport.h"
......@@ -1097,7 +1099,7 @@ void xPhysDomain::genIsoContainer(size_t id)
// if ( in() || out() )
{
// if null size skip iso element
dimMetricDecode(xfem::getAttachedChar(e_bnd, phys.iso_status_tag), face, edge0, edge1, edge2);
dimMetricDecode(xinterface::aomd::getAttachedChar(e_bnd, phys.iso_status_tag), face, edge0, edge1, edge2);
if (face != normal_metric) continue;
}
}
......
......@@ -15,10 +15,12 @@
#include "xElemCutData.h"
#include "xMetricCode.h"
#include "xPhysSurfCut.h"
// xinterface::aomd
#include "xAttachableChar.h"
// xfem
#include <functional>
#include "xAttachableChar.h"
#include "xGetSupport.h"
// boost
......@@ -120,7 +122,7 @@ void xPhysSurfCut::attachStatus(AOMD::mEntity *e, const int idx_code, int nb_pos
status |= out;
else if (idx_code > -3)
status |= in;
xfem::attachChar(e, filter_tag, status);
xinterface::aomd::attachChar(e, filter_tag, status);
return;
}
void xPhysSurfCut::treatElemCutData(AOMD::mEntity *e, std::vector<AOMD::mVertex *> &all_vertex, std::list<xPolytope> &poly_iso,
......@@ -355,14 +357,14 @@ void xPhysSurfCut::clearAllSupportTagRelatedToElem(mEntity *e)
for (i = 0; i < nb_adj; ++i)
{
adj = e->get(what, i);
status = xfem::getAttachedChar(adj, filter_tag);
status = xinterface::aomd::getAttachedChar(adj, filter_tag);
if (status)
{
if (status & cover_in_and_out)
{
new_status = status & (~cover_in_and_out);
if (new_status)
xfem::attachChar(adj, filter_tag, new_status);
xinterface::aomd::attachChar(adj, filter_tag, new_status);
else
adj->deleteData(filter_tag);
}
......@@ -372,14 +374,14 @@ void xPhysSurfCut::clearAllSupportTagRelatedToElem(mEntity *e)
}
// treate element itself
status = xfem::getAttachedChar(e, filter_tag);
status = xinterface::aomd::getAttachedChar(e, filter_tag);
if (status)
{
if (status & cover_in_and_out)
{
new_status = status & (~cover_in_and_out);
if (new_status)
xfem::attachChar(e, filter_tag, new_status);
xinterface::aomd::attachChar(e, filter_tag, new_status);
else
e->deleteData(filter_tag);
}
......@@ -437,35 +439,35 @@ xPhysSurfCut::loader_t xPhysSurfCut::loaderPrivate() const
bool xPhysSurfCut::isIn(mEntity *e) const
{
if (xfem::getAttachedChar(e, filter_tag) & in)
if (xinterface::aomd::getAttachedChar(e, filter_tag) & in)
return true;
else
return false;
}
bool xPhysSurfCut::isTopoCut(mEntity *e) const
{
if (xfem::getAttachedChar(e, filter_tag) & topo_cut)
if (xinterface::aomd::getAttachedChar(e, filter_tag) & topo_cut)
return true;
else
return false;
}
bool xPhysSurfCut::isOut(mEntity *e) const
{
if (xfem::getAttachedChar(e, filter_tag) & out)
if (xinterface::aomd::getAttachedChar(e, filter_tag) & out)
return true;
else
return false;
}
bool xPhysSurfCut::isNew(mEntity *e) const
{
if (xfem::getAttachedChar(e, filter_tag) & new_old)
if (xinterface::aomd::getAttachedChar(e, filter_tag) & new_old)
return true;
else
return false;
}
bool xPhysSurfCut::hasChange(mEntity *e) const
{
if (xfem::getAttachedChar(e, filter_tag) & change)
if (xinterface::aomd::getAttachedChar(e, filter_tag) & change)
return true;
else
return false;
......@@ -482,7 +484,7 @@ void xPhysSurfCut::setSupportTag(mEntity *e)
std::set<mEntity *>::iterator itsupend = support.end();
while (itsup != itsupend)
{
sup_status = xfem::getAttachedChar(*itsup, filter_tag);
sup_status = xinterface::aomd::getAttachedChar(*itsup, filter_tag);
if (sup_status & in)
is_in = true;
else if (sup_status & out)
......@@ -502,13 +504,13 @@ void xPhysSurfCut::setSupportTag(mEntity *e)
assert(is_out);
status |= cover_out;
}
xfem::attachChar(e, filter_tag, status);
xinterface::aomd::attachChar(e, filter_tag, status);
return;
}
bool xPhysSurfCut::isSupportCut(mEntity *e)
{
bool r = false;
status = xfem::getAttachedChar(e, filter_tag);
status = xinterface::aomd::getAttachedChar(e, filter_tag);
if (!(status & cover_in_and_out)) setSupportTag(e);
if ((status & cover_in_and_out) == cover_in_and_out)
return true;
......@@ -518,7 +520,7 @@ bool xPhysSurfCut::isSupportCut(mEntity *e)
bool xPhysSurfCut::isSupportCoversIn(mEntity *e)
{
bool r = false;
status = xfem::getAttachedChar(e, filter_tag);
status = xinterface::aomd::getAttachedChar(e, filter_tag);
if (!(status & cover_in_and_out)) setSupportTag(e);
if (status & cover_in)
return true;
......@@ -527,7 +529,7 @@ bool xPhysSurfCut::isSupportCoversIn(mEntity *e)
}
bool xPhysSurfCut::isSupportCoversOut(mEntity *e)
{
status = xfem::getAttachedChar(e, filter_tag);
status = xinterface::aomd::getAttachedChar(e, filter_tag);
if (!(status & cover_in_and_out)) setSupportTag(e);
if (status & cover_out)
return true;
......@@ -536,7 +538,7 @@ bool xPhysSurfCut::isSupportCoversOut(mEntity *e)
}
void xPhysSurfCut::loadStatus(mEntity *e)
{
status = xfem::getAttachedChar(e, filter_tag);
status = xinterface::aomd::getAttachedChar(e, filter_tag);
return;
}
bool xPhysSurfCut::isIn() const
......@@ -576,29 +578,29 @@ bool xPhysSurfCut::hasChange() const
}
void xPhysSurfCut::setAsOld(mEntity *e)
{
status = xfem::getAttachedChar(e, filter_tag);
if (status & new_old) xfem::attachChar(e, filter_tag, status ^ new_old);
if (status & change) xfem::attachChar(e, filter_tag, status ^ change);
status = xinterface::aomd::getAttachedChar(e, filter_tag);
if (status & new_old) xinterface::aomd::attachChar(e, filter_tag, status ^ new_old);
if (status & change) xinterface::aomd::attachChar(e, filter_tag, status ^ change);
return;
}
void xPhysSurfCut::setAsNew(mEntity *e)
{
status = xfem::getAttachedChar(e, filter_tag);
status = xinterface::aomd::getAttachedChar(e, filter_tag);
if (status)
{
if (status & change)
xfem::attachChar(e, filter_tag, (status ^ change) | new_old);
xinterface::aomd::attachChar(e, filter_tag, (status ^ change) | new_old);
else
xfem::attachChar(e, filter_tag, status | new_old);
xinterface::aomd::attachChar(e, filter_tag, status | new_old);
}
return;
}
// Promotion methode
void xPhysSurfCut::setPromotorStatus(mEntity *e) { promotor_status = xfem::getAttachedChar(e, filter_tag); }
void xPhysSurfCut::setPromotorStatus(mEntity *e) { promotor_status = xinterface::aomd::getAttachedChar(e, filter_tag); }
void xPhysSurfCut::forcePromotorStatus(char c) { promotor_status = c; }
void xPhysSurfCut::promoteStatus(mEntity *e)
{
if (xfem::getAttachedChar(e, filter_tag) == 0) xfem::attachChar(e, filter_tag, promotor_status);
if (xinterface::aomd::getAttachedChar(e, filter_tag) == 0) xinterface::aomd::attachChar(e, filter_tag, promotor_status);
}
void xPhysSurfCut::unPromoteStatus(mEntity *e) { e->deleteData(filter_tag); }
......@@ -623,7 +625,7 @@ void xPhysSurfCut::updateCDGOfWarpFace(mVertex *cdg, std::vector<AOMD::mVertex *
}
/*
void xPhysSurfCut::tagAndPromoteEntity( mEntity *e, char tag){
xfem::attachChar( e, filter_tag, tag);
xinterface::aomd::attachChar( e, filter_tag, tag);
for_each(promotors.begin(), promotors.end(), boost::bind(&xPhysSurfCutByTagging::promoteStatus, _1, e ));
}
......@@ -637,15 +639,15 @@ void xPhysSurfCut::updateCDGOfWarpFace(mVertex *cdg, std::vector<AOMD::mVertex *
{
xPartition part;
xfem::xMesh::getPartition(face, part, xfem::xAcceptAll());
for_each(part.begin(), part.end(), boost::bind( xfem::attachChar, _1, filter_tag, 'i'));
xfem::attachChar( face, filter_tag, 'i');
for_each(part.begin(), part.end(), boost::bind( xinterface::aomd::attachChar, _1, filter_tag, 'i'));
xinterface::aomd::attachChar( face, filter_tag, 'i');
}
if (fcutdata.fromMeshOut)
{
xPartition part;
xfem::xMesh::getPartition(face, part, xfem::xAcceptAll());
for_each(part.begin(), part.end(), boost::bind( xfem::attachChar, _1, filter_tag, 'o'));
xfem::attachChar( face, filter_tag, 'o');
for_each(part.begin(), part.end(), boost::bind( xinterface::aomd::attachChar, _1, filter_tag, 'o'));
xinterface::aomd::attachChar( face, filter_tag, 'o');
}
const unsigned int sizeIn = fcutdata.TrianglesIn.size();
......@@ -653,7 +655,7 @@ void xPhysSurfCut::updateCDGOfWarpFace(mVertex *cdg, std::vector<AOMD::mVertex *
if (( sizeIn || sizeOut ))
{
xfem::attachChar( face, filter_tag, 'c');
xinterface::aomd::attachChar( face, filter_tag, 'c');
xVLSTriangleCutAttachableData *attachdata = new xVLSTriangleCutAttachableData();
for_each(promotors.begin(), promotors.end(), boost::bind(&xPhysSurfCutByTagging::setPromotorStatus,_1, face ));
if (sizeIn)
......@@ -718,7 +720,7 @@ void xPhysSurfCut::updateCDGOfWarpFace(mVertex *cdg, std::vector<AOMD::mVertex *
partition.insert( *itTout);
}
}
else if (xfem::getAttachedChar(e, filter_tag) == 'o')
else if (xinterface::aomd::getAttachedChar(e, filter_tag) == 'o')
xfem::xMesh::getPartition( e, partition, filter);
// else xfem::xMesh::getPartition( e, partition, filter); //this is an ugly hack for some boundary conditions ..
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -11,7 +11,6 @@
#include <sstream>
#include "xAOMDEntityUtil.h"
#include "xAttachableChar.h"
#include "xLevelSetOperators.h"
#include "xMesh.h"
#include "xPhysSurfParameter.h"
......
......@@ -16,7 +16,6 @@
// xinterface
#include "xAOMDEntityUtil.h"
// xfem
#include "xAttachableChar.h"
#include "xElement.h"
#include "xLevelSet.h"
#include "xMesh.h"
......
/*
This file is a part of eXlibris C++ Library
under the GNU Lesser General Public License.
See the NOTICE.md & LICENSE.md files for terms
and conditions.
*/
#ifndef ___XENTITIESSETCONTAINER_H
#define ___XENTITIESSETCONTAINER_H
#include <set>
#include "mAttachableDataContainer.h"
#include "mEntity.h"
namespace xfem
{
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// xAttachableEntitiesSet class
//////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class xAttachableEntitiesSet : public AOMD::mAttachableData
{
public:
xAttachableEntitiesSet() __attribute__((deprecated)) = default;
~xAttachableEntitiesSet() override = default;
// public methodes ///////////////
// public members ////////////////
std::set<AOMD::mEntity *> vect;
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// End xAttachableEntitiesSet class
//////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// get attached data of type xAttachableEntitiesSet
std::set<AOMD::mEntity *> *getAttachedEntitiesSet(AOMD::mEntity *e, unsigned int tag) __attribute__((deprecated));
inline std::set<AOMD::mEntity *> *getAttachedEntitiesSet(AOMD::mEntity *e, unsigned int tag)
{
xAttachableEntitiesSet *av = (xAttachableEntitiesSet *)(e->getData(tag));
if (!av) return nullptr;
return &(av->vect);
}
// set attached data of type
void xAttachableEntitiesSetvoid attachEntitiesSet(AOMD::mEntity *e, unsigned int tag, std::set<AOMD::mEntity *> &v)
__attribute__((deprecated));
{
inline void attachEntitiesSet(AOMD::mEntity * e, unsigned int tag, std::set<AOMD::mEntity *> &v)
{
xAttachableEntitiesSet *av = (xAttachableEntitiesSet *)(e->getData(tag));
if (!av)
{
av = new xAttachableEntitiesSet;
e->attachData(tag, av);
}
(av->vect).insert(v.begin(), v.end());
}
} // end of namespace
#endif
......@@ -1564,10 +1564,8 @@ void DeclareHangingOnEntity(const xinterface::aomd::xAttachedDataManagerAOMD<AOM
C& creator_reg)
{
// get attached vector
std::vector<AOMD::mEntity*>& slave =
const_cast<std::vector<AOMD::mEntity*>&>(*downGroup.getData(*nh)); // getAttachedEntitiesVector(nh,id_down_groupe);
std::vector<AOMD::mEntity*>& exclude =
const_cast<std::vector<AOMD::mEntity*>&>(*bndGroup.getData(*nh)); // getAttachedEntitiesVector(nh,id_bnd_groupe);
std::vector<AOMD::mEntity*>& slave = const_cast<std::vector<AOMD::mEntity*>&>(*downGroup.getData(*nh));
std::vector<AOMD::mEntity*>& exclude = const_cast<std::vector<AOMD::mEntity*>&>(*bndGroup.getData(*nh));
// check that exclude node which are hanging are already treated
......
......@@ -5,8 +5,8 @@
and conditions.
*/
#ifndef _XATTACHABLE_I_RULE_H
#define _XATTACHABLE_I_RULE_H
#ifndef _XINTEGRATION_RULE_STORED_H
#define _XINTEGRATION_RULE_STORED_H
// xquadrature
#include "xIntegrator.h"
......
......@@ -204,8 +204,7 @@ void xNonLocalInfoGeneratorForKeysAndFctsForHangingNode<S, DATAMANAGER>::generat
std::vector<xValKey> master_keys;
// get attached vector
std::vector<AOMD::mEntity *> &slave = const_cast<std::vector<AOMD::mEntity *> &>(
*downGroup.getData(*nh)); // getAttachedEntitiesVector(nh,id_down_groupe);
std::vector<AOMD::mEntity *> &slave = const_cast<std::vector<AOMD::mEntity *> &>(*downGroup.getData(*nh));
std::vector<AOMD::mEntity *> &exclude = const_cast<std::vector<AOMD::mEntity *> &>(*bndGroup.getData(*nh));
// set iterator
......
/*
This file is a part of eXlibris C++ Library
under the GNU Lesser General Public License.
See the NOTICE.md & LICENSE.md files for terms
and conditions.
*/
#ifndef ___XCHARCONTAINER_H
#define ___XCHARCONTAINER_H
#include "mAttachableDataContainer.h"
#include "mEntity.h"
namespace xinterface
{
namespace aomd
{
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// xAttachableChar class
//////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class xAttachableChar : public AOMD::mAttachableData
{
public:
~xAttachableChar() override = default;
// public methodes ///////////////
// public members ////////////////
char c;
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// End xAttachableChar class
//////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// TODO --- TODO --- TODO --- TODO --- TODO --- TODO --- TODO --- TODO --- TODO --- TODO --- TODO --- TODO --- TODO --- TODO ---
// TODO --- TODO --- TODO see if it's the right place for these functions
// get attached data of type xAttachableChar
char getAttachedChar(const AOMD::mEntity* e, unsigned int tag);
inline char getAttachedChar(const AOMD::mEntity* e, unsigned int tag)
{
xAttachableChar* ac = (xAttachableChar*)(e->getData(tag));
if (!ac) return 0;
return ac->c;
}
// set attached data of type xAttachableChar
void attachChar(AOMD::mEntity* e, unsigned int tag, char c);
inline void attachChar(AOMD::mEntity* e, unsigned int tag, char c)
{
xAttachableChar* ac = (xAttachableChar*)(e->getData(tag));
if (!ac)
{
ac = new xAttachableChar;
e->attachData(tag, ac);
}
ac->c = c;
}
// TODO --- TODO --- TODO --- TODO --- TODO --- TODO --- TODO --- TODO --- TODO --- TODO --- TODO --- TODO --- TODO --- TODO ---
// TODO --- TODO --- TODO
} // namespace aomd
} // namespace xinterface
#endif
/*
This file is a part of eXlibris C++ Library
under the GNU Lesser General Public License.
See the NOTICE.md & LICENSE.md files for terms
and conditions.
*/
#ifndef _XATTACHABLE_GP_H
#define _XATTACHABLE_GP_H
// Trellis
#include "mAttachableDataContainer.h"
// xtensor
#include "xPoint.h"
namespace xinterface
{
namespace aomd
{
class xAttachableGaussPoints : public AOMD::mAttachableData
{
public:
typedef std::vector<std::pair<xtensor::xPoint, double>> Container;
typedef Container::iterator Iter;
xAttachableGaussPoints() __attribute__((deprecated)) = default;
Container gauss_points;
};
} // namespace aomd
} // namespace xinterface
#endif
......@@ -41,10 +41,13 @@ void OctreeToAOMDProjection(const oOctree& octree, const oField& lsoct, xMesh* m
void OctreeToAOMDNoHangingProjection(const oOctree& octree, const oField& lsoct, xMesh* mesh, xLevelSet& ls)
{
const oKeyManager& key_manager = lsoct.getKeyManager();
const unsigned int vertex_corner_tag_face =
AOMD_Util::Instance()->lookupMeshDataId("OctreeToAOMDNoHanging_vertex_corner_tag_face");
const unsigned int vertex_corner_tag_vol =
AOMD_Util::Instance()->lookupMeshDataId("OctreeToAOMDNoHanging_vertex_corner_tag_vol");
// const unsigned int vertex_corner_tag_face =
// AOMD_Util::Instance()->lookupMeshDataId("OctreeToAOMDNoHanging_vertex_corner_tag_face");
// const unsigned int vertex_corner_tag_vol =
// AOMD_Util::Instance()->lookupMeshDataId("OctreeToAOMDNoHanging_vertex_corner_tag_vol");
xinterface::aomd::xAttachedDataManagerAOMD<std::vector<AOMD::mEntity*>> vertex_corner_face_tagger;
xinterface::aomd::xAttachedDataManagerAOMD<std::vector<AOMD::mEntity*>> vertex_corner_vol_tagger;
ls.setSupport(mesh, 0.0);
double ls_value;
for (const oKey* key : key_manager)
......@@ -52,17 +55,21 @@ void OctreeToAOMDNoHangingProjection(const oOctree& octree, const oField& lsoct,
mVertex* v = mesh->getMesh().getVertex(key->getId());
ls_value = lsoct.getVal(key);
ls(v) = ls_value;
std::vector<AOMD::mEntity*>* vertex_vector = getAttachedEntitiesVector(v, vertex_corner_tag_face);
if (vertex_vector)
// std::vector<AOMD::mEntity*>* vertex_vector = xinterface::aomd::getAttachedEntitiesVector(v, vertex_corner_tag_face);
if (vertex_corner_face_tagger.getData(*v))
{
std::vector<AOMD::mEntity*>* vertex_vector = vertex_corner_face_tagger.getData(*v);
double mean_contrib = ls_value / 4.;
std::vector<AOMD::mEntity*>::const_iterator itve = vertex_vector->end();
for (std::vector<AOMD::mEntity*>::const_iterator itv = vertex_vector->begin(); itv != itve; ++itv)
ls(static_cast<mVertex*>(*itv)) += mean_contrib;
}
vertex_vector = getAttachedEntitiesVector(v, vertex_corner_tag_vol);
if (vertex_vector)
// vertex_vector = xinterface::aomd::getAttachedEntitiesVector(v, vertex_corner_tag_vol);
if (vertex_corner_vol_tagger.getData(*v))
{
std::vector<AOMD::mEntity*>* vertex_vector = vertex_corner_vol_tagger.getData(*v);
double mean_contrib = ls_value / 8.;
std::vector<AOMD::mEntity*>::const_iterator itve = vertex_vector->end();
for (std::vector<AOMD::mEntity*>::const_iterator itv = vertex_vector->begin(); itv != itve; ++itv)
......
......@@ -15,7 +15,6 @@
#include "oExport.h"
#include "oKeyManager.h"
#include "oOctree.h"
#include "xAttachableEntitiesVector.h"
#include "xLevelSet.h"
#include "xMesh.h"
......@@ -664,10 +663,12 @@ void InterfaceOctreeToAOMDNoHanging(const oOctree& octree, const oField& lsoct,
const int* Periodicity = octree.getPeriodicity();
const oKeyManager& key_manager = lsoct.getKeyManager();
const int level_max = octree.getLevelMax();
const unsigned int vertex_corner_tag_face =
AOMD::AOMD_Util::Instance()->lookupMeshDataId("OctreeToAOMDNoHanging_vertex_corner_tag_face");
const unsigned int vertex_corner_tag_vol =
AOMD::AOMD_Util::Instance()->lookupMeshDataId("OctreeToAOMDNoHanging_vertex_corner_tag_vol");
// const unsigned int vertex_corner_tag_face =
// AOMD::AOMD_Util::Instance()->lookupMeshDataId("OctreeToAOMDNoHanging_vertex_corner_tag_face");
// const unsigned int vertex_corner_tag_vol =
// AOMD::AOMD_Util::Instance()->lookupMeshDataId("OctreeToAOMDNoHanging_vertex_corner_tag_vol");
xinterface::aomd::xAttachedDataManagerAOMD<std::vector<AOMD::mEntity*>> vertex_corner_face_tagger;
xinterface::aomd::xAttachedDataManagerAOMD<std::vector<AOMD::mEntity*>> vertex_corner_vol_tagger;
int ijk[3];
int ijk_n[3];
AOMD::mMesh& mmesh = mesh.getMesh();
......@@ -798,14 +799,16 @@ void InterfaceOctreeToAOMDNoHanging(const oOctree& octree, const oField& lsoct,
// push vertex in entity vector of id1
std::vector<AOMD::mEntity*>* vertex_vector;
AOMD::mEntity* vcorner = (mmesh.getVertex(id1));
if ((vertex_vector = xfem::getAttachedEntitiesVector(vcorner, vertex_corner_tag_face)))
// if ((vertex_vector = xinterface::aomd::getAttachedEntitiesVector(vcorner, vertex_corner_tag_face)))
if (vertex_vector = vertex_corner_face_tagger.getData(*vcorner))
{
vertex_vector->push_back(central_vertex);
}
else
{
std::vector<AOMD::mEntity*> new_vertex_vector(1, central_vertex);
xfem::attachEntitiesVector(vcorner, vertex_corner_tag_face, new_vertex_vector);
// xinterface::aomd::attachEntitiesVector(vcorner, vertex_corner_tag_face, new_vertex_vector);
vertex_corner_face_tagger.setData(*vcorner) = new_vertex_vector;
}
count++;
}
......@@ -945,14 +948,16 @@ void InterfaceOctreeToAOMDNoHanging(const oOctree& octree, const oField& lsoct,
// push central vertex in entity vector of corner's
AOMD::mEntity* vcorner = mmesh.getVertex(id_corner);
if ((vertex_vector = xfem::getAttachedEntitiesVector(vcorner, vertex_corner_tag_vol)))
// if ((vertex_vector = xinterface::aomd::getAttachedEntitiesVector(vcorner, vertex_corner_tag_vol)))
if (vertex_vector = vertex_corner_vol_tagger.getData(*vcorner))
{
vertex_vector->push_back(central_vertex);
}
else
{
std::vector<AOMD::mEntity*> new_vertex_vector(1, central_vertex);
xfem::attachEntitiesVector(vcorner, vertex_corner_tag_vol, new_vertex_vector);
// xinterface::aomd::attachEntitiesVector(vcorner, vertex_corner_tag_vol, new_vertex_vector);
vertex_corner_vol_tagger.setData(*vcorner) = new_vertex_vector;
}
count++;
......@@ -999,14 +1004,18 @@ void InterfaceOctreeToAOMDNoHanging(const oOctree& octree, const oField& lsoct,
// push central vertex in entity vector of corner's
AOMD::mEntity* vcorner = mmesh.getVertex(id_corner);
if ((vertex_vector = xfem::getAttachedEntitiesVector(vcorner, vertex_corner_tag_face)))
// if ((vertex_vector = xinterface::aomd::getAttachedEntitiesVector(vcorner,
// vertex_corner_tag_face)))
if (vertex_vector = vertex_corner_face_tagger.getData(*vcorner))
{
vertex_vector->push_back(central_vertex);
}
else
{
std::vector<AOMD::mEntity*> new_vertex_vector(1, central_vertex);
xfem::attachEntitiesVector(vcorner, vertex_corner_tag_face, new_vertex_vector);
// xinterface::aomd::attachEntitiesVector(vcorner, vertex_corner_tag_face,
// new_vertex_vector);
vertex_corner_face_tagger.setData(*vcorner) = new_vertex_vector;
}
}
ls(v) = mean_ls / 4.;
......
/*
This file is a part of eXlibris C++ Library
under the GNU Lesser General Public License.
See the NOTICE.md & LICENSE.md files for terms
and conditions.
*/
#ifndef ___XENTITIESVECTORCONTAINER_H
#define ___XENTITIESVECTORCONTAINER_H
#include <vector>
#include "mAttachableDataContainer.h"
#include "mEntity.h"
namespace xtls
{
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// xAttachableEntitiesVector class
///////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class xAttachableEntitiesVector : public AOMD::mAttachableData
{
public:
xAttachableEntitiesVector() __attribute__((deprecated)) = default;