Commit 5c4579b3 authored by Nicolas CHEVAUGEON's avatar Nicolas CHEVAUGEON

[xFEM] xBoundary.h/cc are moved to xFEM/src/attic

class xBoundary was only used as a parameter to some
Mechanics::TreatmentOfNatEnv that was never actually used and which was
passed around via a member of xData. It is nothing more than an early
implementation of xSubMesh that was passed around via cut and past for a
long time ... Therefore, xBoundary is now made obsolete and the files
xBoundary.h/cc are moved to xFEM/src/attic.

all its' use will be removed from xTest.

Note : My first clang-format related bug.
The file xDistanceNearestPointGenerator.h need to be included before
xDistanceNearestPoint.h, otherwise some test case can't compile !!! indeed,
it add some overload to cgal AABBPrimitive that needs to be visible for
template instanciation that can take place via  xDistanceNearestPoint.h.
But clang-format messed around and I had to force the inclusion of xDistanceNearestPointGenerator.h before xDistanceNearestPoint.h, by including it at the
beginning of xDistanceNearestPoint.h, and preventing clang-format to reorder
the include by inserting some comment.
parent d4aca3b7
......@@ -62,10 +62,6 @@ if(USE_CGAL)
find_and_set(CGAL CGAL XDOUBLECUT_EXTERNAL_INCLUDES EXTERNAL_LIBRARIES REQUIRED)
endif()
if(USE_XGEOM)
find_and_set(xGeom xGeom XDOUBLECUT_EXTERNAL_INCLUDES EXTERNAL_LIBRARIES REQUIRED )
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 )
......
This diff is collapsed.
/*
/*
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 "xBoundary.h"
#include <string>
#include <cstdio>
#include <cstdio>
#include <string>
namespace xfem
{
bool xBoundary::AddToBoundary(const int &pToInsert) { return (boundary.insert(pToInsert).second); }
bool xBoundary::AddToBoundary(const int &pToInsert){
return (boundary.insert(pToInsert).second);
}
void xBoundary::EmptyBoundary()
{
boundary.erase(boundary.begin(),boundary.end());
}
void xBoundary::EmptyBoundary() { boundary.erase(boundary.begin(), boundary.end()); }
bool xBoundary::IsInBoundary(const int &pToFind) const
{
if(boundary.find(pToFind) == boundary.end())
return false;
else
return true;
if (boundary.find(pToFind) == boundary.end())
return false;
else
return true;
}
void xBoundary::RemoveFromBoundary(const int &pToErase)
{
boundary.erase(pToErase);
}
xBoundary* xBoundaryContainer::getBoundaryWithId(int id) {
void xBoundary::RemoveFromBoundary(const int &pToErase) { boundary.erase(pToErase); }
xBoundary *xBoundaryContainer::getBoundaryWithId(int id)
{
BoundaryCont_t::iterator found;
found = boundaries.find(id);
......@@ -48,68 +34,53 @@ xBoundary* xBoundaryContainer::getBoundaryWithId(int id) {
if (found == boundaries.end()) return nullptr;
return &((*found).second);
}
void xBoundaryContainer::AddToBoundaryWithId(int & id, const int &pToInsert) {
xBoundary boundary;
xBoundary* boundary_ptr = getBoundaryWithId(id);
if (boundary_ptr != nullptr) boundary_ptr->AddToBoundary(pToInsert);
else {boundary.AddToBoundary(pToInsert);
addBoundary(id, boundary);}
return;
void xBoundaryContainer::AddToBoundaryWithId(int &id, const int &pToInsert)
{
xBoundary boundary;
xBoundary *boundary_ptr = getBoundaryWithId(id);
if (boundary_ptr != nullptr)
boundary_ptr->AddToBoundary(pToInsert);
else
{
boundary.AddToBoundary(pToInsert);
addBoundary(id, boundary);
}
return;
}
void xBoundaryContainer::addBoundary(int & id, xBoundary& Boundary) {
void xBoundaryContainer::addBoundary(int &id, xBoundary &Boundary)
{
std::pair<const int, xBoundary> to_add(id, Boundary);
boundaries.insert(to_add);
}
xBoundary *xBoundaryContainer::getBoundaryAtPos(int p_pos) {
xBoundary *xBoundaryContainer::getBoundaryAtPos(int p_pos)
{
BoundaryCont_t::iterator it = boundaries.begin();
BoundaryCont_t::iterator ite = boundaries.end();
xBoundary* ret = nullptr;
xBoundary *ret = nullptr;
int pos = 0;
while (it != ite) {
if (pos == p_pos) {
while (it != ite)
{
if (pos == p_pos)
{
ret = &((*it).second);
break;
}
pos++;
it++;
}
return ret;
}
int xBoundaryContainer::getNbBoundaries() {
return boundaries.size();
}
int xBoundaryContainer::getNbBoundaries() { return boundaries.size(); }
} // end of namespace
} // 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
See the NOTICE.md & LICENSE.md files for terms
and conditions.
*/
#ifndef __GROUP_H
#define __GROUP_H
#include <algorithm>
#include <map>
#include <set>
namespace xfem
{
class xBoundary {
public:
xBoundary() {};
bool AddToBoundary(const int& pToAdd);
void EmptyBoundary();
void RemoveFromBoundary(const int& pToErase);
bool IsInBoundary(const int& pToFind) const;
int size() const {return boundary.size();};
std::set<int>::const_iterator begin() const {return boundary.begin();};
std::set<int>::const_iterator end() const {return boundary.end();};
typedef std::set<int>::const_iterator const_iterator;
private:
std::set<int> boundary;
class xBoundary
{
public:
xBoundary(){};
bool AddToBoundary(const int &pToAdd);
void EmptyBoundary();
void RemoveFromBoundary(const int &pToErase);
bool IsInBoundary(const int &pToFind) const;
int size() const { return boundary.size(); };
std::set<int>::const_iterator begin() const { return boundary.begin(); };
std::set<int>::const_iterator end() const { return boundary.end(); };
typedef std::set<int>::const_iterator const_iterator;
private:
std::set<int> boundary;
};
class xBoundaryContainer {
public :
class xBoundaryContainer
{
public:
int getNbBoundaries();
void addBoundary(int & id, xBoundary &Boundary);
void addBoundary(int &id, xBoundary &Boundary);
xBoundary *getBoundaryWithId(int id);
xBoundary *getBoundaryAtPos(int pos);
void AddToBoundaryWithId(int & id, const int &pToInsert);
private :
void AddToBoundaryWithId(int &id, const int &pToInsert);
private:
typedef std::map<int, xBoundary> BoundaryCont_t;
BoundaryCont_t boundaries;
};
} // end of namespace
} // namespace xfem
#endif
......@@ -14,7 +14,6 @@
#include <unordered_map>
#include "mAOMD.h"
#include "xBoundary.h"
#include "xEnv.h"
#include "xFiniteElement.h"
#include "xMesh.h"
......
......@@ -12,7 +12,6 @@
#include <string>
#include "xAttachedDataManagerAOMD.h"
#include "xBoundary.h"
#include "xEnv.h"
#include "xMaterialManager.h"
#include "xPointToDouble.h"
......@@ -21,7 +20,6 @@ namespace xfem
{
class xZone;
class xZoneContainer;
class xBoundaryContainer;
class xPhysicalEnv;
static const int NB_CHAR_MAX = 256; // 48 was a bit limiting because it is used also for filenames...
......@@ -85,17 +83,9 @@ class xData
double LoadFactor;
double time, dt;
xMaterialManager& MaterialManager;
xBoundaryContainer CurvesGroups; // for the J integral in the case of
// truly modeled cracks
// std::map<std::string, std::function<double (const double&, const double&, const double&)*> level_sets;
int do_postpro;
int do_postpro_manual;
int do_postpro_automatic;
xBoundary allGroups; // All piece of boundary for a given subdomain
bool ComputeExactError;
// to compare two solutions
......
......@@ -11,6 +11,11 @@
#define HAVE_AOMD
#endif
#include "xDistanceNearestPointGenerator.h"
// <- this comment is necessery to force xDistanceNearestPointGenerator.h
// to stay first even if the file is clang-formated .. The file above must always
// come first ! indeed it is adding some overload to CGAL AABBPrimitive that need
// to be present before instanciation of some template.
#include "xDistanceNearestPoint_internal.h"
namespace xgeom
......
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 2.6)
set(text " ")
message_verbose(text)
set(text "-------------------------------------- --")
......
......@@ -39,8 +39,8 @@ list(APPEND EXTERNAL_INCLUDES
${xTool_INCLUDE_DIR}
${xInterfaceAOMDGeneral_INCLUDE_DIR}
${Trellis_INCLUDE_DIR}
${xQuadrature_INCLUDE_DIR}
${xFEM_INCLUDE_DIR}
${xQuadrature_INCLUDE_DIR}
${xFEM_INCLUDE_DIR}
${xExt_INCLUDE_DIR}
${xSolverBase_INCLUDE_DIR}
${xInterfaceSuperLu_INCLUDE_DIR}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment