SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::equations::EquationScale< EquationT > Class Template Referencefinal

Scale an equation by a constant coefficient. More...

#include <arithmetic.hpp>

Collaboration diagram for serif::equations::EquationScale< EquationT >:
[legend]

Public Types

using Test = typename EquationT::Test
 The test type of the scaled equation is the same as the test type of the original equation.
 

Public Member Functions

 EquationScale (EquationT equation, const double coefficient)
 Construct a scaled equation.
 
auto contributions () const noexcept
 Return the contributions of the scaled equation.
 
double coefficient () const noexcept
 Return the coefficient of the scaled equation.
 

Static Public Attributes

static constexpr std::string_view name = "scaled equation"
 Compile time name for the scaled equation, used for debugging and logging.
 

Private Attributes

EquationT m_equation
 The equation being scaled.
 
double m_coefficient
 The coefficient to scale the equation by. Must be finite.
 

Detailed Description

template<Equation EquationT>
class serif::equations::EquationScale< EquationT >

Scale an equation by a constant coefficient.

This class is a compile-time tag that indicates that the weak contributions from a given equation should be scaled by the given coefficient. The actual scaling is performed by the backend. A simple example would be if the scale is set to 1 then the weak contributions would be integrated unchanged; whereas if the scale were set to -1 then the weak contributions would be integrated and then negated.

Template Parameters
EquationTThe equation type to scale.

Member Typedef Documentation

◆ Test

template<Equation EquationT>
using serif::equations::EquationScale< EquationT >::Test = typename EquationT::Test

The test type of the scaled equation is the same as the test type of the original equation.

Constructor & Destructor Documentation

◆ EquationScale()

template<Equation EquationT>
serif::equations::EquationScale< EquationT >::EquationScale ( EquationT equation,
const double coefficient )
inlineexplicit

Construct a scaled equation.

Parameters
equationThe equation to scale.
coefficientThe coefficient to scale the equation by. Must be finite.
Equation Contributions
  • Residuals to all rows which are shared by the summed equations
Exceptions
std::invalid_argumentIf the coefficient is not finite.

Member Function Documentation

◆ coefficient()

template<Equation EquationT>
double serif::equations::EquationScale< EquationT >::coefficient ( ) const
inlinenodiscardnoexcept

Return the coefficient of the scaled equation.

Returns
The coefficient of the scaled equation.

◆ contributions()

template<Equation EquationT>
auto serif::equations::EquationScale< EquationT >::contributions ( ) const
inlinenodiscardnoexcept

Return the contributions of the scaled equation.

Returns
A tuple containing the contributions of the scaled equation.

Member Data Documentation

◆ m_coefficient

template<Equation EquationT>
double serif::equations::EquationScale< EquationT >::m_coefficient
private

The coefficient to scale the equation by. Must be finite.

◆ m_equation

template<Equation EquationT>
EquationT serif::equations::EquationScale< EquationT >::m_equation
private

The equation being scaled.

◆ name

template<Equation EquationT>
std::string_view serif::equations::EquationScale< EquationT >::name = "scaled equation"
staticconstexpr

Compile time name for the scaled equation, used for debugging and logging.


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