Commit bc14d18b authored by Nicolas CHEVAUGEON's avatar Nicolas CHEVAUGEON

m] library xGeomTools added

Main changes :
- A new library xGeomTools is added in xGeom.
  *This library is meant to collect "simple" geometrical classes/functions.
   By "simple" we mean that they dependent only on xtensor, and xtool.
  *All the classes and functions of xGeomTools are in namespace xgeom.
  *For this commit it contains :
   xBoundingBox.h/cc, xOctreeGrid.h, xRegularGrid.h/cc, xSimpleGeometry.h,
   moved from xTensor or xFEM.
  *Previous library xGeom is split in two libraries : xDistanceNearest and
   xScanElement in respectivevly xGeom/xDistanceNearest
   and xGeom/xScanElement,
  *The old xGeom library do not exist any more.
  *Note that the 3 libraries contained in directory xGeom populate
   the namespace xGeom.
  *Global build option BUILD_XGEOM is removed.
  *Global build option BUILD_XGEOMTOOLS, BUILD_XDISTANCENEAREST,
    BUILD_XSCANELEMENT are added.
  *xGeom/CMakeLists.txt is removed
  *xUTil/cmakeUtil :
   FindxGeomTools.cmake, FindxDistanceNearest.cmake, FindxScanElement.cmake
   added, FindxGeom.cmake is removed.
  *xAnalyticalSolution, xCrack, xDoubleCut, xLegacySimpleCut, xDomainDecomp,
   xExport, xExt, xFEM, xInterfaceAOMD, xMeshInterface, xOctree, xMapping,
   xTLS, now depend on  xGeomTools.
  *xOctree and xTLS now depends on xDistanceNearest
- xBoundingBox :
  *added member functions  inclose(), now used in xMesh, xSubMesh
  and xLagrangeMapping.
  *added default constructor and constructor for 2 xPoint.
  *default constructor now build an  empty "bb"  by havinh min(i) > max (i)
- xRegularGrid : dependencies to xMesh are removed.
- xMesh.h :  part of previous xOctreeGrid that was dependent of xMesh are
  no directly implemented in xMesh. (see xMesh::createGrid() and
  xMesh::locateElement)

Miscanelous changes along the way (removing useless dependencies)
- xValue.cc : removed "useless" inclusions of "xApproxFunction.h",
  "xField.h", "xLevelSet.h", "xSpacePolynomial.h", "xTensors.h",
  "xTensorsPtr.h" "xVector.h" as well as useless using AOMD::mEdge
  and using AOMD::mEntity.
- xValue.h : removed useless inclusions of  <set>,
  <boost/graph/adjacency_list.hpp>, <boost/graph/connected_components.hpp>,
  "xTensorsPtr.h", "xDebug.h", "xNearestNeighborInterface.h"
- xValue_imp.h : removed useless includes "mEdge.h" and "xGeomeElem.h"
- xValueManager.h - removed dependencies to xMesh.
- some of AOMD include cascading in other files because of the previous
  removed inclusion were putting std::string in global namespace.
  std::string is now added in the following files :
  std::string xExport.h, xExportEnsight, xExportGmsh.h
  xExportTranslate.cc/h, xField.h, xFEM/src/xSpacePolynomial.h.
- xData.cc inside void xData::ReadInfo(const char *filename),
  unused variable xBoundary crvboundary; is removed.
