SpECTRE  v2024.04.12
MathFunctions::Gaussian< 1, Fr > Class Template Reference

1D 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< 1, Fr >
using frame = Fr
 

Public Member Functions

 WRAPPED_PUPable_decl_base_template (SINGLE_ARG(MathFunction< 1, Fr >), Gaussian)
 
 Gaussian (CkMigrateMessage *)
 
 Gaussian (double amplitude, double width, double center)
 
 Gaussian (double amplitude, double width, const std::array< double, 1 > &center)
 
std::unique_ptr< MathFunction< 1, Fr > > get_clone () const override
 
double operator() (const double &x) const override
 Returns the function value at the coordinate 'x'. More...
 
DataVector operator() (const DataVector &x) const override
 
double first_deriv (const double &x) const override
 Returns the first derivative at 'x'. More...
 
DataVector first_deriv (const DataVector &x) const override
 
double second_deriv (const double &x) const override
 Returns the second derivative at 'x'. More...
 
DataVector second_deriv (const DataVector &x) const override
 
double third_deriv (const double &x) const override
 Returns the third derivative at 'x'. More...
 
DataVector third_deriv (const DataVector &x) const override
 
bool operator== (const MathFunction< 1, Fr > &other) const override
 
bool operator!= (const MathFunction< 1, Fr > &other) const override
 
bool operator== (const Gaussian< 1, Fr > &other) const
 
bool operator!= (const Gaussian< 1, Fr > &other) const
 
void pup (PUP::er &p) override
 
- Public Member Functions inherited from MathFunction< 1, Fr >
 WRAPPED_PUPable_abstract (MathFunction)
 
virtual std::unique_ptr< MathFunctionget_clone () const =0
 
virtual double operator() (const double &x) const =0
 Returns the function value at the coordinate 'x'. More...
 
virtual DataVector operator() (const DataVector &x) const =0
 
Scalar< double > operator() (const tnsr::I< double, 1, Fr > &x) const
 
Scalar< DataVectoroperator() (const tnsr::I< DataVector, 1, Fr > &x) const
 
virtual double first_deriv (const double &x) const =0
 Returns the first derivative at 'x'. More...
 
virtual DataVector first_deriv (const DataVector &x) const =0
 
tnsr::i< double, 1, Fr > first_deriv (const tnsr::I< double, 1, Fr > &x) const
 
tnsr::i< DataVector, 1, Fr > first_deriv (const tnsr::I< DataVector, 1, Fr > &x) const
 
virtual double second_deriv (const double &x) const =0
 Returns the second derivative at 'x'. More...
 
virtual DataVector second_deriv (const DataVector &x) const =0
 
tnsr::ii< double, 1, Fr > second_deriv (const tnsr::I< double, 1, Fr > &x) const
 
tnsr::ii< DataVector, 1, Fr > second_deriv (const tnsr::I< DataVector, 1, Fr > &x) const
 
virtual double third_deriv (const double &x) const =0
 Returns the third derivative at 'x'. More...
 
virtual DataVector third_deriv (const DataVector &x) const =0
 
tnsr::iii< double, 1, Fr > third_deriv (const tnsr::I< double, 1, Fr > &x) const
 
tnsr::iii< DataVector, 1, Fr > third_deriv (const tnsr::I< DataVector, 1, Fr > &x) const
 
virtual bool operator== (const MathFunction< 1, Fr > &other) const =0
 
virtual bool operator!= (const MathFunction< 1, Fr > &other) const =0
 

Static Public Attributes

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

Detailed Description

template<typename Fr>
class MathFunctions::Gaussian< 1, Fr >

1D 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 of type double or DataVector and returns the same type as the input type.

Member Function Documentation

◆ first_deriv() [1/2]

template<typename Fr >
DataVector MathFunctions::Gaussian< 1, Fr >::first_deriv ( const DataVector x) const
overridevirtual

Implements MathFunction< 1, Fr >.

◆ first_deriv() [2/2]

template<typename Fr >
double MathFunctions::Gaussian< 1, Fr >::first_deriv ( const double &  x) const
overridevirtual

Returns the first derivative at 'x'.

Implements MathFunction< 1, Fr >.

◆ get_clone()

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

Implements MathFunction< 1, Fr >.

◆ operator!=()

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

Implements MathFunction< 1, Fr >.

◆ operator()() [1/2]

template<typename Fr >
DataVector MathFunctions::Gaussian< 1, Fr >::operator() ( const DataVector x) const
overridevirtual

Implements MathFunction< 1, Fr >.

◆ operator()() [2/2]

template<typename Fr >
double MathFunctions::Gaussian< 1, Fr >::operator() ( const double &  x) const
overridevirtual

Returns the function value at the coordinate 'x'.

Implements MathFunction< 1, Fr >.

◆ operator==()

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

Implements MathFunction< 1, Fr >.

◆ second_deriv() [1/2]

template<typename Fr >
DataVector MathFunctions::Gaussian< 1, Fr >::second_deriv ( const DataVector x) const
overridevirtual

Implements MathFunction< 1, Fr >.

◆ second_deriv() [2/2]

template<typename Fr >
double MathFunctions::Gaussian< 1, Fr >::second_deriv ( const double &  x) const
overridevirtual

Returns the second derivative at 'x'.

Implements MathFunction< 1, Fr >.

◆ third_deriv() [1/2]

template<typename Fr >
DataVector MathFunctions::Gaussian< 1, Fr >::third_deriv ( const DataVector x) const
overridevirtual

Implements MathFunction< 1, Fr >.

◆ third_deriv() [2/2]

template<typename Fr >
double MathFunctions::Gaussian< 1, Fr >::third_deriv ( const double &  x) const
overridevirtual

Returns the third derivative at 'x'.

Implements MathFunction< 1, Fr >.

Member Data Documentation

◆ help

template<typename Fr >
constexpr Options::String MathFunctions::Gaussian< 1, 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: