Commit af6f2b76 authored by Nicolas CHEVAUGEON's avatar Nicolas CHEVAUGEON

[Xfiles] removing using xxx in global namespace in headers.

    - lot of using std or using xfem or using std::string etc ..  were still present in global namespace in some header. Following a discussion with A. Salzman, I removed most of them.

    - In the transition from mPoint to xPoint, Some using point = xtensor::xPoint were defined inside some class (xMapping, xElementfor example... ). They were identifyed as confusing by A. Salzman and are now removed.

    Most of the changes in this commit reflect the previous change. The guideline is to avoid hiding namespace at least at global scope in header-file. This can avoid some confusion and some surprising and hard to track effects where some stuff compil or not depending on the order of inclusion of header files.
parent a645d0e7
/****************************************************************************
/****************************************************************************
Copyright (C) 2004
Rensselaer Polytechnic Institute
This file is part of the Algorithm-Oriented Mesh Database (AOMD) written
and maintained by the Scientific Computation Research Center (SCOREC) at
This file is part of the Algorithm-Oriented Mesh Database (AOMD) written
and maintained by the Scientific Computation Research Center (SCOREC) at
Rensselaer Polytechnic Intitute, Troy, NY, USA.
This program is free software; you can redistribute it and/or modify it
under the terms of the Rensselaer SCOREC Public License.
This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license text for more details.
You should have received a copy of the Rensselaer SCOREC Public License
along with this program; if not, write to Rensselaer Polytechnic Institure,
110 8th Street, SCOREC, Troy, NY 12180, USA
......@@ -25,121 +25,100 @@
#define _MITERATORNEW_H_
#include <list>
#include "mEntityContainer.h"
#include <vector>
using std::vector;
#include "mEntityContainer.h"
class GEntity;
namespace AOMD {
class mEntity;
class mMesh;
namespace AOMD
{
class mEntity;
class mMesh;
class mIteratorNew
{
class mIteratorNew
{
public:
#ifdef ITER_DEBUG
static int id_generator;
static vector<mIteratorNew*> all_iters;
#endif
typedef std::forward_iterator_tag iterator_category;
typedef class mEntity value_type;
typedef class mEntity * pointer;
typedef class mEntity & reference;
typedef std::list<mEntity*>::iterator iter;
typedef std::list<mEntity*>::const_iterator citer;
#ifdef ITER_DEBUG
static int id_generator;
static std::vector<mIteratorNew *> all_iters;
#endif
typedef std::forward_iterator_tag iterator_category;
typedef class mEntity value_type;
typedef class mEntity *pointer;
typedef class mEntity &reference;
typedef std::list<mEntity *>::iterator iter;
typedef std::list<mEntity *>::const_iterator citer;
private:
#ifdef ITER_DEBUG
int id;
int id;
#endif
int typ; // type 1 : entityset iterator
int typ; // type 1 : entityset iterator
// type -2 ~ 0 : mesh iterator
int dim;
GEntity *ge;
mMeshEntityContainer *allEntities;
int dim;
GEntity *ge;
mMeshEntityContainer *allEntities;
std::list<mEntity*> container;
iter theIter;
std::list<mEntity *> container;
iter theIter;
// added for TSTT - seole Jul 09, 2004
#ifdef TSTT_
int wSize; // workset size
public:
// this one is added for TSTT entityset - seole 07/06/04
// type 1 - entityset iterator
mIteratorNew(std::list<mEntity*>& c, int type, int topo, int wsize=1);
// type 2 - mesh iterator
mIteratorNew(mMesh* mesh, int type, int topo, int wsize=1);
int wrkSize() { return wSize; }
int size() { return (int) container.size(); }
int type() { return typ; }
int wSize; // workset size
public:
// this one is added for TSTT entityset - seole 07/06/04
// type 1 - entityset iterator
mIteratorNew(std::list<mEntity *> &c, int type, int topo, int wsize = 1);
// type 2 - mesh iterator
mIteratorNew(mMesh *mesh, int type, int topo, int wsize = 1);
int wrkSize() { return wSize; }
int size() { return (int)container.size(); }
int type() { return typ; }
#endif
public:
mIteratorNew(mMeshEntityContainer *c,
int dim,
int t);
mIteratorNew(mMeshEntityContainer *c,
int dim,
GEntity *clas);
~mIteratorNew();
mMeshEntityContainer * getEntities () {return allEntities;}
friend class mMeshEntityContainer;
void append (mEntity *e);
void erase (mEntity *e);
inline bool operator != (mIteratorNew const &) const;
inline bool operator == (mIteratorNew const &) const;
inline mEntity * operator *() const;
inline bool end() const;
inline void next() ;
inline void reset() ;
inline mIteratorNew & operator++()
{
mIteratorNew(mMeshEntityContainer *c, int dim, int t);
mIteratorNew(mMeshEntityContainer *c, int dim, GEntity *clas);
~mIteratorNew();
mMeshEntityContainer *getEntities() { return allEntities; }
friend class mMeshEntityContainer;
void append(mEntity *e);
void erase(mEntity *e);
inline bool operator!=(mIteratorNew const &) const;
inline bool operator==(mIteratorNew const &) const;
inline mEntity *operator*() const;
inline bool end() const;
inline void next();
inline void reset();
inline mIteratorNew &operator++()
{
++theIter;
return *this;
}
inline mIteratorNew operator++(int)
{
}
inline mIteratorNew operator++(int)
{
mIteratorNew tmp = *this;
++(*this);
return tmp;
}
};
inline bool mIteratorNew :: end() const
{
citer iend = theIter;
return container.end() == iend;
}
inline void mIteratorNew :: next ()
{
++(*this);
}
inline void mIteratorNew :: reset ()
{
theIter = container.begin();
}
inline mEntity* mIteratorNew :: operator * () const
{
return *theIter;
}
inline bool mIteratorNew :: operator != (mIteratorNew const & other) const
{
return theIter != other.theIter;
}
inline bool mIteratorNew :: operator == (mIteratorNew const & other) const
{
return theIter == other.theIter;
}
} // end of namespace
}
};
inline bool mIteratorNew ::end() const
{
citer iend = theIter;
return container.end() == iend;
}
inline void mIteratorNew ::next() { ++(*this); }
inline void mIteratorNew ::reset() { theIter = container.begin(); }
inline mEntity *mIteratorNew ::operator*() const { return *theIter; }
inline bool mIteratorNew ::operator!=(mIteratorNew const &other) const { return theIter != other.theIter; }
inline bool mIteratorNew ::operator==(mIteratorNew const &other) const { return theIter == other.theIter; }
} // namespace AOMD
#endif
/*
/*
Copyright (C) 2004
Rensselaer Polytechnic Institute
This file is part of Trellis written and maintained by the
This file is part of Trellis written and maintained by the
Scientific Computation Research Center (SCOREC) at Rensselaer Polytechnic
Intitute, Troy, NY, USA.
This program is free software; you can redistribute it and/or modify it
under the terms of the Rensselaer SCOREC Public License.
This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license text for more details.
You should have received a copy of the Rensselaer SCOREC Public License
along with this program; if not, write to Rensselaer Polytechnic Institure,
110 8th Street, SCOREC, Troy, NY 12180, USA
......@@ -22,28 +22,24 @@
#define _OCTREEH_
#include <list>
#include "o_internals.h"
using std::list;
#include "o_internals.h"
/*class Octree; */
Octree* Octree_Create (int, /* max. number of elements allowed in an octant */
double *origin, /* smallest x,y, z of model's bounding box */
double *size, /* size in x, y, z of model bounding box */
void (*BB)(void *, double*, double*),
void (*Centroid)(void *, double *),
int (*InEle)(void *, double *));
void Octree_Delete (Octree *);
void Octree_Insert (void *, Octree *);
void Octree_Arrange(Octree *);
void * Octree_Search (double *, Octree *);
void Octree_SearchAll (double *, Octree *, list<void *> * );
Octree *Octree_Create(int, /* max. number of elements allowed in an octant */
double *origin, /* smallest x,y, z of model's bounding box */
double *size, /* size in x, y, z of model bounding box */
void (*BB)(void *, double *, double *), void (*Centroid)(void *, double *), int (*InEle)(void *, double *));
extern void mEntityBB ( void *a , double *min, double *max);
extern int mEntityInEle ( void *a , double *x);
extern void mEntityCentroid ( void *a , double *x);
void Octree_Delete(Octree *);
void Octree_Insert(void *, Octree *);
void Octree_Arrange(Octree *);
void *Octree_Search(double *, Octree *);
void Octree_SearchAll(double *, Octree *, std::list<void *> *);
extern void mEntityBB(void *a, double *min, double *max);
extern int mEntityInEle(void *a, double *x);
extern void mEntityCentroid(void *a, double *x);
#endif
/*
/*
Copyright (C) 2004
Rensselaer Polytechnic Institute
This file is part of Trellis written and maintained by the
This file is part of Trellis written and maintained by the
Scientific Computation Research Center (SCOREC) at Rensselaer Polytechnic
Intitute, Troy, NY, USA.
This program is free software; you can redistribute it and/or modify it
under the terms of the Rensselaer SCOREC Public License.
This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license text for more details.
You should have received a copy of the Rensselaer SCOREC Public License
along with this program; if not, write to Rensselaer Polytechnic Institure,
110 8th Street, SCOREC, Troy, NY 12180, USA
*/
/****************************************************************
* $Id: GShell.h,v 1.9 2005/02/02 00:08:55 acbauer Exp $
* Description:
/****************************************************************
* $Id: GShell.h,v 1.9 2005/02/02 00:08:55 acbauer Exp $
* Description:
*/
#ifndef H_GShell
#define H_GShell
#include "GEntity.h"
using std::ostream;
using std::istream;
template<class T> class SSList;
template <class T>
class SSList;
class GRegion;
class GVertex;
class GFace;
/** A Shell. A set of faces uses that define the boundary of a region.
*/
class GShell : public AOMD::GEntity {
public:
GShell(SGModel *m, GRegion *region, const SSList<GFace*> &faces, const SSList<int> &dirs);
~GShell() override ;
GeoRep * geometry() override;
TopoType::Value type() const override;
int dim() const override;
AOMD::SBoundingBox3d bounds() const override;
/** Get the region that this shell is attached to. */
GRegion* region() const;
/** Get iterator initialized to first face use of shell. */
SSListCIter<GFaceUse*> firstFaceUse() const;
int inClosure(GEntity *ent) const override;
// these should not be called by anything other than GEntity dervied
// classes
GShell(SGModel *m, GRegion *region); // for reading from file
GFaceUse * appendFace(GFace *face, int dir);
void setRegion(GRegion *region);
void removeFaceUse(GFaceUse *fu);
void write(ostream &out);
void read(istream &in);
protected:
GRegion *Region;
SSList<GFaceUse *> FaceUses;
};
*/
class GShell : public AOMD::GEntity
{
public:
GShell(SGModel *m, GRegion *region, const SSList<GFace *> &faces, const SSList<int> &dirs);
~GShell() override;
GeoRep *geometry() override;
#endif
TopoType::Value type() const override;
int dim() const override;
AOMD::SBoundingBox3d bounds() const override;
/** Get the region that this shell is attached to. */
GRegion *region() const;
/** Get iterator initialized to first face use of shell. */
SSListCIter<GFaceUse *> firstFaceUse() const;
int inClosure(GEntity *ent) const override;
// these should not be called by anything other than GEntity dervied
// classes
GShell(SGModel *m, GRegion *region); // for reading from file
GFaceUse *appendFace(GFace *face, int dir);
void setRegion(GRegion *region);
void removeFaceUse(GFaceUse *fu);
void write(ostream &out);
void read(istream &in);
protected:
GRegion *Region;
SSList<GFaceUse *> FaceUses;
};
#endif
/*
/*
Copyright (C) 2004
Rensselaer Polytechnic Institute
This file is part of Trellis written and maintained by the
This file is part of Trellis written and maintained by the
Scientific Computation Research Center (SCOREC) at Rensselaer Polytechnic
Intitute, Troy, NY, USA.
This program is free software; you can redistribute it and/or modify it
under the terms of the Rensselaer SCOREC Public License.
This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
license text for more details.
You should have received a copy of the Rensselaer SCOREC Public License
along with this program; if not, write to Rensselaer Polytechnic Institure,
110 8th Street, SCOREC, Troy, NY 12180, USA
......@@ -22,46 +22,46 @@
#define H_TopoModel
#include "SGModel.h"
using std::istream;
/** A model consisting only of topology. The TopoModel may be a copy
of an existing model in which case geometric queries will be
of an existing model in which case geometric queries will be
forwarded on to the copied model. Various operations for modifying
the copied topology are supported, in particular, augmentation of
the copied topology are supported, in particular, augmentation of
periodic faces to introduce a seam edge. If there is no source
model for the copy, geometric queries cannot be made.
model for the copy, geometric queries cannot be made.
*/
class TopoModel : public SGModel{
public:
/** Create a TopoModel that is a copy of an existing model. If
source is given as null, create an empty model. */
TopoModel(SGModel *source);
TopoModel(const SString &name, SGModel *source=nullptr);
class TopoModel : public SGModel
{
public:
/** Create a TopoModel that is a copy of an existing model. If
source is given as null, create an empty model. */
TopoModel(SGModel *source);
TopoModel(const SString &name, SGModel *source = nullptr);
//static void registerModeler();
//static SGModel * create(const SString &name, int loadOnly);
// static void registerModeler();
// static SGModel * create(const SString &name, int loadOnly);
SString modeler() const override;
SString modeler() const override;
AOMD::SBoundingBox3d bounds() const override;
void setBounds(const AOMD::SBoundingBox3d &box);
double tolerance() const override;
AOMD::SBoundingBox3d bounds() const override;
void setBounds(const AOMD::SBoundingBox3d &box);
double tolerance() const override;
virtual void finalize();
virtual void finalize();
/** Modify this copy of the model to introduce seam edges on any
periodic faces. */
void augmentPeriodicFaces();
/** Modify this copy of the model to introduce seam edges on any
periodic faces. */
void augmentPeriodicFaces();
protected:
GVertex *createVertex(istream &in) override;
GEdge *createEdge(istream &in) override;
GFace *createFace(istream &in) override;
GRegion *createRegion(istream &in) override;
void readBounds(istream &in) override;
protected:
GVertex *createVertex(istream &in) override;
GEdge *createEdge(istream &in) override;
GFace *createFace(istream &in) override;
GRegion *createRegion(istream &in) override;
void readBounds(istream &in) override;
SGModel *RealModel;
AOMD::SBoundingBox3d bbox;
SGModel *RealModel;
AOMD::SBoundingBox3d bbox;
};
#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
See the NOTICE.md & LICENSE.md files for terms
and conditions.
*/
#ifndef _JintModalParks_H
#define _JintModalParks_H
#include "xLevelSetOperators.h"
#include <sstream>
#include "lCrack.h"
#include "xApproxFunction.h"
#include "xField.h"
#include "xLevelSetOperators.h"
#include "xValueManager.h"
#include "lCrack.h"
#include "xVector.h"
#include <sstream>
using std::stringstream;
using namespace xfem;
namespace xcrack
namespace xcrack
{
class lCrack;
} // end namespace
class lCrack;
} // namespace xcrack
#endif
......@@ -145,7 +145,7 @@ void SingularCrackMapping::deval(double u, double v, double w, double &dxdu, dou
}
}
void SingularCrackMapping::boundingBox(xmapping::point &pMin, xmapping::point &pMax) const
void SingularCrackMapping::boundingBox(xtensor::xPoint &pMin, xtensor::xPoint &pMax) const
{
mapping_regular.boundingBox(pMin, pMax);
}
......
......@@ -29,7 +29,7 @@ class SingularCrackMapping : public xmapping::xMapping
void eval(double u, double v, double w, double &x, double &y, double &z) const override;
void deval(double u, double v, double w, double &dxdu, double &dydu, double &dzdu, double &dxdv, double &dydv, double &dzdv,
double &dxdw, double &dydw, double &dzdw) const override;
void boundingBox(xmapping::point &pMin, xmapping::point &pMax) const override;
void boundingBox(xtensor::xPoint &pMin, xtensor::xPoint &pMax) const override;
// void normalVector(AOMD::mEntity *, double u, double v, double w, xmapping::vector3d &n) const override;
bool inReferenceElement(double u, double v, double w) const override;
void COG(double &u, double &v, double &w) const override;
......
......@@ -14,6 +14,8 @@
#include "xcAnalyticalSolutions.h"
#include "xcCrackBase.h"
using std::string;
xcEvalExactCrackStressPlanarCrack::xcEvalExactCrackStressPlanarCrack(double K1p, double K2p, double K3p,
const xcCrackBase& _fissure)
: K1(K1p), K2(K2p), K3(K3p), crack(_fissure)
......
......@@ -12,9 +12,6 @@
#include <vector>
#include "xEntityFilter.h"
using std::bind1st;
using std::mem_fun;
#include "xTensor2.h"
namespace AOMD
{
......@@ -40,7 +37,7 @@ class xcCrackBase
virtual bool supportsCutthruByCrack(AOMD::mEntity* e) const = 0;
virtual xfem::xEntityFilter supportsCutthruByCrackFilter() const
{
return std::bind1st(mem_fun(&xcrack::xcCrackBase::supportsCutthruByCrack), this);
return std::bind1st(std::mem_fun(&xcrack::xcCrackBase::supportsCutthruByCrack), this);
}
/// This evaluator is meant to decide if an entity is above or below the crack surface.
/*! Return 1 on top of the crack surface (lsn > 0), zero or -1 otherwise.
......
This diff is collapsed.
......@@ -29,8 +29,6 @@
namespace xexport
{
using std::string;
class xExport
{
public:
......
......@@ -18,10 +18,6 @@ namespace xexport
{
// voir si il est dans xExport.
using std::list;
using std::ofstream;
using xtensor::xPoint;
class xExportEnsight : public xExport
{
public:
......@@ -137,41 +133,51 @@ class xExportEnsight : public xExport
throw;
}
void exportLine(const xPoint& P1, const xPoint& P2, const double& val1, const double& val2) override;
void exportLine(const xPoint& P1, const xPoint& P2, const xtensor::xVector<>& val1, const xtensor::xVector<>& val2) override;
void exportLine(const xPoint& P1, const xPoint& P2, const xtensor::xTensor2<>& val1, const xtensor::xTensor2<>& val2) override;
void exportTriangle(const xPoint& P1, const xPoint& P2, const xPoint& P3, const double& val1, const double& val2,
const double& val3) override;
void exportTriangle(const xPoint& P1, const xPoint& P2, const xPoint& P3, const xtensor::xVector<>& val1,
const xtensor::xVector<>& val2, const xtensor::xVector<>& val3) override;
void exportTriangle(const xPoint& P1, const xPoint& P2, const xPoint& P3, const xtensor::xTensor2<>& val1,
const xtensor::xTensor2<>& val2, const xtensor::xTensor2<>& val3) override;
void exportQuad(const xPoint& P1, const xPoint& P2, const xPoint& P3, const xPoint& P4, const double& val1, const double& val2,
const double& val3, const double& val4) override;
void exportQuad(const xPoint& P1, const xPoint& P2, const xPoint& P3, const xPoint& P4, const xtensor::xVector<>& val1,
const xtensor::xVector<>& val2, const xtensor::xVector<>& val3, const xtensor::xVector<>& val4) override;
void exportQuad(const xPoint& P1, const xPoint& P2, const xPoint& P3, const xPoint& P4, const xtensor::xTensor2<>& val1,
const xtensor::xTensor2<>& val2, const xtensor::xTensor2<>& val3, const xtensor::xTensor2<>& val4) override;
void exportTetra(const xPoint& P1, const xPoint& P2, const xPoint& P3, const xPoint& P4, const double& val1,
const double& val2, const double& val3, const double& val4) override;
void exportTetra(const xPoint& P1, const xPoint& P2, const xPoint& P3, const xPoint& P4, const xtensor::xVector<>& val1,
const xtensor::xVector<>& val2, const xtensor::xVector<>& val3, const xtensor::xVector<>& val4) override;
void exportTetra(const xPoint& P1, const xPoint& P2, const xPoint& P3, const xPoint& P4, const xtensor::xTensor2<>& val1,
const xtensor::xTensor2<>& val2, const xtensor::xTensor2<>& val3, const xtensor::xTensor2<>& val4) override;
void exportHex(const xPoint& P1, const xPoint& P2, const xPoint& P3, const xPoint& P4, const xPoint& P5, const xPoint& P6,
const xPoint& P7, const xPoint& P8, const double& val1, const double& val2, const double& val3,
const double& val4, const double& val5, const double& val6, const double& val7, const double& val8) override;
void exportHex(const xPoint& P1, const xPoint& P2, const xPoint& P3, const xPoint& P4, const xPoint& P5, const xPoint& P6,
const xPoint& P7, const xPoint& P8, const xtensor::xVector<>& val1, const xtensor::xVector<>& val2,
const xtensor::xVector<>& val3, const xtensor::xVector<>& val4, const xtensor::xVector<>& val5,
const xtensor::xVector<>& val6, const xtensor::xVector<>& val7, const xtensor::xVector<>& val8) override;
void exportHex(const xPoint& P1, const xPoint& P2, const xPoint&am