OGS
ProcessLib::detail::LocalAssemblerTraitsFixed< ShpPol, NNodes, NodalDOF, Dim > Struct Template Reference

Detailed Description

template<typename ShpPol, unsigned NNodes, unsigned NodalDOF, int Dim>
struct ProcessLib::detail::LocalAssemblerTraitsFixed< ShpPol, NNodes, NodalDOF, Dim >

This class makes it possible to handle Eigen's block expressions transparently, both for fixed-size and dynamically allocated Eigen matrices.

Template Parameters
ShpPolthe shape matrix policy used
NNodesthe number of nodes for the FEM element
NodalDOFthe number of d.o.f. per node. If zero, this struct's methods will determine the size of the generated Eigen::block's at runtime. If non-zero, the size will be determined at compile-time.
Dimglobal spatial dimension

Definition at line 29 of file LocalAssemblerTraits.h.

#include <LocalAssemblerTraits.h>

Public Types

using ShapeMatrices = typename ShpPol::ShapeMatrices
using MatrixDimDim = Matrix<Dim, Dim>
 Square matrix of the given space dimensionality.
using LocalMatrix = Matrix<NNodes * NodalDOF, NNodes * NodalDOF>
using LocalVector = Vector<NNodes * NodalDOF>
using Vector1Comp = Vector<NNodes>
using LaplaceMatrix = Matrix<Dim * NodalDOF, Dim * NodalDOF>

Static Public Member Functions

template<typename Mat>
static auto blockDimDim (Mat const &mat, unsigned top, unsigned left, unsigned nrows, unsigned ncols)
template<typename Mat>
static auto blockDimDim (Mat &mat, unsigned top, unsigned left, unsigned nrows, unsigned ncols)
template<typename Mat>
static auto blockShpShp (Mat const &mat, unsigned top, unsigned left, unsigned nrows, unsigned ncols)
template<typename Mat>
static auto blockShpShp (Mat &mat, unsigned top, unsigned left, unsigned nrows, unsigned ncols)
template<typename Vec>
static auto blockShp (Vec const &vec, unsigned top, unsigned nrows)
 Get a block NNodes x 1 starting at the top'th row.
template<typename Vec>
static auto blockShp (Vec &vec, unsigned top, unsigned nrows)
 Get a block NNodes x 1 starting at the top'th row.

Private Types

template<int N, int M>
using Matrix = typename ShpPol::template MatrixType<N, M>
template<int N>
using Vector = typename ShpPol::template VectorType<N>

Member Typedef Documentation

◆ LaplaceMatrix

template<typename ShpPol, unsigned NNodes, unsigned NodalDOF, int Dim>
using ProcessLib::detail::LocalAssemblerTraitsFixed< ShpPol, NNodes, NodalDOF, Dim >::LaplaceMatrix = Matrix<Dim * NodalDOF, Dim * NodalDOF>

Laplace matrix for the given space dimensionality and number of d.o.f per node.

Definition at line 58 of file LocalAssemblerTraits.h.

◆ LocalMatrix

template<typename ShpPol, unsigned NNodes, unsigned NodalDOF, int Dim>
using ProcessLib::detail::LocalAssemblerTraitsFixed< ShpPol, NNodes, NodalDOF, Dim >::LocalMatrix = Matrix<NNodes * NodalDOF, NNodes * NodalDOF>

Local matrix for the given number of d.o.f. per node and number of integration points

Definition at line 47 of file LocalAssemblerTraits.h.

◆ LocalVector

template<typename ShpPol, unsigned NNodes, unsigned NodalDOF, int Dim>
using ProcessLib::detail::LocalAssemblerTraitsFixed< ShpPol, NNodes, NodalDOF, Dim >::LocalVector = Vector<NNodes * NodalDOF>

Local vector for the given number of d.o.f. per node and number of integration points

Definition at line 50 of file LocalAssemblerTraits.h.

◆ Matrix

template<typename ShpPol, unsigned NNodes, unsigned NodalDOF, int Dim>
template<int N, int M>
using ProcessLib::detail::LocalAssemblerTraitsFixed< ShpPol, NNodes, NodalDOF, Dim >::Matrix = typename ShpPol::template MatrixType<N, M>
private

Definition at line 33 of file LocalAssemblerTraits.h.

◆ MatrixDimDim

template<typename ShpPol, unsigned NNodes, unsigned NodalDOF, int Dim>
using ProcessLib::detail::LocalAssemblerTraitsFixed< ShpPol, NNodes, NodalDOF, Dim >::MatrixDimDim = Matrix<Dim, Dim>

Square matrix of the given space dimensionality.

Definition at line 41 of file LocalAssemblerTraits.h.

◆ ShapeMatrices

template<typename ShpPol, unsigned NNodes, unsigned NodalDOF, int Dim>
using ProcessLib::detail::LocalAssemblerTraitsFixed< ShpPol, NNodes, NodalDOF, Dim >::ShapeMatrices = typename ShpPol::ShapeMatrices

Definition at line 38 of file LocalAssemblerTraits.h.

◆ Vector

template<typename ShpPol, unsigned NNodes, unsigned NodalDOF, int Dim>
template<int N>
using ProcessLib::detail::LocalAssemblerTraitsFixed< ShpPol, NNodes, NodalDOF, Dim >::Vector = typename ShpPol::template VectorType<N>
private

Definition at line 35 of file LocalAssemblerTraits.h.

◆ Vector1Comp

