/* Copyright 2025 Equinor ASA This file is part of the Open Porous Media Project (OPM). OPM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OPM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OPM. If not, see . */ #ifndef OPM_UTIL_SYMM_TENSOR_HPP #define OPM_UTIL_SYMM_TENSOR_HPP #include #include #include namespace Opm { template class SymmTensor : public VoigtContainer { public: using field_type = T; SymmTensor() = default; SymmTensor(std::initializer_list value) : VoigtContainer(std::move(value)) {} void operator+=(const T data); void operator+=(const SymmTensor& data); void operator*=(const T data); SymmTensor& operator=(const T value); void reset(); T trace() const; T traction(const Dune::FieldVector& normal) const; }; template SymmTensor operator*(const T2 value, SymmTensor t1); template SymmTensor operator*(SymmTensor t1, const T2 value); template SymmTensor operator+(SymmTensor t1, const SymmTensor& t2); } // namespace Opm #endif // OPM_UTIL_SYMM_TENSOR_HPP