SymmTensor.hpp
Go to the documentation of this file.
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
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>
57template<class T1, class T2>
59template<class T>
61
62} // namespace Opm
63
64#endif // OPM_UTIL_SYMM_TENSOR_HPP
Definition: SymmTensor.hpp:33
void operator+=(const T data)
void operator*=(const T data)
SymmTensor()=default
SymmTensor< T > & operator=(const T value)
void operator+=(const SymmTensor< T > &data)
T field_type
Definition: SymmTensor.hpp:35
SymmTensor(std::initializer_list< T > value)
Definition: SymmTensor.hpp:38
T trace() const
T traction(const Dune::FieldVector< T, 3 > &normal) const
Definition: VoigtArray.hpp:40
Definition: blackoilboundaryratevector.hh:39
SymmTensor< T1 > operator*(const T2 value, SymmTensor< T1 > t1)
SymmTensor< T > operator+(SymmTensor< T > t1, const SymmTensor< T > &t2)