MechContainer.hpp
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
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 2 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 Consult the COPYING file in the top-level source directory of this
19 module for the precise wording of the license and the list of
20 copyright holders.
21*/
26#ifndef OPM_MECH_CONTAINER_HPP
27#define OPM_MECH_CONTAINER_HPP
28
29#include <dune/common/fvector.hh>
30
31#include <opm/common/utility/SymmTensor.hpp>
32#include <opm/common/utility/VoigtArray.hpp>
33
34#include <array>
35#include <cstddef>
36#include <map>
37#include <string>
38#include <vector>
39
40namespace Opm {
41
42namespace data { class Solution; }
43
44template<class Scalar>
46{
47 using ScalarBuffer = std::vector<Scalar>;
48
49public:
50 void allocate(const std::size_t bufferSize,
51 std::map<std::string, int>& rstKeywords);
52
53 void assignDisplacement(const unsigned globalDofIdx,
54 const Dune::FieldVector<Scalar,3>& disp);
55
56 void assignDelStress(const unsigned globalDofIdx,
57 const SymmTensor<Scalar>& delStress);
58
59 void assignPotentialForces(const unsigned globalDofIdx,
60 const Scalar force,
61 const Scalar pressForce,
62 const Scalar tempForce);
63
64 void assignFracStress(const unsigned globalDofIdx,
65 const SymmTensor<Scalar>& fracStress);
66
67 void assignLinStress(const unsigned globalDofIdx,
68 const SymmTensor<Scalar>& linStress);
69
70 void assignStrain(const unsigned globalDofIdx,
71 const SymmTensor<Scalar>& strain);
72
73 void assignStress(const unsigned globalDofIdx,
74 const SymmTensor<Scalar>& stress);
75
76 void outputRestart(data::Solution& sol);
77
78 bool allocated() const
79 { return allocated_; }
80
81private:
82 bool allocated_ = false;
83 ScalarBuffer potentialForce_;
84 ScalarBuffer potentialPressForce_;
85 ScalarBuffer potentialTempForce_;
86
87 std::array<ScalarBuffer,3> disp_;
88 VoigtArray<Scalar> delstress_;
89 VoigtArray<Scalar> fracstress_;
90 VoigtArray<Scalar> linstress_;
91 VoigtArray<Scalar> strain_;
92 VoigtArray<Scalar> stress_;
93};
94
95} // namespace Opm
96
97#endif // OPM_MECH_CONTAINER_HPP
Definition: MechContainer.hpp:46
void outputRestart(data::Solution &sol)
void assignDelStress(const unsigned globalDofIdx, const SymmTensor< Scalar > &delStress)
bool allocated() const
Definition: MechContainer.hpp:78
void assignFracStress(const unsigned globalDofIdx, const SymmTensor< Scalar > &fracStress)
void assignLinStress(const unsigned globalDofIdx, const SymmTensor< Scalar > &linStress)
void assignDisplacement(const unsigned globalDofIdx, const Dune::FieldVector< Scalar, 3 > &disp)
void assignStrain(const unsigned globalDofIdx, const SymmTensor< Scalar > &strain)
void allocate(const std::size_t bufferSize, std::map< std::string, int > &rstKeywords)
void assignPotentialForces(const unsigned globalDofIdx, const Scalar force, const Scalar pressForce, const Scalar tempForce)
void assignStress(const unsigned globalDofIdx, const SymmTensor< Scalar > &stress)
Definition: blackoilbioeffectsmodules.hh:45