OpenFAST
Wind turbine multiphysics simulator
mapinit.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 _MAPINIT_H
25 #define _MAPINIT_H
26 
27 
28 #include "map.h"
29 
30 
31 MAP_ERROR_CODE initialize_fortran_types(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* initout_type);
32 MAP_ERROR_CODE allocate_outlist(Domain* data, char* map_msg, MAP_ERROR_CODE* ierr);
33 
34 
41 size_t cable_library_meter(const void* el);
42 
43 
50 size_t node_meter(const void* el);
51 
52 
59 size_t cable_line_meter(const void* el);
60 
61 
68 size_t u_list_meter(const void *el);
69 
70 
78 void initialize_init_type_to_null(MAP_InitInputType_t* init_type);
79 
80 
89 void initialize_init_data_to_null(InitializationData* init_data);
90 
91 
98 void initialize_domain_to_null(Domain* domain);
99 
100 
109 void initialize_model_option_defaults(DomainOptions* options);
110 
111 
120 void initialize_inner_solve_data_defaults(InnerSolveAttributes* inner);
121 
122 
132 void initialize_vessel_to_null(Vessel* floater);
133 
134 
144 void initialize_outer_solve_data_defaults(OuterSolveAttributes* outer);
145 
146 
182 MAP_ERROR_CODE set_model_options_list(Domain* data, InitializationData* init, char* map_msg, MAP_ERROR_CODE* ierr);
183 
184 
198 MAP_ERROR_CODE check_help_flag(bstring list);
199 
200 
217 MAP_ERROR_CODE check_inner_f_tol_flag(struct bstrList* list, double* ftol);
218 
219 
237 MAP_ERROR_CODE check_inner_g_tol_flag(struct bstrList* list, double* gtol);
238 
239 
256 MAP_ERROR_CODE check_inner_x_tol_flag(struct bstrList* list, double* xtol);
257 
258 
273 MAP_ERROR_CODE check_inner_max_its_flag(struct bstrList* list, int* max_its);
274 
275 
290 MAP_ERROR_CODE check_outer_max_its_flag(struct bstrList* list, int* max_its);
291 
292 
309 MAP_ERROR_CODE check_outer_tol_flag(struct bstrList* list, double* outer_tol);
310 
311 
325 MAP_ERROR_CODE check_outer_epsilon_flag(struct bstrList* list, double* epsilon);
326 
327 
342 MAP_ERROR_CODE check_outer_bd_flag(struct bstrList* list, FdType* bd);
343 
358 MAP_ERROR_CODE check_outer_cd_flag(struct bstrList* list, FdType* cd);
359 
360 
375 MAP_ERROR_CODE check_outer_fd_flag(struct bstrList* list, FdType* fd);
376 
377 
405 MAP_ERROR_CODE check_pg_cooked_flag(struct bstrList* list, OuterSolveAttributes* solver);
406 
407 
419 MAP_ERROR_CODE check_powell_flag(struct bstrList* list, OuterSolveAttributes* solver);
420 
421 
434 MAP_ERROR_CODE check_integration_dt_flag(struct bstrList* list, double* dt);
435 
436 
449 MAP_ERROR_CODE check_kb_default_flag(struct bstrList* list, double* kb);
450 
451 
466 MAP_ERROR_CODE check_krylov_accelerator_flag(struct bstrList* list, OuterSolveAttributes* solver);
467 
468 
481 MAP_ERROR_CODE check_cb_default_flag(struct bstrList* list, double* cb);
482 
483 
498 MAP_ERROR_CODE check_wave_kinematics_flag(struct bstrList* list, bool* wave);
499 
500 
513 MAP_ERROR_CODE check_lm_model_flag(struct bstrList* list, bool* lm);
514 
515 
529 MAP_ERROR_CODE check_repeat_flag(struct bstrList* list, DomainOptions* options);
530 
531 
544 MAP_ERROR_CODE check_ref_position_flag(struct bstrList* list, Point* ref_position);
545 
546 
555 MAP_ERROR_CODE check_uncaught_flag(struct bstrList* list);
556 
557 
580 MAP_ERROR_CODE set_cable_library_list( Domain* domain, InitializationData* init_data, char* map_msg, MAP_ERROR_CODE* ierr );
581 
582 
590 MAP_ERROR_CODE set_library_diameter(bstring word, CableLibrary* library_ptr);
591 
592 
600 MAP_ERROR_CODE set_library_mass_density(bstring word, CableLibrary* library_ptr);
601 
602 
610 MAP_ERROR_CODE set_library_ea(bstring word, CableLibrary* library_ptr);
611 
612 
620 MAP_ERROR_CODE set_library_cb(bstring word, CableLibrary* library_ptr);
621 
622 
630 MAP_ERROR_CODE set_library_internal_damping(bstring word, CableLibrary* library_ptr);
631 
632 
640 MAP_ERROR_CODE set_library_added_mass_coefficient(bstring word, CableLibrary* library_ptr);
641 
642 
650 MAP_ERROR_CODE set_library_cross_flow_drag_coefficient(bstring word, CableLibrary* library_ptr);
651 
652 
660 MAP_ERROR_CODE set_library_tangent_drag_coefficient(bstring word, CableLibrary* library_ptr);
661 
662 
675 MAP_ERROR_CODE reset_cable_library(CableLibrary* new_cable_library);
676 
677 
678 MAP_ERROR_CODE repeat_nodes(Domain* domain, InitializationData* init_data, char* map_msg, MAP_ERROR_CODE* ierr);
679 MAP_ERROR_CODE set_node_list(const MAP_ParameterType_t* p_type, MAP_InputType_t* u_type, MAP_ConstraintStateType_t* z_type, MAP_OtherStateType_t* other_type, MAP_OutputType_t* y_type, Domain* domain, struct bstrList* node_input_string, char* map_msg, MAP_ERROR_CODE* ierr);
680 MAP_ERROR_CODE allocate_types_for_nodes(MAP_InputType_t* u_type, MAP_ConstraintStateType_t* z_type, MAP_OtherStateType_t* other_type, MAP_OutputType_t* y_type, Domain* domain, struct bstrList* node_input_string, char* map_msg, MAP_ERROR_CODE* ierr);
681 MAP_ERROR_CODE reset_node(Node* node_ptr);
682 MAP_ERROR_CODE expand_node_number(const int n_line, bstring line);
683 MAP_ERROR_CODE expand_node_type(const char* word, bstring line);
684 MAP_ERROR_CODE expand_node_position_x(double* x, const char* word);
685 MAP_ERROR_CODE expand_node_position_y(double* y, const char* word);
686 MAP_ERROR_CODE expand_node_position_z(Vector* position, const double angle, const double x, const double y, const char* word, bstring line);
687 MAP_ERROR_CODE expand_node_mass(const char* word, bstring line);
688 MAP_ERROR_CODE expand_node_buoyancy(const char* word, bstring line);
689 MAP_ERROR_CODE expand_node_force_x(double* fx, const char* word);
690 MAP_ERROR_CODE expand_node_force_y(double* fy, const char* word);
691 MAP_ERROR_CODE expand_node_force_z(Vector* force, const double angle, const double fx, const double fy, const char* word, bstring line);
692 
693 
694 MAP_ERROR_CODE repeat_lines(Domain* domain, InitializationData* init, char* map_msg, MAP_ERROR_CODE* ierr);
695 MAP_ERROR_CODE set_line_list(MAP_ConstraintStateType_t* z_type, Domain* domain, struct bstrList* line_input_string, char* map_msg, MAP_ERROR_CODE* ierr);
696 MAP_ERROR_CODE reset_line(Line* line_ptr);
697 MAP_ERROR_CODE expand_line_number(const int n_line, bstring line);
698 MAP_ERROR_CODE expand_line_property_name(const char* word, bstring line);
699 MAP_ERROR_CODE expand_line_length(const char* word, bstring line);
700 MAP_ERROR_CODE expand_line_anchor_number(const char* word, const int index, const int n, bstring line);
701 MAP_ERROR_CODE expand_line_fairlead_number(const char* word, const int index, const int n, bstring line);
702 MAP_ERROR_CODE expand_line_flag(const char* word, bstring line);
703 
704 
705 MAP_ERROR_CODE set_vartype_ptr(const char* unit, bstring alias, const int num, VarTypePtr* type, bstring property);
706 MAP_ERROR_CODE set_vartype(const char* unit, bstring alias, const int num, VarType* type, bstring property );
707 
708 
717 MAP_ERROR_CODE compare_integer_length(const int a, const int b);
718 
719 
720 // MAP_ERROR_CODE set_line_vartype(Line* line_ptr, const int i); @rm
721 MAP_ERROR_CODE associate_line_with_cable_property(Line* line_ptr, Domain* domain, const char* word, char* map_msg, MAP_ERROR_CODE* ierr);
722 MAP_ERROR_CODE associate_line_with_anchor_node(Line* line_ptr, Domain* domain, const int line_num, const char* word, char* map_msg, MAP_ERROR_CODE* ierr);
723 MAP_ERROR_CODE associate_line_with_fairlead_node(Line* line_ptr, Domain* domain, const int line_num, const char* word, char* map_msg, MAP_ERROR_CODE* ierr);
724 MAP_ERROR_CODE set_line_option_flags(struct bstrList* word, int* index, Line* line_ptr, char* map_msg, MAP_ERROR_CODE* ierr);
725 
726 
732 MAP_ERROR_CODE set_node_vartype(Node* node_ptr);
733 
734 
742 MAP_ERROR_CODE set_output_list(Domain* domain, MAP_InitOutputType_t* io_type, char* map_msg, MAP_ERROR_CODE* ierr);
743 
744 
751 MAP_ERROR_CODE set_vessel(Vessel* floater, const MAP_InputType_t* u_type, char* map_msg, MAP_ERROR_CODE* ierr);
752 
753 
762 MAP_ERROR_CODE set_vartype_float(const char* unit, const char* alias, const int num, VarType* type, const double value);
763 
764 
776 MAP_ERROR_CODE allocate_outer_solve_data(OuterSolveAttributes* ns, const int size, char* map_msg, MAP_ERROR_CODE* ierr);
777 
778 
794 MAP_ERROR_CODE initialize_cable_library_variables(Domain* domain, MAP_ParameterType_t* p_type, char* map_msg, MAP_ERROR_CODE* ierr);
795 
796 
833 MAP_ERROR_CODE first_solve(Domain* domain, MAP_ParameterType_t* p_type, MAP_InputType_t* u_type, MAP_ConstraintStateType_t* z_type, MAP_OtherStateType_t* other_type, MAP_OutputType_t* y_type, char* map_msg, MAP_ERROR_CODE* ierr);
834 
835 
846 MAP_ERROR_CODE is_numeric(const char* string);
847 
848 
862 void log_initialization_information(MAP_InitInputType_t* init_type, MAP_ParameterType_t* p_type, MAP_OutputType_t* y_type, MAP_OtherStateType_t* other_type, Domain* domain, char* map_msg, MAP_ERROR_CODE* ierr);
863 
864 
865 MAP_ERROR_CODE associate_vartype_ptr(VarTypePtr* type, double* arr, int index);
866 void copy_target_string(char* target, unsigned char* source);
867 MAP_ERROR_CODE initialize_external_applied_force(char* unit, char* alias, const int num, VarType* type, char const* property);
868 MAP_ERROR_CODE initialize_node_sum_force_ptr(char* unit, char* alias, const int num, VarTypePtr* type);
869 MAP_ERROR_CODE map_get_version(MAP_InitOutputType_t* io_type);
870 MAP_ERROR_CODE print_help_to_screen();
871 size_t vartype_meter(const void* el);
872 size_t vartype_ptr_meter(const void *el);
873 const char* remove_first_character(const char* string);
874 void print_machine_name_to_screen();
875 
878 MAP_ERROR_CODE associate_constraint_states(Domain* domain, MAP_ConstraintStateType_t* z_type);
879 
880 
881 #endif /* _INITIALIZATION_H */
Definition: MAP_Types.h:99
Definition: map.h:138
Definition: MAP_Types.h:92
Serves the same function as VarType, but treats value as a pointer.
Definition: map.h:128
Central point where all 'VESSEL' nodes can be displaced.
Definition: map.h:191
Definition: MAP_Types.h:23
Definition: MAP_Types.h:46
Definition: MAP_Types.h:73
Definition: MAP_Types.h:36
Defines cable properties for a line.
Definition: map.h:251
Definition: map.h:312
Definition: map.h:145
Definition: bstrlib.h:726
Fundamental MAP type.
Definition: map.h:112
Definition: map.h:454
Definition: map.h:266
Definition: map.h:366
Definition: map.h:393
Definition: MAP_Types.h:81
Definition: MAP_Types.h:54
Definition: map.h:422
Definition: bstrlib.h:80
Definition: map.h:433