MADNESS  0.10.1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
madness::SpectralPropagator Class Reference

Spectral propagtor in time. Refer to documentation of file spectralprop.h for math detail. More...

#include <spectralprop.h>

Collaboration diagram for madness::SpectralPropagator:
Collaboration graph
[legend]

Public Member Functions

 SpectralPropagator (int NPT)
 Construct propagator using NPT points. More...
 
 ~SpectralPropagator ()
 
template<typename uT , typename expLT , typename NT >
uT step (double t, double Delta, const uT &u0, const expLT &expL, const NT &N, const double eps=1e-12, bool doprint=false, bool recurinit=true)
 Step forward in time from $ t $ to $ t+\Delta $. More...
 

Private Member Functions

double p (int i, double t)
 Private: Makes interpolating polyn p[i](t), i=0..NPT. More...
 
template<typename uT , typename expLT , typename NT >
std::vector< uT > solve (double t, double Delta, const uT &u0, const expLT &expL, const NT &N, const double eps, bool doprint, bool recurinit, int &napp)
 
template<typename uT >
uT u (double dt, const std::vector< uT > &v)
 Private: Computes interpolated solution. More...
 

Private Attributes

const int NPT
 Number of quadrature points. More...
 
SpectralPropagatorq
 
std::vector< double > w
 Quadrature weights on [0,1] with value 0 prepended. More...
 
std::vector< double > x
 Quadrature points on [0,1] with value 0 prepended. More...
 

Detailed Description

Spectral propagtor in time. Refer to documentation of file spectralprop.h for math detail.

Constructor & Destructor Documentation

◆ SpectralPropagator()

madness::SpectralPropagator::SpectralPropagator ( int  NPT)
inline

Construct propagator using NPT points.

References madness::gauss_legendre(), MADNESS_ASSERT, NPT, q, w, and x.

◆ ~SpectralPropagator()

madness::SpectralPropagator::~SpectralPropagator ( )
inline

References q.

Member Function Documentation

◆ p()

double madness::SpectralPropagator::p ( int  i,
double  t 
)
inlineprivate

Private: Makes interpolating polyn p[i](t), i=0..NPT.

References NPT, and x.

Referenced by u().

◆ solve()

template<typename uT , typename expLT , typename NT >
std::vector<uT> madness::SpectralPropagator::solve ( double  t,
double  Delta,
const uT &  u0,
const expLT &  expL,
const NT &  N,
const double  eps,
bool  doprint,
bool  recurinit,
int &  napp 
)
inlineprivate

References distance(), expL(), k, N, NPT, madness::print(), q, solve(), u(), v, w, and x.

Referenced by solve(), and step().

◆ step()

template<typename uT , typename expLT , typename NT >
uT madness::SpectralPropagator::step ( double  t,
double  Delta,
const uT &  u0,
const expLT &  expL,
const NT &  N,
const double  eps = 1e-12,
bool  doprint = false,
bool  recurinit = true 
)
inline

Step forward in time from $ t $ to $ t+\Delta $.

The template types should be automatically inferred from the invocation. uT is the C++ type for the solution.

Parameters
[in]tThe current time
[in]DeltaThe time step
[in]u0The solution at the current time
[in]expLA function or functor to compute $ \exp{\tau \hat{L}} u $ for $ \tau \in (0,\Delta) $
[in]NA function to compute the non-linear part
[in]epsThreshold for convergence of iteration on norm of change in solution at last quadrature point.
[in]doprintIf true will print some info on convergence
[in]recurinitIf true initial guess is recursion from lower order quadrature instead of default explicit rule
Returns
The solution at time $ t+\Delta $

The user provided operators are invoked as

uT expL(double tau, const uT& u)
uT u(double dt, const std::vector< uT > &v)
Private: Computes interpolated solution.
Definition: spectralprop.h:131
Fred expL(double dt, const Fred &f)
Definition: testspectralprop.cc:98

where $ \tau \in (0,\Delta) $ and

uT N(double T, const uT& u)
auto T(World &world, response_space &f) -> response_space
Definition: global_functions.cc:34
#define N
Definition: testconv.cc:37

where $ T \in (t,t+\Delta) $ and $ u $ is a trial solution at time $ T $.

References expL(), k, N, NPT, madness::print(), solve(), u(), v, w, and x.

◆ u()

template<typename uT >
uT madness::SpectralPropagator::u ( double  dt,
const std::vector< uT > &  v 
)
inlineprivate

Private: Computes interpolated solution.

References NPT, p(), and v.

Referenced by solve(), and step().

Member Data Documentation

◆ NPT

const int madness::SpectralPropagator::NPT
private

Number of quadrature points.

Referenced by SpectralPropagator(), p(), solve(), step(), and u().

◆ q

SpectralPropagator* madness::SpectralPropagator::q
private

◆ w

std::vector<double> madness::SpectralPropagator::w
private

Quadrature weights on [0,1] with value 0 prepended.

Referenced by SpectralPropagator(), solve(), and step().

◆ x

std::vector<double> madness::SpectralPropagator::x
private

Quadrature points on [0,1] with value 0 prepended.

Referenced by SpectralPropagator(), p(), solve(), and step().


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