OpenBEM
Open-source framework for electromagnetic simulation with the boundary element method.
Loading...
Searching...
No Matches
mesh_transfer.hpp
Go to the documentation of this file.
1// OpenBEM - Copyright (C) 2026 Shashwat Sharma
2
3// This file is part of OpenBEM.
4
5// OpenBEM is free software: you can redistribute it and/or modify it under the terms of the
6// GNU General Public License as published by the Free Software Foundation, either version 3
7// of the License, or (at your option) any later version.
8
9// You should have received a copy of the GNU General Public License along with OpenBEM.
10// If not, see <https://www.gnu.org/licenses/>.
11
12
18#ifndef GEOM_MESH_IO_H
19#define GEOM_MESH_IO_H
20
21#include <string>
22
23#include "types.hpp"
24
25
26namespace bem
27{
28
29// Forward declarations
30template <typename MeshType> class Structure;
31template <uint8_t dim> class TriangleMesh;
32
42{
43public:
44
53 static void read_gmsh_v2(
54 Structure<TriangleMesh<3>>& structure,
55 const std::string msh_filename,
56 const bool decoupled_edges = false
57 );
58
59
66 static void write_gmsh_v2(
67 const Structure<TriangleMesh<3>>& structure,
68 const std::string msh_filename,
69 const std::string extension = "msh"
70 );
71
72
81 const Structure<TriangleMesh<3>>& structure,
82 const std::string msh_filename,
84 std::string field_name = "scalar_field"
85 );
86
87
96 const Structure<TriangleMesh<3>>& structure,
97 const std::string msh_filename,
99 std::string field_name = "vector_field"
100 );
101
102};
103
108}
109
110#ifndef BEM_LINKED
112#endif
113
114#endif
Class that collects mesh input and output static methods.
static void read_gmsh_v2(Structure< TriangleMesh< 3 > > &structure, const std::string msh_filename, const bool decoupled_edges=false)
Reads a GMSH v2 mesh file and populates a TriangleMesh in a Structure.
static void write_gmsh_v2_scalar_field(const Structure< TriangleMesh< 3 > > &structure, const std::string msh_filename, ConstEigRef< EigRowVec< Float > > field, std::string field_name="scalar_field")
Writes a GMSH v2 mesh file from a TriangleMesh in a Structure with a superimposed scalar field.
static void write_gmsh_v2_vector_field(const Structure< TriangleMesh< 3 > > &structure, const std::string msh_filename, ConstEigRef< EigMatNX< Float, 3 > > field, std::string field_name="vector_field")
Writes a GMSH v2 mesh file from a TriangleMesh in a Structure with a superimposed vector field.
static void write_gmsh_v2(const Structure< TriangleMesh< 3 > > &structure, const std::string msh_filename, const std::string extension="msh")
Writes a GMSH v2 mesh file from a TriangleMesh in a Structure.
Class that defines a structure.
Definition structure.hpp:45
Class defining a mesh with triangle elements.
const Eigen::Ref< const EigObj > ConstEigRef
Read-only reference to an Eigen object.
Definition types.hpp:98
Eigen::Matrix< T, 1, Eigen::Dynamic > EigRowVec
Dynamic-size row vector containing type T.
Definition types.hpp:90
Eigen::Matrix< T, N, Eigen::Dynamic > EigMatNX
Fixed-height matrix with N rows containing type T.
Definition types.hpp:78
Primary namespace for the OpenBEM library.
Definition constants.hpp:31