OpenFAST
Wind turbine multiphysics simulator
mapapi.h
1 /****************************************************************
2  * Copyright (C) 2014 mdm *
3  * map[dot]plus[dot]plus[dot]help[at]gmail *
4  * *
5  * Licensed to the Apache Software Foundation (ASF) under one *
6  * or more contributor license agreements. See the NOTICE file *
7  * distributed with this work for additional information *
8  * regarding copyright ownership. The ASF licenses this file *
9  * to you under the Apache License, Version 2.0 (the *
10  * "License"); you may not use this file except in compliance *
11  * with the License. You may obtain a copy of the License at *
12  * *
13  * http://www.apache.org/licenses/LICENSE-2.0 *
14  * *
15  * Unless required by applicable law or agreed to in writing, *
16  * software distributed under the License is distributed on an *
17  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
18  * KIND, either express or implied. See the License for the *
19  * specific language governing permissions and limitations *
20  * under the License. *
21  ****************************************************************/
22 
23 
24 #ifndef _MAPAPI_H
25 #define _MAPAPI_H
26 
27 
38 
39 
40 MAP_EXTERNCALL void set_init_to_null(MAP_InitInputType_t* init_type, char* map_msg, MAP_ERROR_CODE* ierr);
41 MAP_EXTERNCALL void map_add_cable_library_input_text(MAP_InitInputType_t* init_type);
42 MAP_EXTERNCALL void map_add_node_input_text(MAP_InitInputType_t* init_type);
43 MAP_EXTERNCALL void map_add_line_input_text(MAP_InitInputType_t* init_type);
44 MAP_EXTERNCALL void map_add_options_input_text(MAP_InitInputType_t* init_type);
45 MAP_EXTERNCALL double* map_plot_x_array(MAP_OtherStateType_t* other_type, int i, int num_points, char* map_msg, MAP_ERROR_CODE* ierr);
46 MAP_EXTERNCALL double* map_plot_y_array(MAP_OtherStateType_t* other_type, int i, int num_points, char* map_msg, MAP_ERROR_CODE* ierr);
47 MAP_EXTERNCALL double* map_plot_z_array(MAP_OtherStateType_t* other_type, int i, int num_points, char* map_msg, MAP_ERROR_CODE* ierr);
48 MAP_EXTERNCALL void map_plot_array_free(double* array) ;
49 MAP_EXTERNCALL double map_residual_function_length(MAP_OtherStateType_t* other_type, int i, char* map_msg, MAP_ERROR_CODE* ierr);
50 MAP_EXTERNCALL double map_residual_function_height(MAP_OtherStateType_t* other_type, int i, char* map_msg, MAP_ERROR_CODE* ierr);
51 MAP_EXTERNCALL double map_jacobian_dxdh(MAP_OtherStateType_t* other_type, int i, char* map_msg, MAP_ERROR_CODE* ierr);
52 MAP_EXTERNCALL double map_jacobian_dxdv(MAP_OtherStateType_t* other_type, int i, char* map_msg, MAP_ERROR_CODE* ierr);
53 MAP_EXTERNCALL double map_jacobian_dzdh(MAP_OtherStateType_t* other_type, int i, char* map_msg, MAP_ERROR_CODE* ierr);
54 MAP_EXTERNCALL double map_jacobian_dzdv(MAP_OtherStateType_t* other_type, int i, char* map_msg, MAP_ERROR_CODE* ierr);
55 MAP_EXTERNCALL int map_size_lines(MAP_OtherStateType_t* other_type, MAP_ERROR_CODE* ierr, char* map_msg);
56 
57 
66 MAP_EXTERNCALL int free_init_data (InitializationData* init, char* map_msg, MAP_ERROR_CODE* ierr);
67 
90 MAP_EXTERNCALL void map_set_sea_depth(MAP_ParameterType_t* p_type, const double depth);
91 
92 
115 MAP_EXTERNCALL void map_set_sea_density(MAP_ParameterType_t* p_type, const double rho);
116 
117 
140 MAP_EXTERNCALL void map_set_gravity(MAP_ParameterType_t* p_type, const double gravity);
141 
142 
154 MAP_EXTERNCALL void map_get_fairlead_force_2d(double* H, double* V, MAP_OtherStateType_t* other_type, int index, char* map_msg, MAP_ERROR_CODE* ierr);
155 
156 
169 MAP_EXTERNCALL void map_get_fairlead_force_3d(double* fx, double* fy, double* fz, MAP_OtherStateType_t* other_type, int index, char* map_msg, MAP_ERROR_CODE* ierr);
170 
171 
195 MAP_EXTERNCALL void map_offset_vessel(MAP_OtherStateType_t* other_type, MAP_InputType_t* u_type, double x, double y, double z, double phi, double the, double psi, char* map_msg, MAP_ERROR_CODE* ierr);
196 
197 
201 MAP_EXTERNCALL double** map_linearize_matrix(MAP_InputType_t* u_type, MAP_ParameterType_t* p_type, MAP_OtherStateType_t* other_type, MAP_OutputType_t* y_type, MAP_ConstraintStateType_t* z_type, double epsilon, MAP_ERROR_CODE* ierr, char* map_msg);
202 
203 
207 MAP_EXTERNCALL void map_free_linearize_matrix(double** array);
208 
212 MAP_EXTERNCALL double* map_f_op(MAP_InputType_t* u_type, MAP_ParameterType_t* p_type, MAP_OtherStateType_t* other_type, MAP_OutputType_t* y_type, MAP_ConstraintStateType_t* z_type, MAP_ERROR_CODE* ierr, char* map_msg);
213 
217 MAP_EXTERNCALL void map_free_f_op(double* array);
218 
219 
235 MAP_EXTERNCALL void map_init(MAP_InitInputType_t* init_type,
236  MAP_InputType_t* u_type,
237  MAP_ParameterType_t* p_type,
239  MAP_DiscreteStateType_t* xd_type,
241  MAP_OtherStateType_t* other_type,
242  MAP_OutputType_t* y_type,
243  MAP_InitOutputType_t* ioType,
244  MAP_ERROR_CODE* ierr,
245  char* map_msg);
246 
247 
271 MAP_EXTERNCALL void map_update_states(float t,
272  int interval,
273  MAP_InputType_t* u_type,
274  MAP_ParameterType_t* p_type,
276  MAP_DiscreteStateType_t* xd_type,
278  MAP_OtherStateType_t* other_type,
279  MAP_ERROR_CODE* ierr,
280  char* map_msg);
281 
282 
298 MAP_EXTERNCALL void map_calc_output(float t,
299  MAP_InputType_t* u_type,
300  MAP_ParameterType_t* p_type,
302  MAP_DiscreteStateType_t* xd_type,
304  MAP_OtherStateType_t* other_type,
305  MAP_OutputType_t* y_type,
306  MAP_ERROR_CODE* ierr,
307  char* map_msg);
308 
309 
323 MAP_EXTERNCALL void map_end(MAP_InputType_t* u_type,
324  MAP_ParameterType_t* p_type,
326  MAP_DiscreteStateType_t* xd_type,
328  MAP_OtherStateType_t* other_type,
329  MAP_OutputType_t* y_type,
330  MAP_ERROR_CODE* ierr,
331  char* map_msg);
332 
360 MAP_EXTERNCALL void map_set_summary_file_name(MAP_InitInputType_t* init_type, char* map_msg, MAP_ERROR_CODE* ierr);
361 
362 
393 MAP_EXTERNCALL void map_get_header_string(int* n, char** str_array, MAP_OtherStateType_t* other_type);
394 
395 
424 MAP_EXTERNCALL void map_get_unit_string(int* n, char** str_array ,MAP_OtherStateType_t* other_type);
425 
426 
441 MAP_EXTERNCALL InitializationData* MAP_InitInput_Create(char* map_msg, MAP_ERROR_CODE* ierr);
442 
443 
456 MAP_EXTERNCALL MAP_InitInputType_t* map_create_init_type(char* map_msg, MAP_ERROR_CODE* ierr);
457 
458 
473 MAP_EXTERNCALL Domain* MAP_OtherState_Create(char* map_msg, MAP_ERROR_CODE* ierr);
474 
475 
485 MAP_EXTERNCALL MAP_OtherStateType_t* map_create_other_type(char* map_msg, MAP_ERROR_CODE* ierr);
486 
487 
499 MAP_EXTERNCALL MAP_InitOutputType_t* map_create_initout_type(char* map_msg, MAP_ERROR_CODE* ierr);
500 
501 
513 MAP_EXTERNCALL MAP_InputType_t* map_create_input_type(char* map_msg, MAP_ERROR_CODE* ierr);
514 
515 
527 MAP_EXTERNCALL MAP_ParameterType_t* map_create_parameter_type(char* map_msg, MAP_ERROR_CODE* ierr);
528 
529 
541 MAP_EXTERNCALL MAP_ConstraintStateType_t* map_create_constraint_type(char* map_msg, MAP_ERROR_CODE* ierr);
542 
543 
555 MAP_EXTERNCALL MAP_OutputType_t* map_create_output_type(char* map_msg, MAP_ERROR_CODE* ierr);
556 
557 
566 MAP_EXTERNCALL MAP_ContinuousStateType_t* map_create_continuous_type(char* map_msg, MAP_ERROR_CODE* ierr);
567 
568 
569 #endif /* _MAPAPI_H */
MAP_EXTERNCALL void map_free_linearize_matrix(double **array)
lib.py_free_linearize_matrix.argtypes = [POINTER(POINTER(c_double))]
Definition: mapapi.c:560
MAP_EXTERNCALL MAP_ContinuousStateType_t * map_create_continuous_type(char *map_msg, MAP_ERROR_CODE *ierr)
Allocate MAP_ContinuousStateType_t.
Definition: mapapi.c:1353
Definition: MAP_Types.h:50
Definition: MAP_Types.h:99
MAP_EXTERNCALL double * map_f_op(MAP_InputType_t *u_type, MAP_ParameterType_t *p_type, MAP_OtherStateType_t *other_type, MAP_OutputType_t *y_type, MAP_ConstraintStateType_t *z_type, MAP_ERROR_CODE *ierr, char *map_msg)
lib.map_f_op.argtypes = [MapInput_Type, MapData_Type, MapOutnput_Type, c_double, c_char_p, POINTER(c_int)]
Definition: mapapi.c:384
MAP_EXTERNCALL MAP_ParameterType_t * map_create_parameter_type(char *map_msg, MAP_ERROR_CODE *ierr)
Allocate MAP_ParameterType_t.
Definition: mapapi.c:1308
Definition: MAP_Types.h:92
MAP_EXTERNCALL void map_update_states(float t, int interval, MAP_InputType_t *u_type, MAP_ParameterType_t *p_type, MAP_ContinuousStateType_t *x_type, MAP_DiscreteStateType_t *xd_type, MAP_ConstraintStateType_t *z_type, MAP_OtherStateType_t *other_type, MAP_ERROR_CODE *ierr, char *map_msg)
Solves the statics problem for the MSQS system and should be called at each time step or vessel displ...
Definition: mapapi.c:173
MAP_EXTERNCALL void map_set_summary_file_name(MAP_InitInputType_t *init_type, char *map_msg, MAP_ERROR_CODE *ierr)
Set the name out the MAP summary output file.
Definition: mapapi.c:1077
MAP_EXTERNCALL MAP_InputType_t * map_create_input_type(char *map_msg, MAP_ERROR_CODE *ierr)
Allocate MAP_InputType_t.
Definition: mapapi.c:1293
Definition: MAP_Types.h:23
MAP_EXTERNCALL void map_set_sea_density(MAP_ParameterType_t *p_type, const double rho)
Set the water density.
Definition: mapapi.c:1154
Definition: MAP_Types.h:46
Definition: MAP_Types.h:73
MAP_EXTERNCALL void map_free_f_op(double *array)
lib.map_free_f_op.argtypes = [POINTER(c_double)]
Definition: mapapi.c:439
MAP_EXTERNCALL void map_set_sea_depth(MAP_ParameterType_t *p_type, const double depth)
Set the water depth.
Definition: mapapi.c:1148
Definition: MAP_Types.h:36
MAP_EXTERNCALL InitializationData * MAP_InitInput_Create(char *map_msg, MAP_ERROR_CODE *ierr)
Allocate InitializationData.
Definition: mapapi.c:1214
MAP_EXTERNCALL void map_set_gravity(MAP_ParameterType_t *p_type, const double gravity)
Set the gravitational constant.
Definition: mapapi.c:1160
MAP_EXTERNCALL double ** map_linearize_matrix(MAP_InputType_t *u_type, MAP_ParameterType_t *p_type, MAP_OtherStateType_t *other_type, MAP_OutputType_t *y_type, MAP_ConstraintStateType_t *z_type, double epsilon, MAP_ERROR_CODE *ierr, char *map_msg)
lib.linearize_matrix.argtypes = [MapInput_Type, MapData_Type, MapOutnput_Type, c_double, c_char_p, POINTER(c_int)]
Definition: mapapi.c:448
MAP_EXTERNCALL void map_get_header_string(int *n, char **str_array, MAP_OtherStateType_t *other_type)
Obtains the variable name array corresponding to the outputs selected in the MAP input file...
Definition: mapapi.c:1085
MAP_EXTERNCALL void set_init_to_null(MAP_InitInputType_t *init_type, char *map_msg, MAP_ERROR_CODE *ierr)
Fortran binding routine SUBROUTINE MAP_set_initinput_to_null(interf,msg,err) bind(C,name='set_init_to_null')
Definition: mapapi.c:1141
MAP_EXTERNCALL MAP_InitOutputType_t * map_create_initout_type(char *map_msg, MAP_ERROR_CODE *ierr)
Allocate MAP_InitOutputType_t.
Definition: mapapi.c:1278
MAP_EXTERNCALL void map_end(MAP_InputType_t *u_type, MAP_ParameterType_t *p_type, MAP_ContinuousStateType_t *x_type, MAP_DiscreteStateType_t *xd_type, MAP_ConstraintStateType_t *z_type, MAP_OtherStateType_t *other_type, MAP_OutputType_t *y_type, MAP_ERROR_CODE *ierr, char *map_msg)
Deallocates all memory.
Definition: mapapi.c:294
MAP_EXTERNCALL MAP_OtherStateType_t * map_create_other_type(char *map_msg, MAP_ERROR_CODE *ierr)
Allocate MAP_OtherStateType_t and Domain.
Definition: mapapi.c:1262
Definition: map.h:454
MAP_EXTERNCALL void map_get_fairlead_force_3d(double *fx, double *fy, double *fz, MAP_OtherStateType_t *other_type, int index, char *map_msg, MAP_ERROR_CODE *ierr)
Returns X, Y, and Z fairlead force in global reference frame.
Definition: mapapi.c:1049
MAP_EXTERNCALL void map_initialize_msqs_base(MAP_InputType_t *u_type, MAP_ParameterType_t *p_type, MAP_ContinuousStateType_t *x_type, MAP_ConstraintStateType_t *z_type, MAP_OtherStateType_t *other_type, MAP_OutputType_t *y_type, MAP_InitOutputType_t *io_type)
Initalizes all MAP base types (including some internal state)
Definition: mapapi.c:37
MAP_EXTERNCALL MAP_InitInputType_t * map_create_init_type(char *map_msg, MAP_ERROR_CODE *ierr)
Allocate MAP_InitInputType_t and InitializationData.
Definition: mapapi.c:1230
MAP_EXTERNCALL void map_get_fairlead_force_2d(double *H, double *V, MAP_OtherStateType_t *other_type, int index, char *map_msg, MAP_ERROR_CODE *ierr)
Returns vertical and horizontal fairlead force along line plane.
Definition: mapapi.c:1030
MAP_EXTERNCALL Domain * MAP_OtherState_Create(char *map_msg, MAP_ERROR_CODE *ierr)
Allocate Domain.
Definition: mapapi.c:1247
MAP_EXTERNCALL void map_offset_vessel(MAP_OtherStateType_t *other_type, MAP_InputType_t *u_type, double x, double y, double z, double phi, double the, double psi, char *map_msg, MAP_ERROR_CODE *ierr)
call this in python: offset_vessel().argtypes = [MapData_Type, MapInput_Type, c_char_p, POINTER(c_int)] angles are radians
Definition: mapapi.c:332
MAP_EXTERNCALL int free_init_data(InitializationData *init_data, char *map_msg, MAP_ERROR_CODE *ierr)
Deallocates the memory space for the init structure.
Definition: mapapi.c:1368
MAP_EXTERNCALL MAP_OutputType_t * map_create_output_type(char *map_msg, MAP_ERROR_CODE *ierr)
Allocate MAP_OutputType_t.
Definition: mapapi.c:1338
Definition: MAP_Types.h:81
Definition: MAP_Types.h:54
MAP_EXTERNCALL void map_get_unit_string(int *n, char **str_array, MAP_OtherStateType_t *other_type)
Obtains the units of the outputs passed back to the calling program.
Definition: mapapi.c:1111
Definition: map.h:433
MAP_EXTERNCALL void map_calc_output(float t, MAP_InputType_t *u_type, MAP_ParameterType_t *p_type, MAP_ContinuousStateType_t *x_type, MAP_DiscreteStateType_t *xd_type, MAP_ConstraintStateType_t *z_type, MAP_OtherStateType_t *other_type, MAP_OutputType_t *y_type, MAP_ERROR_CODE *ierr, char *map_msg)
Retrieves the values after the statics problem is solved.
Definition: mapapi.c:232
MAP_EXTERNCALL void map_init(MAP_InitInputType_t *init_type, MAP_InputType_t *u_type, MAP_ParameterType_t *p_type, MAP_ContinuousStateType_t *x_type, MAP_DiscreteStateType_t *xd_type, MAP_ConstraintStateType_t *z_type, MAP_OtherStateType_t *other_type, MAP_OutputType_t *y_type, MAP_InitOutputType_t *io_type, MAP_ERROR_CODE *ierr, char *map_msg)
Initializes the MAP model and allocates memory.
Definition: mapapi.c:78
MAP_EXTERNCALL MAP_ConstraintStateType_t * map_create_constraint_type(char *map_msg, MAP_ERROR_CODE *ierr)
Allocate MAP_ConstraintType_t.
Definition: mapapi.c:1323