wrapper.hpp
Go to the documentation of this file.
1 #ifndef OPM_VERTEQ_WRAPPER_HPP_INCLUDED
2 #define OPM_VERTEQ_WRAPPER_HPP_INCLUDED
3 
4 // Copyright (C) 2013 Uni Research AS
5 // This file is licensed under the GNU General Public License v3.0
6 
7 #include <vector>
8 #include <memory> // unique_ptr
9 
10 #ifndef OPM_VERTEQ_VISIBILITY_HPP_INCLUDED
12 #endif /* OPM_VERTEQ_VISIBILITY_HPP_INCLUDED */
13 
14 #ifndef OPM_VERTEQ_OPMFWD_HPP_INCLUDED
15 #include <opm/verteq/opmfwd.hpp>
16 #endif /* OPM_VERTEQ_OPMFWD_HPP_INCLUDED */
17 
18 #ifndef OPM_VERTEQ_SIMULATOR_HPP_INCLUDED
19 #include <opm/verteq/simulator.hpp>
20 #endif /* OPM_VERTEQ_SIMULATOR_HPP_INCLUDED */
21 
22 namespace Opm {
23 
24 // forward declaration
25 class VertEq;
26 
40 protected:
58  std::unique_ptr <Simulator> underlaying,
59  const parameter::ParameterGroup& param,
60  const UnstructuredGrid& grid,
61  const IncompPropertiesInterface& props,
62  const RockCompressibility* rock_comp_props,
63  WellsManager& wells_manager,
64  const std::vector<double>& src,
65  const FlowBoundaryConditions* bcs,
66  LinearSolverInterface& linsolver,
67  const double* gravity);
68 public:
72  virtual ~VertEqWrapperBase ();
73 
85  virtual SimulatorReport run(
86  SimulatorTimer& timer,
87  TwophaseState& state,
88  WellState& well_state);
89 
98  Event& timestep_completed ();
99 
108  void sync ();
109 
110 private:
111  // underlaying simulator to use for 2D
112  std::unique_ptr <Simulator> sim;
113 
114  // vertical equilibrium model
115  VertEq* ve;
116 
117  // list of translated wells
118  WellsManager* wells_mgr;
119 
120  // list of handlers for timestep notifications
121  std::unique_ptr <EventSource> timestep_callbacks;
122 
123  // current state of any simulation we are doing
124  TwophaseState* fineState;
125  TwophaseState* coarseState;
126 
127  // flag that determines whether we have synced or not
128  bool syncDone;
129  void resetSyncFlag ();
130 };
131 
144 template <typename SimulatorType>
159  VertEqWrapper (const parameter::ParameterGroup& param,
160  const UnstructuredGrid& grid,
161  const IncompPropertiesInterface& props,
162  const RockCompressibility* rock_comp_props,
163  WellsManager& wells_manager,
164  const std::vector<double>& src,
165  const FlowBoundaryConditions* bcs,
166  LinearSolverInterface& linsolver,
167  const double* gravity)
168  : VertEqWrapperBase (std::unique_ptr <Simulator> (
169  new SimulatorAdapter <SimulatorType> ()),
170  param, grid, props, rock_comp_props, wells_manager,
171  src, bcs, linsolver, gravity) {
172  }
173 };
174 
175 } /* namespace Opm */
176 
177 #endif /* OPM_VERTEQ_WRAPPER_HPP_INCLUDED */
Vertical Equilibrium Upscaling.
Definition: verteq.hpp:45
Definition: simulator.hpp:107
Definition: opmfwd.hpp:15
Definition: simulator.hpp:31
#define OPM_VERTEQ_PUBLIC
Definition: exc.hpp:19
STL namespace.
Definition: wrapper.hpp:145
VertEqWrapper(const parameter::ParameterGroup &param, const UnstructuredGrid &grid, const IncompPropertiesInterface &props, const RockCompressibility *rock_comp_props, WellsManager &wells_manager, const std::vector< double > &src, const FlowBoundaryConditions *bcs, LinearSolverInterface &linsolver, const double *gravity)
Definition: wrapper.hpp:159
Definition: wrapper.hpp:39