OGS
GMSHInterface.h
Go to the documentation of this file.
1 
11 #pragma once
12 
13 #include <iosfwd>
14 #include <list>
15 #include <memory>
16 #include <string>
17 #include <vector>
18 
20 #include "BaseLib/IO/Writer.h"
21 
22 namespace GeoLib
23 {
24 class GEOObjects;
25 class Polygon;
26 }
27 
28 namespace FileIO
29 {
30 
31 namespace GMSH
32 {
33 
34 class GMSHPolygonTree;
35 class GMSHMeshDensityStrategy;
36 
40 };
41 
45 class GMSHInterface final : public BaseLib::IO::Writer
46 {
47 public:
69  bool include_stations_as_constraints,
70  GMSH::MeshDensityAlgorithm mesh_density_algorithm,
71  double pnt_density, double station_density,
72  std::size_t max_pnts_per_leaf,
73  std::vector<std::string> const& selected_geometries,
74  bool rotate, bool keep_preprocessed_geometry);
75 
76  GMSHInterface(GMSHInterface const&) = delete;
80 
81  ~GMSHInterface() override;
82 
83  void writePhysicalGroups(bool flag) { _write_physical_groups = flag; }
84 
85 protected:
86  bool write() override;
87 
88 private:
97  int writeGMSHInputFile(std::ostream & out);
98 
99  std::size_t _n_lines;
100  std::size_t _n_plane_sfc;
101 
103  std::vector<std::string> const& _selected_geometries;
104  std::string _gmsh_geo_name;
105  std::list<GMSH::GMSHPolygonTree*> _polygon_tree_list;
106 
107  std::vector<GMSH::GMSHPoint*> _gmsh_pnts;
108 
109  std::unique_ptr<GMSH::GMSHMeshDensityStrategy> _mesh_density_strategy;
112  Eigen::Matrix3d _inverse_rot_mat = Eigen::Matrix3d::Zero();
115  bool const _rotate = false;
118 };
119 } // end namespace GMSH
120 } // end namespace FileIO
Definition of the Writer class.
Base class which enables writing an object to string, stringstream or file.
Definition: Writer.h:31
std::ostringstream out
The stream to write to.
Definition: Writer.h:46
Reads and writes GMSH-files to and from OGS data structures.
Definition: GMSHInterface.h:46
GMSHInterface & operator=(GMSHInterface const &)=delete
GMSHInterface(GeoLib::GEOObjects &geo_objs, bool include_stations_as_constraints, GMSH::MeshDensityAlgorithm mesh_density_algorithm, double pnt_density, double station_density, std::size_t max_pnts_per_leaf, std::vector< std::string > const &selected_geometries, bool rotate, bool keep_preprocessed_geometry)
GMSHInterface(GMSHInterface &&)=delete
std::unique_ptr< GMSH::GMSHMeshDensityStrategy > _mesh_density_strategy
Eigen::Matrix3d _inverse_rot_mat
GMSHInterface(GMSHInterface const &)=delete
std::vector< GMSH::GMSHPoint * > _gmsh_pnts
void writePhysicalGroups(bool flag)
Definition: GMSHInterface.h:83
int writeGMSHInputFile(std::ostream &out)
std::vector< std::string > const & _selected_geometries
GeoLib::GEOObjects & _geo_objs
GMSHInterface & operator=(GMSHInterface &&)=delete
bool write() override
Writes the object to the internal stream. This method must be implemented by a subclass....
std::list< GMSH::GMSHPolygonTree * > _polygon_tree_list
Container class for geometric objects.
Definition: GEOObjects.h:61
@ AdaptiveMeshDensity
computing the mesh density employing a QuadTree
@ FixedMeshDensity
set the parameter with a fixed value