/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
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
24{};
26{};
27
28inline constexpr int fast_strlen() { return 1025; }
29
30inline void exw_fast_output_redirect(char* /*unused*/) {}
31
32inline void
33FAST_AllocateTurbines(int* /*unused*/, int* /*unused*/, char* /*unused*/)
34{}
35inline void FAST_DeallocateTurbines(int* /*unused*/, char* /*unused*/) {}
36
38 int* /*unused*/, char* /*unused*/, int* /*unused*/, char* /*unused*/)
39{}
40
41inline void FAST_HubPosition(
42 int* /*unused*/,
43 float* /*unused*/,
44 float* /*unused*/,
45 double* /*unused*/,
46 int* /*unused*/,
47 char* /*unused*/)
48{}
49
50#if OPENFAST_VERSION_MAJOR == 4
51struct ExtInfw_InputType_t
52{};
53
54struct ExtInfw_OutputType_t
55{};
56
57inline void
58FAST_CFD_Solution0(int* /*unused*/, int* /*unused*/, char* /*unused*/)
59{}
60
61inline void FAST_CFD_Step(int* /*unused*/, int* /*unused*/, char* /*unused*/) {}
62
63inline void FAST_ExtInfw_Init(
64 int* /*unused*/,
65 double* /*unused*/,
66 const char* /*unused*/,
67 int* /*unused*/,
68 const char* /*unused*/,
69 int* /*unused*/,
70 int* /*unused*/,
71 int* /*unused*/,
72 float* /*unused*/,
73 float* /*unused*/,
74 int* /*unused*/,
75 int* /*unused*/,
76 float* /*unused*/,
77 int* /*unused*/,
78 double* /*unused*/,
79 int* /*unused*/,
80 int* /*unused*/,
81 int* /*unused*/,
82 int* /*unused*/,
83 int* /*unused*/,
84 OpFM_InputType* /*unused*/,
85 OpFM_OutputType* /*unused*/,
86 SC_DX_InputType* /*unused*/,
87 SC_DX_OutputType* /*unused*/,
88 int* /*unused*/,
89 char* /*unused*/)
90{}
91
92inline void FAST_ExtInfw_Restart(
93 int* /*unused*/,
94 char* /*unused*/,
95 int* /*unused*/,
96 double* /*unused*/,
97 int* /*unused*/,
98 int* /*unused*/,
99 int* /*unused*/,
100 int* /*unused*/,
101 OpFM_InputType* /*unused*/,
102 OpFM_OutputType* /*unused*/,
103 SC_DX_InputType* /*unused*/,
104 SC_DX_OutputType* /*unused*/,
105 int* /*unused*/,
106 char* /*unused*/)
107{}
108
109#else
111{};
112
114{};
115
116inline void
117FAST_OpFM_Solution0(int* /*unused*/, int* /*unused*/, char* /*unused*/)
118{}
119
120inline void FAST_OpFM_Step(int* /*unused*/, int* /*unused*/, char* /*unused*/)
121{}
122
123inline void FAST_OpFM_Init(
124 int* /*unused*/,
125 double* /*unused*/,
126 const char* /*unused*/,
127 int* /*unused*/,
128 int* /*unused*/,
129 int* /*unused*/,
130 int* /*unused*/,
131 float* /*unused*/,
132 float* /*unused*/,
133 int* /*unused*/,
134 int* /*unused*/,
135 float* /*unused*/,
136 int* /*unused*/,
137 double* /*unused*/,
138 int* /*unused*/,
139 int* /*unused*/,
140 int* /*unused*/,
141 OpFM_InputType* /*unused*/,
142 OpFM_OutputType* /*unused*/,
143 SC_DX_InputType* /*unused*/,
144 SC_DX_OutputType* /*unused*/,
145 int* /*unused*/,
146 char* /*unused*/)
147{}
148
150 int* /*unused*/,
151 char* /*unused*/,
152 int* /*unused*/,
153 double* /*unused*/,
154 int* /*unused*/,
155 int* /*unused*/,
156 int* /*unused*/,
157 OpFM_InputType* /*unused*/,
158 OpFM_OutputType* /*unused*/,
159 SC_DX_InputType* /*unused*/,
160 SC_DX_OutputType* /*unused*/,
161 int* /*unused*/,
162 char* /*unused*/)
163{}
164#endif
165
166#endif
167
168#if OPENFAST_VERSION_MAJOR == 4
169static constexpr auto& FAST_Solution0 = FAST_CFD_Solution0;
170static constexpr auto& FAST_Step = FAST_CFD_Step;
171using OfInputType = ExtInfw_InputType_t;
172using OfOutputType = ExtInfw_OutputType_t;
173#else
174static constexpr auto& FAST_Solution0 = FAST_OpFM_Solution0;
175static constexpr auto& FAST_Step = FAST_OpFM_Step;
178#endif
179
180} // namespace exw_fast
181
182#endif /* FAST_WRAPPER_H */
Definition fast_types.H:8
OpFM_OutputType OfOutputType
Definition fast_wrapper.H:177
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:123
void FAST_CreateCheckpoint(int *, char *, int *, char *)
Definition fast_wrapper.H:37
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:149
void exw_fast_output_redirect(char *)
Definition fast_wrapper.H:30
void FAST_OpFM_Solution0(int *, int *, char *)
Definition fast_wrapper.H:117
void FAST_DeallocateTurbines(int *, char *)
Definition fast_wrapper.H:35
static constexpr auto & FAST_Solution0
Definition fast_wrapper.H:174
void FAST_AllocateTurbines(int *, int *, char *)
Definition fast_wrapper.H:33
static constexpr auto & FAST_Step
Definition fast_wrapper.H:175
OpFM_InputType OfInputType
Definition fast_wrapper.H:176
constexpr int fast_strlen()
Definition fast_wrapper.H:28
void FAST_HubPosition(int *, float *, float *, double *, int *, char *)
Definition fast_wrapper.H:41
void FAST_OpFM_Step(int *, int *, char *)
Definition fast_wrapper.H:120
Definition fast_wrapper.H:111
Definition fast_wrapper.H:114
Definition fast_wrapper.H:24
Definition fast_wrapper.H:26