OGS
HMatrixUtils.h
Go to the documentation of this file.
1
11#pragma once
12
14
15namespace ProcessLib
16{
19template <typename ShapeFunction, int DisplacementDim>
21{
22private:
24 template <int N>
25 using VectorType =
26 typename ShapeMatrixPolicyType<ShapeFunction,
27 DisplacementDim>::template VectorType<N>;
28
30 template <int N, int M>
31 using MatrixType =
33 template MatrixType<N, M>;
34
35 // Dimensions of specific H-matrix for n-points and displacement dimension.
36 static int const _number_of_dof = ShapeFunction::NPOINTS * DisplacementDim;
37
38public:
41
43
46};
47
49template <int DisplacementDim,
50 int NPOINTS,
51 typename N_Type,
52 typename HMatrixType>
53void computeHMatrix(N_Type const& N, HMatrixType& H)
54{
55 static_assert(1 < DisplacementDim && DisplacementDim <= 3,
56 "LinearHMatrix::computeHMatrix: DisplacementDim must be in "
57 "range (1,3].");
58
59 H.setZero();
60
61 for (int j = 0; j < DisplacementDim; j++)
62 {
63 H.block(j, j * NPOINTS, 1, NPOINTS) = N;
64 }
65}
66
67} // namespace ProcessLib
typename ShapeMatrixPolicyType< ShapeFunction, DisplacementDim >::template VectorType< N > VectorType
Reusing the ShapeMatrixPolicy vector type.
static int const _number_of_dof
MatrixType< _number_of_dof, _number_of_dof > StiffnessMatrixType
typename ShapeMatrixPolicyType< ShapeFunction, DisplacementDim >:: template MatrixType< N, M > MatrixType
Reusing the ShapeMatrixPolicy matrix type.
VectorType< _number_of_dof > NodalForceVectorType
MatrixType< DisplacementDim, _number_of_dof > HMatrixType
VectorType< DisplacementDim > ForceVectorType
MatrixType< DisplacementDim, DisplacementDim > ConstitutiveMatrixType
void computeHMatrix(N_Type const &N, HMatrixType &H)
Fills a H-matrix based on given shape function.