SpECTRE  2021.08.02
MathFunctions::Gaussian< VolumeDim, Fr > Class Template Reference

Gaussian \(f = A \exp\left(-\frac{(x-x_0)^2}{w^2}\right)\). More...

#include <Gaussian.hpp>

Classes

struct  Amplitude
 
struct  Center
 
struct  Width
 

Public Types

using options = tmpl::list< Amplitude, Width, Center >
 
- Public Types inherited from MathFunction< VolumeDim, Fr >
using frame = Fr
 

Public Member Functions

 WRAPPED_PUPable_decl_base_template (SINGLE_ARG(MathFunction< VolumeDim, Fr >), Gaussian)
 
 Gaussian (CkMigrateMessage *) noexcept
 
 Gaussian (double amplitude, double width, const std::array< double, VolumeDim > &center) noexcept
 
 Gaussian (const Gaussian &)=delete
 
Gaussianoperator= (const Gaussian &)=delete
 
 Gaussian (Gaussian &&) noexcept=default
 
Gaussianoperator= (Gaussian &&) noexcept=default
 
Scalar< double > operator() (const tnsr::I< double, VolumeDim, Fr > &x) const noexcept override
 Returns the value of the function at the coordinate 'x'. More...
 
Scalar< DataVectoroperator() (const tnsr::I< DataVector, VolumeDim, Fr > &x) const noexcept override
 Returns the value of the function at the coordinate 'x'. More...
 
tnsr::i< double, VolumeDim, Fr > first_deriv (const tnsr::I< double, VolumeDim, Fr > &x) const noexcept override
 Returns the first partial derivatives of the function at 'x'. More...
 
tnsr::i< DataVector, VolumeDim, Fr > first_deriv (const tnsr::I< DataVector, VolumeDim, Fr > &x) const noexcept override
 Returns the first partial derivatives of the function at 'x'. More...
 
tnsr::ii< double, VolumeDim, Fr > second_deriv (const tnsr::I< double, VolumeDim, Fr > &x) const noexcept override
 Returns the second partial derivatives of the function at 'x'. More...
 
tnsr::ii< DataVector, VolumeDim, Fr > second_deriv (const tnsr::I< DataVector, VolumeDim, Fr > &x) const noexcept override
 Returns the second partial derivatives of the function at 'x'. More...
 
tnsr::iii< double, VolumeDim, Fr > third_deriv (const tnsr::I< double, VolumeDim, Fr > &x) const noexcept override
 Returns the third partial derivatives of the function at 'x'. More...
 
tnsr::iii< DataVector, VolumeDim, Fr > third_deriv (const tnsr::I< DataVector, VolumeDim, Fr > &x) const noexcept override
 Returns the third partial derivatives of the function at 'x'. More...
 
void pup (PUP::er &p) override
 
- Public Member Functions inherited from MathFunction< VolumeDim, Fr >
 WRAPPED_PUPable_abstract (MathFunction)
 
 MathFunction (const MathFunction &)=delete
 
MathFunctionoperator= (const MathFunction &)=delete
 
 MathFunction (MathFunction &&) noexcept=default
 
MathFunctionoperator= (MathFunction &&) noexcept=default
 

Static Public Attributes

static constexpr Options::String help
 
- Static Public Attributes inherited from MathFunction< VolumeDim, Fr >
constexpr static size_t volume_dim = VolumeDim
 

Friends

bool operator== (const Gaussian &lhs, const Gaussian &rhs) noexcept
 

Detailed Description

template<size_t VolumeDim, typename Fr>
class MathFunctions::Gaussian< VolumeDim, Fr >

Gaussian \(f = A \exp\left(-\frac{(x-x_0)^2}{w^2}\right)\).

Details

