SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::discretization::forms Namespace Reference

Classes

struct  boundary_flux
 The boundary_flux form represents the boundary flux operation in the discretization framework. It takes a trial term and a test term as template parameters and defines the operand types for the boundary flux operation. More...
 
struct  divergence
 The divergence form represents the divergence operation in the discretization framework. It takes a trial term and a test term as template parameters and defines the operand types for the divergence operation. More...
 
struct  force
 The force form represents the force term in the discretization framework. It takes a trial term and a test term as template parameters and defines the operand types for the force operation. More...
 
struct  form
 The form struct is a tag type that is used to identify a form in the discretization. It is used to group together forms that belong to the same mathematical operation. Each form should have a unique name and a list of operand types that belong to it. More...
 
struct  FormDescriptor
 Runtime form descriptor including runtime term information. Used to represented the compile-time form type at runtime. More...
 
struct  FormTraits
 Compile-time traits for forms, used to extract types and properties from template parameters. This struct is specialized for each form type to provide specific traits such as trial and test order reductions. More...
 
struct  FormTraits< boundary_flux< TrialT, TestT > >
 Specialization of FormTraits for the boundary_flux form, which has no order reduction for either trial or test terms. More...
 
struct  FormTraits< divergence< TrialT, TestT > >
 Specialization of FormTraits for the divergence form, which has an order reduction of 1, to satisfy the Inf-Sup condition, for the trial term and no order reduction for the test term. More...
 
struct  FormTraits< force< TrialT, TestT > >
 Specialization of FormTraits for the force form, which has no order reduction for either trial or test terms. More...
 
struct  FormTraits< mass< TrialT, TestT > >
 Specialization of FormTraits for the mass form, which has no order reduction for either trial or test terms. More...
 
struct  FormTraits< projection< TrialT, TestT > >
 Specialization of FormTraits for the projection form, which has no order reduction for either trial or test terms. More...
 
struct  FormTraits< source< TrialT, TestT > >
 Specialization of FormTraits for the source form, which has no order reduction for either trial or test terms. More...
 
struct  mass
 The mass form represents the mass matrix operation in the discretization framework. It takes a trial term and a test term as template parameters and defines the operand types for the mass operation. More...
 
struct  Operand
 Compile time representation of some operand. An operand associates a term to an operation type (e.g. the gradient of gravitational potential where gravitational potential is the term and gradient is the operation). More...
 
struct  OperandResult
 General case for compile time metadata associating some operand to the value type of its result. These use the OperationValue struct and the information in the operand to determine the value type of the result of that operand. More...
 
struct  OperandResult< OperandT >
 Specialization of the OperandResult struct for operands that are valid operands (satisfy the IsOperand concept) and are spatial terms (e.g defined over the domain, think mass density). This specialization uses the OperationValue struct to determine the value type of the result of the operand based on its term type and operation type. More...
 
struct  Operation
 The Operation struct defines a set of operations that can be applied to terms in the context of a form. These operations include value, gradient, divergence, curl, and normal trace. Similar to the statement I made at the top of forms.hpp, if you are a developer looking to extend the mathematical capabilities of SERiF this is a place you should be looking early on. More...
 
struct  OperationValue
 General case for compile time metadata associating a tensor rank to an operation. The specialization of this will also specific what the return value of an operation of that rank will be. More...
 
struct  OperationValue< 0, Operation::Gradient >
 The gradient of a rank 0 tensor is a rank 1 tensor (a vector of doubles) More...
 
struct  OperationValue< 0, Operation::Value >
 The value of a rank 0 tensor is a scalar, a double in the case of SERiF where we restrict ourselves to double precision. More...
 
struct  OperationValue< 1, Operation::Curl >
 The curl of a rank 1 tensor is a rank 1 tensor (a vector of doubles) More...
 
struct  OperationValue< 1, Operation::Divergence >
 The divergence of a rank one tensor is a scalar (a double) More...
 
struct  OperationValue< 1, Operation::Gradient >
 Vector gradients use G[component][derivative] = partial_derivative(u_component, x_derivative). More...
 
struct  OperationValue< 1, Operation::NormalTrace >
 
struct  OperationValue< 1, Operation::Value >
 The value of a rank 1 tensor is a rank 1 tensor (a vector of doubles in SERiF) More...
 
struct  projection
 The projection form represents the projection operation in the discretization framework. It takes a trial term and a test term as template parameters and defines the operand types for the projection operation. More...
 
struct  source
 The source form represents the source term in the discretization framework. It takes a trial term and a test term as template parameters and defines the operand types for the source operation. More...
 
struct  ValueComponents
 Helper variable template to determine the number of components in the value type of an operand. This is a convenience variable that allows you to easily access the number of components in the value type of an operand without having to explicitly use the OperandResult struct. More...
 
struct  ValueComponents< double >
 
struct  ValueComponents< std::array< Entry, Size > >
 
struct  ValueComponents< void >
 

Concepts

