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