OGS
MeshSurfaceExtraction.h
Go to the documentation of this file.
1
15#pragma once
16
17#include <Eigen/Core>
18#include <cstddef>
19#include <vector>
20
21#include "MeshLib/Mesh.h"
22#include "MeshLib/Properties.h"
23
24namespace MeshLib
25{
26// forward declarations
27class Mesh;
28class Element;
29class Node;
30} // namespace MeshLib
31
32namespace MeshToolsLib
33{
39{
40public:
42 static std::vector<double> getSurfaceAreaForNodes(
43 const MeshLib::Mesh& mesh);
44
46 static std::vector<MeshLib::Node*> getSurfaceNodes(
47 const MeshLib::Mesh& mesh, Eigen::Vector3d const& dir, double angle);
48
69 const MeshLib::Mesh& subsfc_mesh,
70 Eigen::Vector3d const& dir,
71 double angle,
72 std::string_view subsfc_node_id_prop_name = "",
73 std::string_view subsfc_element_id_prop_name = "",
74 std::string_view face_id_prop_name = "");
75
76private:
78 static void get2DSurfaceElements(
79 const std::vector<MeshLib::Element*>& all_elements,
80 std::vector<MeshLib::Element*>& sfc_elements,
81 std::vector<std::size_t>& element_to_bulk_element_id_map,
82 std::vector<std::size_t>& element_to_bulk_face_id_map,
83 Eigen::Vector3d const& dir,
84 double angle,
85 unsigned mesh_dimension);
86};
87
88namespace BoundaryExtraction
89{
90std::unique_ptr<MeshLib::Mesh> getBoundaryElementsAsMesh(
91 MeshLib::Mesh const& bulk_mesh,
92 std::string_view subsfc_node_id_prop_name,
93 std::string_view subsfc_element_id_prop_name,
94 std::string_view face_id_prop_name);
95}
96
98 MeshLib::Mesh& surface_mesh,
99 std::string_view node_to_bulk_node_id_map_name,
100 std::vector<std::size_t> const& node_to_bulk_node_id_map,
101 std::string_view element_to_bulk_element_id_map_name,
102 std::vector<std::size_t> const& element_to_bulk_element_id_map,
103 std::string_view element_to_bulk_face_id_map_name,
104 std::vector<std::size_t> const& element_to_bulk_face_id_map);
105
106} // namespace MeshToolsLib
Definition of the class Properties that implements a container of properties.
Definition of the Mesh class.
A set of tools concerned with extracting nodes and elements from a mesh surface.
static std::vector< double > getSurfaceAreaForNodes(const MeshLib::Mesh &mesh)
Returns a vector of the areas assigned to each node on a surface mesh.
static void get2DSurfaceElements(const std::vector< MeshLib::Element * > &all_elements, std::vector< MeshLib::Element * > &sfc_elements, std::vector< std::size_t > &element_to_bulk_element_id_map, std::vector< std::size_t > &element_to_bulk_face_id_map, Eigen::Vector3d const &dir, double angle, unsigned mesh_dimension)
Functionality needed for getSurfaceNodes() and getMeshSurface()
static MeshLib::Mesh * getMeshSurface(const MeshLib::Mesh &subsfc_mesh, Eigen::Vector3d const &dir, double angle, std::string_view subsfc_node_id_prop_name="", std::string_view subsfc_element_id_prop_name="", std::string_view face_id_prop_name="")
static std::vector< MeshLib::Node * > getSurfaceNodes(const MeshLib::Mesh &mesh, Eigen::Vector3d const &dir, double angle)
Returns the surface nodes of a mesh.
std::unique_ptr< MeshLib::Mesh > getBoundaryElementsAsMesh(MeshLib::Mesh const &bulk_mesh, std::string_view subsfc_node_id_prop_name, std::string_view subsfc_element_id_prop_name, std::string_view face_id_prop_name)
void addBulkIDPropertiesToMesh(MeshLib::Mesh &surface_mesh, std::string_view node_to_bulk_node_id_map_name, std::vector< std::size_t > const &node_to_bulk_node_id_map, std::string_view element_to_bulk_element_id_map_name, std::vector< std::size_t > const &element_to_bulk_element_id_map, std::string_view element_to_bulk_face_id_map_name, std::vector< std::size_t > const &element_to_bulk_face_id_map)