00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _green_api_h
00029 #define _green_api_h
00030
00031 #include "constants.h"
00032 #include "config.h"
00033 #include "stdarg.h"
00034
00035 #define boolean int
00036 #define true 1
00037 #define false 0
00038
00039 #define NOT_TIME_DEPENDENT false
00040 #define TIME_DEPENDENT true
00041
00042
00043 #ifdef __cplusplus
00044 extern "C" {
00045 #endif
00046
00047 typedef enum{
00048 LOAD_PLUGIN = 0,
00049 KERNEL_PLUGIN = 1,
00050 GREEN_PLUGIN = 2,
00051 DATAOUT_PLUGIN = 3,
00052 POSTPROCESS_PLUGIN = 4,
00053 LOADHISTORY_PLUGIN = 5,
00054 CRUSTALDECAY_PLUGIN = 6
00055 }PluginCategory;
00056
00057 typedef enum{
00058 X_FIELD = 0,
00059 Y_FIELD = 1,
00060 Z_FIELD = 2,
00061 ADD_FIELD = 3
00062 }FieldName;
00063
00064 typedef enum{
00065 ERROR_MSG = -1,
00066 NOERROR = 0
00067 }ExitCode;
00068
00069
00070 void crusde_error(const char* format, ...);
00071 void crusde_debug(const char* format, ...);
00072 void crusde_warning(const char* format, ...);
00073 void crusde_info(const char* format, ...);
00074
00075 double* crusde_register_param_double(const char* param_name, PluginCategory);
00076 double* crusde_register_optional_param_double(const char* param_name, PluginCategory, double);
00077
00078
00079
00080 char** crusde_register_param_string(const char* param_name, PluginCategory);
00081 char** crusde_register_optional_param_string(const char* param_name, PluginCategory, char*);
00082
00083 void crusde_register_output_field(int* position, FieldName);
00084
00085 int crusde_get_size_x();
00086 int crusde_get_size_y();
00087 int crusde_get_size_t();
00088 int crusde_get_gridsize();
00089 int crusde_get_min_x();
00090 int crusde_get_min_y();
00091 int crusde_get_dimensions();
00092 int crusde_get_displacement_dimensions();
00093 int crusde_model_time();
00094 int crusde_get_timesteps();
00095 int crusde_model_step();
00096 int crusde_stepsize();
00097 int crusde_get_x_index();
00098 int crusde_get_y_index();
00099 int crusde_get_z_index();
00100
00101 const char* crusde_get_observation_file();
00102 const char* crusde_get_out_file();
00103
00104 int crusde_get_green_at(double** res, int x, int y);
00105
00106 double crusde_get_load_at(int x, int y);
00107 double crusde_get_load_history_at(int t);
00108 double crusde_get_crustal_decay_at(int t);
00109
00110 void crusde_set_result(double**);
00111 double** crusde_get_result();
00112 void crusde_set_quadrant(int);
00113 int crusde_get_quadrant();
00114
00115 void crusde_exit(ExitCode code);
00116
00117 int crusde_get_current_load_component();
00118 void crusde_set_current_load_component(int);
00119 int crusde_get_number_of_loads();
00120
00121 void crusde_set_operator_space(int, int);
00122 void crusde_get_operator_space(int*, int*);
00123
00124 boolean crusde_crustal_decay_given();
00125 boolean crusde_load_history_given();
00126
00127
00128
00129 green_exec_function crusde_request_green_plugin(char* plugin);
00130 load_exec_function crusde_request_load_plugin(char* plugin);
00131 run_function crusde_request_kernel_plugin(char* plugin);
00132 run_function crusde_request_postprocessor_plugin(char* plugin);
00133 loadhistory_exec_function crusde_request_loadhistory_plugin(char* plugin);
00134 crustaldecay_exec_function crusde_request_crustaldecay_plugin(char* plugin);
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146 #ifdef __cplusplus
00147 }
00148 #endif
00149
00150 #endif // _green_api_h