DampingFunction.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 #include <memory>
8 
11 
12 /// \cond
13 class DataVector;
14 /// \endcond
15 
16 /// Holds classes implementing DampingFunction (functions \f$R^n \to R\f$).
18 /// \cond
19 template <size_t VolumeDim, typename Fr>
21 /// \endcond
22 
23 /*!
24  * \brief Base class defining interface for constraint damping functions.
25  *
26  * Encodes a function \f$R^n \to R\f$ where n is `VolumeDim` that represents
27  * a generalized-harmonic constraint-damping parameter (i.e., Gamma0,
28  * Gamma1, or Gamma2).
29  */
30 template <size_t VolumeDim, typename Fr>
31 class DampingFunction : public PUP::able {
32  public:
33  using creatable_classes =
35  VolumeDim, Fr>>;
36  constexpr static size_t volume_dim = VolumeDim;
37  using frame = Fr;
38 
39  WRAPPED_PUPable_abstract(DampingFunction); // NOLINT
40 
41  DampingFunction() = default;
42  DampingFunction(const DampingFunction& /*rhs*/) = default;
43  DampingFunction& operator=(const DampingFunction& /*rhs*/) = default;
44  DampingFunction(DampingFunction&& /*rhs*/) noexcept = default;
45  DampingFunction& operator=(DampingFunction&& /*rhs*/) noexcept = default;
46  ~DampingFunction() override = default;
47 
48  //@{
49  /// Returns the value of the function at the coordinate 'x'.
50  virtual Scalar<double> operator()(
51  const tnsr::I<double, VolumeDim, Fr>& x) const noexcept = 0;
53  const tnsr::I<DataVector, VolumeDim, Fr>& x) const noexcept = 0;
54  //@}
55 
56  virtual auto get_clone() const noexcept
58 };
59 } // namespace GeneralizedHarmonic::ConstraintDamping
60 
61 #include "Evolution/Systems/GeneralizedHarmonic/ConstraintDamping/GaussianPlusConstant.hpp"
GeneralizedHarmonic::ConstraintDamping
Holds classes implementing DampingFunction (functions ).
Definition: DampingFunction.hpp:17
CharmPupable.hpp
GeneralizedHarmonic::ConstraintDamping::GaussianPlusConstant
A Gaussian plus a constant: .
Definition: GaussianPlusConstant.hpp:35
cstddef
DataVector
Stores a collection of function values.
Definition: DataVector.hpp:42
memory
Scalar
Tensor< T, Symmetry<>, index_list<> > Scalar
Definition: TypeAliases.hpp:21
TypeAliases.hpp
GeneralizedHarmonic::ConstraintDamping::DampingFunction
Base class defining interface for constraint damping functions.
Definition: DampingFunction.hpp:31
GeneralizedHarmonic::ConstraintDamping::DampingFunction::operator()
virtual Scalar< double > operator()(const tnsr::I< double, VolumeDim, Fr > &x) const noexcept=0
Returns the value of the function at the coordinate 'x'.
std::unique_ptr