OGS
ShapeMatrices-impl.h
Go to the documentation of this file.
1
13namespace NumLib
14{
15namespace detail
16{
17/*
18 * zero reset functions for Eigen
19 */
20template <class T>
21void setMatrixZero(T& mat)
22{
23 // mat.setZero();
24 const std::size_t n = mat.rows() * mat.cols();
25 auto* v = mat.data();
26 for (std::size_t i = 0; i < n; i++)
27 {
28 v[i] = .0;
29 }
30}
31
32template <class T>
33void setVectorZero(T& vec)
34{
35 // vec.setZero();
36 const std::size_t n = vec.size();
37 auto* v = vec.data();
38 for (std::size_t i = 0; i < n; i++)
39 {
40 v[i] = .0;
41 }
42}
43
44/*
45 * "tag dispatching" technique is used below to emulate explicit specialization
46 * of a template function in a template class
47 */
48template <ShapeMatrixType FIELD_TYPE>
50{
51};
52
53template <class T_N, class T_DNDR, class T_J, class T_DNDX>
59
60template <class T_N, class T_DNDR, class T_J, class T_DNDX>
66
67template <class T_N, class T_DNDR, class T_J, class T_DNDX>
76
77template <class T_N, class T_DNDR, class T_J, class T_DNDX>
84
85template <class T_N, class T_DNDR, class T_J, class T_DNDX>
93
94template <class T_N, class T_DNDR, class T_J, class T_DNDX>
101
102} // namespace detail
103
104template <class T_N, class T_DNDR, class T_J, class T_DNDX>
109
110template <class T_N, class T_DNDR, class T_J, class T_DNDX>
111template <ShapeMatrixType T_SHAPE_MATRIX_TYPE>
116
117template <class T_N, class T_DNDR, class T_J, class T_DNDX>
119{
120 out << "N :\n" << N << "\n";
121 out << "dNdr:\n" << dNdr << "\n";
122 out << "J :\n" << J << "\n";
123 out << "|J| : " << detJ << "\n";
124 out << "invJ:\n" << invJ << "\n";
125 out << "dNdx:\n" << dNdx << "\n";
126}
127
128template <class T_N, class T_DNDR, class T_J, class T_DNDX>
129std::ostream& operator<<(std::ostream& os,
131{
132 shape.write(os);
133 return os;
134}
135
136} // namespace NumLib
void setMatrixZero(T &mat)
void setVectorZero(T &vec)
void setZero(ShapeMatrices< T_N, T_DNDR, T_J, T_DNDX > &shape, ShapeDataFieldType< ShapeMatrixType::N >)
std::ostream & operator<<(std::ostream &os, LocalToGlobalIndexMap const &map)
Coordinates mapping matrices at particular location.
JacobianType invJ
Inverse matrix of the Jacobian.
ShapeType N
Vector of shape functions, N(r)
double detJ
Determinant of the Jacobian.
JacobianType J
Jacobian matrix, J=dx/dr.
void write(std::ostream &out) const
void setZero()
reset all data with zero