SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::discretization::forms::mass< TrialT, TestT > Struct Template Referencefinal

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...

#include <forms.hpp>

Inheritance diagram for serif::discretization::forms::mass< TrialT, TestT >:
[legend]
Collaboration diagram for serif::discretization::forms::mass< TrialT, TestT >:
[legend]

Public Types

using trial_type = TrialT
 The trial term type for the mass form.
 
using test_type = TestT
 The test term type for the mass form.
 
using operand_types = utils::types::TypeList<Operand<TrialT>, Operand<TestT>>
 Type list of operand types for the mass form, used for compile-time reflection and iteration over the operands.
 

Static Public Attributes

static constexpr std::string_view name = meta::template_name<mass>()
 Compile time reflected name of the form.
 

Detailed Description

template<blocks::Term TrialT, blocks::Term TestT>
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.

Template Parameters
TrialTThe trial term type.
TestTThe test term type.

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:

You have some scalar field \(u(x,t)\) on some domain \(\Omega\) which satisfies

\[\frac{\partial u}{\partial t} = f(x,t) \]

In the simplest case let every spatial point be independent such that there are no spatial derivatives. We first take this into weak form

\[\int_{\Omega}v\frac{\partial u}{\partial t}d\Omega = \int_{\Omega}vf(x,t)d\Omega \]

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

\[u\approx u_h = \sum_{j=1}^{N}c_{j}(t)\phi_{j}(x) \]

Then we can rewrite our weak form as

\[\int_{\Omega}v\sum_{j=1}^{N}c_{j}'(t)\phi_{j}(x)d\Omega = \int_{\Omega}vf(x,t)d\Omega \]

If we use the galerkin method such that our test function is the same as our basis functions, then we can write this as

\[\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 \]

Since we have defined the problem so that the basis functions are not time-dependent we can rearrange this as

\[\sum_{j}\left(\int_{\Omega}\phi_{i}\phi_{j}d\Omega\right)c_{j}'(t) = \int_{\Omega}\phi_{i}f(x,t)d\Omega \]

When then define

\[M_{ij} = \int_{\Omega}\phi_{i}\phi_{j}d\Omega \]

This is the so called mass 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 asstiffness matrices'').

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.

Member Typedef Documentation

◆ operand_types

template<blocks::Term TrialT, blocks::Term TestT>
using serif::discretization::forms::mass< TrialT, TestT >::operand_types = utils::types::TypeList<Operand<TrialT>, Operand<TestT>>

Type list of operand types for the mass form, used for compile-time reflection and iteration over the operands.

◆ test_type

template<blocks::Term TrialT, blocks::Term TestT>
using serif::discretization::forms::mass< TrialT, TestT >::test_type = TestT

The test term type for the mass form.

◆ trial_type

template<blocks::Term TrialT, blocks::Term TestT>
using serif::discretization::forms::mass< TrialT, TestT >::trial_type = TrialT

The trial term type for the mass form.

Member Data Documentation

◆ name

template<blocks::Term TrialT, blocks::Term TestT>
std::string_view serif::discretization::forms::mass< TrialT, TestT >::name = meta::template_name<mass>()
staticconstexpr

Compile time reflected name of the form.


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