OGS
Tensor.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
8
#include "
MaterialLib/MPL/Property.h
"
9
10
namespace
MaterialPropertyLib
11
{
13
constexpr
int
tensorSize
(
int
dim)
14
{
15
if
(dim == 1)
16
{
17
return
3;
// Diagonal entries.
18
}
19
if
(dim == 2)
20
{
21
return
5;
// 2x2 matrix and the 3rd diagonal entry.
22
}
23
if
(dim == 3)
24
{
25
return
9;
// Full 3x3 matrix.
26
}
27
OGS_FATAL
(
"Tensor size for dimension {} is not defined."
, dim);
28
}
29
45
template
<
int
Dim>
46
using
Tensor
= Eigen::Matrix<double,
tensorSize
(Dim), 1>;
47
48
}
// namespace MaterialPropertyLib
OGS_FATAL
#define OGS_FATAL(...)
Definition
Error.h:19
Property.h
MaterialPropertyLib
Definition
ChemicalSolverInterface.h:98
MaterialPropertyLib::Tensor
Eigen::Matrix< double, tensorSize(Dim), 1 > Tensor
Definition
Tensor.h:46
MaterialPropertyLib::tensorSize
constexpr int tensorSize(int dim)
See Tensor type for details.
Definition
Tensor.h:13
MaterialLib
MPL
Utils
Tensor.h
Generated by
1.14.0