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 
209 
225 MAP_EXTERNCALL void map_init(MAP_InitInputType_t* init_type,
226  MAP_InputType_t* u_type,
227  MAP_ParameterType_t* p_type,
229  MAP_DiscreteStateType_t* xd_type,
231  MAP_OtherStateType_t* other_type,
232  MAP_OutputType_t* y_type,
233  MAP_InitOutputType_t* ioType,
234  MAP_ERROR_CODE* ierr,
235  char* map_msg);
236 
237 
261 MAP_EXTERNCALL void map_update_states(float t,
262  int interval,
263  MAP_InputType_t* u_type,
264  MAP_ParameterType_t* p_type,
266  MAP_DiscreteStateType_t* xd_type,
268  MAP_OtherStateType_t* other_type,
269  MAP_ERROR_CODE* ierr,
270  char* map_msg);
271 
272 
288 MAP_EXTERNCALL void map_calc_output(float t,
289  MAP_InputType_t* u_type,
290  MAP_ParameterType_t* p_type,
292  MAP_DiscreteStateType_t* xd_type,
294  MAP_OtherStateType_t* other_type,
295  MAP_OutputType_t* y_type,
296  MAP_ERROR_CODE* ierr,
297  char* map_msg);
298 
299 
313 MAP_EXTERNCALL void map_end(MAP_InputType_t* u_type,
314  MAP_ParameterType_t* p_type,
316  MAP_DiscreteStateType_t* xd_type,
318  MAP_OtherStateType_t* other_type,
319  MAP_OutputType_t* y_type,
320  MAP_ERROR_CODE* ierr,
321  char* map_msg);
322 
350 MAP_EXTERNCALL void map_set_summary_file_name(MAP_InitInputType_t* init_type, char* map_msg, MAP_ERROR_CODE* ierr);
351 
352 
383 MAP_EXTERNCALL void map_get_header_string(int* n, char** str_array, MAP_OtherStateType_t* other_type);
384 
385 
414 MAP_EXTERNCALL void map_get_unit_string(int* n, char** str_array ,MAP_OtherStateType_t* other_type);
415 
416 
431 MAP_EXTERNCALL InitializationData* MAP_InitInput_Create(char* map_msg, MAP_ERROR_CODE* ierr);
432 
433 
446 MAP_EXTERNCALL MAP_InitInputType_t* map_create_init_type(char* map_msg, MAP_ERROR_CODE* ierr);
447 
448 
463 MAP_EXTERNCALL Domain* MAP_OtherState_Create(char* map_msg, MAP_ERROR_CODE* ierr);
464 
465 
475 MAP_EXTERNCALL MAP_OtherStateType_t* map_create_other_type(char* map_msg, MAP_ERROR_CODE* ierr);
476 
477 
489 MAP_EXTERNCALL MAP_InitOutputType_t* map_create_initout_type(char* map_msg, MAP_ERROR_CODE* ierr);
490 
491 
503 MAP_EXTERNCALL MAP_InputType_t* map_create_input_type(char* map_msg, MAP_ERROR_CODE* ierr);
504 
505 
517 MAP_EXTERNCALL MAP_ParameterType_t* map_create_parameter_type(char* map_msg, MAP_ERROR_CODE* ierr);
518 
519 
531 MAP_EXTERNCALL MAP_ConstraintStateType_t* map_create_constraint_type(char* map_msg, MAP_ERROR_CODE* ierr);
532 
533 
545 MAP_EXTERNCALL MAP_OutputType_t* map_create_output_type(char* map_msg, MAP_ERROR_CODE* ierr);
546 
547 
556 MAP_EXTERNCALL MAP_ContinuousStateType_t* map_create_continuous_type(char* map_msg, MAP_ERROR_CODE* ierr);
557 
558 
559 #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:492
MAP_EXTERNCALL MAP_ContinuousStateType_t * map_create_continuous_type(char *map_msg, MAP_ERROR_CODE *ierr)
Allocate MAP_ContinuousStateType_t.
Definition: mapapi.c:1285
Definition: MAP_Types.h:50
Definition: MAP_Types.h:99
MAP_EXTERNCALL MAP_ParameterType_t * map_create_parameter_type(char *map_msg, MAP_ERROR_CODE *ierr)
Allocate MAP_ParameterType_t.
Definition: mapapi.c:1240
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:1009
MAP_EXTERNCALL MAP_InputType_t * map_create_input_type(char *map_msg, MAP_ERROR_CODE *ierr)
Allocate MAP_InputType_t.
Definition: mapapi.c:1225
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:1086
Definition: MAP_Types.h:46
Definition: MAP_Types.h:73
MAP_EXTERNCALL void map_set_sea_depth(MAP_ParameterType_t *p_type, const double depth)
Set the water depth.
Definition: mapapi.c:1080
Definition: MAP_Types.h:36
MAP_EXTERNCALL InitializationData * MAP_InitInput_Create(char *map_msg, MAP_ERROR_CODE *ierr)
Allocate InitializationData.
Definition: mapapi.c:1146
MAP_EXTERNCALL void map_set_gravity(MAP_ParameterType_t *p_type, const double gravity)
Set the gravitational constant.
Definition: mapapi.c:1092
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:381
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:1017
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:1073
MAP_EXTERNCALL MAP_InitOutputType_t * map_create_initout_type(char *map_msg, MAP_ERROR_CODE *ierr)
Allocate MAP_InitOutputType_t.
Definition: mapapi.c:1210
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:1194
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:981
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:1162
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:962
MAP_EXTERNCALL Domain * MAP_OtherState_Create(char *map_msg, MAP_ERROR_CODE *ierr)
Allocate Domain.
Definition: mapapi.c:1179
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:1300
MAP_EXTERNCALL MAP_OutputType_t * map_create_output_type(char *map_msg, MAP_ERROR_CODE *ierr)
Allocate MAP_OutputType_t.
Definition: mapapi.c:1270
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:1043
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:1255