My Project
Loading...
Searching...
No Matches
SymmTensor.hpp
1/*
2 Copyright 2025 Equinor ASA
3
4 This file is part of the Open Porous Media Project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef OPM_UTIL_SYMM_TENSOR_HPP
21#define OPM_UTIL_SYMM_TENSOR_HPP
22
23#include <dune/common/fvector.hh>
24
25#include <opm/simulators/utils/VoigtArray.hpp>
26
27#include <utility>
28
29namespace Opm {
30
31template<class T>
32class SymmTensor : public VoigtContainer<T>
33{
34public:
35 using field_type = T;
36
37 SymmTensor() = default;
38 SymmTensor(std::initializer_list<T> value)
39 : VoigtContainer<T>(std::move(value))
40 {}
41
42 void operator+=(const T data);
43 void operator+=(const SymmTensor<T>& data);
44
45 void operator*=(const T data);
46
47 SymmTensor<T>& operator=(const T value);
48
49 void reset();
50
51 T trace() const;
52 T traction(const Dune::FieldVector<T,3>& normal) const;
53};
54
55template<class T1, class T2>
56SymmTensor<T1> operator*(const T2 value, SymmTensor<T1> t1);
57template<class T1, class T2>
58SymmTensor<T1> operator*(SymmTensor<T1> t1, const T2 value);
59template<class T>
61
62} // namespace Opm
63
64#endif // OPM_UTIL_SYMM_TENSOR_HPP
Definition SymmTensor.hpp:33
Definition VoigtArray.hpp:40
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242