- all modified and added files are clang-formatted.
parent b71ddff8
......@@ -24,11 +24,18 @@ if(BUILD_XTOOL)
add_subdirectory(xTool "${CMAKE_CURRENT_BINARY_DIR}/xTool")
endif()
add_subdirectory(xTensor "${CMAKE_CURRENT_BINARY_DIR}/xTensor")
if(BUILD_XGEOMTOOLS)
add_subdirectory(xGeom/xGeomTools "${CMAKE_CURRENT_BINARY_DIR}/xGeom/xGeomTools")
endif(BUILD_XGEOMTOOLS)
add_subdirectory(xMapping "${CMAKE_CURRENT_BINARY_DIR}/xMapping")
if(BUILD_TRELLIS)
add_subdirectory(Trellis "${CMAKE_CURRENT_BINARY_DIR}/Trellis")
endif(BUILD_TRELLIS)
if(BUILD_XINTERFACE_AOMD_GENERAL)
add_subdirectory(xInterface/AOMD/ "${CMAKE_CURRENT_BINARY_DIR}/xInterface/AOMD")
endif()
......@@ -62,12 +69,9 @@ endif()
if(BUILD_XFEM)
option(USE_XREFMESH_WITH_SUB "use mesh refinement with submesh" OFF)
option(USE_DEBUG_FLAG "use DEBUG print" OFF)
add_subdirectory(xTensor "${CMAKE_CURRENT_BINARY_DIR}/xTensor")
add_subdirectory(xMapping "${CMAKE_CURRENT_BINARY_DIR}/xMapping")
add_subdirectory(xQuadrature "${CMAKE_CURRENT_BINARY_DIR}/xQuadrature")
add_subdirectory(xFEM "${CMAKE_CURRENT_BINARY_DIR}/xFEM")
add_subdirectory(xExport "${CMAKE_CURRENT_BINARY_DIR}/xExport")
endif(BUILD_XFEM)
......@@ -98,9 +102,14 @@ if(BUILD_XDISTMESH)
endif()
if(BUILD_XGEOM)
add_subdirectory(xGeom "${CMAKE_CURRENT_BINARY_DIR}/xGeom")
endif(BUILD_XGEOM)
if(BUILD_XDISTANCENEAREST)
add_subdirectory(xGeom/xDistanceNearest "${CMAKE_CURRENT_BINARY_DIR}/xGeom/xDistanceNearest")
endif(BUILD_XDISTANCENEAREST)
if(BUILD_XSCANELEMENT)
add_subdirectory(xGeom/xScanElement "${CMAKE_CURRENT_BINARY_DIR}/xGeom/xScanElement")
endif(BUILD_XSCANELEMENT)
if(BUILD_XOCTREE)
......
......@@ -13,6 +13,7 @@ add_library(xAnalyticalSolution ${BUILD_SHARED_LIBS} ${sources} )
find_package(Trellis REQUIRED)
find_package(xTool REQUIRED)
find_package(xGeomTools REQUIRED)
find_package(xFEM REQUIRED)
find_package(xQuadrature)
find_package(xInterfaceAOMDGeneral)
......@@ -22,9 +23,10 @@ find_package(Boost REQUIRED)
list(APPEND EXTERNAL_INCLUDES
${Boost_INCLUDE_DIRS}
${xTool_INCLUDE_DIR}
${xGeomTools_INCLUDE_DIR}
${xFEM_INCLUDE_DIR}
${xQuadrature_INCLUDE_DIR}
${Trellis_INCLUDE_DIR}
${xQuadrature_INCLUDE_DIR}
${Trellis_INCLUDE_DIR}
${xInterfaceAOMDGeneral_INCLUDE_DIR}
${MPI_CXX_INCLUDE_PATH}
)
......
......@@ -7,6 +7,7 @@ set( text "--------------- --")
message_verbose(text)
find_package(xTool REQUIRED)
find_package(xGeomTools REQUIRED)
find_package(xInterfaceAOMDGeneral REQUIRED)
find_package(Trellis REQUIRED)
find_package(xQuadrature )
......@@ -36,15 +37,16 @@ include_directories(
src
${Boost_INCLUDE_DIR}
${xTool_INCLUDE_DIR}
${xGeomTools_INCLUDE_DIR}
${xInterfaceAOMDGeneral_INCLUDE_DIR}
${xFEM_INCLUDE_DIR}
${xLegacySimpleCut_INCLUDE_DIR}
${xFEM_INCLUDE_DIR}
${xLegacySimpleCut_INCLUDE_DIR}
${Trellis_INCLUDE_DIR}
${xSolverBase_INCLUDE_DIR}
${xInterfaceSuperLu_INCLUDE_DIR}
${xInterfaceLapack_INCLUDE_DIR}
${Boost_INCLUDE_DIR}
${xQuadrature_INCLUDE_DIR}
${xQuadrature_INCLUDE_DIR}
)
target_link_libraries(xCrack xLegacySimpleCut )
......
......@@ -22,6 +22,7 @@
#include "xGeomElem.h"
#include "xIntegrationRule.h"
#include "xMesh.h"
// xgeom
#include "xSimpleGeometry.h"
// xtensor
#include "xVector.h"
......@@ -38,9 +39,11 @@
using namespace xcrack;
using namespace xfem;
using namespace xgeom;
using namespace xtensor;
xtensor::xVector<> createProjectedMesh(const std::vector<xtensor::xPoint> &nodes, xlinalg::xCSRVector &lsn,
xlinalg::xCSRVector &lst, pGEntity classification, xMesh *theMesh)
xVector<> createProjectedMesh(const std::vector<xPoint> &nodes, xlinalg::xCSRVector &lsn, xlinalg::xCSRVector &lst,
pGEntity classification, xMesh *theMesh)
{
xlinalg::xDenseMatrix Aglob(4);
for (int ii = 0; ii < 4; ii++)
......@@ -86,15 +89,15 @@ xtensor::xVector<> createProjectedMesh(const std::vector<xtensor::xPoint> &nodes
point_on_front[(i0 + 1) % 3] = sol_sing_node[0];
point_on_front[(i0 + 2) % 3] = sol_sing_node[1];
// Tous ce qui précède ne sert qu'a calculer un point sur lfront
xtensor::xPoint ve_on_front(point_on_front[0], point_on_front[1], point_on_front[2]);
xtensor::xVector<> x_front_dir(v_front_dir[0], v_front_dir[1], v_front_dir[2]);
xPoint ve_on_front(point_on_front[0], point_on_front[1], point_on_front[2]);
xVector<> x_front_dir(v_front_dir[0], v_front_dir[1], v_front_dir[2]);
x_front_dir.norm();
map<double, AOMD::mVertex *> classe;
for (int ii = 0; ii < 4; ii++)
{
xtensor::xVector<> P0Pii(ve_on_front, nodes[ii]);
xVector<> P0Pii(ve_on_front, nodes[ii]);
double absc_proj = P0Pii * x_front_dir;
xtensor::xVector<> P0Proj = x_front_dir * absc_proj;
xVector<> P0Proj = x_front_dir * absc_proj;
AOMD::mVertex *proj_vert = theMesh->getMesh().createVertex(point_on_front[0] + P0Proj[0], point_on_front[1] + P0Proj[1],
point_on_front[2] + P0Proj[2], classification);
classe.insert(make_pair(absc_proj, proj_vert));
......@@ -135,7 +138,7 @@ void IntegratorSingularCrack3D_c::accept(xCommandOnGeomElem &command3d, AOMD::mE
xElement elem(e_geom3d); // interpo sur element de base!
// AOMD::mVertex* Vert[4]; -Wunused-but-set-variable says it is not used
// AOMD::mVertex* s_Vert[4];
std::vector<xtensor::xPoint> nodes(4);
std::vector<xPoint> nodes(4);
xlinalg::xCSRVector b_lsn0(4);
xlinalg::xCSRVector b_lst0(4);
for (int ii = 0; ii < 4; ii++)
......@@ -148,8 +151,7 @@ void IntegratorSingularCrack3D_c::accept(xCommandOnGeomElem &command3d, AOMD::mE
b_lst0[ii] = elem.getInterpoSca(valst);
}
xMesh mesh_points_on_crack;
xtensor::xVector<> x_front_dir =
createProjectedMesh(nodes, b_lsn0, b_lst0, e_geom3d->getClassification(), &mesh_points_on_crack);
xVector<> x_front_dir = createProjectedMesh(nodes, b_lsn0, b_lst0, e_geom3d->getClassification(), &mesh_points_on_crack);
// if (debug)
// AOMD_Util::Instance()->ex_port("localcrackfront.msh",&mesh_points_on_crack);
......@@ -200,7 +202,7 @@ void IntegratorSingularCrack3D_c::accept(xCommandOnGeomElem &command3d, AOMD::mE
AOMD::mVertex *Vert00 = (AOMD::mVertex *)e1->get(0, 0);
AOMD::mVertex *Vert01 = (AOMD::mVertex *)e1->get(0, 1);
// si edge miniscule, i.e. probleme numerique pour la projection precedente, pas de calcul
xtensor::xVector<> seg_elem(Vert00->point(), Vert01->point());
xVector<> seg_elem(Vert00->point(), Vert01->point());
double norme_xvect = seg_elem.mag();
if (norme_xvect > 1.0e-15)
{
......@@ -211,13 +213,13 @@ void IntegratorSingularCrack3D_c::accept(xCommandOnGeomElem &command3d, AOMD::mE
{
one_d_segment.setUVW(k);
const bool special_z = false;
xtensor::xPoint integ_point;
xPoint integ_point;
double w;
if (!special_z)
integ_point = one_d_segment.getXYZ();
else
{
xtensor::xPoint uvw = one_d_segment.getUVW();
xPoint uvw = one_d_segment.getUVW();
w = uvw(0);
uvw(0) = 2. * (1. - ((1. + w) / 2.) * ((1. + w) / 2.)) - 1.; // special Z-mapping
one_d_segment.setUVW(uvw);
......
......@@ -22,6 +22,7 @@
// AOMD
#include "ParUtil.h"
#include "mEdge.h"
#ifdef PARALLEL
#include "autopack.h"
......@@ -105,20 +106,20 @@ void xcFront::createFronts()
const bool debug = false;
int verbose = parameters.getInt("sifs_verbosity");
xMesh &front_mesh_mod = (const_cast<xMesh &>(front_mesh));
AOMD::mMesh& mmesh=front_mesh_mod.getMesh();
//front_mesh_mod.modifyAllState();
mmesh.modifyState( 3, 2, true );
mmesh.modifyState( 3, 1, true );
mmesh.modifyState( 3, 0, true );
mmesh.modifyState( 2, 1, true );
mmesh.modifyState( 2, 0, true );
mmesh.modifyState( 1, 0, true );
mmesh.modifyState( 0, 1, true );
mmesh.modifyState( 0, 2, true );
mmesh.modifyState( 0, 3, true );
mmesh.modifyState( 1, 2, true );
mmesh.modifyState( 1, 3, true );
mmesh.modifyState( 2, 3, true );
AOMD::mMesh &mmesh = front_mesh_mod.getMesh();
// front_mesh_mod.modifyAllState();
mmesh.modifyState(3, 2, true);
mmesh.modifyState(3, 1, true);
mmesh.modifyState(3, 0, true);
mmesh.modifyState(2, 1, true);
mmesh.modifyState(2, 0, true);
mmesh.modifyState(1, 0, true);
mmesh.modifyState(0, 1, true);
mmesh.modifyState(0, 2, true);
mmesh.modifyState(0, 3, true);
mmesh.modifyState(1, 2, true);
mmesh.modifyState(1, 3, true);
mmesh.modifyState(2, 3, true);
front_mesh_global = new xMesh;
if (verbose) cout << "broadcasting_front_mesh" << endl;
......@@ -533,8 +534,8 @@ void xcFrontPart::createDomainsAndRadialFunction()
// int dim_front = front_mesh.dim();
int dim_mesh = mesh.dim();
// (const_cast<xMesh &>(mesh)).modifyState(0, dim_mesh, true);
(const_cast<xMesh &>(mesh)).getMesh().modifyState(0, dim_mesh, true);
// (const_cast<xMesh &>(mesh)).modifyState(0, dim_mesh, true);
(const_cast<xMesh &>(mesh)).getMesh().modifyState(0, dim_mesh, true);
mesh.createSubMesh(subset_for_int_label);
xcElementsAlongFrontCreator seed_creator(front_mesh, front_part_name, front_distance);
......
......@@ -67,6 +67,7 @@ if(USE_XGEOM)
endif()
find_and_set(xTool xTool XDOUBLECUT_EXTERNAL_INCLUDES NOTHING REQUIRED )
find_and_set(xGeomTools xGeomTools XDOUBLECUT_EXTERNAL_INCLUDES NOTHING REQUIRED )
find_and_set(xInterfaceAOMDGeneral xInterfaceAOMDGeneral XDOUBLECUT_EXTERNAL_INCLUDES NOTHING REQUIRED )
find_and_set(Trellis Trellis XDOUBLECUT_EXTERNAL_INCLUDES NOTHING REQUIRED )
find_and_set(xFEM xFEM XDOUBLECUT_EXTERNAL_INCLUDES NOTHING REQUIRED )
......
......@@ -12,17 +12,16 @@
// boost
#include <boost/bimap.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/connected_components.hpp>
// AOMD
#include "mEntity.h"
// xfem
#include "xAttachableChar.h"
#include "xAttachableString.h"
#include "xExportGmsh.h"
#include "xGetSupport.h"
#include "xSupportComponent.h"
// xcut
#include "xElemCutData.h"
#include "xElemCutDomainData.h"
......
......@@ -34,6 +34,7 @@ find_and_set(xTool xTool XLEGACYSIMPLECUT_EXTERN
#find_and_set(xTensor xTensor XLEGACYSIMPLECUT_EXTERNAL_INCLUDES NOTHING REQUIRED )
find_and_set(xInterfaceAOMDGeneral xInterfaceAOMDGeneral XLEGACYSIMPLECUT_EXTERNAL_INCLUDES NOTHING REQUIRED )
find_and_set(Trellis Trellis XLEGACYSIMPLECUT_EXTERNAL_INCLUDES NOTHING REQUIRED )
find_and_set(xGeomTools xGeomTools XLEGACYSIMPLECUT_EXTERNAL_INCLUDES NOTHING REQUIRED )
find_and_set(xFEM xFEM XLEGACYSIMPLECUT_EXTERNAL_INCLUDES NOTHING )
find_and_set(Boost Boost XLEGACYSIMPLECUT_EXTERNAL_INCLUDES NOTHING REQUIRED )
find_and_set(xQuadrature xQuadrature XLEGACYSIMPLECUT_EXTERNAL_INCLUDES NOTHING )
......
......@@ -15,6 +15,7 @@ set(XDOD_INCLUDES Solver Solver/Mumps DomainManager)
find_and_set(Boost Boost XDOD_EXTERNAL_INCLUDES NOTHING REQUIRED )
find_and_set(Trellis Trellis XDOD_EXTERNAL_INCLUDES NOTHING REQUIRED )
find_and_set(xTool xTool XDOD_EXTERNAL_INCLUDES NOTHING REQUIRED )
find_and_set(xGeomTools xGeomTools XDOD_EXTERNAL_INCLUDES NOTHING REQUIRED )
find_and_set(xFEM xFEM XDOD_EXTERNAL_INCLUDES NOTHING REQUIRED )
find_and_set(xQuadrature xQuadrature XDOD_EXTERNAL_INCLUDES NOTHING )
find_and_set(xSolverBase xSolverBase XDOD_EXTERNAL_INCLUDES NOTHING REQUIRED )
......
......@@ -17,6 +17,7 @@ file(GLOB src_files src/*.cc src/*.h )
find_package(xTool REQUIRED )
find_package(xInterfaceAOMDGeneral REQUIRED )
find_package(xTensor REQUIRED )
find_package(xGeomTools REQUIRED )
find_package(xFEM REQUIRED )
find_package(xQuadrature )
find_package(Trellis REQUIRED )
......@@ -30,9 +31,10 @@ include_directories(
src
${xTool_INCLUDE_DIR}
${xInterfaceAOMDGeneral_INCLUDE_DIR}
${xQuadrature_INCLUDE_DIR}
${xFEM_INCLUDE_DIR}
${xTensor_INCLUDE_DIR}
${xQuadrature_INCLUDE_DIR}
${xFEM_INCLUDE_DIR}
${xTensor_INCLUDE_DIR}
${xGeomTools_INCLUDE_DIR}
${Trellis_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
)
......
......@@ -39,12 +39,12 @@ class xExport
int getNbSplit() const { return nbsplit; }
int getNbSplit(AOMD::mEntity *e) const { return filterSplit(e) ? nbsplit : nbsplitdefault; }
string getFileNameExtension() const { return filename_extension; }
string getFileNamePrefix() const { return filename_prefix; }
std::string getFileNameExtension() const { return filename_extension; }
std::string getFileNamePrefix() const { return filename_prefix; }
void setFilterSplit(const xfem::xEntityFilter &fin) { filterSplit = fin; }
virtual ~xExport() = default;
virtual void openFile(const string &fName) = 0;
virtual void startView(const string &comment) = 0;
virtual void openFile(const std::string &fName) = 0;
virtual void startView(const std::string &comment) = 0;
virtual void exportPoint(const xtensor::xPoint &P1, const double &val1) = 0;
virtual void exportPoint(const xtensor::xPoint &P1, const xtensor::xVector<> &val1) = 0;
......@@ -115,8 +115,8 @@ class xExport
bool process_started;
int nbsplit;
int nbsplitdefault;
string filename_extension;
string filename_prefix;
std::string filename_extension;
std::string filename_prefix;
xfem::xEntityFilter filterSplit;
MPI_Comm world;
......
......@@ -67,30 +67,30 @@ class xExportEnsight : public xExport
};
private:
string project_name_; // nom du projet
std::string project_name_; // nom du projet
// int cptFigure_;
string current_variable_name_;
std::string current_variable_name_;
short typeElement_;
short typeVariable_;
public:
list<Coordon> liste; // Pour les coordonnées.
/*pour la dependance du temps on vérifiera la longeur de la liste
std::list<Coordon> liste; // Pour les coordonnées.
/*pour la dependance du temps on vérifiera la longeur de la std::liste
de Coordon par rapport à la taille des variables, et si on est pas égal, alors c'est en fonction du temps
et on pourra trouver la dépendace ( nombre de pas de temps ) pa rapport a un calcul */
list<float> scalaire;
list<Coordon> vecteur;
list<Tensor> tensor;
std::list<float> scalaire;
std::list<Coordon> vecteur;
std::list<Tensor> tensor;
Figure();
Figure(string); // on donne juste le nom du project
Figure(std::string); // on donne juste le nom du project
// Figure(const Figure&);
string getProjectName() const;
std::string getProjectName() const;
short getTypeElem() const;
// int getCptFigure() const;
string getVariableName() const;
void setVariableName(const string& s);
std::string getVariableName() const;
void setVariableName(const std::string& s);
short getTypeVariable() const;
void addElem(float, float, float);
......@@ -102,7 +102,7 @@ class xExportEnsight : public xExport
void incrementCptFigure();
void addTypeElem(short);
void addNomFigure(const string&);
void addNomFigure(const std::string&);
void afficheToutCoordon() const;
// classe interne tensor.
......@@ -181,11 +181,11 @@ class xExportEnsight : public xExport
protected:
Figure fig;
ofstream fcase;
ofstream fgeo;
ofstream fscl;
ofstream fvct;
ofstream ftens;
std::ofstream fcase;
std::ofstream fgeo;
std::ofstream fscl;
std::ofstream fvct;
std::ofstream ftens;
bool writeGeo;
virtual void exportGeometry() = 0;
virtual void exportVariableScl() = 0;
......@@ -195,9 +195,9 @@ class xExportEnsight : public xExport
virtual void openLoadFic(std::ofstream&) = 0;
void writeHeaderCase();
string giveElemEnsight(short type);
std::string giveElemEnsight(short type);
string giveExtension(short a);
std::string giveExtension(short a);
bool isLoad() const;
void firstOn(short, short);
};
......@@ -207,10 +207,10 @@ class xExportEnsightAscii : public xExportEnsight
public:
xExportEnsightAscii(MPI_Comm world = MPI_COMM_WORLD);
~xExportEnsightAscii() override;
void startView(const string& comment) override;
void startView(const std::string& comment) override;
void endView() override;
void openFile(const string& fName) override;
void openFile(const std::string& fName) override;
void closeFile() override;
protected:
......@@ -227,10 +227,10 @@ class xExportEnsightBinary : public xExportEnsight
public:
xExportEnsightBinary(MPI_Comm world = MPI_COMM_WORLD);
~xExportEnsightBinary() override;
void startView(const string& comment) override;
void startView(const std::string& comment) override;
void endView() override;
void openFile(const string& fName) override;
void openFile(const std::string& fName) override;
void closeFile() override;
protected:
......
......@@ -130,10 +130,10 @@ class xExportGmshAscii : public xExportGmsh
public:
xExportGmshAscii(MPI_Comm world = MPI_COMM_WORLD);
~xExportGmshAscii() override;
void startView(const string &comment) override;
void startView(const std::string &comment) override;
void addDrawable(xGmshDrawable::gType, int, double *, double *, double *, double *) override; //
void endView() override;
void openFile(const string &fName) override;
void openFile(const std::string &fName) override;
void closeFile() override;
protected:
......@@ -146,10 +146,10 @@ class xExportGmshAsciigz : public xExportGmsh
public:
xExportGmshAsciigz(MPI_Comm world = MPI_COMM_WORLD);
virtual ~xExportGmshAsciigz();
void startView(const string &comment);
void startView(const std::string &comment);
virtual void addDrawable(xGmshDrawable::gType, int, double *, double *, double *, double *); //
void endView();
void openFile(const string &fName);
void openFile(const std::string &fName);
void closeFile();
protected:
......@@ -163,10 +163,10 @@ class xExportGmshBinary : public xExportGmsh
public:
xExportGmshBinary(MPI_Comm world = MPI_COMM_WORLD);
~xExportGmshBinary() override;
void startView(const string &comment) override;
void startView(const std::string &comment) override;
void addDrawable(xGmshDrawable::gType, int, double *, double *, double *, double *) override;
void endView() override;
void openFile(const string &fName) override;
void openFile(const std::string &fName) override;
void closeFile() override;
private:
......@@ -190,10 +190,10 @@ class xExportGmshMPIIO : public xExportGmsh
public:
xExportGmshMPIIO(MPI_Comm world = MPI_COMM_WORLD);
~xExportGmshMPIIO() override;
void startView(const string &comment) override;
void startView(const std::string &comment) override;
void addDrawable(xGmshDrawable::gType, int, double *, double *, double *, double *) override;
void endView() override;
void openFile(const string &fName) override;
void openFile(const std::string &fName) override;
void closeFile() override;
private:
......@@ -247,10 +247,10 @@ class xExportGmshAsciiSort : public xExportGmsh
public:
xExportGmshAsciiSort(MPI_Comm world = MPI_COMM_WORLD);
~xExportGmshAsciiSort() override;
void startView(const string &comment) override;
void startView(const std::string &comment) override;
void addDrawable(xGmshDrawable::gType, int, double *, double *, double *, double *) override; //
void endView() override;
void openFile(const string &fName) override;
void openFile(const std::string &fName) override;
void closeFile() override;
protected:
......
This diff is collapsed.
......@@ -21,31 +21,31 @@ namespace xexport
class xExportTranslate : public xExportEnsightBinary
{
public:
xExportTranslate(string, string, string);
xExportTranslate(std::string, std::string, std::string);
private:
ifstream fpos_;
string project_name_;
string cSrc_;
std::ifstream fpos_;
std::string project_name_;
std::string cSrc_;
bool isBinary_;
xExportEnsightBinary project_;
short giveTypeElementGmsh(char a);
short giveTypeVariable(const char nan);
bool isFileBinary(const string&);
bool isFileBinary(const std::string&);
void readGmshBinary();
void readGmshAscii();
void readFileGmsh();
void writeFileEnsight();
// second partie : traitement
string giveNomProject(string li);
std::string giveNomProject(std::string li);
bool isFinAc(char a);
bool isSeparateur(char a);
void traiteVariableScalaire(const string& ligne);
void traiteVariableVector(const string& ligne);
void traiteVariableTensor(const string& ligne);
void traiteVariable(string ligne);
void traiteVariableScalaire(const std::string& ligne);
void traiteVariableVector(const std::string& ligne);
void traiteVariableTensor(const std::string& ligne);
void traiteVariable(std::string ligne);
void readPosBinary(int nbr, int cpt);
void traiteElemBinaire(double* ptr, int cpt);
......
......@@ -16,6 +16,7 @@ file( GLOB sources src/*.cc src/*.h )
find_package(xTool REQUIRED )
find_package(xGeomTools REQUIRED )
find_package(xInterfaceAOMDGeneral REQUIRED )
find_package(Trellis REQUIRED )
find_package(xFEM REQUIRED )
......@@ -35,11 +36,12 @@ list(APPEND EXTERNAL_INCLUDES
${MPI_CXX_INCLUDE_PATH}
${Boost_INCLUDE_DIRS}
${xTool_INCLUDE_DIR}
${xGeomTools_INCLUDE_DIR}
${xInterfaceAOMDGeneral_INCLUDE_DIR}
${Trellis_INCLUDE_DIR}
${xFEM_INCLUDE_DIR}
${xQuadrature_INCLUDE_DIR}
${xLegacySimpleCut_INCLUDE_DIR}
${xQuadrature_INCLUDE_DIR}
${xLegacySimpleCut_INCLUDE_DIR}
${xSolverBase_INCLUDE_DIR}
${SuperLu_INCLUDE_DIR}
)
......
......@@ -37,6 +37,8 @@ endif()
find_package(xTool REQUIRED )
find_package(xTensor REQUIRED )
find_package(xGeomTools REQUIRED )
find_package(xInterfaceAOMDGeneral REQUIRED )
find_package(xSolverBase REQUIRED )
find_package(xInterfaceLapack REQUIRED )
......@@ -54,8 +56,9 @@ list(APPEND INCLUDES_DIR
${Boost_INCLUDE_DIRS}
${Trellis_INCLUDE_DIR}
${xMapping_INCLUDE_DIR}
${xQuadrature_INCLUDE_DIR}
${xTool_INCLUDE_DIR}
${xQuadrature_INCLUDE_DIR}
${xTool_INCLUDE_DIR}
${xGeomTools_INCLUDE_DIR}
${xTensor_INCLUDE_DIR}
${xInterfaceAOMDGeneral_INCLUDE_DIR}
${xSolverBase_INCLUDE_DIR}
......@@ -69,8 +72,8 @@ include_directories( ${INCLUDES_DIR} )
set_target_properties(xFEM PROPERTIES COMPILE_FLAGS "-Wno-deprecated ${FLAGS}" )
target_link_libraries( xFEM ${ANN_LIBRARIES} ${xTensor_LIBRARIES} )
target_link_libraries( xFEM ${ANN_LIBRARIES} ${xTensor_LIBRARIES} ${xGeomTools_LIBRARIES})
target_include_directories(xFEM PUBLIC ${INCLUDES_DIR})
install_target_in_destination(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
See the NOTICE.md & LICENSE.md files for terms
and conditions.
*/
#include "xAlgorithm.h"
#include "ParUtil.h"
using AOMD::ParUtil;
namespace xfem
{
// helper function for generateMpcWithL2Projection
int setDofNum(xValue < double > *v)
int setDofNum(xValue<double>* v)
{
xStateOfValue * s = v->getState();
return(( static_cast < const xStateOfValueDof * >( s ))->Numdof-1 );
xStateOfValue* s = v->getState();
return ((static_cast<const xStateOfValueDof*>(s))->Numdof - 1);
}
string GetFileNameWithProcessRank(const string& base, const string& exte)
{
#ifdef PARALLEL
stringstream expname;
expname << base + "_"<< ParUtil::Instance()->size() << "_" << ParUtil::Instance()->rank()+1 << exte;
return expname.str();
stringstream expname;
expname << base + "_" << ParUtil::Instance()->size() << "_" << ParUtil::Instance()->rank() + 1 << exte;
return expname.str();
#endif
#ifndef PARALLEL
return base + ".msh";
return base + ".msh";
#endif
}
}
} // namespace xfem
......@@ -457,7 +457,6 @@ void xData::ReadInfo(const char *filename)
xEnv env;
xPhysicalEnv *InfoEnv;
xBoundary crvboundary;
PhysicalEnv->clear();
char mat_class[NB_CHAR_MAX], mat_param[NB_CHAR_MAX], zone_name[NB_CHAR_MAX];
......
......@@ -13,6 +13,7 @@
#include <functional>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
#include "xApproxFctPtr.h"
......@@ -264,12 +265,12 @@ class xFieldPointwise : public xFieldBase
insert(f);
}
template <class T>
xFieldPointwise(value_manager_t* vm, const T& f, const string& val_) : value_manager(vm), val(val_), grad("grad")
xFieldPointwise(value_manager_t* vm, const T& f, const std::string& val_) : value_manager(vm), val(val_), grad("grad")
{
insert(f);
}
template <class T>
xFieldPointwise(value_manager_t* vm, const T& f, const string& val_, const string& grad_)
xFieldPointwise(value_manager_t* vm, const T& f, const std::string& val_, const std::string& grad_)
: value_manager(vm), val(val_), grad(grad_)
{
insert(f);
......@@ -282,8 +283,8 @@ class xFieldPointwise : public xFieldBase