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
32
33#include <array>
34#include <cstddef>
35#include <map>
36#include <string>
37#include <vector>
38
39namespace Opm {
40
41namespace data { class Solution; }
42
43template<class Scalar>
45{
46 using ScalarBuffer = std::vector<Scalar>;
47
48public:
49 void allocate(const std::size_t bufferSize,
50 std::map<std::string, int>& rstKeywords);
51
52 void assignDisplacement(const unsigned globalDofIdx,
53 const Dune::FieldVector<Scalar,3>& disp);
54
55 void assignDelStress(const unsigned globalDofIdx,
56 const Dune::FieldVector<Scalar,6>& delStress);
57
58 void assignPotentialForces(const unsigned globalDofIdx,
59 const Scalar force,
60 const Scalar pressForce,
61 const Scalar tempForce);
62
63 void assignFracStress(const unsigned globalDofIdx,
64 const Dune::FieldVector<Scalar,6>& fracStress);
65
66 void assignLinStress(const unsigned globalDofIdx,
67 const Dune::FieldVector<Scalar,6>& linStress);
68
69 void assignStrain(const unsigned globalDofIdx,
70 const Dune::FieldVector<Scalar,6>& strain);
71
72 void assignStress(const unsigned globalDofIdx,
73 const Dune::FieldVector<Scalar,6>& stress);
74
75 void outputRestart(data::Solution& sol);
76
77 bool allocated() const
78 { return allocated_; }
79
80private:
81 bool allocated_ = false;
82 ScalarBuffer potentialForce_;
83 ScalarBuffer potentialPressForce_;
84 ScalarBuffer potentialTempForce_;
85
86 std::array<ScalarBuffer,3> disp_;
87 VoigtArray<Scalar> delstress_;
88 VoigtArray<Scalar> fracstress_;
89 VoigtArray<Scalar> linstress_;
90 VoigtArray<Scalar> strain_;
91 VoigtArray<Scalar> stress_;
92};
93
94} // namespace Opm
95
96#endif // OPM_MECH_CONTAINER_HPP
Definition: MechContainer.hpp:45
void outputRestart(data::Solution &sol)
bool allocated() const
Definition: MechContainer.hpp:77
void assignStrain(const unsigned globalDofIdx, const Dune::FieldVector< Scalar, 6 > &strain)
void assignLinStress(const unsigned globalDofIdx, const Dune::FieldVector< Scalar, 6 > &linStress)
void assignDisplacement(const unsigned globalDofIdx, const Dune::FieldVector< Scalar, 3 > &disp)
void assignFracStress(const unsigned globalDofIdx, const Dune::FieldVector< Scalar, 6 > &fracStress)
void assignDelStress(const unsigned globalDofIdx, const Dune::FieldVector< Scalar, 6 > &delStress)
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 Dune::FieldVector< Scalar, 6 > &stress)
Definition: VoigtArray.hpp:95
Definition: blackoilboundaryratevector.hh:39