/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}
10
11extern void exw_fast_output_redirect(char*);
12
13inline constexpr int fast_strlen() { return INTERFACE_STRING_LENGTH; }
14
15#else
16
17#define ErrID_None 0
18#define ErrID_Info 1
19#define ErrID_Warn 2
20#define ErrID_Severe 3
21#define ErrID_Fatal 4
22
23inline constexpr int fast_strlen() { return 1025; }
24
25inline void exw_fast_output_redirect(char* /*unused*/) {}
26
27inline void
28FAST_AllocateTurbines(int* /*unused*/, int* /*unused*/, char* /*unused*/)
29{}
30inline void FAST_DeallocateTurbines(int* /*unused*/, char* /*unused*/) {}
31
33 int* /*unused*/, char* /*unused*/, int* /*unused*/, char* /*unused*/)
34{}
35
36inline void FAST_HubPosition(
37 int* /*unused*/,
38 float* /*unused*/,
39 float* /*unused*/,
40 double* /*unused*/,
41 int* /*unused*/,
42 char* /*unused*/)
43{}
44
45#if OPENFAST_VERSION_MAJOR == 4
46struct ExtInfw_InputType_t
47{};
48
49struct ExtInfw_OutputType_t
50{};
51
52inline void
53FAST_CFD_Solution0(int* /*unused*/, int* /*unused*/, char* /*unused*/)
54{}
55
56inline void FAST_CFD_Step(int* /*unused*/, int* /*unused*/, char* /*unused*/) {}
57
58inline void FAST_ExtInfw_Init(
59 int* /*unused*/,
60 double* /*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 double* /*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
80inline void FAST_ExtInfw_Restart(
81 int* /*unused*/,
82 char* /*unused*/,
83 int* /*unused*/,
84 double* /*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
106inline void
107FAST_OpFM_Solution0(int* /*unused*/, int* /*unused*/, char* /*unused*/)
108{}
109
110inline void FAST_OpFM_Step(int* /*unused*/, int* /*unused*/, char* /*unused*/)
111{}
112
113inline void FAST_OpFM_Init(
114 int* /*unused*/,
115 double* /*unused*/,
116 const char* /*unused*/,
117 int* /*unused*/,
118 int* /*unused*/,
119 int* /*unused*/,
120 int* /*unused*/,
121 float* /*unused*/,
122 float* /*unused*/,
123 int* /*unused*/,
124 int* /*unused*/,
125 float* /*unused*/,
126 int* /*unused*/,
127 double* /*unused*/,
128 int* /*unused*/,
129 int* /*unused*/,
130 int* /*unused*/,
131 OpFM_InputType* /*unused*/,
132 OpFM_OutputType* /*unused*/,
133 SC_DX_InputType* /*unused*/,
134 SC_DX_OutputType* /*unused*/,
135 int* /*unused*/,
136 char* /*unused*/)
137{}
138
140 int* /*unused*/,
141 char* /*unused*/,
142 int* /*unused*/,
143 double* /*unused*/,
144 int* /*unused*/,
145 int* /*unused*/,
146 int* /*unused*/,
147 OpFM_InputType* /*unused*/,
148 OpFM_OutputType* /*unused*/,
149 SC_DX_InputType* /*unused*/,
150 SC_DX_OutputType* /*unused*/,
151 int* /*unused*/,
152 char* /*unused*/)
153{}
154#endif
155
156#endif
157
158#if OPENFAST_VERSION_MAJOR == 4
159static constexpr auto& FAST_Solution0 = FAST_CFD_Solution0;
160static constexpr auto& FAST_Step = FAST_CFD_Step;
161using OfInputType = ExtInfw_InputType_t;
162using OfOutputType = ExtInfw_OutputType_t;
163#else
164static constexpr auto& FAST_Solution0 = FAST_OpFM_Solution0;
165static constexpr auto& FAST_Step = FAST_OpFM_Step;
168#endif
169
170} // namespace exw_fast
171
172#endif /* FAST_WRAPPER_H */
Definition fast_wrapper.H:4
OpFM_OutputType OfOutputType
Definition fast_wrapper.H:167
void FAST_OpFM_Init(int *, double *, const char *, int *, int *, int *, int *, float *, float *, int *, int *, float *, int *, double *, int *, int *, int *, OpFM_InputType *, OpFM_OutputType *, SC_DX_InputType *, SC_DX_OutputType *, int *, char *)
Definition fast_wrapper.H:113
void FAST_CreateCheckpoint(int *, char *, int *, char *)
Definition fast_wrapper.H:32
void FAST_OpFM_Restart(int *, char *, int *, double *, int *, int *, int *, OpFM_InputType *, OpFM_OutputType *, SC_DX_InputType *, SC_DX_OutputType *, int *, char *)
Definition fast_wrapper.H:139
void exw_fast_output_redirect(char *)
Definition fast_wrapper.H:25
void FAST_OpFM_Solution0(int *, int *, char *)
Definition fast_wrapper.H:107
void FAST_DeallocateTurbines(int *, char *)
Definition fast_wrapper.H:30
static constexpr auto & FAST_Solution0
Definition fast_wrapper.H:164
void FAST_AllocateTurbines(int *, int *, char *)
Definition fast_wrapper.H:28
static constexpr auto & FAST_Step
Definition fast_wrapper.H:165
OpFM_InputType OfInputType
Definition fast_wrapper.H:166
constexpr int fast_strlen()
Definition fast_wrapper.H:23
void FAST_HubPosition(int *, float *, float *, double *, int *, char *)
Definition fast_wrapper.H:36
void FAST_OpFM_Step(int *, int *, char *)
Definition fast_wrapper.H:110
Definition fast_wrapper.H:96
Definition fast_wrapper.H:99
Definition fast_wrapper.H:102
Definition fast_wrapper.H:104