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 t_max;
18  int abort_error_level;
19  bool end_early;
20  int num_outs;
21  char channel_names[MAXIMUM_OUTPUTS * CHANNEL_LENGTH + 1];
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_array is a 1D vector for the values from a single step
33  // output_values is a 2D array for the values from all steps in the simulation
34  std::vector<double> output_array;
35  double **output_values;
36 
37  public:
38 
39  // Constructor
40  FastLibAPI(std::string input_file);
41 
42  // Destructor
43  ~FastLibAPI();
44 
45  bool fatal_error(int error_status);
46  void fast_init();
47  void fast_sim();
48  void fast_deinit();
49  void fast_run();
50  int total_time_steps();
51  std::string output_channel_names();
52  void get_hub_position(float *absolute_position, float *rotational_velocity, double *orientation_dcm);
53 };
54 
55 #endif
Definition: FastLibAPI.h:9