OGS
MeshGenerator.h
Go to the documentation of this file.
1 
11 #pragma once
12 
13 #include <array>
14 #include <functional>
15 #include <string>
16 #include <vector>
17 
18 #include "BaseLib/Subdivision.h"
19 #include "MathLib/Point3d.h"
20 #include "MeshLib/Mesh.h"
21 
22 namespace MeshLib
23 {
24 class Node;
25 
26 namespace MeshGenerator
27 {
28 
35 std::vector<MeshLib::Node*> generateRegularNodes(
36  const std::vector<const std::vector<double>*> &vec_xyz_coords,
37  const MathLib::Point3d& origin = MathLib::ORIGIN);
38 
45 std::vector<MeshLib::Node*> generateRegularNodes(
46  const std::vector<double> &vec_x_coords,
47  const MathLib::Point3d& origin = MathLib::ORIGIN);
48 
56 std::vector<MeshLib::Node*> generateRegularNodes(
57  std::vector<double> &vec_x_coords,
58  std::vector<double> &vec_y_coords,
59  const MathLib::Point3d& origin = MathLib::ORIGIN);
60 
69 std::vector<MeshLib::Node*> generateRegularNodes(
70  std::vector<double> &vec_x_coords,
71  std::vector<double> &vec_y_coords,
72  std::vector<double> &vec_z_coords,
73  const MathLib::Point3d& origin = MathLib::ORIGIN);
74 
82 std::vector<MeshLib::Node*> generateRegularNodes(const std::array<unsigned,3> &n_cells,
83  const std::array<double,3> &cell_size,
84  const MathLib::Point3d& origin);
85 
94  MathLib::Point3d const& origin = MathLib::ORIGIN,
95  std::string const& mesh_name = "mesh");
96 
105 Mesh* generateLineMesh(const double length,
106  const std::size_t subdivision,
107  MathLib::Point3d const& origin = MathLib::ORIGIN,
108  std::string const& mesh_name = "mesh");
109 
118 Mesh* generateLineMesh(const unsigned n_cells,
119  const double cell_size,
120  MathLib::Point3d const& origin = MathLib::ORIGIN,
121  std::string const& mesh_name = "mesh");
122 
133  const BaseLib::ISubdivision &div_y,
134  MathLib::Point3d const& origin = MathLib::ORIGIN,
135  std::string const& mesh_name = "mesh");
136 
147 Mesh* generateRegularQuadMesh(const double length,
148  const std::size_t subdivision,
149  MathLib::Point3d const& origin = MathLib::ORIGIN,
150  std::string const& mesh_name = "mesh");
151 
164 Mesh* generateRegularQuadMesh(const double x_length,
165  const double y_length,
166  const std::size_t x_subdivision,
167  const std::size_t y_subdivision,
168  MathLib::Point3d const& origin = MathLib::ORIGIN,
169  std::string const& mesh_name = "mesh");
170 
181 Mesh* generateRegularQuadMesh(const unsigned n_x_cells,
182  const unsigned n_y_cells,
183  const double cell_size,
184  MathLib::Point3d const& origin = MathLib::ORIGIN,
185  std::string const& mesh_name = "mesh");
186 
198 Mesh* generateRegularQuadMesh(const unsigned n_x_cells,
199  const unsigned n_y_cells,
200  const double cell_size_x,
201  const double cell_size_y,
202  MathLib::Point3d const& origin = MathLib::ORIGIN,
203  std::string const& mesh_name = "mesh");
204 
216  const BaseLib::ISubdivision &div_y,
217  const BaseLib::ISubdivision &div_z,
218  MathLib::Point3d const& origin = MathLib::ORIGIN,
219  std::string const& mesh_name = "mesh");
220 
229 Mesh* generateRegularHexMesh(const double length,
230  const std::size_t subdivision,
231  MathLib::Point3d const& origin = MathLib::ORIGIN,
232  std::string const& mesh_name = "mesh");
233 
246 Mesh* generateRegularHexMesh(const double x_length,
247  const double y_length,
248  const double z_length,
249  const std::size_t x_subdivision,
250  const std::size_t y_subdivision,
251  const std::size_t z_subdivision,
252  MathLib::Point3d const& origin = MathLib::ORIGIN,
253  std::string const& mesh_name = "mesh");
254 
265 Mesh* generateRegularHexMesh(const unsigned n_x_cells,
266  const unsigned n_y_cells,
267  const unsigned n_z_cells,
268  const double cell_size,
269  MathLib::Point3d const& origin = MathLib::ORIGIN,
270  std::string const& mesh_name = "mesh");
271 
284 Mesh* generateRegularHexMesh(const unsigned n_x_cells,
285  const unsigned n_y_cells,
286  const unsigned n_z_cells,
287  const double cell_size_x,
288  const double cell_size_y,
289  const double cell_size_z,
290  MathLib::Point3d const& origin = MathLib::ORIGIN,
291  std::string const& mesh_name = "mesh");
292 
307  const BaseLib::ISubdivision& div_x,
308  const BaseLib::ISubdivision& div_y,
309  const BaseLib::ISubdivision& div_z,
310  MathLib::Point3d const& origin = MathLib::ORIGIN,
311  std::string const& mesh_name = "mesh");
312 
324  const BaseLib::ISubdivision &div_y,
325  MathLib::Point3d const& origin = MathLib::ORIGIN,
326  std::string const& mesh_name = "mesh");
327 
338 Mesh* generateRegularTriMesh(const double length,
339  const std::size_t subdivision,
340  MathLib::Point3d const& origin = MathLib::ORIGIN,
341  std::string const& mesh_name = "mesh");
342 
355 Mesh* generateRegularTriMesh(const double x_length,
356  const double y_length,
357  const std::size_t x_subdivision,
358  const std::size_t y_subdivision,
359  MathLib::Point3d const& origin = MathLib::ORIGIN,
360  std::string const& mesh_name = "mesh");
361 
372 Mesh* generateRegularTriMesh(const unsigned n_x_cells,
373  const unsigned n_y_cells,
374  const double cell_size,
375  MathLib::Point3d const& origin = MathLib::ORIGIN,
376  std::string const& mesh_name = "mesh");
377 
389 Mesh* generateRegularTriMesh(const unsigned n_x_cells,
390  const unsigned n_y_cells,
391  const double cell_size_x,
392  const double cell_size_y,
393  MathLib::Point3d const& origin = MathLib::ORIGIN,
394  std::string const& mesh_name = "mesh");
395 
409 Mesh* generateRegularPrismMesh(const double x_length,
410  const double y_length,
411  const double z_length,
412  const std::size_t x_subdivision,
413  const std::size_t y_subdivision,
414  const std::size_t z_subdivision,
415  MathLib::Point3d const& origin = MathLib::ORIGIN,
416  std::string const& mesh_name = "mesh");
417 
428 Mesh* generateRegularPrismMesh(const unsigned n_x_cells,
429  const unsigned n_y_cells,
430  const unsigned n_z_cells,
431  const double cell_size,
432  MathLib::Point3d const& origin = MathLib::ORIGIN,
433  std::string const& mesh_name = "mesh");
434 
447 Mesh* generateRegularPrismMesh(const unsigned n_x_cells,
448  const unsigned n_y_cells,
449  const unsigned n_z_cells,
450  const double cell_size_x,
451  const double cell_size_y,
452  const double cell_size_z,
453  MathLib::Point3d const& origin = MathLib::ORIGIN,
454  std::string const& mesh_name = "mesh");
455 
468  const BaseLib::ISubdivision &div_y,
469  const BaseLib::ISubdivision &div_z,
470  MathLib::Point3d const& origin = MathLib::ORIGIN,
471  std::string const& mesh_name = "mesh");
472 
487 Mesh* generateRegularTetMesh(const double x_length,
488  const double y_length,
489  const double z_length,
490  const std::size_t x_subdivision,
491  const std::size_t y_subdivision,
492  const std::size_t z_subdivision,
493  MathLib::Point3d const& origin = MathLib::ORIGIN,
494  std::string const& mesh_name = "mesh");
495 
510 Mesh* generateRegularTetMesh(const unsigned n_x_cells,
511  const unsigned n_y_cells,
512  const unsigned n_z_cells,
513  const double cell_size_x,
514  const double cell_size_y,
515  const double cell_size_z,
516  MathLib::Point3d const& origin = MathLib::ORIGIN,
517  std::string const& mesh_name = "mesh");
518 
524 createSurfaceMesh(std::string const& mesh_name,
525  MathLib::Point3d const& ll, MathLib::Point3d const& ur,
526  std::array<std::size_t, 2> const& n_steps,
527  const std::function<double(double,double)>& f);
528 
529 } // namespace MeshGenerator
530 } // namespace MeshLib
Definition of the Mesh class.
Definition of the Point3d class.
const Point3d ORIGIN
Definition: Point3d.h:26
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)
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)
Mesh * generateLineMesh(const BaseLib::ISubdivision &div, MathLib::Point3d const &origin=MathLib::ORIGIN, std::string const &mesh_name="mesh")
Mesh * generateRegularTriMesh(const BaseLib::ISubdivision &div_x, const BaseLib::ISubdivision &div_y, MathLib::Point3d const &origin=MathLib::ORIGIN, std::string const &mesh_name="mesh")
Mesh * generateRegularQuadMesh(const BaseLib::ISubdivision &div_x, const BaseLib::ISubdivision &div_y, MathLib::Point3d const &origin=MathLib::ORIGIN, std::string const &mesh_name="mesh")
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")
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")
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")