|
hp-FEM
Adaptive hp-FEM suite for nano-optics
|
Namespaces | |
| namespace | adaptivity |
| namespace | assembly |
| namespace | constants |
| namespace | fespace |
| namespace | io |
| namespace | materials |
| namespace | mesh |
| namespace | physics |
| namespace | pml |
| namespace | solvers |
Classes | |
| class | AnisotropicUnsupported |
| class | Cancelled |
| Thrown by a solve whose progress callback returned false. More... | |
| class | Error |
| class | InvalidArgument |
| class | NotImplemented |
| struct | ProgressEvent |
A phase of a solve starting (or, with step == num_steps, the solve being done). More... | |
| class | ProgressReporter |
Typedefs | |
| using | ProgressCallback = std::function< bool(const ProgressEvent &)> |
| using | Timing = std::map< std::string, double > |
| Wall-clock seconds per phase by name, plus "total". | |
| using | Real = double |
| using | Complex = std::complex< double > |
| using | Index = std::int64_t |
| global indices (DoFs, entities) | |
| using | LocalIndex = std::int32_t |
| element-local indices | |
| using | Vector = Eigen::Matrix< Complex, Eigen::Dynamic, 1 > |
| using | RealVector = Eigen::Matrix< Real, Eigen::Dynamic, 1 > |
| using | Matrix = Eigen::Matrix< Complex, Eigen::Dynamic, Eigen::Dynamic > |
| using | RealMatrix = Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > |
| using | SparseMatrix = Eigen::SparseMatrix< Complex, Eigen::RowMajor, Index > |
| template<int Dim> | |
| using | Point = Eigen::Matrix< Real, Dim, 1 > |
Functions | |
| void | assertion_failed (const char *expr, const char *file, int line, const std::string &msg) |
| spdlog::logger & | log () |
Returns the library logger. Usage: hpfem::log().debug("{} cells", n); | |
| bool | has_openmp () noexcept |
| True if the library was built with OpenMP. | |
| int | num_threads () noexcept |
| Number of threads a parallel loop uses (1 without OpenMP). | |
| void | set_num_threads (int threads) noexcept |
| int | thread_index () noexcept |
| Index of the calling thread inside a parallel loop, 0 outside. | |
| template<class Body > | |
| void | parallel_for (Index n, Body &&body) |
| Real | cyl_bessel_j (Real nu, Real x) |
| Real | cyl_neumann (Real nu, Real x) |
| Real | sph_bessel (unsigned order, Real x) |
Spherical Bessel function of the first kind \( j_n(x) \), x ≥ 0 (std::sph_bessel). | |
| Real | sph_neumann (unsigned order, Real x) |
Spherical Bessel function of the second kind \( y_n(x) \), x > 0 (std::sph_neumann). | |
| Real | bessel_j (int order, Real x) |
| Real | bessel_y (int order, Real x) |
| Bessel function of the second kind \( Y_n(x) \), x > 0, any integer order. | |
| Real | bessel_j_derivative (int order, Real x) |
| Derivative \( J_n'(x) = J_{n-1}(x) - \frac{n}{x} J_n(x) \). | |
| Complex | hankel1 (int order, Real x) |
| Hankel function of the first kind \( H_n^{(1)}(x) = J_n(x) + iY_n(x) \), x > 0. | |
| Complex | hankel1_derivative (int order, Real x) |
| Derivative \( H_n^{(1)\prime}(x) = H_{n-1}^{(1)}(x) - \frac{n}{x} H_n^{(1)}(x) \). | |
| Real | spherical_bessel_j (int order, Real x) |
| Spherical Bessel function of the first kind \( j_n(x) \), n ≥ 0, real x ≥ 0. | |
| Real | spherical_bessel_y (int order, Real x) |
| Spherical Bessel function of the second kind \( y_n(x) \), n ≥ 0, x > 0. | |
| Complex | spherical_hankel1 (int order, Real x) |
| std::vector< Complex > | spherical_bessel_j (int max_order, Complex z) |
| std::vector< Real > | bessel_i_scaled (int max_order, Real x) |
| constexpr std::size_t | as_size (Index i) noexcept |
| Converts a non-negative global or local index to a container index. | |
| std::string_view | version () noexcept |
| Library version as "major.minor.patch". | |
Variables | |
| constexpr Complex | kI {0.0, 1.0} |
| constexpr Index | kInvalidIndex = -1 |
| "No entity" marker, e.g. the neighbour across a boundary facet. | |
| using hpfem::Complex = typedef std::complex<double> |
| using hpfem::Index = typedef std::int64_t |
global indices (DoFs, entities)
| using hpfem::LocalIndex = typedef std::int32_t |
element-local indices
| using hpfem::Matrix = typedef Eigen::Matrix<Complex, Eigen::Dynamic, Eigen::Dynamic> |
| using hpfem::Point = typedef Eigen::Matrix<Real, Dim, 1> |
| using hpfem::ProgressCallback = typedef std::function<bool(const ProgressEvent&)> |
Return false to cancel: the solve stops before the phase and throws Cancelled. The callback runs on the calling thread between the phases, never inside a parallel loop.
| using hpfem::Real = typedef double |
| using hpfem::RealMatrix = typedef Eigen::Matrix<Real, Eigen::Dynamic, Eigen::Dynamic> |
| using hpfem::RealVector = typedef Eigen::Matrix<Real, Eigen::Dynamic, 1> |
| using hpfem::SparseMatrix = typedef Eigen::SparseMatrix<Complex, Eigen::RowMajor, Index> |
| using hpfem::Timing = typedef std::map<std::string, double> |
Wall-clock seconds per phase by name, plus "total".
| using hpfem::Vector = typedef Eigen::Matrix<Complex, Eigen::Dynamic, 1> |
|
constexprnoexcept |
Converts a non-negative global or local index to a container index.
| void hpfem::assertion_failed | ( | const char * | expr, |
| const char * | file, | ||
| int | line, | ||
| const std::string & | msg | ||
| ) |
Exponentially scaled modified Bessel functions \( e^{-x} I_n(x) \) of the integer orders n = 0 … max_order for x ≥ 0 ( \( I_{-n} = I_n \)): Miller's backward recurrence \( I_{n-1} = \frac{2n}{x} I_n + I_{n+1} \), normalised by \( e^{-x}(I_0 + 2\sum_{k\ge1} I_k)
= 1 \). Stable for every x (no overflow: the scaled values are ≤ 1); the start order \( N = n_{max} + 32 + \lceil\sqrt{80x}\rceil \) lies where \( e^{-x}I_N \) is below \( e^{-40} \) of the largest term. The azimuthal orders of a Gaussian off the axis.
| InvalidArgument | for max_order < 0 or x < 0. |
Bessel function of the first kind \( J_n(x) \), any integer order ( \( J_{-n} = (-1)^n J_n \)).
Derivative \( J_n'(x) = J_{n-1}(x) - \frac{n}{x} J_n(x) \).
Bessel function of the second kind \( Y_n(x) \), x > 0, any integer order.
Bessel function of the first kind \( J_\nu(x) \) of real order ν ≥ 0, x ≥ 0 (std::cyl_bessel_j).
Bessel function of the second kind \( Y_\nu(x) \) of real order ν ≥ 0, x > 0 (std::cyl_neumann).
Hankel function of the first kind \( H_n^{(1)}(x) = J_n(x) + iY_n(x) \), x > 0.
Derivative \( H_n^{(1)\prime}(x) = H_{n-1}^{(1)}(x) - \frac{n}{x} H_n^{(1)}(x) \).
|
noexcept |
True if the library was built with OpenMP.
|
inline |
Returns the library logger. Usage: hpfem::log().debug("{} cells", n);
|
noexcept |
Number of threads a parallel loop uses (1 without OpenMP).
| void hpfem::parallel_for | ( | Index | n, |
| Body && | body | ||
| ) |
Runs body(i, thread) for i in [0, n) on all threads with dynamic scheduling. An exception thrown by the body stops the loop (remaining indices are skipped) and is rethrown on the calling thread once all threads have finished; with several throwing bodies the first one caught wins.
|
noexcept |
Sets the number of threads of subsequent parallel loops (ignored without OpenMP; values < 1 restore the OpenMP default).
Spherical Bessel function of the first kind \( j_n(x) \), x ≥ 0 (std::sph_bessel).
Spherical Bessel function of the second kind \( y_n(x) \), x > 0 (std::sph_neumann).
\( j_0(z), \dots, j_N(z) \) for complex z (e.g. inside an absorbing sphere) by downward recurrence \( j_{n-1} = \frac{2n+1}{z} j_n - j_{n+1} \) started well above N and normalised with \( j_0 = \sin z / z \) (stable for all orders, unlike the upward recurrence). For |z| < 1e-300 the limit \( j_n(0) = \delta_{n0} \) is returned.
| InvalidArgument | for max_order < 0. |
Spherical Bessel function of the first kind \( j_n(x) \), n ≥ 0, real x ≥ 0.
Spherical Bessel function of the second kind \( y_n(x) \), n ≥ 0, x > 0.
Spherical Hankel function of the first kind \( h_n^{(1)}(x) = j_n(x) + i y_n(x) \) (outgoing for exp(−iωt)), x > 0.
|
inlinenoexcept |
Index of the calling thread inside a parallel loop, 0 outside.
|
noexcept |
Library version as "major.minor.patch".
|
inlineconstexpr |
imaginary unit
|
inlineconstexpr |
"No entity" marker, e.g. the neighbour across a boundary facet.