Skip to content
Snippets Groups Projects
Commit a8701388 authored by Tom Fischer's avatar Tom Fischer
Browse files

Change namespace according to new file structure.

parent dc0b54c6
No related branches found
No related tags found
No related merge requests found
Showing
with 126 additions and 85 deletions
......@@ -430,10 +430,10 @@ void MainWindow::save()
std::vector<std::string> selected_geometries;
_project.getGEOObjects().getGeometryNames(selected_geometries);
GMSHInterface gmsh_io(
GeoLib::IO::GMSHInterface gmsh_io(
_project.getGEOObjects(), true,
FileIO::GMSH::MeshDensityAlgorithm::AdaptiveMeshDensity,
0.05, 0.5, 2, selected_geometries);
GeoLib::IO::GMSH::MeshDensityAlgorithm::AdaptiveMeshDensity, 0.05,
0.5, 2, selected_geometries);
gmsh_io.setPrecision(std::numeric_limits<double>::digits10);
bool const success = gmsh_io.writeToFile(fileName.toStdString());
......@@ -902,16 +902,16 @@ void MainWindow::callGMSH(std::vector<std::string> & selectedGeometries,
if (!fileName.isEmpty())
{
if (param4 == -1) { // adaptive meshing selected
GMSHInterface gmsh_io(
GeoLib::IO::GMSHInterface gmsh_io(
_project.getGEOObjects(), true,
FileIO::GMSH::MeshDensityAlgorithm::AdaptiveMeshDensity,
GeoLib::IO::GMSH::MeshDensityAlgorithm::AdaptiveMeshDensity,
param2, param3, param1, selectedGeometries);
gmsh_io.setPrecision(std::numeric_limits<double>::digits10);
gmsh_io.writeToFile(fileName.toStdString());
} else { // homogeneous meshing selected
GMSHInterface gmsh_io(
GeoLib::IO::GMSHInterface gmsh_io(
_project.getGEOObjects(), true,
FileIO::GMSH::MeshDensityAlgorithm::FixedMeshDensity,
GeoLib::IO::GMSH::MeshDensityAlgorithm::FixedMeshDensity,
param4, param3, param1, selectedGeometries);
gmsh_io.setPrecision(std::numeric_limits<double>::digits10);
gmsh_io.writeToFile(fileName.toStdString());
......
......@@ -29,7 +29,9 @@
#include "GeoLib/PolylineWithSegmentMarker.h"
#include "GeoLib/PolygonWithSegmentMarker.h"
namespace FileIO
namespace GeoLib
{
namespace IO
{
GMSHInterface::GMSHInterface(GeoLib::GEOObjects& geo_objs,
bool /*include_stations_as_constraints*/,
......@@ -244,4 +246,5 @@ void GMSHInterface::writePoints(std::ostream& out) const
}
}
} // end namespace FileIO
} // end namespace IO
} // end namespace GeoLib
......@@ -19,14 +19,14 @@
namespace GeoLib
{
class GEOObjects;
class Polygon;
}
class GEOObjects;
class Polygon;
namespace FileIO
namespace IO
{
namespace GMSH {
namespace GMSH
{
class GMSHPoint;
class GMSHPolygonTree;
......@@ -103,7 +103,7 @@ private:
std::string _gmsh_geo_name;
std::list<GMSH::GMSHPolygonTree*> _polygon_tree_list;
std::vector<FileIO::GMSH::GMSHPoint*> _gmsh_pnts;
std::vector<GMSH::GMSHPoint*> _gmsh_pnts;
GMSH::GMSHMeshDensityStrategy *_mesh_density_strategy;
/// Holds the inverse rotation matrix. The matrix is used in writePoints() to
......@@ -115,6 +115,7 @@ private:
bool _rotate = false;
bool _keep_preprocessed_geometry = true;
};
}
} // end namespace IO
} // end namespace GeoLib
#endif /* GMSHINTERFACE_H_ */
......@@ -17,7 +17,6 @@
#include <logog/include/logog.hpp>
#include "GeoLib/Point.h"
#include "GeoLib/Polygon.h"
#ifndef NDEBUG
......@@ -27,9 +26,12 @@
#include "MathLib/MathTools.h"
namespace FileIO
namespace GeoLib
{
namespace IO
{
namespace GMSH
{
namespace GMSH {
GMSHAdaptiveMeshDensity::GMSHAdaptiveMeshDensity(double pnt_density, double station_density,
std::size_t max_pnts_per_leaf) :
......@@ -157,4 +159,5 @@ void GMSHAdaptiveMeshDensity::getQuadTreeGeometry(std::vector<GeoLib::Point*> &p
#endif
}
} // end namespace FileIO
} // end namespace IO
} // end namespace GeoLib
......@@ -11,22 +11,21 @@
#ifndef GMSHADAPTIVEMESHDENSITY_H_
#define GMSHADAPTIVEMESHDENSITY_H_
// FileIO
#include "GMSHMeshDensityStrategy.h"
namespace GeoLib
{
class Polygon;
class Point;
template <typename T> class QuadTree;
class Polygon;
class Point;
template <typename T> class QuadTree;
#ifndef NDEBUG
class Polyline;
class Polyline;
#endif
}
namespace FileIO
namespace IO
{
namespace GMSH
{
namespace GMSH {
class GMSHAdaptiveMeshDensity : public GMSHMeshDensityStrategy
{
......@@ -54,6 +53,7 @@ private:
};
}
} // end namespace FileIO
} // end namespace IO
} // end namespace GeoLib
#endif /* GMSHADAPTIVEMESHDENSITY_H_ */
......@@ -10,9 +10,12 @@
#include "GMSHFixedMeshDensity.h"
namespace FileIO
namespace GeoLib
{
namespace IO
{
namespace GMSH
{
namespace GMSH {
GMSHFixedMeshDensity::GMSHFixedMeshDensity(double mesh_density) :
_mesh_density(mesh_density)
......@@ -36,4 +39,5 @@ double GMSHFixedMeshDensity::getMeshDensityAtStation(GeoLib::Point const*const)
}
}
} // end namespace FileIO
} // end namespace IO
} // end namespace GeoLib
......@@ -13,9 +13,12 @@
#include "GMSHMeshDensityStrategy.h"
namespace FileIO
namespace GeoLib
{
namespace IO
{
namespace GMSH
{
namespace GMSH {
class GMSHFixedMeshDensity : public GMSHMeshDensityStrategy
{
......@@ -31,6 +34,7 @@ private:
};
}
}
} // end namespace IO
} // end namespace GeoLib
#endif /* GMSHFIXEDMESHDENSITY_H_ */
......@@ -11,9 +11,12 @@
#include <ostream>
#include "GMSHLine.h"
namespace FileIO
namespace GeoLib
{
namespace IO
{
namespace GMSH
{
namespace GMSH {
GMSHLine::GMSHLine(std::size_t start_point_id, std::size_t end_point_id) :
_start_pnt_id(start_point_id), _end_pnt_id(end_point_id)
......@@ -33,5 +36,6 @@ void GMSHLine::resetLineData(std::size_t start_point_id, std::size_t end_point_i
_end_pnt_id = end_point_id;
}
}
} // end namespace FileIO
} // end namespace GMSH
} // end namespace IO
} // end namespace GeoLib
......@@ -13,9 +13,12 @@
#include <iosfwd>
namespace FileIO
namespace GeoLib
{
namespace IO
{
namespace GMSH
{
namespace GMSH {
class GMSHLine {
public:
......@@ -29,7 +32,8 @@ private:
std::size_t _end_pnt_id;
};
}
}
} // end namespace GMSH
} // end namespace IO
} // end namespace GeoLib
#endif /* GMSHLINE_H_ */
......@@ -13,9 +13,12 @@
#include "GMSHLine.h"
#include "GMSHLineLoop.h"
namespace FileIO
namespace GeoLib
{
namespace IO
{
namespace GMSH
{
namespace GMSH {
GMSHLineLoop::GMSHLineLoop(bool is_sfc) :
_is_sfc(is_sfc)
......@@ -52,5 +55,6 @@ void GMSHLineLoop::write(std::ostream &os, std::size_t line_offset, std::size_t
}
}
} // end namespace FileIO
} // end namespace GMSH
} // end namespace IO
} // end namespace GeoLib
......@@ -14,10 +14,12 @@
#include <vector>
#include <iosfwd>
namespace FileIO
namespace GeoLib
{
namespace IO
{
namespace GMSH
{
namespace GMSH {
class GMSHLine;
......@@ -35,7 +37,8 @@ private:
bool _is_sfc;
};
}
}
} // end namespace GMSH
} // end namespace IO
} // end namespace GeoLib
#endif /* GMSHLINELOOP_H_ */
......@@ -15,13 +15,11 @@
namespace GeoLib
{
class Point;
}
namespace FileIO
class Point;
namespace IO
{
namespace GMSH
{
namespace GMSH {
/**
* virtual base class GMSHMeshDensityStrategy for classes
* GMSHAdaptiveMeshDensity and GMSHFixedMeshDensity.
......@@ -35,8 +33,8 @@ public:
virtual double getMeshDensityAtStation(GeoLib::Point const*const) const = 0;
};
}
} // end namespace
} // end namespace GMSH
} // end namespace IO
} // end namespace GeoLib
#endif /* GMSHMESHDENSITYSTRATEGY_H_ */
......@@ -13,9 +13,12 @@
#include "GMSHPoint.h"
namespace FileIO
namespace GeoLib
{
namespace IO
{
namespace GMSH
{
namespace GMSH {
GMSHPoint::GMSHPoint(GeoLib::Point const& pnt, std::size_t id, double mesh_density) :
GeoLib::Point(pnt, id), _mesh_density(mesh_density)
......@@ -40,5 +43,6 @@ std::ostream& operator<< (std::ostream &os, GMSHPoint const& p)
return os;
}
}
} // end namespace FileIO
} // end namespace GMSH
} // end namespace IO
} // end namespace GeoLib
......@@ -14,9 +14,12 @@
// GeoLib
#include "GeoLib/Point.h"
namespace FileIO
namespace GeoLib
{
namespace IO
{
namespace GMSH
{
namespace GMSH {
class GMSHPoint : public GeoLib::Point {
public:
......@@ -30,7 +33,8 @@ private:
/** overload the output operator for class GMSHPoint */
std::ostream& operator<< (std::ostream &os, GMSHPoint const& p);
}
}
} // end namespace GMSH
} // end namespace IO
} // end namespace GeoLib
#endif /* GMSHPOINT_H_ */
......@@ -20,9 +20,12 @@
#include "GeoLib/PolylineWithSegmentMarker.h"
#include "GeoLib/PolygonWithSegmentMarker.h"
namespace FileIO
namespace GeoLib
{
namespace IO
{
namespace GMSH
{
namespace GMSH {
GMSHPolygonTree::GMSHPolygonTree(GeoLib::PolygonWithSegmentMarker* polygon,
GMSHPolygonTree* parent,
......@@ -248,7 +251,7 @@ void GMSHPolygonTree::initMeshDensityStrategy()
}
}
void GMSHPolygonTree::createGMSHPoints(std::vector<FileIO::GMSH::GMSHPoint*> & gmsh_pnts) const
void GMSHPolygonTree::createGMSHPoints(std::vector<GMSHPoint*> & gmsh_pnts) const
{
const std::size_t n_pnts_polygon (_node_polygon->getNumberOfPoints());
for (std::size_t k(0); k<n_pnts_polygon-1; k++) {
......@@ -419,5 +422,6 @@ void GMSHPolygonTree::getStationsInsideSubPolygons(std::vector<GeoLib::Point con
}
}
}
} // end namespace FileIO
} // end namespace GMSH
} // end namespace IO
} // end namespace GeoLib
......@@ -22,15 +22,15 @@
namespace GeoLib
{
class GEOObjects;
class Polygon;
class PolylineWithSegmentMarker;
class PolygonWithSegmentMarker;
}
class GEOObjects;
class Polygon;
class PolylineWithSegmentMarker;
class PolygonWithSegmentMarker;
namespace FileIO
namespace IO
{
namespace GMSH
{
namespace GMSH {
class GMSHPolygonTree: public GeoLib::SimplePolygonTree {
public:
......@@ -75,7 +75,7 @@ public:
* Method creates the gmsh point data structures - including the mesh density.
* @param gmsh_pnts a vector of pointers to instances of class GMSHPoint
*/
void createGMSHPoints(std::vector<FileIO::GMSH::GMSHPoint*> & gmsh_pnts) const;
void createGMSHPoints(std::vector<GMSHPoint*> & gmsh_pnts) const;
virtual void writeLineLoop(std::size_t &line_offset, std::size_t &sfc_offset, std::ostream& out) const;
void writeSubPolygonsAsLineConstraints(std::size_t &line_offset, std::size_t sfc_number, std::ostream& out) const;
......@@ -94,12 +94,13 @@ private:
std::string const& _geo_name;
std::vector<GeoLib::Point const*> _stations;
std::vector<GeoLib::PolylineWithSegmentMarker*> _plys;
std::vector<FileIO::GMSH::GMSHLine*> _gmsh_lines_for_constraints;
std::vector<GMSHLine*> _gmsh_lines_for_constraints;
GMSHMeshDensityStrategy * _mesh_density_strategy;
};
}
}
} // end namespace GMSH
} // end namespace IO
} // end namespace GeoLib
#endif /* GMSHPOLYGONTREE_H_ */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment