OGS
ShapeMatrices.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
6#include <Eigen/Core>
7#include <iosfwd>
8
9namespace NumLib
10{
23
34template <class T_N, class T_DNDR, class T_J, class T_DNDX>
36{
37 using ShapeType = T_N;
38 using DrShapeType = T_DNDR;
39 using JacobianType = T_J;
40 using DxShapeType = T_DNDX;
41
46 double detJ;
51
59 ShapeMatrices() = delete;
60
70 ShapeMatrices(std::size_t local_dim, std::size_t global_dim,
71 std::size_t n_nodes)
72 : N(n_nodes),
73 dNdr(local_dim, n_nodes),
74 J(local_dim, local_dim),
75 detJ(.0),
76 invJ(local_dim, local_dim),
77 dNdx(global_dim, n_nodes),
79 {
80 setZero();
81 }
82
84 void setZero();
85
91 template <ShapeMatrixType T_SHAPE_MATRIX_TYPE>
92 void setZero();
93
98 void write(std::ostream& out) const;
99
101}; // ShapeMatrices
102
103} // namespace NumLib
104
105#include "ShapeMatrices-impl.h"
ShapeMatrixType
Shape matrix type to be calculated.
@ DNDR
calculates dNdr
@ N_J
calculates N, dNdr, J, and detJ
@ DNDR_J
calculates dNdr, J, and detJ
@ DNDX
calculates dNdr, J, detJ, invJ, and dNdx
ShapeMatrices(std::size_t local_dim, std::size_t global_dim, std::size_t n_nodes)
void write(std::ostream &out) const
void setZero()
reset all data with zero