OGS
HMatrixUtils.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
7
8namespace ProcessLib
9{
12template <typename ShapeFunction, int DisplacementDim>
14{
15private:
17 template <int N>
18 using VectorType =
20 DisplacementDim>::template VectorType<N>;
21
23 template <int N, int M>
24 using MatrixType =
26 template MatrixType<N, M>;
27
28 // Dimensions of specific H-matrix for n-points and displacement dimension.
29 static int const _number_of_dof = ShapeFunction::NPOINTS * DisplacementDim;
30
31public:
34
36
39};
40
42template <int DisplacementDim,
43 int NPOINTS,
44 typename N_Type,
45 typename HMatrixType>
46void computeHMatrix(N_Type const& N, HMatrixType& H)
47{
48 static_assert(1 < DisplacementDim && DisplacementDim <= 3,
49 "LinearHMatrix::computeHMatrix: DisplacementDim must be in "
50 "range (1,3].");
51
52 H.setZero();
53
54 for (int j = 0; j < DisplacementDim; j++)
55 {
56 H.block(j, j * NPOINTS, 1, NPOINTS) = N;
57 }
58}
59
60} // namespace ProcessLib
EigenFixedShapeMatrixPolicy< ShapeFunction, GlobalDim > ShapeMatrixPolicyType
typename ShapeMatrixPolicyType< ShapeFunction, DisplacementDim >::template VectorType< N > VectorType
Reusing the ShapeMatrixPolicy vector type.
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.