My Project
Loading...
Searching...
No Matches
BlackOilFluidSystemNonStatic.hpp
1
/*
2
Copyright 2025 Equinor ASA
3
4
This file is part of the Open Porous Media project (OPM).
5
OPM is free software: you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation, either version 3 of the License, or
8
(at your option) any later version.
9
10
OPM is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
14
15
You should have received a copy of the GNU General Public License
16
along with OPM. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
#ifndef OPM_BLACK_OIL_FLUID_SYSTEM_NONSTATIC_HPP
19
#define OPM_BLACK_OIL_FLUID_SYSTEM_NONSTATIC_HPP
20
21
#include <opm/common/utility/gpuDecorators.hpp>
22
23
24
// Here we need to define certain macros before including the macrotemplate file.
25
//
26
// The idea is in essence the following:
27
// 1) In the macrotemplate file, we have method declarations of the form
28
//
29
// `STATIC_OR_DEVICE void foo();`
30
//
31
// and member variable declarations of the form
32
//
33
// `STATIC_OR_NOTHING int bar;`
34
//
35
// 2) We want to be able to compile the same code for both the dynamic (non-static) and static
36
// versions of the fluid system. The dynamic version is used when the fluid system is accessed
37
// from the GPU, while the static version is used when the fluid system is accessed from the CPU.
38
// 3) We want to be able to compile the same code for both the dynamic and static versions of the
39
// fluid system, but with different method and member variable declarations.
40
//
41
// Furthermore, we need to specify the class name of the fluid system, which is different for the
42
// nonstatic and static versions of the fluid system. We also need to specify if we are compiling
43
// the static version of the fluid system, since we will define certain constructors and singleton
44
// functions only in the static or nonstatic case.
45
46
// Nonstatic class name
47
#define FLUIDSYSTEM_CLASSNAME_NONSTATIC BlackOilFluidSystemNonStatic
48
49
// Static class name
50
#define FLUIDSYSTEM_CLASSNAME_STATIC BlackOilFluidSystem
51
52
// Fluid system class name for the fluid system we are defining now, ie the nonstatic version
53
#define FLUIDSYSTEM_CLASSNAME BlackOilFluidSystemNonStatic
54
55
// We need to decorate the nonstatic member functions with the gpu decorators
56
#define STATIC_OR_DEVICE OPM_HOST_DEVICE
57
58
// Member variables need no decorators for the nonstatic version
59
#define STATIC_OR_NOTHING
60
61
62
// We need to forward-declare the static version of the fluid system, since we will
63
// add it as a friend to the nonstatic version.
64
namespace
Opm
65
{
66
template
<
class
Scalar,
67
class
IndexTraits,
68
template
<
typename
>
typename
Storage,
69
template
<
typename
>
typename
SmartPointer>
70
class
FLUIDSYSTEM_CLASSNAME_STATIC
;
71
}
72
73
// Include the macrotemplate file
74
#include <
opm/material/fluidsystems/BlackOilFluidSystem_macrotemplate.hpp
>
75
76
// Undefine the macros we defined above
77
#undef STATIC_OR_DEVICE
78
#undef STATIC_OR_NOTHING
79
#undef FLUIDSYSTEM_CLASSNAME_NONSTATIC
80
#undef FLUIDSYSTEM_CLASSNAME_STATIC
81
#undef FLUIDSYSTEM_CLASSNAME
82
#endif
BlackOilFluidSystem_macrotemplate.hpp
Opm::FLUIDSYSTEM_CLASSNAME_STATIC
Definition
BlackOilFluidSystemNonStatic.hpp:70
Opm
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition
Exceptions.hpp:30
opm
material
fluidsystems
BlackOilFluidSystemNonStatic.hpp
Generated by
1.9.8