SpECTRE  v2024.03.19
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 *)
 
 Gaussian (double amplitude, double width, const std::array< double, VolumeDim > &center)
 
std::unique_ptr< MathFunction< VolumeDim, Fr > > get_clone () const override
 
Scalar< double > operator() (const tnsr::I< double, VolumeDim, Fr > &x) const override
 Returns the value of the function at the coordinate 'x'. More...
 
Scalar< DataVectoroperator() (const tnsr::I< DataVector, VolumeDim, Fr > &x) const 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 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 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 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 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 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 override
 Returns the third partial derivatives of the function at 'x'. More...
 
bool operator== (const MathFunction< VolumeDim, Fr > &other) const override
 
bool operator!= (const MathFunction< VolumeDim, Fr > &other) const override
 
bool operator== (const Gaussian< VolumeDim, Fr > &other) const
 
bool operator!= (const Gaussian< VolumeDim, Fr > &other) const
 
void pup (PUP::er &p) override
 
- Public Member Functions inherited from MathFunction< VolumeDim, Fr >
 WRAPPED_PUPable_abstract (MathFunction)
 
virtual std::unique_ptr< MathFunctionget_clone () const =0
 
virtual bool operator== (const MathFunction< VolumeDim, Fr > &other) const =0
 
virtual bool operator!= (const MathFunction< VolumeDim, Fr > &other) const =0
 

Static Public Attributes

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

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
overridevirtual

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
overridevirtual

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

Implements MathFunction< VolumeDim, Fr >.

◆ get_clone()

template<size_t VolumeDim, typename Fr >
std::unique_ptr< MathFunction< VolumeDim, Fr > > MathFunctions::Gaussian< VolumeDim, Fr >::get_clone ( ) const
overridevirtual

◆ operator!=()

template<size_t VolumeDim, typename Fr >
bool MathFunctions::Gaussian< VolumeDim, Fr >::operator!= ( const MathFunction< VolumeDim, Fr > &  other) const
overridevirtual

◆ operator()() [1/2]

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

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
overridevirtual

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

Implements MathFunction< VolumeDim, Fr >.

◆ operator==()

template<size_t VolumeDim, typename Fr >
bool MathFunctions::Gaussian< VolumeDim, Fr >::operator== ( const MathFunction< VolumeDim, Fr > &  other) const
overridevirtual

◆ 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
overridevirtual

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
overridevirtual

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
overridevirtual

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
overridevirtual

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"}

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