Commit 22fa74d5 authored by Nicolas CHEVAUGEON's avatar Nicolas CHEVAUGEON
Browse files

[XFEM, xExport, xInterface/xOctree] dependences to AOMD's octree is removed and related changes.

xFEM/src/xOctreeGrid.h is a new file. It introduce a octree grid search
  structure to use in place of the AOMD::octree that was used in xMesh
  for the locateOctree members functions. It permits to construct an octree
  search structure on top of a collection of mesh entity.

xFEM/src/xRegularGrid.h/cc has been modifyed so that :
 - it uses the xBoundingBox class.
 - The member function name have been changed to reflect the camel case
   convention, common to the rest of the xFEM library.
 - getElementsForPoint now return a vector of {element, localcoordinate} pair,
   so that the local coordinate of the target point in each element that
   contains it is now accessible.
 - The code have been clarifyed and simplifyed.

xBoundingBox.h :
  - added 2 member function in xBoundingBox :
   /// return the center of the bounding box
   xPoint center() const { return (min + max) * 0.5; }
   /// return a vector from min to max
   xVector<double> diag() const { return xVector<double>{min, max}; }
  - Note that following a discussion with A. Salzmann, xBoundingBox could
    be moved in a near futur to namespace xgeom and the file might be part
    of a new library (xGeomTools maybe)

xFEM/src/xMesh.h/cc has been modifyed so that :
  - It uses the xBoundingBox class were usefull, implying some interface
    change :
     * std::pair<xPoint, xPoint> compute_bounding_box(mEntity* e)
       is changed to :
       xBoundingBox compute_bounding_box(const mEntity& e);
     * void compute_bounding_box(xPoint& min,xPoint& max) const;
       is "deprecated", but is still there during the transition.
       it is replaced by :
       xtensor::xBoundingBox compute_bounding_box() const;
  - locateElementOctree and locateElement have changed interface,
    reflecting the changes in xRegularGrid and the use of xOctreeGrid instead of
    AOMD's octree.
  - Better control of the search structure in xMesh, since now the octree or
    the regular grid can both be cleared, updated or accessed by calling
    respectively xMesh Members   createOctree(), clearOctree(), getOctreeGrid(),
    createGrid(), clearGrid(), getRegularGrid.
  - The search structure pointers are now managed in a unique_ptr.
  - xMesh::copyMeshInternal now copy the search structures if needed instead
    of throwing.
  - AOMD_SharedInfo.h, autopack.h, OctreeCreate2.h (from AOMD) are not
    included anymore.

xCrack/src/CrackPostpro.cc,  xCrack/src/ExportSensors.cc/h, modified so that it
  reflect the change in xMesh::locateElement

 xExport/src/xSensors.cc/h :
  -modified so that it reflect the change in xMesh::locateElement,
  -Trellis_Util::mPoint replaced by xtensor::xPoint
  -small changes to simplify the implementation
  -clang-format first the first time I think.

xInterface/xOctree/src/surf2LevelSet.cc/h
  -modifyed to use xBoundingBox
  -surface2LevelSet::getBB(xPoint&, xPoint&) is replaced by
   const xBoundingBox &getBB() const { return BB; }
  -surface2LevelSet members xPoint BBmin, BBmax are replaced xBoundingBox BB;
  -a bug was found in the process :
   In surface2LevelSet::createMeshBBox that create an xMesh out of grid,
   the grid point coordinate were computed as :
    double xyz[3] = {BB.min(0) + i * elemSizeX, BB.min(1) +
                                 j * elemSizeY, BB.min(2) + k * elemSizeY};
   instead of :
     double xyz[3] = {BB.min(0) + i * elemSizeX, BB.min(1) +
                                  j * elemSizeY, BB.min(2) + k * elemSizeZ};
   The bug is corrected, but reference of test case
   xinterface-xoctree-test/surface2LevelSet had to be changed.