Input file options are: Amplitude, Width, and Center. The function takes input coordinates of type tnsr::I<T, VolumeDim, Fr>, where T is e.g. double or DataVector, Fr is a frame (e.g. Frame::Inertial), and VolumeDim is the dimension of the spatial volume, i.e. 2 or 3. (The case of VolumeDim == 1 is handled specially by Gaussian<1, T, Frame::Inertial>.)

Member Function Documentation

◆ first_deriv() [1/2]

template<size_t VolumeDim, typename Fr >
tnsr::i< DataVector, VolumeDim, Fr > MathFunctions::Gaussian< VolumeDim, Fr >::first_deriv ( const tnsr::I< DataVector, VolumeDim, Fr > &  x) const
overridevirtualnoexcept

Returns the first partial derivatives of the function at 'x'.

Implements MathFunction< VolumeDim, Fr >.

◆ first_deriv() [2/2]

template<size_t VolumeDim, typename Fr >
tnsr::i< double, VolumeDim, Fr > MathFunctions::Gaussian< VolumeDim, Fr >::first_deriv ( const tnsr::I< double, VolumeDim, Fr > &  x) const
overridevirtualnoexcept

Returns the first partial derivatives of the function at 'x'.

Implements MathFunction< VolumeDim, Fr >.

◆ operator()() [1/2]

template<size_t VolumeDim, typename Fr >
Scalar< DataVector > MathFunctions::Gaussian< VolumeDim, Fr >::operator() ( const tnsr::I< DataVector, VolumeDim, Fr > &  x) const
overridevirtualnoexcept

Returns the value of the function at the coordinate 'x'.

Implements MathFunction< VolumeDim, Fr >.

◆ operator()() [2/2]

template<size_t VolumeDim, typename Fr >
Scalar< double > MathFunctions::Gaussian< VolumeDim, Fr >::operator() ( const tnsr::I< double, VolumeDim, Fr > &  x) const
overridevirtualnoexcept

Returns the value of the function at the coordinate 'x'.

Implements MathFunction< VolumeDim, Fr >.

◆ second_deriv() [1/2]

template<size_t VolumeDim, typename Fr >
tnsr::ii< DataVector, VolumeDim, Fr > MathFunctions::Gaussian< VolumeDim, Fr >::second_deriv ( const tnsr::I< DataVector, VolumeDim, Fr > &  x) const
overridevirtualnoexcept

Returns the second partial derivatives of the function at 'x'.

Implements MathFunction< VolumeDim, Fr >.

◆ second_deriv() [2/2]

template<size_t VolumeDim, typename Fr >
tnsr::ii< double, VolumeDim, Fr > MathFunctions::Gaussian< VolumeDim, Fr >::second_deriv ( const tnsr::I< double, VolumeDim, Fr > &  x) const
overridevirtualnoexcept

Returns the second partial derivatives of the function at 'x'.

Implements MathFunction< VolumeDim, Fr >.

◆ third_deriv() [1/2]

template<size_t VolumeDim, typename Fr >
tnsr::iii< DataVector, VolumeDim, Fr > MathFunctions::Gaussian< VolumeDim, Fr >::third_deriv ( const tnsr::I< DataVector, VolumeDim, Fr > &  x) const
overridevirtualnoexcept

Returns the third partial derivatives of the function at 'x'.

Implements MathFunction< VolumeDim, Fr >.

◆ third_deriv() [2/2]

template<size_t VolumeDim, typename Fr >
tnsr::iii< double, VolumeDim, Fr > MathFunctions::Gaussian< VolumeDim, Fr >::third_deriv ( const tnsr::I< double, VolumeDim, Fr > &  x) const
overridevirtualnoexcept

Returns the third partial derivatives of the function at 'x'.

Implements MathFunction< VolumeDim, Fr >.

Member Data Documentation

◆ help

template<size_t VolumeDim, typename Fr >
constexpr Options::String MathFunctions::Gaussian< VolumeDim, Fr >::help
staticconstexpr
Initial value:
= {
"Computes a Gaussian about an arbitrary coordinate center with given "
"width and amplitude"}