opm-simulators
flow_gpu.hpp
1 /*
2  This file is part of the Open Porous Media project (OPM).
3 
4  OPM is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  OPM is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with OPM. If not, see <http://www.gnu.org/licenses/>.
16 */
17 #ifndef FLOW_GPU_HPP
18 #define FLOW_GPU_HPP
19 
22 /*
23  This file extracts typetag declarations that must be present in both the .CU and .HIP
24  executables for Flow to avoid double maintenance.
25 */
26 
27 namespace Opm
28 {
29 
30 namespace Properties
31 {
32  namespace TTag
33  {
34  // FlowGasWaterEnergyProblemGPU is declared in FlowGasWaterEnergyTypeTag.hpp
35  // (InheritsFrom = FlowGasWaterEnergyProblem). The template below maps it
36  // to FlowGasWaterEnergyProblemGPUTrue<Storage> for GPU-storage variants.
37 
38  template <template <class> class Storage>
40  using InheritsFrom = std::tuple<FlowGasWaterEnergyProblemGPU>;
41  };
42 
43  template <template <class> class Storage>
46  };
47  } // namespace TTag
48 
49  template <class TypeTag>
50  struct RunAssemblyOnGpu<TypeTag, TTag::FlowGasWaterEnergyProblemGPU> {
51  static constexpr bool value = true;
52  };
53 
54  template <class TypeTag>
55  struct Scalar<TypeTag, TTag::FlowGasWaterEnergyProblemGPU> {
56  using type = double;
57  };
58 
59  template <class TypeTag>
60  struct GpuFIBlackOilModel<TypeTag, TTag::FlowGasWaterEnergyProblemGPU> {
62  };
63 
64  template <class TypeTag, template <class> class Storage>
65  struct FluidSystem<TypeTag, TTag::FlowGasWaterEnergyProblemGPUTrue<Storage>> {
66  using type = Opm::
67  BlackOilFluidSystemNonStatic<double, Opm::BlackOilDefaultFluidSystemIndices, Storage>;
68  };
69 } // namespace Properties
70 
72 int flowGasWaterEnergyMainGPU(int argc, char** argv, bool outputCout, bool outputFiles);
73 
75 int flowGasWaterEnergyMainGPUStandalone(int argc, char** argv);
76 
77 } // namespace Opm
78 
79 #endif // FLOW_GPU_HPP
Structs needed for tpfalinearizer and its gpuparams struct extracted to be defined in one place that ...
Definition: blackoilbioeffectsmodules.hh:45
The discretization specific part of the intensive quantities.
Definition: fvbaseproperties.hh:148
The fluid systems including the information about the phases.
Definition: multiphasebaseproperties.hh:79
The blackoilmodel that is tailored for GPU compatibility.
Definition: fvbaseproperties.hh:143
int flowGasWaterEnergyMainGPU(int argc, char **argv, bool outputCout, bool outputFiles)
Main function used in flow binary.
int flowGasWaterEnergyMainGPUStandalone(int argc, char **argv)
Main function used in flow_gaswater binary.
Definition: fvbaseproperties.hh:50
Property to specify the type of scalar values.
Definition: basicproperties.hh:76
Shared TypeTag declaration for the gas+water+energy (CO2STORE-style) blackoil flow problem...
Definition: SimpleFIBlackOilModel.hpp:68
GPU-simulation variant: all physics properties are inherited from FlowGasWaterEnergyProblem; the GPU-...
Definition: FlowGasWaterEnergyTypeTag.hpp:50