All modifyed files have been clang-fomated.
parent 661796b4
......@@ -34,7 +34,6 @@
using namespace std;
using namespace xfem;
using namespace std;
using namespace AOMD;
namespace xcrack
......@@ -284,20 +283,15 @@ void lCrack::extractSIFs(const xField<>& disp_l, std::string filename, bool auto
JEM.setUVW(i); // Upos, Vpos, Wpos and JacMatrix are set
xtensor::xPoint xyz = JEM.getXYZ();
if (debug) printf("XPos YPos ZPos %12.5e %12.5e %12.5e\n", xyz(0), xyz(1), xyz(2));
std::set<mEntity*> eset;
mesh->locateElement(xyz, eset); // todo
if (debug) cout << "eset size is " << eset.size() << endl;
if (eset.size() == 0)
{
// cout << "warning xyz out of the box " << xyz << endl;
out_of_the_box = true;
// assert(0);
}
double eset_size = (double)eset.size();
for (std::set<mEntity*>::const_iterator its = eset.begin(); its != eset.end(); ++its)
auto list_pe_uvw = mesh->locateElement(xyz); // todo
if (list_pe_uvw.empty()) out_of_the_box = true;
double eset_size = (double)std::distance(list_pe_uvw.begin(), list_pe_uvw.end());
for (auto pe_uvw : list_pe_uvw)
{
mEntity* e = *its; // IxElement of the FE mesh
xfem::xGeomElem geom_appro(e);
const AOMD::mEntity* pe = pe_uvw.first;
xfem::xGeomElem geom_appro(const_cast<AOMD::mEntity*>(pe));
xMaterial* mat = xMaterialManagerSingleton::instance().getMaterial(&geom_appro);
const xTensors* properties = mat->getProperties();
MatInfo[0] = properties->scalar("YOUNG_MODULUS");
......@@ -313,7 +307,7 @@ void lCrack::extractSIFs(const xField<>& disp_l, std::string filename, bool auto
dalpha = gradqloc * axis;
double alpha = GetqLoc(postid, xyz, JBoxDimension, JFrontPoint, JMap);
if (debug) cout << "alpha is " << alpha << endl;
geom_appro.setUVWForXYZ(JEM.getXYZ());
geom_appro.setUVW(pe_uvw.second);
double Jhh_l;
xtensor::xVector<> Ih_l;
......
......@@ -23,27 +23,24 @@ void xeExportSensors::setMesh(xMesh* mesh)
}
sensor_to_elt.clear();
std::map<int, xtensor::xPoint>::const_iterator it = sensors.begin();
int i = 0;
for (; it != sensors.end(); ++it, ++i)
for (const auto& id_pt : sensors)
{
// int is = it->first;
xtensor::xPoint p = it->second;
std::set<mEntity*> elts;
mesh->locateElement(p, elts);
if (elts.size() == 0)
xtensor::xPoint p = id_pt.second;
auto elt_uvw_list = mesh->locateElement(p);
if (elt_uvw_list.empty())
{
cerr << "the sensor located at " << p << " is not in the mesh " << endl;
abort();
}
std::set<mEntity*>::const_iterator it_elts = elts.begin();
bool check = false;
for (; it_elts != elts.end(); ++it_elts)
for (auto elt_uvw : elt_uvw_list)
{
if (test(*it_elts))
AOMD::mEntity* pe = const_cast<AOMD::mEntity*>(elt_uvw.first);
if (test(pe))
{
xfem::xGeomElem* geo = new xfem::xGeomElem(*it_elts);
geo->setUVWForXYZ(p);
xfem::xGeomElem* geo = new xfem::xGeomElem(pe);
geo->setUVW(elt_uvw.second);
if (debug) cout << " in SetMesh, location of sensor is " << geo->getXYZ() << endl;
sensor_to_elt.insert(make_pair(i, geo));
check = true;
......@@ -54,6 +51,7 @@ void xeExportSensors::setMesh(xMesh* mesh)
cerr << "the sensor located at " << p << " is is in the mesh but not in a valid element" << endl;
abort();
}
++i;
}
}
......
......@@ -38,11 +38,7 @@ class xeExportSensors
}
~xeExportSensors()
{
std::map<int, xfem::xGeomElem*>::iterator itstart = sensor_to_elt.begin();
for (; itstart != sensor_to_elt.end(); itstart++)
{
delete itstart->second;
}
for (auto& id_geom : sensor_to_elt) delete id_geom.second;
}
void setMesh(xMesh* m);
......
/*
/*
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
See the NOTICE.md & LICENSE.md files for terms
and conditions.
*/
#include <list>
#include <set>
// xfem
#include "xGeomElem.h"
#include "xMesh.h"
// xexport
#include "xSensors.h"
// AOMD
#include "mEntity.h"
// xtool
#include "workInProgress.h"
#include <list>
#include <set>
namespace xexport
{
void xSensors::registerSensor(const int nb_, const Trellis_Util::mPoint pt_, xfem::xMesh* mesh_)
{
point_container.insert(std::pair<int, Trellis_Util::mPoint>(nb_, pt_));
std::set<AOMD::mEntity*> elts;
mesh_->locateElement(pt_, elts);
// in // if all proc do have a elts.size()==0 then sensor is out of mesh otherwise it is just in some proc that are not
// this one. => reduce on max of elts.size to test
// if (max==0) => message
// else if (elts.size()==0) => nothing
// else treatement
assert(xtool::workInProgress());
if (elts.size()==0)
{
std::cout << "sensor is out of mesh, it is not set" << std::endl;
}
else
{
AOMD::mEntity* elt = *(elts.begin());
xfem::xGeomElem* geo = new xfem::xGeomElem(elt);
geo->setUVWForXYZ(pt_);
geo->SetIntegrationPointNumberForDegree(0);
geom_elem_container.insert(std::pair<int, xfem::xGeomElem*>(nb_, geo));
}
}
void xSensors::registerSensor(const int nb_, const xtensor::xPoint pt_, xfem::xMesh* mesh_)
{
point_container.insert(std::make_pair(nb_, pt_));
auto list_pe_uvw = mesh_->locateElement(pt_);
// in // if all proc do have a elts.size()==0 then sensor is out of mesh otherwise it is just in some proc that are not
// this one. => reduce on max of elts.size to test
// if (max==0) => message
// else if (elts.size()==0) => nothing
// else treatement
assert(xtool::workInProgress());
if (list_pe_uvw.empty())
std::cout << "sensor is out of mesh, it is not set" << std::endl;
else
{
auto pe_uvw = list_pe_uvw.front();
std::unique_ptr<xfem::xGeomElem> geo(new xfem::xGeomElem(const_cast<AOMD::mEntity*>(pe_uvw.first)));
geo->setUVW(pe_uvw.second);
geo->SetIntegrationPointNumberForDegree(0);
geom_elem_container.insert(std::make_pair(nb_, std::move(geo)));
}
}
void xSensors::reinit(xfem::xMesh* mesh_)
{
clean();
std::map<int, Trellis_Util::mPoint>::const_iterator it=point_container.begin();
std::vector<int> to_remove;
for (; it!=point_container.end(); ++it)
void xSensors::reinit(xfem::xMesh* mesh_)
{
clean();
std::vector<int> to_remove;
for (const auto& id_point : point_container)
{
int nb = id_point.first;
const xtensor::xPoint& p = id_point.second;
auto list_pe_uvw = mesh_->locateElement(p);
if (list_pe_uvw.empty())
{
int nb = it->first;
Trellis_Util::mPoint p = it->second;
std::set<AOMD::mEntity*> elts;
mesh_->locateElement(p, elts);
if (elts.size()==0)
{
std::cout << "sensor " << nb << " is out of mesh, it is removed" << std::endl;
to_remove.push_back(nb);
}
else
{
AOMD::mEntity* elt = *(elts.begin());
xfem::xGeomElem* geo = new xfem::xGeomElem(elt);
geo->setUVWForXYZ(p);
geo->SetIntegrationPointNumberForDegree(0);
geom_elem_container.insert(std::pair<int, xfem::xGeomElem*>(nb,geo));
}
std::cout << "sensor " << nb << " is out of mesh, it is removed" << std::endl;
to_remove.push_back(nb);
}
for (std::vector<int>::const_iterator it=to_remove.begin(); it!=to_remove.end(); ++it)
else
{
int nb = *it;
point_container.erase(nb);
auto pe_uvw = list_pe_uvw.front();
std::unique_ptr<xfem::xGeomElem> geo(new xfem::xGeomElem(const_cast<AOMD::mEntity*>(pe_uvw.first)));
geo->setUVW(pe_uvw.second);
geo->SetIntegrationPointNumberForDegree(0);
geom_elem_container.insert(std::make_pair(nb, std::move(geo)));
}
}
}
for (auto id : to_remove) point_container.erase(id);
}
xExportSensors::~xExportSensors()
{
for (std::map<std::string, std::map<int, std::fstream*> >::iterator it=to_export_container.begin(); it!=to_export_container.end(); ++it)
xExportSensors::~xExportSensors()
{
for (std::map<std::string, std::map<int, std::fstream*>>::iterator it = to_export_container.begin();
it != to_export_container.end(); ++it)
{
std::map<int, std::fstream*>& filestr_map = it->second;
for (std::map<int, std::fstream*>::iterator itm = filestr_map.begin(); itm != filestr_map.end(); ++itm)
{
std::map<int, std::fstream*>& filestr_map = it->second;
for (std::map<int, std::fstream*>::iterator itm=filestr_map.begin(); itm!=filestr_map.end(); ++itm)
{
if (itm->second)
{
itm->second->close();
delete itm->second;
}
}
filestr_map.clear();
if (itm->second)
{
itm->second->close();
delete itm->second;
}
}
to_export_container.clear();
}
filestr_map.clear();
}
to_export_container.clear();
}
void xExportSensors::init(const xParseData& sensor_parser_, xfem::xMesh* mesh_, const int step_string_length_,
std::string key_label_, std::string point_label_)
{
step_string_length = step_string_length_;
std::list<std::string> string_list = sensor_parser_.getListString(key_label_);
std::list<std::string>::const_iterator it = string_list.begin();
for (; it!=string_list.end(); ++it)
{
to_export_container.insert(std::pair<std::string, std::map<int, std::fstream*> >(*it, std::map<int, std::fstream*>()));
}
std::list<xtensor::xVector<> > point_list = sensor_parser_.getListVector(point_label_);
std::list<xtensor::xVector<> >::const_iterator itp = point_list.begin();
int counter = 1;
for (; itp!=point_list.end(); ++itp, ++counter)
{
xtensor::xVector<> vec = *itp;
sensors.registerSensor(counter, Trellis_Util::mPoint(vec(0),vec(1),vec(2)), mesh_);
}
}
void xExportSensors::init(const xParseData& sensor_parser_, xfem::xMesh* mesh_, const int step_string_length_,
std::string key_label_, std::string point_label_)
{
step_string_length = step_string_length_;
std::list<std::string> string_list = sensor_parser_.getListString(key_label_);
for (auto name : string_list)
{
to_export_container.insert(std::pair<std::string, std::map<int, std::fstream*>>(name, std::map<int, std::fstream*>()));
}
int counter = 1;
for (auto pt : sensor_parser_.getListVector(point_label_)) sensors.registerSensor(counter++, pt, mesh_);
}
bool xExportSensors::toExport(const std::string& export_name_) {
std::map<std::string, std::map<int, std::fstream*> >::const_iterator it = to_export_container.find(export_name_);
if (it!=to_export_container.end()) return true;
return false;
}
bool xExportSensors::toExport(const std::string& export_name_)
{
return to_export_container.find(export_name_) != to_export_container.end();
}
} // namespace xexport
/*
/*
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
See the NOTICE.md & LICENSE.md files for terms
and conditions.
*/
#ifndef _SENSOR_H
#define _SENSOR_H
#include "xEval.h"
#include "xParseData.h"
#include <fstream>
#include <iostream>
#include <map>
#include <sstream>
// xtensor
#include "xPoint.h"
#include "xTensor2.h"
// xfem
#include "xCommandOnGeomElem.h"
#include "xRegion.h"
#include "xEval.h"
#include "xIntegrationRule.h"
#include "xParseData.h"
#include "xRegion.h"
#include "mPoint.h"
#include <map>
#include <iostream>
#include <sstream>
#include <fstream>
// A xSensors is a collection of mPoint numbered (map) where measure may
// A xSensors is a collection of xPoint numbered (map) where measure may
// be needed. Measure is done through the use of xEval<T>.
// REMARKS:
// (1) nothing is done in the constructor, the "set" function add new mPoint
// (2) mPoint is checked whether or not it is on the mesh,
// (1) nothing is done in the constructor, the "set" function add new xPoint
// (2) xPoint is checked whether or not it is on the mesh,
// if not it is only removed (no assert())
// (3) "measure" measures only on mPoint number nb_ (and check if it exists, if not return false)
// (4) "measureAll" measures all existing mPoint
// (3) "measure" measures only on xPoint number nb_ (and check if it exists, if not return false)
// (4) "measureAll" measures all existing xPoint
// A xExportSensors has a member xSensors and works with the same behavior.
// REMARKS:
......@@ -37,264 +39,249 @@
// (2) files names must be defined in a .dat file read from xParseData EXPORT_SENSOR_LABELS, EXPORT_SENSOR_POINTS.
// (3) if a label in "measure" or "measureAll" doesn't match an EXPORT_SENSOR_LABELS, then no measure is done.
namespace xexport
{
class xSensors
{
class xSensors
{
public:
xSensors() {}
~xSensors() { clean(); }
xSensors() {}
~xSensors() { clean(); }
// set new mPoint to the point_container, and xfem::xGeomElem* to the geom_elem_container
void registerSensor(const int nb_, const Trellis_Util::mPoint pt_, xfem::xMesh* mesh_);
// set new mPoint to the point_container, and xfem::xGeomElem* to the geom_elem_container
void registerSensor(const int nb_, const xtensor::xPoint pt_, xfem::xMesh* mesh_);
void registerBox(const int nb_, const xfem::xEntityFilter box_)
{
box_filter_container.insert(std::make_pair(nb_, box_));
}
void registerBox(const int nb_, const xfem::xEntityFilter box_) { box_filter_container.insert(std::make_pair(nb_, box_)); }
// remove mPoint from the point_container and xfem::xGeomElem* from the geom_elem_container
inline void removeSensor(const int nb_);
// remove mPoint from the point_container and xfem::xGeomElem* from the geom_elem_container
inline void removeSensor(const int nb_);
// remove all point from the point_container and all xfem::xGeomElem* from the geom_elem_container
inline void removeAll();
// remove all point from the point_container and all xfem::xGeomElem* from the geom_elem_container
inline void removeAll();
// reinit all xfem::xGeomElem* of the geom_elem_container from point_container
void reinit(xfem::xMesh* mesh_);
// reinit all xfem::xGeomElem* of the geom_elem_container from point_container
void reinit(xfem::xMesh* mesh_);
// measure value from an evaluator on mPoint number nb_
template <typename T>
bool measure(const xfem::xEval<T>& eval_, const int nb_, T& val_);
// measure value from an evaluator on mPoint number nb_
template <typename T>
bool measure(const xfem::xEval<T>& eval_, const int nb_, T& val_);
// measure value from an evaluator on all mPoint
template <typename T>
void measureAll(const xfem::xEval<T>& eval_, std::map<int, T>& val_map_);
// measure value from an evaluator on all mPoint
template <typename T>
void measureAll(const xfem::xEval<T>& eval_, std::map<int, T>& val_map_);
// measure maximum value on a predefined box
template <typename ITER>
bool measureMaxOnBox(const xfem::xEval<double>& eval_, const int nb_, const xfem::xIntegrationRule& integration_rule_, const ITER& begin_, const ITER& end_, double& val_)
// measure maximum value on a predefined box
template <typename ITER>
bool measureMaxOnBox(const xfem::xEval<double>& eval_, const int nb_, const xfem::xIntegrationRule& integration_rule_,
const ITER& begin_, const ITER& end_, double& val_)
{
std::map<int, xfem::xEntityFilter>::const_iterator found = box_filter_container.find(nb_);
if (found != box_filter_container.end())
{
std::map<int, xfem::xEntityFilter>::const_iterator found=box_filter_container.find(nb_);
if (found!=box_filter_container.end()) {
val_=-std::numeric_limits<double>::max();
xfem::xEvalMaxCommand<const xfem::xEval<double> > command(eval_, val_);
xfem::xFilteredRegion<ITER, xfem::xEntityFilter> fr(begin_, end_, found->second);
ApplyCommandOnIntegrationRule(command, integration_rule_, fr.begin(), fr.end());
return true;
}
return false;
val_ = -std::numeric_limits<double>::max();
xfem::xEvalMaxCommand<const xfem::xEval<double>> command(eval_, val_);
xfem::xFilteredRegion<ITER, xfem::xEntityFilter> fr(begin_, end_, found->second);
ApplyCommandOnIntegrationRule(command, integration_rule_, fr.begin(), fr.end());
return true;
}
template <typename ITER>
void measureMaxOnAllBoxes(const xfem::xEval<double>& eval_, const xfem::xIntegrationRule& integration_rule_, const ITER& begin_, const ITER& end_, std::map<int, double>& val_map_)
return false;
}
template <typename ITER>
void measureMaxOnAllBoxes(const xfem::xEval<double>& eval_, const xfem::xIntegrationRule& integration_rule_,
const ITER& begin_, const ITER& end_, std::map<int, double>& val_map_)
{
double val = 0.;
for (const auto& id_filter : box_filter_container)
{
double val=0.;
std::map<int, xfem::xEntityFilter>::const_iterator it=box_filter_container.begin();
for (; it!=box_filter_container.end(); ++it) {
measureMaxOnBox(eval_, it->first, integration_rule_, begin_, end_, val);
if(val>-std::numeric_limits<double>::max()) {
val_map_.insert(std::pair<int, double>(it->first, val));
}
}
int id = id_filter.first;
measureMaxOnBox(eval_, id, integration_rule_, begin_, end_, val);
if (val > -std::numeric_limits<double>::max())
{
val_map_.insert(std::pair<int, double>(id, val));
}
}
}
private:
// clean geom_elem_container
inline void clean();
// clean geom_elem_container
inline void clean();
std::map<int, Trellis_Util::mPoint> point_container;
std::map<int, xfem::xGeomElem* > geom_elem_container;
std::map<int, xfem::xEntityFilter > box_filter_container;
};
std::map<int, xtensor::xPoint> point_container;
std::map<int, std::unique_ptr<xfem::xGeomElem>> geom_elem_container;
std::map<int, xfem::xEntityFilter> box_filter_container;
};
class xExportSensors
{
class xExportSensors
{
public:
xExportSensors() { xtensor::xTensor2<>::setExportFormat(0); }
~xExportSensors();
xExportSensors() { xtensor::xTensor2<>::setExportFormat(0); }
~xExportSensors();
// read xParseData EXPORT_SENSOR_LABELS to get all file names and EXPORT_SENSOR_POINTS to get all mPoint
void init(const xParseData& sensor_parser_, xfem::xMesh* mesh_, const int step_string_length_=2,
std::string key_label_="EXPORT_SENSOR_LABELS", std::string point_label_="EXPORT_SENSOR_POINTS");
// read xParseData EXPORT_SENSOR_LABELS to get all file names and EXPORT_SENSOR_POINTS to get all xPoint
void init(const xParseData& sensor_parser_, xfem::xMesh* mesh_, const int step_string_length_ = 2,
std::string key_label_ = "EXPORT_SENSOR_LABELS", std::string point_label_ = "EXPORT_SENSOR_POINTS");
bool toExport(const std::string& export_name_);
bool toExport(const std::string& export_name_);
// reinits xSensor geom_elem_container member
inline void reinit(xfem::xMesh* mesh_);
// reinits xSensor geom_elem_container member
inline void reinit(xfem::xMesh* mesh_);
// measures and writes into a file named
// "sensor_"+nb_+export_name_+".txt" if sensor nb_ exists and
// if export_name_ matches a string in to_export_container
template <typename T>
void measure(const xfem::xEval<T>& eval_, const double time_, const int nb_, const std::string export_name_);
// measures and writes into a file named
// "sensor_"+nb_+export_name_+".txt" if sensor nb_ exists and
// if export_name_ matches a string in to_export_container
template <typename T>
void measure(const xfem::xEval<T>& eval_, const double time_, const int nb_, const std::string export_name_);
// measures and writes into files named
// "sensor_"+nb+export_name+".txt" for all existing sensor nb
// if export_name_ matches a string in to_export_container
template <typename T>
void measureAll(const xfem::xEval<T>& eval_, const double time_, const std::string export_name_);
// measures and writes into files named
// "sensor_"+nb+export_name+".txt" for all existing sensor nb
// if export_name_ matches a string in to_export_container
template <typename T>
void measureAll(const xfem::xEval<T>& eval_, const double time_, const std::string export_name_);
template <typename T>
void measure(const T& val_, const double time_, const std::string export_name_);
template <typename T>
void measure(const T& val_, const double time_, const std::string export_name_);
private:
inline std::string outputId(const int time_id);
xSensors sensors;
std::map<std::string, std::map<int, std::fstream*> > to_export_container;
int step_string_length;
};
void xSensors::removeSensor(const int nb_)
{
xfem::xGeomElem* geo = geom_elem_container[nb_];
if (geo) delete geo;
geom_elem_container.erase(nb_);
point_container.erase(nb_);
}
void xSensors::removeAll()
{
clean();
point_container.clear();
}
void xSensors::clean()
{
std::map<int, xfem::xGeomElem*>::iterator it=geom_elem_container.begin();
for (; it!=geom_elem_container.end(); ++it)
inline std::string outputId(const int time_id);
xSensors sensors;
std::map<std::string, std::map<int, std::fstream*>> to_export_container;
int step_string_length;
};
void xSensors::removeSensor(const int nb_)
{
geom_elem_container.erase(nb_);
point_container.erase(nb_);
}
void xSensors::removeAll()
{
clean();
point_container.clear();
}