/home/runner/work/amr-wind/amr-wind/amr-wind/wind_energy/actuator/turbine/fast/fast_wrapper.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/wind_energy/actuator/turbine/fast/fast_wrapper.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
fast_wrapper.H
Go to the documentation of this file.
1#ifndef FAST_WRAPPER_H
2#define FAST_WRAPPER_H
3
4namespace exw_fast {
5
6#ifdef AMR_WIND_USE_OPENFAST
7extern "C" {
8#include "FAST_Library.h"
9#include "AMReX_REAL.H"
10
11using namespace amrex::literals;
12}
13
14extern void exw_fast_output_redirect(char*);
15
16constexpr int fast_strlen() { return INTERFACE_STRING_LENGTH; }
17
18#else
19
20#define ErrID_None 0
21#define ErrID_Info 1
22#define ErrID_Warn 2
23#define ErrID_Severe 3
24#define ErrID_Fatal 4
25
26constexpr int fast_strlen() { return 1025; }
27
28void exw_fast_output_redirect(char* /*unused*/) {}
29
30void FAST_AllocateTurbines(int* /*unused*/, int* /*unused*/, char* /*unused*/)
31{}
32void FAST_DeallocateTurbines(int* /*unused*/, char* /*unused*/) {}
33
35 int* /*unused*/, char* /*unused*/, int* /*unused*/, char* /*unused*/)
36{}
37
39 int* /*unused*/,
40 float* /*unused*/,
41 float* /*unused*/,
42 amrex::Real* /*unused*/,
43 int* /*unused*/,
44 char* /*unused*/)
45{}
46
47#if OPENFAST_VERSION_MAJOR == 4
48struct ExtInfw_InputType_t
49{};
50
51struct ExtInfw_OutputType_t
52{};
53
54void FAST_CFD_Solution0(int* /*unused*/, int* /*unused*/, char* /*unused*/) {}
55
56void FAST_CFD_Step(int* /*unused*/, int* /*unused*/, char* /*unused*/) {}
57
58void FAST_ExtInfw_Init(
59 int* /*unused*/,
60 amrex::Real* /*unused*/,
61 const char* /*unused*/,
62 int* /*unused*/,
63 const char* /*unused*/,
64 int* /*unused*/,
65 int* /*unused*/,
66 float* /*unused*/,
67 int* /*unused*/,
68 amrex::Real* /*unused*/,
69 int* /*unused*/,
70 int* /*unused*/,
71 int* /*unused*/,
72 int* /*unused*/,
73 int* /*unused*/,
74 OpFM_InputType* /*unused*/,
75 OpFM_OutputType* /*unused*/,
76 int* /*unused*/,
77 char* /*unused*/)
78{}
79
80void FAST_ExtInfw_Restart(
81 int* /*unused*/,
82 char* /*unused*/,
83 int* /*unused*/,
84 amrex::Real* /*unused*/,
85 int* /*unused*/,
86 int* /*unused*/,
87 int* /*unused*/,
88 OpFM_InputType* /*unused*/,
89 OpFM_OutputType* /*unused*/,
90 int* /*unused*/,
91 char* /*unused*/)
92{}
93
94#else
96{};
97
99{};
100
102{};
104{};
105
106void FAST_OpFM_Solution0(int* /*unused*/, int* /*unused*/, char* /*unused*/) {}
107
108void FAST_OpFM_Step(int* /*unused*/, int* /*unused*/, char* /*unused*/) {}
109
111 int* /*unused*/,
112 amrex::Real* /*unused*/,
113 const char* /*unused*/,
114 int* /*unused*/,
115 int* /*unused*/,
116 int* /*unused*/,
117 int* /*unused*/,
118 float* /*unused*/,
119 float* /*unused*/,
120 int* /*unused*/,
121 int* /*unused*/,
122 float* /*unused*/,
123 int* /*unused*/,
124 amrex::Real* /*unused*/,
125 int* /*unused*/,
126 int* /*unused*/,
127 int* /*unused*/,
128 OpFM_InputType* /*unused*/,
129 OpFM_OutputType* /*unused*/,
130 SC_DX_InputType* /*unused*/,
131 SC_DX_OutputType* /*unused*/,
132 int* /*unused*/,
133 char* /*unused*/)
134{}
135
137 int* /*unused*/,
138 char* /*unused*/,
139 int* /*unused*/,
140 amrex::Real* /*unused*/,
141 int* /*unused*/,
142 int* /*unused*/,
143 int* /*unused*/,
144 OpFM_InputType* /*unused*/,
145 OpFM_OutputType* /*unused*/,
146 SC_DX_InputType* /*unused*/,
147 SC_DX_OutputType* /*unused*/,
148 int* /*unused*/,
149 char* /*unused*/)
150{}
151#endif
152
153#endif
154
155#if OPENFAST_VERSION_MAJOR == 4
156static constexpr auto& FAST_Solution0 = FAST_CFD_Solution0;
157static constexpr auto& FAST_Step = FAST_CFD_Step;
158using OfInputType = ExtInfw_InputType_t;
159using OfOutputType = ExtInfw_OutputType_t;
160#else
161static constexpr auto& FAST_Solution0 = FAST_OpFM_Solution0;
162static constexpr auto& FAST_Step = FAST_OpFM_Step;
165#endif
166
167} // namespace exw_fast
168
169#endif /* FAST_WRAPPER_H */
Definition fast_wrapper.H:4
OpFM_OutputType OfOutputType
Definition fast_wrapper.H:164
void FAST_CreateCheckpoint(int *, char *, int *, char *)
Definition fast_wrapper.H:34
void exw_fast_output_redirect(char *)
Definition fast_wrapper.H:28
void FAST_OpFM_Restart(int *, char *, int *, amrex::Real *, int *, int *, int *, OpFM_InputType *, OpFM_OutputType *, SC_DX_InputType *, SC_DX_OutputType *, int *, char *)
Definition fast_wrapper.H:136
void FAST_OpFM_Init(int *, amrex::Real *, const char *, int *, int *, int *, int *, float *, float *, int *, int *, float *, int *, amrex::Real *, int *, int *, int *, OpFM_InputType *, OpFM_OutputType *, SC_DX_InputType *, SC_DX_OutputType *, int *, char *)
Definition fast_wrapper.H:110
void FAST_OpFM_Solution0(int *, int *, char *)
Definition fast_wrapper.H:106
void FAST_DeallocateTurbines(int *, char *)
Definition fast_wrapper.H:32
static constexpr auto & FAST_Solution0
Definition fast_wrapper.H:161
void FAST_AllocateTurbines(int *, int *, char *)
Definition fast_wrapper.H:30
static constexpr auto & FAST_Step
Definition fast_wrapper.H:162
OpFM_InputType OfInputType
Definition fast_wrapper.H:163
constexpr int fast_strlen()
Definition fast_wrapper.H:26
void FAST_OpFM_Step(int *, int *, char *)
Definition fast_wrapper.H:108
void FAST_HubPosition(int *, float *, float *, amrex::Real *, int *, char *)
Definition fast_wrapper.H:38
Definition fast_wrapper.H:96
Definition fast_wrapper.H:99
Definition fast_wrapper.H:102
Definition fast_wrapper.H:104