template<typename ShpPol, unsigned NNodes, unsigned NodalDOF, int Dim>
using ProcessLib::detail::LocalAssemblerTraitsFixed< ShpPol, NNodes, NodalDOF, Dim >::Vector1Comp = Vector<NNodes>

Local vector for one component of one process variable. The size is the number of nodes in the element.

Definition at line 54 of file LocalAssemblerTraits.h.

Member Function Documentation

◆ blockDimDim() [1/2]

template<typename ShpPol, unsigned NNodes, unsigned NodalDOF, int Dim>
template<typename Mat>
auto ProcessLib::detail::LocalAssemblerTraitsFixed< ShpPol, NNodes, NodalDOF, Dim >::blockDimDim ( Mat & mat,
unsigned top,
unsigned left,
unsigned nrows,
unsigned ncols )
inlinestatic

Get a block Dim x Dim whose upper left corner is at top and left.

Definition at line 83 of file LocalAssemblerTraits.h.

85 {
86 if constexpr (NodalDOF != 0)
87 {
88 assert(nrows == Dim && ncols == Dim);
89 (void)nrows;
90 (void)ncols;
91 return mat.template block<Dim, Dim>(top, left);
92 }
93 else
94 {
95 assert(nrows == ncols);
96 return mat.block(top, left, nrows, ncols);
97 }
98 }

◆ blockDimDim() [2/2]

template<typename ShpPol, unsigned NNodes, unsigned NodalDOF, int Dim>
template<typename Mat>
auto ProcessLib::detail::LocalAssemblerTraitsFixed< ShpPol, NNodes, NodalDOF, Dim >::blockDimDim ( Mat const & mat,
unsigned top,
unsigned left,
unsigned nrows,
unsigned ncols )
inlinestatic

Get a block Dim x Dim whose upper left corner is at top and left.

Definition at line 63 of file LocalAssemblerTraits.h.

65 {
66 if constexpr (NodalDOF != 0)
67 {
68 assert(nrows == Dim && ncols == Dim);
69 (void)nrows;
70 (void)ncols;
71 return mat.template block<Dim, Dim>(top, left);
72 }
73 else
74 {
75 assert(nrows == ncols);
76 return mat.block(top, left, nrows, ncols);
77 }
78 }

◆ blockShp() [1/2]

template<typename ShpPol, unsigned NNodes, unsigned NodalDOF, int Dim>
template<typename Vec>
auto ProcessLib::detail::LocalAssemblerTraitsFixed< ShpPol, NNodes, NodalDOF, Dim >::blockShp ( Vec & vec,
unsigned top,
unsigned nrows )
inlinestatic

Get a block NNodes x 1 starting at the top'th row.

Definition at line 158 of file LocalAssemblerTraits.h.

159 {
160 if constexpr (NodalDOF != 0)
161 {
162 assert(nrows == NNodes);
163 (void)nrows;
164 return vec.template block<NNodes, 1>(top, 0);
165 }
166 else
167 {
168 return vec.block(top, 0, nrows, 1);
169 }
170 }

◆ blockShp() [2/2]

template<typename ShpPol, unsigned NNodes, unsigned NodalDOF, int Dim>
template<typename Vec>
auto ProcessLib::detail::LocalAssemblerTraitsFixed< ShpPol, NNodes, NodalDOF, Dim >::blockShp ( Vec const & vec,
unsigned top,
unsigned nrows )
inlinestatic

Get a block NNodes x 1 starting at the top'th row.

Definition at line 142 of file LocalAssemblerTraits.h.

143 {
144 if constexpr (NodalDOF != 0)
145 {
146 assert(nrows == NNodes);
147 (void)nrows;
148 return vec.template block<NNodes, 1>(top, 0);
149 }
150 else
151 {
152 return vec.block(top, 0, nrows, 1);
153 }
154 }

◆ blockShpShp() [1/2]

template<typename ShpPol, unsigned NNodes, unsigned NodalDOF, int Dim>
template<typename Mat>
auto ProcessLib::detail::LocalAssemblerTraitsFixed< ShpPol, NNodes, NodalDOF, Dim >::blockShpShp ( Mat & mat,
unsigned top,
unsigned left,
unsigned nrows,
unsigned ncols )
inlinestatic

Get a block NNodes x NNodes whose upper left corner is at top and left.

Definition at line 123 of file LocalAssemblerTraits.h.

125 {
126 if constexpr (NodalDOF != 0)
127 {
128 assert(nrows == NNodes && ncols == NNodes);
129 (void)nrows;
130 (void)ncols;
131 return mat.template block<NNodes, NNodes>(top, left);
132 }
133 else
134 {
135 assert(nrows == ncols);
136 return mat.block(top, left, nrows, ncols);
137 }
138 }

◆ blockShpShp() [2/2]

template<typename ShpPol, unsigned NNodes, unsigned NodalDOF, int Dim>
template<typename Mat>
auto ProcessLib::detail::LocalAssemblerTraitsFixed< ShpPol, NNodes, NodalDOF, Dim >::blockShpShp ( Mat const & mat,
unsigned top,
unsigned left,
unsigned nrows,
unsigned ncols )
inlinestatic

Get a block NNodes x NNodes whose upper left corner is at top and left.

Definition at line 103 of file LocalAssemblerTraits.h.

105 {
106 if constexpr (NodalDOF != 0)
107 {
108 assert(nrows == NNodes && ncols == NNodes);
109 (void)nrows;
110 (void)ncols;
111 return mat.template block<NNodes, NNodes>(top, left);
112 }
113 else
114 {
115 assert(nrows == ncols);
116 return mat.block(top, left, nrows, ncols);
117 }
118 }

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