hp-FEM
Adaptive hp-FEM suite for nano-optics
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
hpfem::physics::RieszProjectionBase Class Reference

#include <riesz_projection.hpp>

Inheritance diagram for hpfem::physics::RieszProjectionBase:
Inheritance graph
[legend]

Public Member Functions

 RieszProjectionBase (std::unique_ptr< RieszPencil > pencil, RieszSetup setup)
 
virtual ~RieszProjectionBase ()
 
 RieszProjectionBase (const RieszProjectionBase &)=delete
 
RieszProjectionBase & operator= (const RieszProjectionBase &)=delete
 
Index add_load (Vector load, std::function< Complex(Complex)> scale={})
 
Index add_load (std::function< Vector(Complex)> load)
 A load given as a function of ω (full size), e.g. an incident field.
 
Index add_current (Vector current_load)
 
Index add_functional (Vector q)
 A functional \( Q(x) = q^\top x \) (full size). Returns the functional index.
 
Index add_emitted_power (Index source, Real factor=1.0)
 
void run ()
 
const std::vector< RieszContour > & contours () const noexcept
 
Index background () const noexcept
 Index of the background contour (the last one) after run.
 
Index num_sources () const noexcept
 
Index num_functionals () const noexcept
 
const RieszPencil & pencil () const noexcept
 
const RieszSetup & setup () const noexcept
 
Complex contribution (Index contour, Index source, Index functional, Complex omega) const
 
Complex total (Index source, Index functional, Complex omega) const
 Sum of all contributions: the expansion of \( Q_f(x_s(\omega)) \).
 
Matrix spectrum (Index source, Index functional, std::span< const Complex > omegas) const
 
Matrix direct (Complex omega) const
 
Vector field (Index contour, Index source, Complex omega) const
 
Vector expand (Index source, Complex omega) const
 
Vector direct_field (Index source, Complex omega) const
 Direct solution at ω (full size).
 

Detailed Description

Riesz projection of the solutions of a pencil for several sources and functionals: the engine behind RieszProjection<Dim> and AxisymmetricRieszProjection.

Constructor & Destructor Documentation

◆ RieszProjectionBase() [1/2]

hpfem::physics::RieszProjectionBase::RieszProjectionBase ( std::unique_ptr< RieszPencil >  pencil,
RieszSetup  setup 
)
Exceptions
InvalidArgumentfor an empty range, non-positive point counts or radii.

◆ ~RieszProjectionBase()

virtual hpfem::physics::RieszProjectionBase::~RieszProjectionBase ( )
virtual

◆ RieszProjectionBase() [2/2]

hpfem::physics::RieszProjectionBase::RieszProjectionBase ( const RieszProjectionBase &  )
delete

Member Function Documentation

◆ add_current()

Index hpfem::physics::RieszProjectionBase::add_current ( Vector  current_load)

A current source: load \( i\omega\mu_0 b_J \) with \( b_J \) from current_load (or axisymmetric_current_load).

◆ add_emitted_power()

Index hpfem::physics::RieszProjectionBase::add_emitted_power ( Index  source,
Real  factor = 1.0 
)

The power a current source emits, \( Q(x) = -\tfrac{1}{2}\,\mathrm{factor}\, \overline{b_J}^\top x = -\tfrac12\,\mathrm{factor}\int E\cdot J^* \); the physical power is its real part, and the real parts of the modal contributions add up to it exactly.

Exceptions
InvalidArgumentif source was not added with add_current.

◆ add_functional()

Index hpfem::physics::RieszProjectionBase::add_functional ( Vector  q)

A functional \( Q(x) = q^\top x \) (full size). Returns the functional index.

◆ add_load() [1/2]

Index hpfem::physics::RieszProjectionBase::add_load ( std::function< Vector(Complex)>  load)

A load given as a function of ω (full size), e.g. an incident field.

◆ add_load() [2/2]

Index hpfem::physics::RieszProjectionBase::add_load ( Vector  load,
std::function< Complex(Complex)>  scale = {} 
)

A load \( b(\omega) = s(\omega)\, b \) (full size; scale empty means 1). Returns the source index.

Exceptions
InvalidArgumentfor a wrong size or after run.

◆ background()

Index hpfem::physics::RieszProjectionBase::background ( ) const
inlinenoexcept

Index of the background contour (the last one) after run.

◆ contours()

const std::vector< RieszContour > & hpfem::physics::RieszProjectionBase::contours ( ) const
inlinenoexcept

◆ contribution()

Complex hpfem::physics::RieszProjectionBase::contribution ( Index  contour,
Index  source,
Index  functional,
Complex  omega 
) const

Contribution of a contour to \( Q_f(x_s(\omega)) \): the pole term \( Q_f(R_n)/(\omega - \omega_n) \), the group integral (direct solve minus integral for ω inside the group circle) or the background integral.

Exceptions
InvalidArgumentfor ω outside the background contour, or before run.

◆ direct()

Matrix hpfem::physics::RieszProjectionBase::direct ( Complex  omega) const

Direct solve at ω (one factorisation): \( Q_f(x_s(\omega)) \) for all sources and functionals (sources × functionals), the reference of the expansion.

◆ direct_field()

Vector hpfem::physics::RieszProjectionBase::direct_field ( Index  source,
Complex  omega 
) const

Direct solution at ω (full size).

◆ expand()

Vector hpfem::physics::RieszProjectionBase::expand ( Index  source,
Complex  omega 
) const

The expanded field, the sum of all contour fields (full size; needs store_residues and store_fields).

◆ field()

Vector hpfem::physics::RieszProjectionBase::field ( Index  contour,
Index  source,
Complex  omega 
) const

Field contribution of a contour (full size): the residue term of a pole (needs store_residues), the integral of a group or the background (needs store_fields).

Exceptions
InvalidArgumentif the vectors were not stored.

◆ num_functionals()

Index hpfem::physics::RieszProjectionBase::num_functionals ( ) const
inlinenoexcept

◆ num_sources()

Index hpfem::physics::RieszProjectionBase::num_sources ( ) const
inlinenoexcept

◆ operator=()

RieszProjectionBase & hpfem::physics::RieszProjectionBase::operator= ( const RieszProjectionBase &  )
delete

◆ pencil()

const RieszPencil & hpfem::physics::RieszProjectionBase::pencil ( ) const
inlinenoexcept

◆ run()

void hpfem::physics::RieszProjectionBase::run ( )

Chooses the contours, performs the contour solves and logs the convergence check of every contour (warning above RieszSetup::convergence_warning).

Exceptions
Errorif a factorisation fails, InvalidArgument without sources or functionals.

◆ setup()

const RieszSetup & hpfem::physics::RieszProjectionBase::setup ( ) const
inlinenoexcept

◆ spectrum()

Matrix hpfem::physics::RieszProjectionBase::spectrum ( Index  source,
Index  functional,
std::span< const Complex >  omegas 
) const

The contributions of every contour (rows, the background last) at the given frequencies (columns): the modal spectrum of the functional for the source.

◆ total()

Complex hpfem::physics::RieszProjectionBase::total ( Index  source,
Index  functional,
Complex  omega 
) const

Sum of all contributions: the expansion of \( Q_f(x_s(\omega)) \).


The documentation for this class was generated from the following file: