hp-FEM
Adaptive hp-FEM suite for nano-optics
Loading...
Searching...
No Matches
gmsh.hpp
Go to the documentation of this file.
1#pragma once
4
5#include <filesystem>
6#include <istream>
7#include <vector>
8
10#include "hpfem/mesh/mesh.hpp"
11
12namespace hpfem::mesh {
13
33template <int Dim>
34[[nodiscard]] Mesh<Dim> read_gmsh(std::istream& in, Real scale = 1.0);
35
37template <int Dim>
38[[nodiscard]] Mesh<Dim> read_gmsh(const std::filesystem::path& file, Real scale = 1.0);
39
46template <int Dim>
52
54template <int Dim>
55struct GmshMesh {
57 std::vector<PeriodicLink<Dim>> periodic;
58};
59
63template <int Dim>
64[[nodiscard]] GmshMesh<Dim> read_gmsh_with_periodic(std::istream& in, Real scale = 1.0);
65template <int Dim>
66[[nodiscard]] GmshMesh<Dim> read_gmsh_with_periodic(const std::filesystem::path& file,
67 Real scale = 1.0);
68
69extern template struct PeriodicLink<2>;
70extern template struct PeriodicLink<3>;
71extern template struct GmshMesh<2>;
72extern template struct GmshMesh<3>;
73extern template GmshMesh<2> read_gmsh_with_periodic<2>(std::istream&, Real);
74extern template GmshMesh<3> read_gmsh_with_periodic<3>(std::istream&, Real);
75extern template GmshMesh<2> read_gmsh_with_periodic<2>(const std::filesystem::path&, Real);
76extern template GmshMesh<3> read_gmsh_with_periodic<3>(const std::filesystem::path&, Real);
77extern template Mesh<2> read_gmsh<2>(std::istream&, Real);
78extern template Mesh<3> read_gmsh<3>(std::istream&, Real);
79extern template Mesh<2> read_gmsh<2>(const std::filesystem::path&, Real);
80extern template Mesh<3> read_gmsh<3>(const std::filesystem::path&, Real);
81
82} // namespace hpfem::mesh
Definition mesh.hpp:61
Definition adaptive_mesh.hpp:19
std::int32_t Tag
Integer tag of a physical group (Gmsh convention: positive; 0 means untagged).
Definition mesh.hpp:23
template Mesh< 3 > read_gmsh< 3 >(std::istream &, Real)
template Mesh< 2 > read_gmsh< 2 >(std::istream &, Real)
GmshMesh< Dim > read_gmsh_with_periodic(std::istream &in, Real scale=1.0)
Mesh< Dim > read_gmsh(std::istream &in, Real scale=1.0)
constexpr Tag kNoTag
Definition mesh.hpp:24
template GmshMesh< 3 > read_gmsh_with_periodic< 3 >(std::istream &, Real)
template GmshMesh< 2 > read_gmsh_with_periodic< 2 >(std::istream &, Real)
double Real
Definition types.hpp:15
Eigen::Matrix< Real, Dim, 1 > Point
Definition types.hpp:27
The mesh and its periodic links (assembly::PeriodicPair needs only the Bloch phase).
Definition gmsh.hpp:55
Mesh< Dim > mesh
Definition gmsh.hpp:56
std::vector< PeriodicLink< Dim > > periodic
Definition gmsh.hpp:57