hp-FEM
Adaptive hp-FEM suite for nano-optics
Loading...
Searching...
No Matches
types.hpp
Go to the documentation of this file.
1#pragma once
5
6#include <complex>
7#include <cstddef>
8#include <cstdint>
9
10#include <Eigen/Core>
11#include <Eigen/SparseCore>
12
13namespace hpfem {
14
15using Real = double;
16using Complex = std::complex<double>;
17using Index = std::int64_t;
18using LocalIndex = std::int32_t;
19
20using Vector = Eigen::Matrix<Complex, Eigen::Dynamic, 1>;
21using RealVector = Eigen::Matrix<Real, Eigen::Dynamic, 1>;
22using Matrix = Eigen::Matrix<Complex, Eigen::Dynamic, Eigen::Dynamic>;
23using RealMatrix = Eigen::Matrix<Real, Eigen::Dynamic, Eigen::Dynamic>;
24using SparseMatrix = Eigen::SparseMatrix<Complex, Eigen::RowMajor, Index>;
25
26template <int Dim>
27using Point = Eigen::Matrix<Real, Dim, 1>;
28
29inline constexpr Complex kI{0.0, 1.0};
31inline constexpr Index kInvalidIndex = -1;
32
34[[nodiscard]] constexpr std::size_t as_size(Index i) noexcept {
35 return static_cast<std::size_t>(i);
36}
37
38} // namespace hpfem
Definition axisymmetric_estimator.hpp:39
double Real
Definition types.hpp:15
constexpr Complex kI
Definition types.hpp:29
Eigen::Matrix< Real, Dim, 1 > Point
Definition types.hpp:27
constexpr std::size_t as_size(Index i) noexcept
Converts a non-negative global or local index to a container index.
Definition types.hpp:34
Eigen::Matrix< Complex, Eigen::Dynamic, Eigen::Dynamic > Matrix
Definition types.hpp:22
Eigen::SparseMatrix< Complex, Eigen::RowMajor, Index > SparseMatrix
Definition types.hpp:24
std::int64_t Index
global indices (DoFs, entities)
Definition types.hpp:17
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > RealMatrix
Definition types.hpp:23
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealVector
Definition types.hpp:21
std::int32_t LocalIndex
element-local indices
Definition types.hpp:18
Eigen::Matrix< Complex, Eigen::Dynamic, 1 > Vector
Definition types.hpp:20
constexpr Index kInvalidIndex
"No entity" marker, e.g. the neighbour across a boundary facet.
Definition types.hpp:31
std::complex< double > Complex
Definition types.hpp:16