SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::equations::Contribution< TestOperandT, SupportT > Struct Template Reference

A helper struct for authoring equations with fewer lines of boiler-plate. The idea here is that every equation must report certain members so that the backend can inspect at compile time. An author could certainly write these members themselves, but the Contribution struct auto generates those members based on its template parameters. Therefore, by inheriting from the Contribution struct an equation author can avoid writing those members themselves. Note that while this is inheritance it is still a compile-time relation. Contribution does not add any runtime overhead to the equation. More...

#include <contributions.hpp>

Inheritance diagram for serif::equations::Contribution< TestOperandT, SupportT >:
[legend]

Public Types

using Test = TestOperandT::term_type
 The test type of the contribution.
 
using TestOperand = TestOperandT
 The operand type of the contribution (associating a test function and a term)
 
using Support = SupportT
 The domain support of the contribution (which then boils down to the dofs which are supported by the term on that test function)
 

Detailed Description

template<discretization::forms::IsOperand TestOperandT, typename SupportT = discretization::blocks::SupportOf<typename TestOperandT::term_type>>
struct serif::equations::Contribution< TestOperandT, SupportT >

A helper struct for authoring equations with fewer lines of boiler-plate. The idea here is that every equation must report certain members so that the backend can inspect at compile time. An author could certainly write these members themselves, but the Contribution struct auto generates those members based on its template parameters. Therefore, by inheriting from the Contribution struct an equation author can avoid writing those members themselves. Note that while this is inheritance it is still a compile-time relation. Contribution does not add any runtime overhead to the equation.

Template Parameters
TestOperandTThe test operation type, which must be a valid operand (IsOperand).
SupportTThe support type, which must be a valid support (IsSupport). This defaults to the support of the test term.
Note
The support type is, by default, read from the test term. There are very few situations where you should need to override this default.
Read this as "residuals are contributed to the row(s) defined by the test operation. e.g Some density constraint function might contribute to the residuals of the overall system through some density row.

Member Typedef Documentation

◆ Support

template<discretization::forms::IsOperand TestOperandT, typename SupportT = discretization::blocks::SupportOf<typename TestOperandT::term_type>>
using serif::equations::Contribution< TestOperandT, SupportT >::Support = SupportT

The domain support of the contribution (which then boils down to the dofs which are supported by the term on that test function)

◆ Test

template<discretization::forms::IsOperand TestOperandT, typename SupportT = discretization::blocks::SupportOf<typename TestOperandT::term_type>>
using serif::equations::Contribution< TestOperandT, SupportT >::Test = TestOperandT::term_type

The test type of the contribution.

The terminology Test here comes from finite element analysis. Specifically, the test type is the type of the test function used in the weak formulation of the equation. More concretely, the test type is the type for which the residuals are computed. Therefore think of this as the type of the residual row that this contribution contributes to. There are a lot of repetitions of the word type here, which I can recognize is a bit confusing. Effectively, the way that we have structured much of this code is that we embed particular functions into the type system. Therefore when I say "the type of the test function" what I mean is the c++ type that we have defined to represent the test function.

Note
The above comment would probably make any actual writer shake in their boots. I'm sure there is a better way to phrase that; however, I am at a loss for the moment. The TL;DR here is that since we encode so much information into the type system we use the word type a lot. If this makes you rationally upset please email me...

◆ TestOperand

template<discretization::forms::IsOperand TestOperandT, typename SupportT = discretization::blocks::SupportOf<typename TestOperandT::term_type>>
using serif::equations::Contribution< TestOperandT, SupportT >::TestOperand = TestOperandT

The operand type of the contribution (associating a test function and a term)


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