OpenFAST
Wind turbine multiphysics simulator
|
NWTC required functions necessary to hook MAP into FAST. More...
#include "map.h"
#include "maperror.h"
#include "MAP_Types.h"
#include "mapapi.h"
#include "lineroutines.h"
#include "freedata.h"
#include "mapinit.h"
#include "outputstream.h"
#include "numeric.h"
#include "jacobian.h"
#include "residual.h"
Functions | |
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) More... | |
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. More... | |
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 displacement. More... | |
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. More... | |
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. More... | |
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 More... | |
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)] | |
MAP_EXTERNCALL void | map_free_f_op (double *array) |
lib.map_free_f_op.argtypes = [POINTER(c_double)] | |
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)] | |
MAP_EXTERNCALL void | map_free_linearize_matrix (double **array) |
lib.py_free_linearize_matrix.argtypes = [POINTER(POINTER(c_double))] | |
MAP_EXTERNCALL double * | map_plot_x_array (MAP_OtherStateType_t *other_type, int i, int num_points, char *map_msg, MAP_ERROR_CODE *ierr) |
MAP_EXTERNCALL double * | map_plot_y_array (MAP_OtherStateType_t *other_type, int i, int num_points, char *map_msg, MAP_ERROR_CODE *ierr) |
MAP_EXTERNCALL double * | map_plot_z_array (MAP_OtherStateType_t *other_type, int i, int num_points, char *map_msg, MAP_ERROR_CODE *ierr) |
MAP_EXTERNCALL void | map_plot_array_free (double *array) |
MAP_EXTERNCALL double | map_residual_function_length (MAP_OtherStateType_t *other_type, int i, char *map_msg, MAP_ERROR_CODE *ierr) |
MAP_EXTERNCALL double | map_residual_function_height (MAP_OtherStateType_t *other_type, int i, char *map_msg, MAP_ERROR_CODE *ierr) |
MAP_EXTERNCALL double | map_jacobian_dxdh (MAP_OtherStateType_t *other_type, int i, char *map_msg, MAP_ERROR_CODE *ierr) |
MAP_EXTERNCALL double | map_jacobian_dxdv (MAP_OtherStateType_t *other_type, int i, char *map_msg, MAP_ERROR_CODE *ierr) |
MAP_EXTERNCALL double | map_jacobian_dzdh (MAP_OtherStateType_t *other_type, int i, char *map_msg, MAP_ERROR_CODE *ierr) |
MAP_EXTERNCALL double | map_jacobian_dzdv (MAP_OtherStateType_t *other_type, int i, char *map_msg, MAP_ERROR_CODE *ierr) |
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. More... | |
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. More... | |
MAP_EXTERNCALL int | map_size_lines (MAP_OtherStateType_t *other_type, MAP_ERROR_CODE *ierr, char *map_msg) |
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. More... | |
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. More... | |
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. More... | |
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') | |
MAP_EXTERNCALL void | map_set_sea_depth (MAP_ParameterType_t *p_type, const double depth) |
Set the water depth. More... | |
MAP_EXTERNCALL void | map_set_sea_density (MAP_ParameterType_t *p_type, const double rho) |
Set the water density. More... | |
MAP_EXTERNCALL void | map_set_gravity (MAP_ParameterType_t *p_type, const double gravity) |
Set the gravitational constant. More... | |
MAP_EXTERNCALL void | map_add_cable_library_input_text (MAP_InitInputType_t *init_type) |
MAP_EXTERNCALL void | map_add_node_input_text (MAP_InitInputType_t *init_type) |
MAP_EXTERNCALL void | map_add_line_input_text (MAP_InitInputType_t *init_type) |
MAP_EXTERNCALL void | map_add_options_input_text (MAP_InitInputType_t *init_type) |
MAP_EXTERNCALL InitializationData * | MAP_InitInput_Create (char *map_msg, MAP_ERROR_CODE *ierr) |
Allocate InitializationData. More... | |
MAP_EXTERNCALL MAP_InitInputType_t * | map_create_init_type (char *map_msg, MAP_ERROR_CODE *ierr) |
Allocate MAP_InitInputType_t and InitializationData. More... | |
MAP_EXTERNCALL Domain * | MAP_OtherState_Create (char *map_msg, MAP_ERROR_CODE *ierr) |
Allocate Domain. More... | |
MAP_EXTERNCALL MAP_OtherStateType_t * | map_create_other_type (char *map_msg, MAP_ERROR_CODE *ierr) |
Allocate MAP_OtherStateType_t and Domain. More... | |
MAP_EXTERNCALL MAP_InitOutputType_t * | map_create_initout_type (char *map_msg, MAP_ERROR_CODE *ierr) |
Allocate MAP_InitOutputType_t. More... | |
MAP_EXTERNCALL MAP_InputType_t * | map_create_input_type (char *map_msg, MAP_ERROR_CODE *ierr) |
Allocate MAP_InputType_t. More... | |
MAP_EXTERNCALL MAP_ParameterType_t * | map_create_parameter_type (char *map_msg, MAP_ERROR_CODE *ierr) |
Allocate MAP_ParameterType_t. More... | |
MAP_EXTERNCALL MAP_ConstraintStateType_t * | map_create_constraint_type (char *map_msg, MAP_ERROR_CODE *ierr) |
Allocate MAP_ConstraintType_t. More... | |
MAP_EXTERNCALL MAP_OutputType_t * | map_create_output_type (char *map_msg, MAP_ERROR_CODE *ierr) |
Allocate MAP_OutputType_t. More... | |
MAP_EXTERNCALL MAP_ContinuousStateType_t * | map_create_continuous_type (char *map_msg, MAP_ERROR_CODE *ierr) |
Allocate MAP_ContinuousStateType_t. More... | |
MAP_EXTERNCALL int | free_init_data (InitializationData *init_data, char *map_msg, MAP_ERROR_CODE *ierr) |
Deallocates the memory space for the init structure. More... | |
NWTC required functions necessary to hook MAP into FAST.
These functions provide the binding to solve constraints for subsequent time-steps.
MAP_EXTERNCALL int free_init_data | ( | InitializationData * | init, |
char * | map_msg, | ||
MAP_ERROR_CODE * | ierr | ||
) |
Deallocates the memory space for the init structure.
Should be called immediately after map_init()
init | MAP-native initialization data structure. This is distinct from the FAST-framework data structure |
map_msg | error string |
ierr | error code |
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.
This function should be called immediately after map_update_states. Can be called multiple times, but must be called between map_init() and map_end()
t | current (global) time |
u_type | input type, F2C FAST-native derived type. |
p_type | parameter type, F2C FAST-native derived type |
x_type | continuous-state type, F2C FAST-native derived type |
none | void type. It exists because MAP does not use discrete types (it would fill this place otherwise) |
z_type | constraint-state type, F2C FAST-native derived tpe |
other_type | other-state type, F2C FAST-native derived type. This is core structure that houses all internal MAP states that cannot be mapped to Fortran |
y_type | output type, F2C FAST-native derived type |
ierr | error code |
map_msg | error string |
MAP_EXTERNCALL MAP_ConstraintStateType_t* map_create_constraint_type | ( | char * | map_msg, |
MAP_ERROR_CODE * | ierr | ||
) |
Allocate MAP_ConstraintType_t.
Called to allocate memory for the constraint type. Constraints are variables solved through an algebraic equation. This is fairlead end forces (H and V) and node positions. This function is a necessary call for C and python, but can be ignored for Fortran if the MAP template is followed (that is, ISO C Binding is followed in the mapping of Fortran type and C structures).
map_msg,error | message |
ierr,error | code |
MAP_EXTERNCALL MAP_ContinuousStateType_t* map_create_continuous_type | ( | char * | map_msg, |
MAP_ERROR_CODE * | ierr | ||
) |
Allocate MAP_ContinuousStateType_t.
Called to allocate memory for the coninuous type. Not currently used, but it still is required to be allocated for FAST consistentcy.
map_msg,error | message |
ierr,error | code |
MAP_EXTERNCALL MAP_InitInputType_t* map_create_init_type | ( | char * | map_msg, |
MAP_ERROR_CODE * | ierr | ||
) |
Allocate MAP_InitInputType_t and InitializationData.
Called to allocate memory for the initialzation data for both the Fortran derived data and internal state data. Following sucessful allocation, initialize_init_type_to_null and initialize_init_data_to_null are both called to nullify data. If not called, memory errors results. This should the first function called when interacting with MAP. This is a necessary function for interaction with python and C based programs
map_msg,error | message |
ierr,error | code |
MAP_EXTERNCALL MAP_InitOutputType_t* map_create_initout_type | ( | char * | map_msg, |
MAP_ERROR_CODE * | ierr | ||
) |
Allocate MAP_InitOutputType_t.
Called to allocate memory for the initialization output type. The only obligation of this struct is to store the program version, necessary for FAST. This function is a necessary call for C and python, but can be ignored for Fortran if the MAP template is followed (that is, ISO C Binding is followed in the mapping of Fortran type and C structures).
map_msg,error | message |
ierr,error | code |
MAP_EXTERNCALL MAP_InputType_t* map_create_input_type | ( | char * | map_msg, |
MAP_ERROR_CODE * | ierr | ||
) |
Allocate MAP_InputType_t.
Called to allocate memory for the input type. The program inputs are the fairlead displacement due to the motion of the vessel the cable are attached to. This function is a necessary call for C and python, but can be ignored for Fortran if the MAP template is followed (that is, ISO C Binding is followed in the mapping of Fortran type and C structures).
map_msg,error | message |
ierr,error | code |
MAP_EXTERNCALL MAP_OtherStateType_t* map_create_other_type | ( | char * | map_msg, |
MAP_ERROR_CODE * | ierr | ||
) |
Allocate MAP_OtherStateType_t and Domain.
Called to allocate memory for the other states for both the Fortran derived data and internal state data. This is a necessary function for interaction with python and C based programs. The
map_msg,error | message |
ierr,error | code |
MAP_EXTERNCALL MAP_OutputType_t* map_create_output_type | ( | char * | map_msg, |
MAP_ERROR_CODE * | ierr | ||
) |
Allocate MAP_OutputType_t.
Called to allocate memory for the output type. IMPORTANT: this is different from the OutList. Output types are forces at the line fairlead only for lines connecting to the vessel. This function is a necessary call for C and python, but can be ignored for Fortran if the MAP template is followed (that is, ISO C Binding is followed in the mapping of Fortran type and C structures).
map_msg,error | message |
ierr,error | code |
MAP_EXTERNCALL MAP_ParameterType_t* map_create_parameter_type | ( | char * | map_msg, |
MAP_ERROR_CODE * | ierr | ||
) |
Allocate MAP_ParameterType_t.
Called to allocate memory for the parameter type. Parameters are time-invariant constants, such as gravitational constant. This function is a necessary call for C and python, but can be ignored for Fortran if the MAP template is followed (that is, ISO C Binding is followed in the mapping of Fortran type and C structures).
map_msg,error | message |
ierr,error | code |
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.
Must be called after map_init(). This is called once.
u_type | input type, F2C FAST-native derived type. |
p_type | parameter type, F2C FAST-native derived type |
x_type | continuous-state type, F2C FAST-native derived type |
none | void type. It exists because MAP does not use discrete types (it would fill this place otherwise) |
z_type | constraint-state type, F2C FAST-native derived tpe |
other_type | other-state type, F2C FAST-native derived type. This is core structure that houses all internal MAP states that cannot be mapped to Fortran |
y_type | output type, F2C FAST-native derived type |
ierr | error code |
map_msg | error string |
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.
H,reference | to horizontal fairlead force magnitude |
V,reference | to vertical fairlead force magnitude |
other_type,other | state type fortran derived |
index,line | number we are requesting the data for |
map_msg,error | message |
ierr,error | code |
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.
fx,reference | to horizontal X fairlead force in global frame |
fy,reference | to horizontal Y fairlead force in global frame |
fz,reference | to vertical Z fairlead force in global frame |
other_type,other | state type fortran derived |
index,line | number we are requesting the data for |
map_msg,error | message |
ierr,error | code |
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.
For example, str_array can be:
X[2] H[1] X[6] H[3] X[10] H[5] X[14] H[7]
n | number of header blocks. Should be proportional to the number of itms being output to the FAST output file |
str_array | the string being output. |
other_type | Fortran other state derived type |
Example Fortran usage:
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.
str_array can be:
[m] [N] [m] [N] [m] [N] [m] [N]
n | number of header blocks. Should be proportional to the number of itms being output to the FAST output file |
str_array | the string being output. |
other_type | Fortran other state derived type |
Example Fortran usage:
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 * | ioType, | ||
MAP_ERROR_CODE * | ierr, | ||
char * | map_msg | ||
) |
Initializes the MAP model and allocates memory.
Inconsistencies with the input file is reported here. This should only be called once.
init_type | initialization type, F2C FAST-native derived type |
u_type | input type, F2C FAST-native derived type. |
p_type | parameter type, F2C FAST-native derived type |
x_type | continuous-state type, F2C FAST-native derived type |
none | void type. It exists because MAP does not use discrete types (it would fill this place otherwise) |
z_type | constraint-state type, F2C FAST-native derived tpe |
other_type | other-state type, F2C FAST-native derived type. This is core structure that houses all internal MAP states that cannot be mapped to Fortran |
y_type | output type, F2C FAST-native derived type |
ioType | init-output types, F2C FAST-native derived type |
ierr | error code |
map_msg | error string |
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)
The idea is to set variables to zero and null to prevent seg-faults in the case of early program termination before initialization (MAP_Init) is fully complete. MAP_Init
el,opaque | object used in simclist |
MAP_EXTERNCALL InitializationData* MAP_InitInput_Create | ( | char * | map_msg, |
MAP_ERROR_CODE * | ierr | ||
) |
Allocate InitializationData.
Called by map_create_init_type to allocate memory for the iinitialization data type. The reason why a layer is added to the initialization data is due to Fortran interactions. It is straighforward to pass 1D character arrays between Fortran and C instead of 2D arrays. 2D arrays would make more sense since multiple lines from the MAP input file can be packed in one step. MAP_InitInputType_t in responsible for the 1D arrays. which are passed from Fortran to C. MAP then takes the 1D aray and packs it into InitializationData. This is used to subsequently initialize the model. Structure is free'd by calling MAP_InitInput_Delete.
map_msg,error | message |
ierr,error | code |
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
lib.map_offset_vessel.argtypes = [MapData_Type, MapInput_Type, c_double, c_double, c_double, c_double, c_double, c_double, c_char_p, POINTER(c_int)]
Angles are in degrees. This routine converts angles from deg to rad Per Fossen (Fossen, Thor I. Guidance and control of ocean vehicles. Vol. 199. No. 4. New York: Wiley, 1994), this matrix converts vector from the body frame to the global reference frame:
R = | cos(ψ)*cos(θ) cos(ψ)*sin(θ)*sin(φ) − sin(ψ)*cos(φ) cos(ψ)*sin(θ)*cos(φ) + sin(ψ)*sin(φ) | | sin(ψ)*cos(θ) sin(ψ)*sin(θ)*sin(φ) + cos(ψ)*cos(φ) sin(ψ)*sin(θ)*cos(φ) − cos(ψ)*sin(φ) | | −sin(θ) cos(θ)*sin(φ) cos(θ)*cos(φ) |
We need to invoke this procedure to move the vessel nodes with body rotations factored:
u_type = x + [R]*r ▲ ▲ ▲ | | | global | | global | local
MAP_EXTERNCALL Domain* MAP_OtherState_Create | ( | char * | map_msg, |
MAP_ERROR_CODE * | ierr | ||
) |
Allocate Domain.
Called by map_create_other_type to allocate memory for the internal state (model) data type. 'Other States', as FAST calls them, are states not fitting a regular role as a parameter, constraint, input, ect. Other states contain information on the line connectivity matrix, how reference to poperties for each line, buoyancy properties of the nodes, ect. Deallocated using interaction with python and C based programs. Structure is free'd by calling MAP_OtherState_Delete.
map_msg,error | message |
ierr,error | code |
MAP_EXTERNCALL void map_set_gravity | ( | MAP_ParameterType_t * | p_type, |
const double | gravity | ||
) |
Set the gravitational constant.
Should be called before map_init()
p_type | paramter type, native C struct MAP_ParameterType_t |
grtavity | gravitational acceleration [m/s^2] |
Example Fortran usage:
MAP_EXTERNCALL void map_set_sea_density | ( | MAP_ParameterType_t * | p_type, |
const double | rho | ||
) |
Set the water density.
Should be called before map_init()
p_type | paramter type, native C struct MAP_ParameterType_t |
rho | water density [kg/m^3] |
Example Fortran usage:
MAP_EXTERNCALL void map_set_sea_depth | ( | MAP_ParameterType_t * | p_type, |
const double | depth | ||
) |
Set the water depth.
Should be called before map_init()
p_type | paramter type, native C struct MAP_ParameterType_t |
depth | water depth [m] |
Example Fortran usage:
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.
Does not need to be called; the default summary file name is 'outlist.map.sum'.
init_type | initalization type, native C struct InitializationData_t |
map_msg | MAP error message |
ierr | MAP error code |
Example Fortran usage:
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 displacement.
Can be called multiple times, but must be called between map_init() and map_end() If the reference to u_type changes, then we have to update the location MAP internal states are pointing to. This is accomplished in the following code. The issue here is when this is called in Fortran:
CALL MAP_CopyInput(u(1), u_interp, MESH_NEWCOPY, ErrStat, ErrMsg)
u_interp is passed into into the argument for map_update_states(); however, the internal states are not pointing to data in u_interp. We address this below. Note that the initial reference for point_iter is set in set_node_list()
t | current (global) time |
interval | coupling interval |
u_type | input type, F2C FAST-native derived type. |
p_type | parameter type, F2C FAST-native derived type |
x_type | continuous-state type, F2C FAST-native derived type |
none | void type. It exists because MAP does not use discrete types (it would fill this place otherwise) |
z_type | constraint-state type, F2C FAST-native derived tpe |
other_type | other-state type, F2C FAST-native derived type. This is core structure that houses all internal MAP states that cannot be mapped to Fortran |
ierr | error code |
map_msg | error string |