|
hp-FEM
Adaptive hp-FEM suite for nano-optics
|
Assembles the matrices once, factorises the Newmark operator and advances a state. More...
#include <time_domain.hpp>
Public Member Functions | |
| TimeDomain (const fespace::NedelecDofMap< Dim > &dofs, TimeDomainSetup< Dim > setup) | |
| const fespace::NedelecDofMap< Dim > & | dofs () const noexcept |
| const TimeDomainSetup< Dim > & | setup () const noexcept |
| Index | num_free_dofs () const noexcept |
| TimeState< Dim > | initialize (const Vector &u0, const Vector &v0, Real t0=0) const |
| TimeState< Dim > | initialize (Real t0=0) const |
| Zero initial state. | |
| void | step (TimeState< Dim > &state) const |
| One Newmark step of length dt. | |
| void | run (TimeState< Dim > &state, int steps, const std::function< void(const TimeState< Dim > &)> &observer={}) const |
steps steps; observer(state) is called after each one (if given). | |
| Real | energy (const TimeState< Dim > &state) const |
| Discrete energy \( \tfrac12(v^T M v + u^T S u) \) [J]. | |
| Vector | load (Real t) const |
| Load \( -g'(t)\,(J, \phi_i) \) on the free DoFs at time t (zero without source). | |
| const SparseMatrix & | stiffness () const noexcept |
| Matrices on the free DoFs: stiffness (μ⁻¹), mass (ε), damping (σ and absorbing). | |
| const SparseMatrix & | mass () const noexcept |
| const SparseMatrix & | damping () const noexcept |
Assembles the matrices once, factorises the Newmark operator and advances a state.
| hpfem::physics::TimeDomain< Dim >::TimeDomain | ( | const fespace::NedelecDofMap< Dim > & | dofs, |
| TimeDomainSetup< Dim > | setup | ||
| ) |
| InvalidArgument | for dt ≤ 0, complex materials, an absorbing tag on an interior facet, or a current without signal (and vice versa). |
|
inlinenoexcept |
|
inlinenoexcept |
| Real hpfem::physics::TimeDomain< Dim >::energy | ( | const TimeState< Dim > & | state | ) | const |
Discrete energy \( \tfrac12(v^T M v + u^T S u) \) [J].
| TimeState< Dim > hpfem::physics::TimeDomain< Dim >::initialize | ( | const Vector & | u0, |
| const Vector & | v0, | ||
| Real | t0 = 0 |
||
| ) | const |
State at t0 from the initial field and velocity (PEC entries are zeroed); the acceleration is the consistent one, \( M a = f(t_0) - C v - S u \).
| InvalidArgument | if a vector does not match the DoF map. |
| TimeState< Dim > hpfem::physics::TimeDomain< Dim >::initialize | ( | Real | t0 = 0 | ) | const |
Zero initial state.
| Vector hpfem::physics::TimeDomain< Dim >::load | ( | Real | t | ) | const |
Load \( -g'(t)\,(J, \phi_i) \) on the free DoFs at time t (zero without source).
|
inlinenoexcept |
|
inlinenoexcept |
| void hpfem::physics::TimeDomain< Dim >::run | ( | TimeState< Dim > & | state, |
| int | steps, | ||
| const std::function< void(const TimeState< Dim > &)> & | observer = {} |
||
| ) | const |
steps steps; observer(state) is called after each one (if given).
|
inlinenoexcept |
| void hpfem::physics::TimeDomain< Dim >::step | ( | TimeState< Dim > & | state | ) | const |
One Newmark step of length dt.
|
inlinenoexcept |
Matrices on the free DoFs: stiffness (μ⁻¹), mass (ε), damping (σ and absorbing).