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 36 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. More...
 
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. More...
 
template<typename Vec >
static auto blockShp (Vec &vec, unsigned top, unsigned nrows)
 Get a block NNodes x 1 starting at the top'th row. More...
 

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 65 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 54 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 57 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 40 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 48 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 45 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 42 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 61 of file LocalAssemblerTraits.h.

Member Function Documentation

◆ blockDimDim() [1/2]

template<typename ShpPol , unsigned NNodes, unsigned NodalDOF, int Dim>
template<typename Mat >
static 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 90 of file LocalAssemblerTraits.h.

92  {
93  if constexpr (NodalDOF != 0)
94  {
95  assert(nrows == Dim && ncols == Dim);
96  (void)nrows;
97  (void)ncols;
98  return mat.template block<Dim, Dim>(top, left);
99  }
100  else
101  {
102  assert(nrows == ncols);
103  return mat.block(top, left, nrows, ncols);
104  }
105  }

◆ blockDimDim() [2/2]

template<typename ShpPol , unsigned NNodes, unsigned NodalDOF, int Dim>
template<typename Mat >
static 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 70 of file LocalAssemblerTraits.h.

72  {
73  if constexpr (NodalDOF != 0)
74  {
75  assert(nrows == Dim && ncols == Dim);
76  (void)nrows;
77  (void)ncols;
78  return mat.template block<Dim, Dim>(top, left);
79  }
80  else
81  {
82  assert(nrows == ncols);
83  return mat.block(top, left, nrows, ncols);
84  }
85  }

◆ blockShp() [1/2]

template<typename ShpPol , unsigned NNodes, unsigned NodalDOF, int Dim>
template<typename Vec >
static 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 165 of file LocalAssemblerTraits.h.

166  {
167  if constexpr (NodalDOF != 0)
168  {
169  assert(nrows == NNodes);
170  (void)nrows;
171  return vec.template block<NNodes, 1>(top, 0);
172  }
173  else
174  {
175  return vec.block(top, 0, nrows, 1);
176  }
177  }

◆ blockShp() [2/2]

template<typename ShpPol , unsigned NNodes, unsigned NodalDOF, int Dim>
template<typename Vec >
static 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 149 of file LocalAssemblerTraits.h.

150  {
151  if constexpr (NodalDOF != 0)
152  {
153  assert(nrows == NNodes);
154  (void)nrows;
155  return vec.template block<NNodes, 1>(top, 0);
156  }
157  else
158  {
159  return vec.block(top, 0, nrows, 1);
160  }
161  }

◆ blockShpShp() [1/2]

template<typename ShpPol , unsigned NNodes, unsigned NodalDOF, int Dim>
template<typename Mat >
static 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 130 of file LocalAssemblerTraits.h.

132  {
133  if constexpr (NodalDOF != 0)
134  {
135  assert(nrows == NNodes && ncols == NNodes);
136  (void)nrows;
137  (void)ncols;
138  return mat.template block<NNodes, NNodes>(top, left);
139  }
140  else
141  {
142  assert(nrows == ncols);
143  return mat.block(top, left, nrows, ncols);
144  }
145  }

◆ blockShpShp() [2/2]

template<typename ShpPol , unsigned NNodes, unsigned NodalDOF, int Dim>
template<typename Mat >
static 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 110 of file LocalAssemblerTraits.h.

112  {
113  if constexpr (NodalDOF != 0)
114  {
115  assert(nrows == NNodes && ncols == NNodes);
116  (void)nrows;
117  (void)ncols;
118  return mat.template block<NNodes, NNodes>(top, left);
119  }
120  else
121  {
122  assert(nrows == ncols);
123  return mat.block(top, left, nrows, ncols);
124  }
125  }

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