Compat.hpp
1 /*
2  Copyright 2016 Statoil ASA
3  2016 IRIS
4 
5  This file is part of the Open Porous Media project (OPM).
6 
7  OPM is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  OPM is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with OPM. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef OPM_SIMULATORS_COMPAT_HPP
22 #define OPM_SIMULATORS_COMPAT_HPP
23 
24 #include <opm/output/data/Solution.hpp>
25 #include <opm/output/data/Wells.hpp>
26 #include <opm/core/props/BlackoilPhases.hpp>
27 #include <vector>
28 
29 namespace Opm {
30 
31  // Forward declarations
32  class SimulationDataContainer;
33  class WellStateFullyImplicitBlackoil;
34 
37  std::vector< double > destripe( const std::vector< double >& v,
38  size_t stride,
39  size_t offset );
40 
45  std::vector< double >& stripe( const std::vector< double >& v,
46  size_t stride,
47  size_t offset,
48  std::vector< double >& dst );
49 
55  data::Solution simToSolution( const SimulationDataContainer& reservoir,
56  const bool use_si_units,
57  PhaseUsage phases );
58 
62  void solutionToSim( const data::Solution& sol,
63  const std::map<std::string,std::vector<double> >& extra,
64  PhaseUsage phases,
65  SimulationDataContainer& state );
66 
69  void wellsToState( const data::Wells& wells,
70  PhaseUsage phases,
71  WellStateFullyImplicitBlackoil& state );
72 
73 }
74 
75 #endif //OPM_SIMULATORS_COMPAT_HPP
void wellsToState(const data::Wells &wells, PhaseUsage phases, WellStateFullyImplicitBlackoil &state)
Copies the following fields from wells into state.
Definition: Compat.cpp:221
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: AdditionalObjectDeleter.hpp:22
data::Solution simToSolution(const SimulationDataContainer &reservoir, const bool use_si_units, PhaseUsage phases)
Returns Solution with the following fields: PRESSURE, TEMP (unconditionally) SWAT, SGAS, RS, RV, SSOL (if appropriate fields present in input) If use_si_units is true, the fields will have the measure UnitSystem::measure::identity, and therefore not be converted to customary units (depending on family) upon output.
Definition: Compat.cpp:77
std::vector< double > & stripe(const std::vector< double > &v, size_t stride, size_t offset, std::vector< double > &dst)
Inject single data vector into striped data.
Definition: Compat.cpp:58
std::vector< double > destripe(const std::vector< double > &v, size_t stride, size_t offset)
Extract single data vector from striped data.
Definition: Compat.cpp:39
void solutionToSim(const data::Solution &sol, const std::map< std::string, std::vector< double > > &, PhaseUsage phases, SimulationDataContainer &state)
Copies the following fields from sol into state (all conditionally): PRESSURE, TEMP, SWAT, SGAS, RS, RV, SSOL Also handles extra data such as hysteresis parameters, SOMAX, etc.
Definition: Compat.cpp:134