OpenFAST
Wind turbine multiphysics simulator
FastLibAPI.h
1 #ifndef FastLibAPI_h
2 #define FastLibAPI_h
3 
4 #include "FAST_Library.h"
5 #include <string>
6 #include <stdlib.h>
7 #include <vector>
8 
9 class FastLibAPI {
10 
11  private:
12  std::string input_file_name;
13 
14  int n_turbines;
15  int i_turb;
16  double dt;
17  double dt_out;
18  double t_max;
19  int abort_error_level;
20  bool end_early;
21  int num_outs;
22  bool ended;
23 
24  // The inputs are meant to be from Simulink.
25  // If < NumFixedInputs, FAST_SetExternalInputs simply returns,
26  // but this behavior may change to an error
27  // MAKE THIS NumFixedInputs
28  int num_inputs;
29  double inp_array[NumFixedInputs] = {};
30 
31  // These arrays hold the outputs from OpenFAST
32  // output_values is a 2D array for the values from all steps in the simulation
33  std::vector<std::vector<double>> output_values;
34 
35  public:
36 
37  // Constructor
38  FastLibAPI(std::string input_file);
39 
40  // Destructor
41  ~FastLibAPI();
42 
43  bool fatal_error(int error_status);
44  void fast_init();
45  void fast_sim();
46  void fast_deinit();
47  void fast_run();
48  int total_time_steps();
49  int total_output_steps();
50  std::vector<std::string> output_channel_names;
51  void get_hub_position(float *absolute_position, float *rotational_velocity, double *orientation_dcm);
52 };
53 
54 #endif
Definition: FastLibAPI.h:9