NiHu
2.0
|
Discretised function spaces are meshes extended with shape functions that describe the interpolation scheme of a certain physical quantity over the elements of the mesh. NiHu provides two methods for building function spaces:
Any NiHu mesh can be transformed into a piecewise constant function space using the library function NiHu::constant_view
Constant view means that the physical quantity is considered to be constant over each element, and its nodal location is at the element center.
Alternatively, meshes can be viewed as piecewise isoparametric function spaces, using the function NiHu::isoparametric_view:
Isoparametric view means that the physical quantity is interpolated using the element's geometrical interpolation functions, so its nodal locations coincide with the geometrical nodes.
function space view's may be generated using an alternative, more general syntax:
where the NiHu::field_option::constant and NiHu::field_option::isoparametric are tag types. This syntax is more suitable for generic programming, and developers may customise their own field generation options.
Any function space and function space view (constant, isoparametic, etc.) can be transformed into a Dirac-view using the NiHu::dirac function.
A Dirac function space behaves as a set of Dirac delta basis functions located at the original function space's nodes. For example
generates Dirac delta functions in the element centers of my_mesh
, while
generates Dirac delta functions in the nodal vertices of my_mesh
. The Dirac-like behaviour becomes important when we define weighted double integrals (weighted residual matrices) with Dirac delta function spaces.
auto
keywords becomes inevitable when working with function space views. For example, in the code fragment below: the second auto
resolves to
which is cumbersome to read and interpret.
A mesh can be extended into a vector function space by passing additional arguments to the view constructors. The expression
creates a function space that interpolates a vector valued quantity over a mesh with piecewise constant interpolation funcions.
Heterogeneous function spaces are a collection of different element types with different field interpolation shape functions. NiHu provides a way (function NiHu::create_function_space) to manually define heterogeneous function spaces in a similar manner as defining a mesh. Although this option is rarely needed, we refer to the tutorial Defining a custom field for further information.