OGS
FEFLOWMeshInterface.h
Go to the documentation of this file.
1
10#pragma once
11
12#include <iosfwd>
13#include <string>
14#include <vector>
15
16namespace GeoLib
17{
18class Point;
19class Polyline;
20}
21
22namespace MeshLib
23{
24class Mesh;
25class Element;
26class Node;
27enum class MeshElemType;
28}
29
30namespace FileIO
31{
37{
38public:
48 MeshLib::Mesh* readFEFLOWFile(const std::string& filename);
49
50private:
51 // CLASS
52 struct FEM_CLASS
53 {
54 unsigned problem_class = 0;
55 unsigned time_mode = 0;
56 unsigned orientation = 0;
57 unsigned dimension = 0;
58 unsigned n_layers3d = 0;
59 unsigned saturation_flag = 0;
60 unsigned save_fsize_rreal = 0;
61 unsigned save_fsize_creal = 0;
62 };
63
64 // DIMENSION
65 struct FEM_DIM
66 {
67 std::size_t n_nodes = 0;
68 std::size_t n_elements = 0;
69 std::size_t obs = 0;
70 std::size_t np_cor = 0;
71 unsigned n_nodes_of_element = 0;
72 unsigned n_steps = 0;
73 unsigned icrank = 0;
74 unsigned upwind = 0;
75 unsigned optim = 0;
76 unsigned aquifer_type = 0;
77 unsigned nwca = 0;
78 unsigned adaptive_mesh = 0;
79 unsigned sp_fem_pcs_id = 0;
80 unsigned sorption_type = 0;
81 unsigned reaction_type = 0;
82 unsigned dispersion_type = 0;
83 };
84
86 MeshLib::Element* readElement(std::string const& line,
87 std::vector<MeshLib::Node*> const& nodes);
88
90 MeshLib::Element* readElement(const FEM_DIM& fem_dim,
91 const MeshLib::MeshElemType elem_type,
92 const std::string& line,
93 const std::vector<MeshLib::Node*>& nodes);
94
96 void readNodeCoordinates(std::ifstream& in,
97 std::vector<MeshLib::Node*>& nodes);
98
100 void readNodeCoordinates(std::ifstream& in,
101 const FEM_CLASS& fem_class,
102 const FEM_DIM& fem_dim,
103 std::vector<MeshLib::Node*> const& nodes);
104
106 void readElevation(std::ifstream& in,
107 const FEM_CLASS& fem_class,
108 const FEM_DIM& fem_dim,
109 std::vector<MeshLib::Node*>& vec_nodes);
110
112 std::vector<std::size_t> getIndexList(const std::string& str_ranges);
113
116 std::ifstream& in,
117 std::vector<std::vector<std::size_t>>& vec_elementsets);
118
119 void setMaterialIDs(
120 FEM_CLASS const& fem_class,
121 FEM_DIM const& fem_dim,
122 std::vector<GeoLib::Polyline*> const& lines,
123 std::vector<std::vector<std::size_t>> const& vec_elementsets,
124 std::vector<MeshLib::Element*> const& vec_elements,
125 std::vector<int>& material_ids);
126};
127} // namespace FileIO
void setMaterialIDs(FEM_CLASS const &fem_class, FEM_DIM const &fem_dim, std::vector< GeoLib::Polyline * > const &lines, std::vector< std::vector< std::size_t > > const &vec_elementsets, std::vector< MeshLib::Element * > const &vec_elements, std::vector< int > &material_ids)
std::vector< std::size_t > getIndexList(const std::string &str_ranges)
void readNodeCoordinates(std::ifstream &in, std::vector< MeshLib::Node * > &nodes)
read node coordinates given in the XYZCOOR section
MeshLib::Mesh * readFEFLOWFile(const std::string &filename)
void readElevation(std::ifstream &in, const FEM_CLASS &fem_class, const FEM_DIM &fem_dim, std::vector< MeshLib::Node * > &vec_nodes)
read elevation data
MeshLib::Element * readElement(std::string const &line, std::vector< MeshLib::Node * > const &nodes)
Read element type and node indices according to the element type.
void readELEMENTALSETS(std::ifstream &in, std::vector< std::vector< std::size_t > > &vec_elementsets)
parse ELEMENTALSETS
TemplateElement< PointRule1 > Point
Definition Point.h:20
MeshElemType
Types of mesh elements supported by OpenGeoSys. Values are from VTKCellType enum.
Definition MeshEnums.h:27