OGS
MeshSurfaceExtraction.h
Go to the documentation of this file.
1 
15 #pragma once
16 
17 #include <cstddef>
18 #include <vector>
19 
20 #include <Eigen/Eigen>
21 
22 #include "MeshLib/Mesh.h"
23 #include "MeshLib/Properties.h"
24 
25 namespace MeshLib
26 {
27 // forward declarations
28 class Mesh;
29 class Element;
30 class Node;
31 
37 {
38 public:
40  static std::vector<double> getSurfaceAreaForNodes(
41  const MeshLib::Mesh& mesh);
42 
44  static std::vector<MeshLib::Node*> getSurfaceNodes(
45  const MeshLib::Mesh& mesh, Eigen::Vector3d const& dir, double angle);
46 
67  const MeshLib::Mesh& subsfc_mesh,
68  Eigen::Vector3d const& dir,
69  double angle,
70  std::string const& subsfc_node_id_prop_name = "",
71  std::string const& subsfc_element_id_prop_name = "",
72  std::string const& face_id_prop_name = "");
73 
74 private:
76  static void get2DSurfaceElements(
77  const std::vector<MeshLib::Element*>& all_elements,
78  std::vector<MeshLib::Element*>& sfc_elements,
79  std::vector<std::size_t>& element_to_bulk_element_id_map,
80  std::vector<std::size_t>& element_to_bulk_face_id_map,
81  Eigen::Vector3d const& dir,
82  double angle,
83  unsigned mesh_dimension);
84 };
85 
86 namespace BoundaryExtraction
87 {
88 std::unique_ptr<MeshLib::Mesh> getBoundaryElementsAsMesh(
89  MeshLib::Mesh const& bulk_mesh,
90  std::string const& subsfc_node_id_prop_name,
91  std::string const& subsfc_element_id_prop_name,
92  std::string const& face_id_prop_name);
93 }
94 
96  MeshLib::Mesh& surface_mesh,
97  std::string const& node_to_bulk_node_id_map_name,
98  std::vector<std::size_t> const& node_to_bulk_node_id_map,
99  std::string const& element_to_bulk_element_id_map_name,
100  std::vector<std::size_t> const& element_to_bulk_element_id_map,
101  std::string const& element_to_bulk_face_id_map_name,
102  std::vector<std::size_t> const& element_to_bulk_face_id_map);
103 
104 } // namespace MeshLib
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 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 const &subsfc_node_id_prop_name="", std::string const &subsfc_element_id_prop_name="", std::string const &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.
static std::vector< double > getSurfaceAreaForNodes(const MeshLib::Mesh &mesh)
Returns a vector of the areas assigned to each node on a surface mesh.
std::unique_ptr< MeshLib::Mesh > getBoundaryElementsAsMesh(MeshLib::Mesh const &bulk_mesh, std::string const &subsfc_node_id_prop_name, std::string const &subsfc_element_id_prop_name, std::string const &face_id_prop_name)
void addBulkIDPropertiesToMesh(MeshLib::Mesh &surface_mesh, std::string const &node_to_bulk_node_id_map_name, std::vector< std::size_t > const &node_to_bulk_node_id_map, std::string const &element_to_bulk_element_id_map_name, std::vector< std::size_t > const &element_to_bulk_element_id_map, std::string const &element_to_bulk_face_id_map_name, std::vector< std::size_t > const &element_to_bulk_face_id_map)