OGS
GMSHInterface.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <iosfwd>
7#include <list>
8#include <memory>
9#include <string>
10#include <vector>
11
13#include "BaseLib/IO/Writer.h"
14
15namespace GeoLib
16{
17class GEOObjects;
18class Polygon;
19}
20
21namespace FileIO
22{
23
24namespace GMSH
25{
26
27class GMSHPolygonTree;
29
34
39{
40public:
62 bool include_stations_as_constraints,
63 GMSH::MeshDensityAlgorithm mesh_density_algorithm,
64 double pnt_density, double station_density,
65 std::size_t max_pnts_per_leaf,
66 std::vector<std::string> const& selected_geometries,
67 bool rotate, bool keep_preprocessed_geometry);
68
69 GMSHInterface(GMSHInterface const&) = delete;
73
74 ~GMSHInterface() override;
75
76 void writePhysicalGroups(bool flag) { _write_physical_groups = flag; }
77
78protected:
79 bool write() override;
80
81private:
90 int writeGMSHInputFile(std::ostream & out);
91
92 std::size_t _n_lines;
93 std::size_t _n_plane_sfc;
94
96 std::vector<std::string> const& _selected_geometries;
97 std::string _gmsh_geo_name;
98 std::list<GMSH::GMSHPolygonTree*> _polygon_tree_list;
99
100 std::vector<GMSH::GMSHPoint*> _gmsh_pnts;
101
102 std::unique_ptr<GMSH::GMSHMeshDensityStrategy> _mesh_density_strategy;
105 Eigen::Matrix3d _inverse_rot_mat = Eigen::Matrix3d::Zero();
108 bool const _rotate = false;
111};
112} // end namespace GMSH
113} // end namespace FileIO
Base class which enables writing an object to string, stringstream or file.
Definition Writer.h:21
std::ostringstream out
The stream to write to.
Definition Writer.h:36
GMSHInterface & operator=(GMSHInterface &&)=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 & operator=(GMSHInterface const &)=delete
GMSHInterface(GMSHInterface const &)=delete
std::vector< GMSH::GMSHPoint * > _gmsh_pnts
void writePhysicalGroups(bool flag)
int writeGMSHInputFile(std::ostream &out)
std::vector< std::string > const & _selected_geometries
GeoLib::GEOObjects & _geo_objs
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:46
@ AdaptiveMeshDensity
computing the mesh density employing a QuadTree
@ FixedMeshDensity
set the parameter with a fixed value