Files
MeanField_SERiF/docs/man/man3/serif_discretization_forms_mass.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

127 lines
5.3 KiB
Groff

.TH "serif::discretization::forms::mass< TrialT, TestT >" 3 "Version v0.0.1a" "SERiF" \" -*- nroff -*-
.ad l
.nh
.SH NAME
serif::discretization::forms::mass< TrialT, TestT > \- 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\&.
.SH SYNOPSIS
.br
.PP
.PP
\fR#include <forms\&.hpp>\fP
.PP
Inherits \fBserif::discretization::forms::form\fP\&.
.SS "Public Types"
.in +1c
.ti -1c
.RI "using \fBtrial_type\fP = TrialT"
.br
.RI "The trial term type for the mass form\&. "
.ti -1c
.RI "using \fBtest_type\fP = TestT"
.br
.RI "The test term type for the mass form\&. "
.ti -1c
.RI "using \fBoperand_types\fP = \fButils::types::TypeList\fP<\fBOperand\fP<TrialT>, \fBOperand\fP<TestT>>"
.br
.RI "Type list of operand types for the mass form, used for compile-time reflection and iteration over the operands\&. "
.in -1c
.SS "Static Public Attributes"
.in +1c
.ti -1c
.RI "static constexpr std::string_view \fBname\fP = \fBmeta::template_name\fP<\fBmass\fP>()"
.br
.RI "Compile time reflected name of the form\&. "
.in -1c
.SH "Detailed Description"
.PP
.SS "template<blocks::Term TrialT, blocks::Term TestT>
.br
struct serif::discretization::forms::mass< TrialT, TestT >"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\&.
.PP
\fBTemplate Parameters\fP
.RS 4
\fITrialT\fP The trial term type\&.
.br
\fITestT\fP The test term type\&.
.RE
.PP
It is important to not that we do not use mass here in the physics sense of the term; rather, mass is a common term in finite-element analysis\&. The mass matrix is a particular matrix that arrises in the weak discretization of a wide variety of PDEs\&. Consider the following example:
.PP
You have some scalar field $u(x,t)$ on some domain $\Omega$ which satisfies
.PP
\[\frac{\partial u}{\partial t} = f(x,t)
\]
.PP
In the simplest case let every spatial point be independent such that there are no spatial derivatives\&. We first take this into weak form
.PP
\[\int_{\Omega}v\frac{\partial u}{\partial t}d\Omega = \int_{\Omega}vf(x,t)d\Omega
\]
.PP
Now we must discretize this over some meshing, lets call the approximated solution $u_h$ such that, approximating with $N$ basis functions $\phi_j(x)$ we have
.PP
\[u\approx u_h = \sum_{j=1}^{N}c_{j}(t)\phi_{j}(x)
\]
.PP
Then we can rewrite our weak form as
.PP
\[\int_{\Omega}v\sum_{j=1}^{N}c_{j}'(t)\phi_{j}(x)d\Omega = \int_{\Omega}vf(x,t)d\Omega
\]
.PP
If we use the galerkin method such that our test function is the same as our basis functions, then we can write this as
.PP
\[\int _{\Omega}\phi_{i}(x)\sum_{j=1}^{N}c_{j}'(t)\phi_{j}(x)d\Omega = \int_{\Omega}\phi_{i}(x)f(x,t)d\Omega
\]
.PP
Since we have defined the problem so that the basis functions are not time-dependent we can rearrange this as
.PP
\[\sum_{j}\left(\int_{\Omega}\phi_{i}\phi_{j}d\Omega\right)c_{j}'(t) = \int_{\Omega}\phi_{i}f(x,t)d\Omega
\]
.PP
When then define
.PP
\[M_{ij} = \int_{\Omega}\phi_{i}\phi_{j}d\Omega
\]
.PP
This is the so called \fRmass matrix''\&. The careful reader will note that this really need have nothing to do with mass\&. Formally the mass matrix just represents the \\f$L^{2}\\f$ inner product of the basis functions\&. Historically (from some rudimentary googling) this seems to be a holdover from the early days of finite element analysis and models of the longitudinal vibrations of a elastic bar\&. You can go through that PDE following the same general steps as above and you also arrive at some \\f$L^{2}\\f$ inner product of the basis functions (along with another term)\&. The inner product term turns out to be associated with the mass of the bar while the other term turns out to be associated with the stiffness of the bar (and therefore matrices of that form have become known as\fPstiffness matrices'')\&.
.PP
There is likely a good argument for us to use a different name, clarity may be improved\&. However, most resource on finite element analysis will use the term mass matrix so I have decided to stick with that for now\&.
.SH "Member Typedef Documentation"
.PP
.SS "template<blocks::Term TrialT, blocks::Term TestT> using \fBserif::discretization::forms::mass\fP< TrialT, TestT >::operand_types = \fButils::types::TypeList\fP<\fBOperand\fP<TrialT>, \fBOperand\fP<TestT>>"
.PP
Type list of operand types for the mass form, used for compile-time reflection and iteration over the operands\&.
.SS "template<blocks::Term TrialT, blocks::Term TestT> using \fBserif::discretization::forms::mass\fP< TrialT, TestT >::test_type = TestT"
.PP
The test term type for the mass form\&.
.SS "template<blocks::Term TrialT, blocks::Term TestT> using \fBserif::discretization::forms::mass\fP< TrialT, TestT >::trial_type = TrialT"
.PP
The trial term type for the mass form\&.
.SH "Member Data Documentation"
.PP
.SS "template<blocks::Term TrialT, blocks::Term TestT> std::string_view \fBserif::discretization::forms::mass\fP< TrialT, TestT >::name = \fBmeta::template_name\fP<\fBmass\fP>()\fR [static]\fP, \fR [constexpr]\fP"
.PP
Compile time reflected name of the form\&.
.SH "Author"
.PP
Generated automatically by Doxygen for SERiF from the source code\&.