SpECTRE  v2026.04.01
Loading...
Searching...
No Matches
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< VolumeDim, Fr >
using frame = Fr
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'.
DataVector operator() (const DataVector &x) const override
double first_deriv (const double &x) const override
 Returns the first derivative at 'x'.
DataVector first_deriv (const DataVector &x) const override
double second_deriv (const double &x) const override
 Returns the second derivative at 'x'.
DataVector second_deriv (const DataVector &x) const override
double third_deriv (const double &x) const override
 Returns the third derivative at 'x'.
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< VolumeDim, Fr >
 WRAPPED_PUPable_abstract (MathFunction)
virtual bool operator== (const MathFunction< VolumeDim, Fr > &other) const =0
virtual bool operator!= (const MathFunction< VolumeDim, Fr > &other) const =0
virtual Scalar< double > operator() (const tnsr::I< double, VolumeDim, Fr > &x) const =0
 Returns the value of the function at the coordinate 'x'.
virtual Scalar< DataVectoroperator() (const tnsr::I< DataVector, VolumeDim, Fr > &x) const =0
 Returns the value of the function at the coordinate 'x'.
virtual tnsr::i< double, VolumeDim, Fr > first_deriv (const tnsr::I< double, VolumeDim, Fr > &x) const =0
 Returns the first partial derivatives of the function at 'x'.
virtual tnsr::i< DataVector, VolumeDim, Fr > first_deriv (const tnsr::I< DataVector, VolumeDim, Fr > &x) const =0
 Returns the first partial derivatives of the function at 'x'.
virtual tnsr::ii< double, VolumeDim, Fr > second_deriv (const tnsr::I< double, VolumeDim, Fr > &x) const =0
 Returns the second partial derivatives of the function at 'x'.
virtual tnsr::ii< DataVector, VolumeDim, Fr > second_deriv (const tnsr::I< DataVector, VolumeDim, Fr > &x) const =0
 Returns the second partial derivatives of the function at 'x'.
virtual tnsr::iii< double, VolumeDim, Fr > third_deriv (const tnsr::I< double, VolumeDim, Fr > &x) const =0
 Returns the third partial derivatives of the function at 'x'.
virtual tnsr::iii< DataVector, VolumeDim, Fr > third_deriv (const tnsr::I< DataVector, VolumeDim, Fr > &x) const =0
 Returns the third partial derivatives of the function at 'x'.
Public Member Functions inherited from MathFunction< 1, Fr >
 WRAPPED_PUPable_abstract (MathFunction)
Scalar< double > operator() (const tnsr::I< double, 1, Fr > &x) const
Scalar< DataVectoroperator() (const tnsr::I< DataVector, 1, Fr > &x) const
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
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
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

Static Public Attributes

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

◆ 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>
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:
  • src/PointwiseFunctions/MathFunctions/Gaussian.hpp