OGS
MeshGenerator.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 <array>
7#include <functional>
8#include <string>
9#include <vector>
10
11#include "BaseLib/Subdivision.h"
12#include "MathLib/Point3d.h"
13#include "MeshLib/Mesh.h"
14
15namespace MeshLib
16{
17class Node;
18}
19
20namespace MeshToolsLib
21{
22namespace MeshGenerator
23{
24
31std::vector<MeshLib::Node*> generateRegularNodes(
32 const std::vector<const std::vector<double>*>& vec_xyz_coords,
33 const MathLib::Point3d& origin = MathLib::ORIGIN);
34
41std::vector<MeshLib::Node*> generateRegularNodes(
42 const std::vector<double>& vec_x_coords,
43 const MathLib::Point3d& origin = MathLib::ORIGIN);
44
52std::vector<MeshLib::Node*> generateRegularNodes(
53 std::vector<double>& vec_x_coords,
54 std::vector<double>& vec_y_coords,
55 const MathLib::Point3d& origin = MathLib::ORIGIN);
56
65std::vector<MeshLib::Node*> generateRegularNodes(
66 std::vector<double>& vec_x_coords,
67 std::vector<double>& vec_y_coords,
68 std::vector<double>& vec_z_coords,
69 const MathLib::Point3d& origin = MathLib::ORIGIN);
70
78std::vector<MeshLib::Node*> generateRegularNodes(
79 const std::array<unsigned, 3>& n_cells,
80 const std::array<double, 3>& cell_size,
81 const MathLib::Point3d& origin);
82
90MeshLib::Mesh* generateLineMesh(
91 const BaseLib::ISubdivision& div,
92 MathLib::Point3d const& origin = MathLib::ORIGIN,
93 std::string const& mesh_name = "mesh");
94
103MeshLib::Mesh* generateLineMesh(
104 const double length,
105 const std::size_t subdivision,
106 MathLib::Point3d const& origin = MathLib::ORIGIN,
107 std::string const& mesh_name = "mesh");
108
117MeshLib::Mesh* generateLineMesh(
118 const unsigned n_cells,
119 const double cell_size,
120 MathLib::Point3d const& origin = MathLib::ORIGIN,
121 std::string const& mesh_name = "mesh");
122
132MeshLib::Mesh* generateRegularQuadMesh(
133 const BaseLib::ISubdivision& div_x,
134 const BaseLib::ISubdivision& div_y,
135 MathLib::Point3d const& origin = MathLib::ORIGIN,
136 std::string const& mesh_name = "mesh");
137
148MeshLib::Mesh* generateRegularQuadMesh(
149 const double length,
150 const std::size_t subdivision,
151 MathLib::Point3d const& origin = MathLib::ORIGIN,
152 std::string const& mesh_name = "mesh");
153
166MeshLib::Mesh* generateRegularQuadMesh(
167 const double x_length,
168 const double y_length,
169 const std::size_t x_subdivision,
170 const std::size_t y_subdivision,
171 MathLib::Point3d const& origin = MathLib::ORIGIN,
172 std::string const& mesh_name = "mesh");
173
184MeshLib::Mesh* generateRegularQuadMesh(
185 const unsigned n_x_cells,
186 const unsigned n_y_cells,
187 const double cell_size,
188 MathLib::Point3d const& origin = MathLib::ORIGIN,
189 std::string const& mesh_name = "mesh");
190
202MeshLib::Mesh* generateRegularQuadMesh(
203 const unsigned n_x_cells,
204 const unsigned n_y_cells,
205 const double cell_size_x,
206 const double cell_size_y,
207 MathLib::Point3d const& origin = MathLib::ORIGIN,
208 std::string const& mesh_name = "mesh");
209
220MeshLib::Mesh* generateRegularHexMesh(
221 const BaseLib::ISubdivision& div_x,
222 const BaseLib::ISubdivision& div_y,
223 const BaseLib::ISubdivision& div_z,
224 MathLib::Point3d const& origin = MathLib::ORIGIN,
225 std::string const& mesh_name = "mesh");
226
235MeshLib::Mesh* generateRegularHexMesh(
236 const double length,
237 const std::size_t subdivision,
238 MathLib::Point3d const& origin = MathLib::ORIGIN,
239 std::string const& mesh_name = "mesh");
240
253MeshLib::Mesh* generateRegularHexMesh(
254 const double x_length,
255 const double y_length,
256 const double z_length,
257 const std::size_t x_subdivision,
258 const std::size_t y_subdivision,
259 const std::size_t z_subdivision,
260 MathLib::Point3d const& origin = MathLib::ORIGIN,
261 std::string const& mesh_name = "mesh");
262
273MeshLib::Mesh* generateRegularHexMesh(
274 const unsigned n_x_cells,
275 const unsigned n_y_cells,
276 const unsigned n_z_cells,
277 const double cell_size,
278 MathLib::Point3d const& origin = MathLib::ORIGIN,
279 std::string const& mesh_name = "mesh");
280
293MeshLib::Mesh* generateRegularHexMesh(
294 const unsigned n_x_cells,
295 const unsigned n_y_cells,
296 const unsigned n_z_cells,
297 const double cell_size_x,
298 const double cell_size_y,
299 const double cell_size_z,
300 MathLib::Point3d const& origin = MathLib::ORIGIN,
301 std::string const& mesh_name = "mesh");
302
316MeshLib::Mesh* generateRegularPyramidMesh(
317 const BaseLib::ISubdivision& div_x,
318 const BaseLib::ISubdivision& div_y,
319 const BaseLib::ISubdivision& div_z,
320 MathLib::Point3d const& origin = MathLib::ORIGIN,
321 std::string const& mesh_name = "mesh");
322
333MeshLib::Mesh* generateRegularTriMesh(
334 const BaseLib::ISubdivision& div_x,
335 const BaseLib::ISubdivision& div_y,
336 MathLib::Point3d const& origin = MathLib::ORIGIN,
337 std::string const& mesh_name = "mesh");
338
349MeshLib::Mesh* generateRegularTriMesh(
350 const double length,
351 const std::size_t subdivision,
352 MathLib::Point3d const& origin = MathLib::ORIGIN,
353 std::string const& mesh_name = "mesh");
354
367MeshLib::Mesh* generateRegularTriMesh(
368 const double x_length,
369 const double y_length,
370 const std::size_t x_subdivision,
371 const std::size_t y_subdivision,
372 MathLib::Point3d const& origin = MathLib::ORIGIN,
373 std::string const& mesh_name = "mesh");
374
385MeshLib::Mesh* generateRegularTriMesh(
386 const unsigned n_x_cells,
387 const unsigned n_y_cells,
388 const double cell_size,
389 MathLib::Point3d const& origin = MathLib::ORIGIN,
390 std::string const& mesh_name = "mesh");
391
403MeshLib::Mesh* generateRegularTriMesh(
404 const unsigned n_x_cells,
405 const unsigned n_y_cells,
406 const double cell_size_x,
407 const double cell_size_y,
408 MathLib::Point3d const& origin = MathLib::ORIGIN,
409 std::string const& mesh_name = "mesh");
410
424MeshLib::Mesh* generateRegularPrismMesh(
425 const double x_length,
426 const double y_length,
427 const double z_length,
428 const std::size_t x_subdivision,
429 const std::size_t y_subdivision,
430 const std::size_t z_subdivision,
431 MathLib::Point3d const& origin = MathLib::ORIGIN,
432 std::string const& mesh_name = "mesh");
433
444MeshLib::Mesh* generateRegularPrismMesh(
445 const unsigned n_x_cells,
446 const unsigned n_y_cells,
447 const unsigned n_z_cells,
448 const double cell_size,
449 MathLib::Point3d const& origin = MathLib::ORIGIN,
450 std::string const& mesh_name = "mesh");
451
464MeshLib::Mesh* generateRegularPrismMesh(
465 const unsigned n_x_cells,
466 const unsigned n_y_cells,
467 const unsigned n_z_cells,
468 const double cell_size_x,
469 const double cell_size_y,
470 const double cell_size_z,
471 MathLib::Point3d const& origin = MathLib::ORIGIN,
472 std::string const& mesh_name = "mesh");
473
486MeshLib::Mesh* generateRegularTetMesh(
487 const BaseLib::ISubdivision& div_x,
488 const BaseLib::ISubdivision& div_y,
489 const BaseLib::ISubdivision& div_z,
490 MathLib::Point3d const& origin = MathLib::ORIGIN,
491 std::string const& mesh_name = "mesh");
492
508MeshLib::Mesh* generateRegularTetMesh(
509 const double x_length,
510 const double y_length,
511 const double z_length,
512 const std::size_t x_subdivision,
513 const std::size_t y_subdivision,
514 const std::size_t z_subdivision,
515 MathLib::Point3d const& origin = MathLib::ORIGIN,
516 std::string const& mesh_name = "mesh");
517
533MeshLib::Mesh* generateRegularTetMesh(
534 const unsigned n_x_cells,
535 const unsigned n_y_cells,
536 const unsigned n_z_cells,
537 const double cell_size_x,
538 const double cell_size_y,
539 const double cell_size_z,
540 MathLib::Point3d const& origin = MathLib::ORIGIN,
541 std::string const& mesh_name = "mesh");
542
547MeshLib::Mesh* createSurfaceMesh(
548 std::string const& mesh_name, MathLib::Point3d const& ll,
549 MathLib::Point3d const& ur, std::array<std::size_t, 2> const& n_steps,
550 const std::function<double(double, double)>& f);
551
552} // namespace MeshGenerator
553} // namespace MeshToolsLib
const Point3d ORIGIN
Definition Point3d.h:89
MeshLib::Mesh * generateLineMesh(const BaseLib::ISubdivision &div, MathLib::Point3d const &origin=MathLib::ORIGIN, std::string const &mesh_name="mesh")
MeshLib::Mesh * generateRegularPyramidMesh(const BaseLib::ISubdivision &div_x, const BaseLib::ISubdivision &div_y, const BaseLib::ISubdivision &div_z, MathLib::Point3d const &origin=MathLib::ORIGIN, std::string const &mesh_name="mesh")
MeshLib::Mesh * generateRegularTetMesh(const BaseLib::ISubdivision &div_x, const BaseLib::ISubdivision &div_y, const BaseLib::ISubdivision &div_z, MathLib::Point3d const &origin=MathLib::ORIGIN, std::string const &mesh_name="mesh")
MeshLib::Mesh * generateRegularQuadMesh(const BaseLib::ISubdivision &div_x, const BaseLib::ISubdivision &div_y, MathLib::Point3d const &origin=MathLib::ORIGIN, std::string const &mesh_name="mesh")
MeshLib::Mesh * generateRegularPrismMesh(const double x_length, const double y_length, const double z_length, const std::size_t x_subdivision, const std::size_t y_subdivision, const std::size_t z_subdivision, MathLib::Point3d const &origin=MathLib::ORIGIN, std::string const &mesh_name="mesh")
std::vector< MeshLib::Node * > generateRegularNodes(const std::vector< const std::vector< double > * > &vec_xyz_coords, const MathLib::Point3d &origin=MathLib::ORIGIN)
MeshLib::Mesh * createSurfaceMesh(std::string const &mesh_name, MathLib::Point3d const &ll, MathLib::Point3d const &ur, std::array< std::size_t, 2 > const &n_steps, const std::function< double(double, double)> &f)
MeshLib::Mesh * generateRegularTriMesh(const BaseLib::ISubdivision &div_x, const BaseLib::ISubdivision &div_y, MathLib::Point3d const &origin=MathLib::ORIGIN, std::string const &mesh_name="mesh")
MeshLib::Mesh * generateRegularHexMesh(const BaseLib::ISubdivision &div_x, const BaseLib::ISubdivision &div_y, const BaseLib::ISubdivision &div_z, MathLib::Point3d const &origin=MathLib::ORIGIN, std::string const &mesh_name="mesh")