89 DBUG(
"GMSHInterface::writeGMSHInputFile(): get data from GEOObjects.");
111 auto* merged_pnts(
const_cast<std::vector<GeoLib::Point*>*
>(
115 ERR(
"GMSHInterface::writeGMSHInputFile(): Did not found any points.");
130 for (
auto pnt : *merged_pnts)
136 std::vector<GeoLib::Polyline*>
const* merged_plys(
138 DBUG(
"GMSHInterface::writeGMSHInputFile(): Obtained data.");
142 ERR(
"GMSHInterface::writeGMSHInputFile(): Did not find any polylines.");
150 pnt_vec, *(
const_cast<std::vector<GeoLib::Polyline*>*
>(merged_plys)));
152 std::vector<GeoLib::Polyline*> polygons;
155 for (
auto polyline : *merged_plys)
157 if (!polyline->isClosed())
163 if (polygons.empty())
165 OGS_FATAL(
"GMSHInterface::writeGMSHInputFile(): no polygons found.");
171 polygons.begin(), polygons.end(),
173 [
this](
auto const& polygon)
175 return new GMSH::GMSHPolygonTree(
176 dynamic_cast<GeoLib::PolygonWithSegmentMarker*>(polygon),
177 nullptr, _geo_objs, _gmsh_geo_name, *_mesh_density_strategy);
180 "GMSHInterface::writeGMSHInputFile(): Computed topological hierarchy - "
181 "detected {:d} polygons.",
186 "GMSHInterface::writeGMSHInputFile(): Computed topological hierarchy - "
187 "calculated {:d} polygon trees.",
193 polygon_tree->markSharedSegments();
200 std::vector<GeoLib::Point*> gmsh_stations{};
203 auto const* stations(
_geo_objs.getStationVec(geometry_name));
206 for (
auto* station : *stations)
215 if ((*it)->insertStation(gmsh_stations.back()))
224 if (!gmsh_stations.empty())
226 _geo_objs.addStationVec(std::move(gmsh_stations), gmsh_stations_name);
230 for (
auto polyline : *merged_plys)
232 if (!polyline->isClosed())
236 auto polyline_with_segment_marker =
238 polygon_tree->insertPolyline(polyline_with_segment_marker);
246 polygon_tree->initMeshDensityStrategy();
250 const std::size_t n_merged_pnts(merged_pnts->size());
252 for (std::size_t k(0); k < n_merged_pnts; k++)
261 std::stringstream error_messages;
262 error_messages.precision(std::numeric_limits<double>::max_digits10);
263 for (std::size_t k = 0; k <
_gmsh_pnts.size(); ++k)
268 <<
"The point at (" << *(*merged_pnts)[k]
269 <<
") is not part of a polyline, and won't be used in the "
270 "meshing as a constraint. If you want to include it in the "
271 "mesh please create a observation/measurement station for "
272 "the point and include it additional in the meshing "
276 auto const error_message = error_messages.str();
277 if (!error_message.empty())
291 polygon_tree->writeSubPolygonsAsLineConstraints(
_n_lines,
295 polygon_tree->writeAdditionalPointData(pnt_id_offset,
_n_plane_sfc - 1,
304 _geo_objs.removeStationVec(gmsh_stations_name);
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)