concept  Form
 Concept for types that are forms in the discretization framework. In order satisfy this concept a type must derive from the form base class and must define a member type called operand_types which is intended to be a type list of the trial and test terms for the form.
 
concept  IsOperation
 
concept  IsOperand
 Concept to validate a valid operand. An operand is valid if the following conditions are satisfied.
 

Typedefs

using VectorValue = std::array<double, 3>
 Alias for a rank 1 tensor of dimension 3 with elements doubles.
 
using MatrixValue = std::array<VectorValue, 3>
 Alias for a rank 2 tensor of dimension 3 with cells as doubles.
 
template<IsOperand OperandT>
using OperandValue = OperandResult<OperandT>::type
 Alias for the value type of an operand. This is a convenience alias that allows you to easily access the value type of an operand without having to explicitly use the OperandResult struct.
 
template<typename OutputT, typename InputT>
using PartialDerivative
 Alias for the partial derivative of some output type with respect to some input type. This is a convenience alias that allows you to easily access the partial derivative type without having to explicitly use the OperandResult struct.
 

Functions

template<typename ValueT>
decltype(auto) component (ValueT &value, int index)
 Read one entry of a scalar/vector/matrix value. This is a convenience function that allows you to easily access the components of a value type without having to explicitly use the OperandResult struct.
 
template<typename OutputT, typename InputT>
double derivative_component (const PartialDerivative< OutputT, InputT > &value, int output, int input)
 Read one entry of a scalar/vector/matrix local derivative.
 

Variables

template<Form FormT>
constexpr FormDescriptor form_descriptor
 Specialization of the FormDescriptor class at compile time for some particular compile-time form. This allows us to generate constexpr instances of this struct at compile time and usable at runtime.
 
template<typename ValueT>
constexpr int component_count = ValueComponents<std::remove_cv_t<ValueT>>::value
 

Typedef Documentation

◆ MatrixValue

Alias for a rank 2 tensor of dimension 3 with cells as doubles.

◆ OperandValue

template<IsOperand OperandT>
using serif::discretization::forms::OperandValue = OperandResult<OperandT>::type

Alias for the value type of an operand. This is a convenience alias that allows you to easily access the value type of an operand without having to explicitly use the OperandResult struct.

Template Parameters
OperandTThe operand type to determine the value type for.

◆ PartialDerivative

template<typename OutputT, typename InputT>
using serif::discretization::forms::PartialDerivative
Initial value:
std::conditional_t<std::same_as<OutputT, double>, InputT, std::conditional_t<std::same_as<InputT, double>, OutputT,
std::array<std::array<double, component_count<InputT>>, component_count<OutputT>>>>
constexpr int component_count
Definition value.hpp:150

Alias for the partial derivative of some output type with respect to some input type. This is a convenience alias that allows you to easily access the partial derivative type without having to explicitly use the OperandResult struct.

Template Parameters
OutputTThe output type of the partial derivative.
InputTThe input type of the partial derivative.
Todo
Should probably be consolidated with the other PartialDerivative system... No, should definitely be consolidated...

◆ VectorValue

using serif::discretization::forms::VectorValue = std::array<double, 3>

Alias for a rank 1 tensor of dimension 3 with elements doubles.

Todo
This file was a mistake, the information it is is helpful yes, however, it has lost generality, lost good type information, and does not need to be separate Really we should refactor this to be part of Operation, remove the assumption of 3 dimensionality, and probably fall back to something like a span rather than an array.

Function Documentation

◆ component()

template<typename ValueT>
decltype(auto) serif::discretization::forms::component ( ValueT & value,
int index )

Read one entry of a scalar/vector/matrix value. This is a convenience function that allows you to easily access the components of a value type without having to explicitly use the OperandResult struct.

Template Parameters
ValueTThe value type to read from.
Parameters
valueThe value to read from.
indexThe index of the component to read.
Returns
The component of the value at the specified index.

◆ derivative_component()

template<typename OutputT, typename InputT>
double serif::discretization::forms::derivative_component ( const PartialDerivative< OutputT, InputT > & value,
int output,
int input )

Read one entry of a scalar/vector/matrix local derivative.

Template Parameters
OutputTThe output type of the partial derivative.
InputTThe input type of the partial derivative.
Parameters
valueThe partial derivative to read from.
outputThe index of the output component to read.
inputThe index of the input component to read.
Returns
The component of the partial derivative at the specified indices.

Variable Documentation

◆ component_count

template<typename ValueT>
int serif::discretization::forms::component_count = ValueComponents<std::remove_cv_t<ValueT>>::value
inlineconstexpr

◆ form_descriptor

template<Form FormT>
FormDescriptor serif::discretization::forms::form_descriptor
inlineconstexpr
Initial value:
{
.name = FormT::name,
}
constexpr TermDescriptor term_descriptor
Create a TermDescriptor for a given term type.
Definition runtime.hpp:60

Specialization of the FormDescriptor class at compile time for some particular compile-time form. This allows us to generate constexpr instances of this struct at compile time and usable at runtime.

Template Parameters
FormTThe form to generate a descriptor for