hp-FEM
Adaptive hp-FEM suite for nano-optics
Loading...
Searching...
No Matches
goal_oriented.hpp
Go to the documentation of this file.
1#pragma once
14
15#include <functional>
16#include <vector>
17
20#include "hpfem/core/types.hpp"
23
24namespace hpfem::physics {
25
27template <int Dim>
28using Functional = std::function<Vector(const fespace::NedelecDofMap<Dim>&)>;
29
33 std::vector<Complex> contributions;
34 std::vector<Real> indicators;
37 [[nodiscard]] Real total() const;
38};
39
42template <int Dim>
43[[nodiscard]] GoalEstimate dwr_estimate(const Scattering<Dim>& problem,
44 const ScatteringSolution<Dim>& solution,
45 const Functional<Dim>& functional,
46 const adaptivity::EstimatorOptions& options = {});
47
49template <int Dim>
51 const assembly::ComplexVector<Dim>& weight);
52
58 int order, int num_points,
60
62 const Functional<2>&,
65 const Functional<3>&,
71
72} // namespace hpfem::physics
Definition dof_map.hpp:51
Assembles, constrains and solves a scattering problem and evaluates its fields.
Definition scattering.hpp:96
Eigen::Matrix< Complex, Dim, 1 > ComplexVector
Definition maxwell_forms.hpp:31
Definition absorption.hpp:21
template Functional< 3 > point_value_functional< 3 >(const Point< 3 > &, const assembly::ComplexVector< 3 > &)
std::function< Vector(const fespace::NedelecDofMap< Dim > &)> Functional
A linear functional given on any DoF map of the mesh: returns q with Q(E_h) = qᵀ e_h.
Definition goal_oriented.hpp:28
template GoalEstimate dwr_estimate< 3 >(const Scattering< 3 > &, const ScatteringSolution< 3 > &, const Functional< 3 > &, const adaptivity::EstimatorOptions &)
template GoalEstimate dwr_estimate< 2 >(const Scattering< 2 > &, const ScatteringSolution< 2 > &, const Functional< 2 > &, const adaptivity::EstimatorOptions &)
Functional< 2 > fourier_coefficient_functional(Real x0, Real y0, Real period, Real ky0, int order, int num_points, const assembly::ComplexVector< 2 > &e)
Functional< Dim > point_value_functional(const Point< Dim > &x, const assembly::ComplexVector< Dim > &weight)
Point value (w not conjugated).
template Functional< 2 > point_value_functional< 2 >(const Point< 2 > &, const assembly::ComplexVector< 2 > &)
GoalEstimate dwr_estimate(const Scattering< Dim > &problem, const ScatteringSolution< Dim > &solution, const Functional< Dim > &functional, const adaptivity::EstimatorOptions &options={})
double Real
Definition types.hpp:15
Eigen::Matrix< Real, Dim, 1 > Point
Definition types.hpp:27
Eigen::Matrix< Complex, Eigen::Dynamic, 1 > Vector
Definition types.hpp:20
std::complex< double > Complex
Definition types.hpp:16
Definition residual_estimator.hpp:37
Result of the DWR estimate.
Definition goal_oriented.hpp:31
Complex error
Σ_K r_K(w): estimated Q(E) − Q(E_h)
Definition goal_oriented.hpp:32
std::vector< Real > indicators
|r_K(w)| per cell
Definition goal_oriented.hpp:34
Complex value
Definition goal_oriented.hpp:35
Real total() const
Σ_K |r_K|, an upper bound of the estimated goal error.
std::vector< Complex > contributions
r_K(w) per cell
Definition goal_oriented.hpp:33
Coefficients of the unknown field on the DoF map.
Definition scattering.hpp:86