FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
meshhexer.hpp
1// FEAT3: Finite Element Analysis Toolbox, Version 3
2// Copyright (C) 2010 by Stefan Turek & the FEAT group
3// FEAT3 is released under the GNU General Public License version 3,
4// see the file 'copyright.txt' in the top level directory for details.
5
6#pragma once
7
9
10#if defined(FEAT_HAVE_MESHHEXER) || defined(DOXYGEN)
11
12#include <kernel/geometry/conformal_mesh.hpp>
13#include <kernel/geometry/subdivision_levels.hpp>
14#include <kernel/shape.hpp>
15#include <kernel/util/string.hpp>
16
17namespace FEAT::Geometry
18{
19 struct Gap
20 {
21 double diameter;
22 double confidence;
23
24 Gap(double d, double c) : diameter(d), confidence(c)
25 {
26 }
27 };
28
30 {
31 void* _surface_mesh;
32
33 friend MeshHexerSurfaceMesh load_from_file(const String& filename, bool triangulate);
34
35 explicit MeshHexerSurfaceMesh(void* sm) noexcept : _surface_mesh(sm)
36 {
37 }
38
39 public:
41
43 MeshHexerSurfaceMesh& operator=(const MeshHexerSurfaceMesh&) = delete;
44
46 MeshHexerSurfaceMesh& operator=(MeshHexerSurfaceMesh&&) = default;
47
53 bool is_closed() const;
54
62
72 bool is_outward_oriented() const;
73
79 double minimal_aspect_ratio() const;
80
86 double maximal_aspect_ratio() const;
87
143 std::vector<Gap> gaps();
144
154
168 template<typename DataType_>
170 DataType_ x_min,
171 DataType_ y_min,
172 DataType_ z_min,
173 DataType_ x_max,
174 DataType_ y_max,
175 DataType_ z_max,
176 std::uint64_t levels);
177
185 template<typename DataType_>
187
203 template<typename DataType_>
204 std::pair<ConformalMesh<Shape::Hexahedron, 3, DataType_>, SubdivisionLevels> prepare_fbm_mesh(
205 DataType_ x_min,
206 DataType_ y_min,
207 DataType_ z_min,
208 DataType_ x_max,
209 DataType_ y_max,
210 DataType_ z_max,
211 std::uint64_t levels);
212
222 template<typename DataType_>
223 std::pair<ConformalMesh<Shape::Hexahedron, 3, DataType_>, SubdivisionLevels> prepare_fbm_mesh(std::uint64_t levels);
224
237 void write_to_file(const std::string& filename);
238 }; // MeshHexerSurfaceMesh
239
255 MeshHexerSurfaceMesh load_from_file(const String& filename, bool triangulate = false);
256} // namespace FEAT::Geometry
257
258#endif
FEAT Kernel base header.
Conformal mesh class template.
bool is_wound_consistently() const
Check if the winding order of the faces of the surface mesh is consistent.
bool is_outward_oriented() const
Check if the surface normals of all faces of the surface mesh point towards the unbounded side.
Gap min_gap()
Compute the smallest Gap of the surface mesh.
bool is_closed() const
Check if the surface mesh describes a closed surface.
ConformalMesh< Shape::Hexahedron, 3, DataType_ > fbm_mesh(DataType_ x_min, DataType_ y_min, DataType_ z_min, DataType_ x_max, DataType_ y_max, DataType_ z_max, std::uint64_t levels)
Create a non-fitted volume mesh for this surface mesh.
void write_to_file(const std::string &filename)
Write the surface mesh to disk.
friend MeshHexerSurfaceMesh load_from_file(const String &filename, bool triangulate)
Load a surface mesh from a file.
std::pair< ConformalMesh< Shape::Hexahedron, 3, DataType_ >, SubdivisionLevels > prepare_fbm_mesh(DataType_ x_min, DataType_ y_min, DataType_ z_min, DataType_ x_max, DataType_ y_max, DataType_ z_max, std::uint64_t levels)
Create a non-fitted volume mesh for this surface mesh.
std::pair< ConformalMesh< Shape::Hexahedron, 3, DataType_ >, SubdivisionLevels > prepare_fbm_mesh(std::uint64_t levels)
Create a non-fitted volume mesh for this surface mesh.
ConformalMesh< Shape::Hexahedron, 3, DataType_ > fbm_mesh(std::uint64_t levels)
Create a non-fitted volume mesh for this surface mesh.
double minimal_aspect_ratio() const
Compute the smallest aspect ratio of any face of the surface mesh.
std::vector< Gap > gaps()
Compute Gap candidates of the surface mesh.
double maximal_aspect_ratio() const
Compute the largest aspect ratio of any face of the surface mesh.
Subdivision level markings for meshes.
String class implementation.
Definition: string.hpp:47
Geometry namespace.
MeshHexerSurfaceMesh load_from_file(const String &filename, bool triangulate=false)
Load a surface mesh from a file.