Files
MeanField_SERiF/docs/man/man3/serif_discretization_forms.3
Emily Boudreaux 6b57738330 docs(docs): built docs
Note for now much of the docs is LLM written. This was done to save time and focus on code development. The docs have been LOOSLEY reviewed. However, the code itself has been either fully written by hand or fully reviewed. Therefore, the docs should at the moment be seen as a loose resource rather than authoratiative (and this is on top of the general ability for docs to drift)
2026-11-09 14:09:44 -05:00

322 lines
14 KiB
Groff

.TH "serif::discretization::forms" 3 "Version v0.0.1a" "SERiF" \" -*- nroff -*-
.ad l
.nh
.SH NAME
serif::discretization::forms
.SH SYNOPSIS
.br
.PP
.SS "Classes"
.in +1c
.ti -1c
.RI "struct \fBboundary_flux\fP"
.br
.RI "The \fBboundary_flux\fP 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\&. "
.ti -1c
.RI "struct \fBdivergence\fP"
.br
.RI "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\&. "
.ti -1c
.RI "struct \fBforce\fP"
.br
.RI "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\&. "
.ti -1c
.RI "struct \fBform\fP"
.br
.RI "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\&. "
.ti -1c
.RI "struct \fBFormDescriptor\fP"
.br
.RI "Runtime form descriptor including runtime term information\&. Used to represented the compile-time form type at runtime\&. "
.ti -1c
.RI "struct \fBFormTraits\fP"
.br
.RI "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\&. "
.ti -1c
.RI "struct \fBFormTraits< boundary_flux< TrialT, TestT > >\fP"
.br
.RI "Specialization of \fBFormTraits\fP for the \fBboundary_flux\fP form, which has no order reduction for either trial or test terms\&. "
.ti -1c
.RI "struct \fBFormTraits< divergence< TrialT, TestT > >\fP"
.br
.RI "Specialization of \fBFormTraits\fP 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\&. "
.ti -1c
.RI "struct \fBFormTraits< force< TrialT, TestT > >\fP"
.br
.RI "Specialization of \fBFormTraits\fP for the force form, which has no order reduction for either trial or test terms\&. "
.ti -1c
.RI "struct \fBFormTraits< mass< TrialT, TestT > >\fP"
.br
.RI "Specialization of \fBFormTraits\fP for the mass form, which has no order reduction for either trial or test terms\&. "
.ti -1c
.RI "struct \fBFormTraits< projection< TrialT, TestT > >\fP"
.br
.RI "Specialization of \fBFormTraits\fP for the projection form, which has no order reduction for either trial or test terms\&. "
.ti -1c
.RI "struct \fBFormTraits< source< TrialT, TestT > >\fP"
.br
.RI "Specialization of \fBFormTraits\fP for the source form, which has no order reduction for either trial or test terms\&. "
.ti -1c
.RI "struct \fBmass\fP"
.br
.RI "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\&. "
.ti -1c
.RI "struct \fBOperand\fP"
.br
.RI "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)\&. "
.ti -1c
.RI "struct \fBOperandResult\fP"
.br
.RI "General case for compile time metadata associating some operand to the value type of its result\&. These use the \fBOperationValue\fP struct and the information in the operand to determine the value type of the result of that operand\&. "
.ti -1c
.RI "struct \fBOperandResult< OperandT >\fP"
.br
.RI "Specialization of the \fBOperandResult\fP struct for operands that are valid operands (satisfy the \fBIsOperand\fP concept) and are spatial terms (e\&.g defined over the domain, think mass density)\&. This specialization uses the \fBOperationValue\fP struct to determine the value type of the result of the operand based on its term type and operation type\&. "
.ti -1c
.RI "struct \fBOperation\fP"
.br
.RI "The \fBOperation\fP 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 \fBforms\&.hpp\fP, if you are a developer looking to extend the mathematical capabilities of SERiF this is a place you should be looking early on\&. "
.ti -1c
.RI "struct \fBOperationValue\fP"
.br
.RI "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\&. "
.ti -1c
.RI "struct \fBOperationValue< 0, Operation::Gradient >\fP"
.br
.RI "The gradient of a rank 0 tensor is a rank 1 tensor (a vector of doubles) "
.ti -1c
.RI "struct \fBOperationValue< 0, Operation::Value >\fP"
.br
.RI "The value of a rank 0 tensor is a scalar, a double in the case of SERiF where we restrict ourselves to double precision\&. "
.ti -1c
.RI "struct \fBOperationValue< 1, Operation::Curl >\fP"
.br
.RI "The curl of a rank 1 tensor is a rank 1 tensor (a vector of doubles) "
.ti -1c
.RI "struct \fBOperationValue< 1, Operation::Divergence >\fP"
.br
.RI "The divergence of a rank one tensor is a scalar (a double) "
.ti -1c
.RI "struct \fBOperationValue< 1, Operation::Gradient >\fP"
.br
.RI "\fBVector\fP gradients use G[component][derivative] = partial_derivative(u_component, x_derivative)\&. "
.ti -1c
.RI "struct \fBOperationValue< 1, Operation::NormalTrace >\fP"
.br
.ti -1c
.RI "struct \fBOperationValue< 1, Operation::Value >\fP"
.br
.RI "The value of a rank 1 tensor is a rank 1 tensor (a vector of doubles in SERiF) "
.ti -1c
.RI "struct \fBprojection\fP"
.br
.RI "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\&. "
.ti -1c
.RI "struct \fBsource\fP"
.br
.RI "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\&. "
.ti -1c
.RI "struct \fBValueComponents\fP"
.br
.RI "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 \fBOperandResult\fP struct\&. "
.ti -1c
.RI "struct \fBValueComponents< double >\fP"
.br
.ti -1c
.RI "struct \fBValueComponents< std::array< Entry, Size > >\fP"
.br
.ti -1c
.RI "struct \fBValueComponents< void >\fP"
.br
.in -1c
.SS "Concepts"
.in +1c
.ti -1c
.RI "concept \fBForm\fP"
.br
.RI "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\&. "
.ti -1c
.RI "concept \fBIsOperation\fP"
.br
.ti -1c
.RI "concept \fBIsOperand\fP"
.br
.RI "Concept to validate a valid operand\&. An operand is valid if the following conditions are satisfied\&. "
.in -1c
.SS "Typedefs"
.in +1c
.ti -1c
.RI "using \fBVectorValue\fP = std::array<double, 3>"
.br
.RI "Alias for a rank 1 tensor of dimension 3 with elements doubles\&. "
.ti -1c
.RI "using \fBMatrixValue\fP = std::array<\fBVectorValue\fP, 3>"
.br
.RI "Alias for a rank 2 tensor of dimension 3 with cells as doubles\&. "
.ti -1c
.RI "template<IsOperand OperandT> using \fBOperandValue\fP = \fBOperandResult\fP<OperandT>::type"
.br
.RI "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 \fBOperandResult\fP struct\&. "
.ti -1c
.RI "template<typename OutputT, typename InputT> using \fBPartialDerivative\fP"
.br
.RI "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 \fBOperandResult\fP struct\&. "
.in -1c
.SS "Functions"
.in +1c
.ti -1c
.RI "template<typename ValueT> decltype(auto) \fBcomponent\fP (ValueT &value, int index)"
.br
.RI "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 \fBOperandResult\fP struct\&. "
.ti -1c
.RI "template<typename OutputT, typename InputT> double \fBderivative_component\fP (const \fBPartialDerivative\fP< OutputT, InputT > &value, int output, int input)"
.br
.RI "Read one entry of a scalar/vector/matrix local derivative\&. "
.in -1c
.SS "Variables"
.in +1c
.ti -1c
.RI "template<Form FormT> constexpr \fBFormDescriptor\fP \fBform_descriptor\fP"
.br
.RI "Specialization of the \fBFormDescriptor\fP 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\&. "
.ti -1c
.RI "template<typename ValueT> constexpr int \fBcomponent_count\fP = \fBValueComponents\fP<std::remove_cv_t<ValueT>>::value"
.br
.in -1c
.SH "Typedef Documentation"
.PP
.SS "using \fBserif::discretization::forms::MatrixValue\fP = std::array<\fBVectorValue\fP, 3>"
.PP
Alias for a rank 2 tensor of dimension 3 with cells as doubles\&.
.SS "template<IsOperand OperandT> using \fBserif::discretization::forms::OperandValue\fP = \fBOperandResult\fP<OperandT>::type"
.PP
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 \fBOperandResult\fP struct\&.
.PP
\fBTemplate Parameters\fP
.RS 4
\fIOperandT\fP The operand type to determine the value type for\&.
.RE
.PP
.SS "template<typename OutputT, typename InputT> using \fBserif::discretization::forms::PartialDerivative\fP"
\fBInitial value:\fP
.nf
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>>>>
.PP
.fi
.PP
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 \fBOperandResult\fP struct\&.
.PP
\fBTemplate Parameters\fP
.RS 4
\fIOutputT\fP The output type of the partial derivative\&.
.br
\fIInputT\fP The input type of the partial derivative\&.
.RE
.PP
\fBTodo\fP
.RS 4
Should probably be consolidated with the other \fBPartialDerivative\fP system\&.\&.\&. No, should \fIdefinitely\fP be consolidated\&.\&.\&.
.RE
.PP
.SS "using \fBserif::discretization::forms::VectorValue\fP = std::array<double, 3>"
.PP
Alias for a rank 1 tensor of dimension 3 with elements doubles\&.
.PP
\fBTodo\fP
.RS 4
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 \fBOperation\fP, remove the assumption of 3 dimensionality, and probably fall back to something like a span rather than an array\&.
.RE
.PP
.SH "Function Documentation"
.PP
.SS "template<typename ValueT> decltype(auto) serif::discretization::forms::component (ValueT & value, int index)"
.PP
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 \fBOperandResult\fP struct\&.
.PP
\fBTemplate Parameters\fP
.RS 4
\fIValueT\fP The value type to read from\&.
.RE
.PP
\fBParameters\fP
.RS 4
\fIvalue\fP The value to read from\&.
.br
\fIindex\fP The index of the component to read\&.
.RE
.PP
\fBReturns\fP
.RS 4
The component of the value at the specified index\&.
.RE
.PP
.SS "template<typename OutputT, typename InputT> double serif::discretization::forms::derivative_component (const \fBPartialDerivative\fP< OutputT, InputT > & value, int output, int input)"
.PP
Read one entry of a scalar/vector/matrix local derivative\&.
.PP
\fBTemplate Parameters\fP
.RS 4
\fIOutputT\fP The output type of the partial derivative\&.
.br
\fIInputT\fP The input type of the partial derivative\&.
.RE
.PP
\fBParameters\fP
.RS 4
\fIvalue\fP The partial derivative to read from\&.
.br
\fIoutput\fP The index of the output component to read\&.
.br
\fIinput\fP The index of the input component to read\&.
.RE
.PP
\fBReturns\fP
.RS 4
The component of the partial derivative at the specified indices\&.
.RE
.PP
.SH "Variable Documentation"
.PP
.SS "template<typename ValueT> int serif::discretization::forms::component_count = \fBValueComponents\fP<std::remove_cv_t<ValueT>>::value\fR [inline]\fP, \fR [constexpr]\fP"
.SS "template<Form FormT> \fBFormDescriptor\fP serif::discretization::forms::form_descriptor\fR [inline]\fP, \fR [constexpr]\fP"
\fBInitial value:\fP
.nf
{
\&.name = FormT::name,
\&.trial = blocks::term_descriptor<typename FormT::trial_type>,
\&.test = blocks::term_descriptor<typename FormT::test_type>
}
.PP
.fi
.PP
Specialization of the \fBFormDescriptor\fP 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\&.
.PP
\fBTemplate Parameters\fP
.RS 4
\fIFormT\fP The form to generate a descriptor for
.RE
.PP
.SH "Author"
.PP
Generated automatically by Doxygen for SERiF from the source code\&.