crusde_api.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  * File:        ./crusde_api.h
00003  * Author:      Ronni Grapenthin, NORVULK & HU-BERLIN
00004  * Created:     20.02.2007
00005  * Licence:     GPLv2
00006  *
00007  * #########################################################################
00008  *
00009  * CrusDe, simulation framework for crustal deformation studies
00010  * Copyright (C) 2007 Ronni Grapenthin
00011  *
00012  * This program is free software; you can redistribute it and/or
00013  * modify it under the terms of the GNU General Public License
00014  * as published by the Free Software Foundation; version 2
00015  * of the License.
00016  *
00017  * This program is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  * GNU General Public License for more details.
00021  *
00022  * You should have received a copy of the GNU General Public License
00023  * along with this program; if not, write to the Free Software
00024  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00025  *
00026  ****************************************************************************/
00027 
00028 #ifndef _green_api_h    
00029 #define _green_api_h
00030 
00031 #include "constants.h"
00032 #include "config.h"
00033 
00034 #define boolean int             /* mimic boolean */
00035 #define true    1               /* mimic boolean true */
00036 #define false   0               /* mimic boolean false */
00037 
00038 #define NOT_TIME_DEPENDENT false
00039 #define TIME_DEPENDENT     true
00040 
00041 // 
00042 #ifdef __cplusplus
00043 extern "C" {
00044 #endif
00045 
00046 typedef enum{
00047         LOAD_PLUGIN = 0,
00048         KERNEL_PLUGIN = 1,
00049         GREEN_PLUGIN = 2,
00050         DATAOUT_PLUGIN = 3,
00051         POSTPROCESS_PLUGIN = 4,
00052         LOADHISTORY_PLUGIN = 5,
00053         CRUSTALDECAY_PLUGIN = 6
00054 }PluginCategory;
00055 
00056 typedef enum{
00057         X_FIELD = 0,
00058         Y_FIELD = 1,
00059         Z_FIELD = 2,
00060         ADD_FIELD = 3
00061 }FieldName;
00062 
00063 
00064 double*         crusde_register_param_double(const char* param_name, PluginCategory);
00065                                                         /*register double parameter with CrusDe*/
00066 char**      crusde_register_param_string(const char* param_name, PluginCategory);
00067                                                         /*register string parameter with CrusDe*/
00068 void            crusde_register_output_field(int* position, FieldName);
00069                                                         /*register output field with CrusDe*/
00070 int             crusde_get_size_x();            /*length of the region of interest*/
00071 int             crusde_get_size_y();            /*width of the region of interest*/
00072 int             crusde_get_size_t();            /*total number of time steps*/
00073 int             crusde_get_gridsize();          /*side length of a grid cell*/
00074 int             crusde_get_min_x();             /*westernmost coordinate of ROI*/
00075 int             crusde_get_min_y();             /*southernmost coordinate of ROI*/
00076 int             crusde_get_dimensions();                /*total number of output fields*/
00077 int             crusde_get_displacement_dimensions();   /*total number of spatial output fields (x,y,z)*/
00078 unsigned long int crusde_model_time();      /*current time step*/
00079 unsigned long int crusde_get_timesteps();   /* total number of timesteps*/
00080 int                     crusde_model_step();
00081 int             crusde_stepsize();              /*time increment with each model step*/
00082 int             crusde_get_x_index();           /*index of x-displacement values in result array*/
00083 int             crusde_get_y_index();           /*index of y-displacement values in result array*/
00084 int             crusde_get_z_index();           /*index of z-displacement values in result array*/
00085 
00086 const char*     crusde_get_observation_file();          /*filename of points to be observed (unused)*/
00087 const char*     crusde_get_out_file();                  /*filename for result output*/
00088 
00089 int             crusde_get_green_at(double** res, int x, int y);
00090                                                         /*green's function coefficients at x,y, t*/
00091 double          crusde_get_load_at(int x, int y);/*load at x,y,t*/
00092 double          crusde_get_load_history_at(int t);      /*load history at t*/
00093 double          crusde_get_crustal_decay_at(int t);     /*crustal decay at t*/
00094 
00095 void            crusde_set_result(double**);            /*return pointer to model results*/
00096 double**        crusde_get_result();                    /*pointer to model results*/
00097 void            crusde_set_quadrant(int);               /*get / set quadrant in coordinate system ...*/
00098 int                     crusde_get_quadrant();                  /*... in which green's function is calculated*/
00099 
00100 void            crusde_exit(int exitcode);              /*have CrusDe terminate gracefully*/
00101 
00102 int             crusde_get_current_load_component();    /*get the current load component id to work with it with somewhere*/
00103 void            crusde_set_current_load_component(int); /*set the current load component id that is globally worked with*/
00104 int         crusde_get_number_of_loads();
00105 
00106 void        crusde_set_operator_space(int, int);    /* operator can set the spatial dimensions it operates on */
00107 void        crusde_get_operator_space(int*, int*);  /* anybody else can retrieve this information */
00108 
00109 boolean         crusde_crustal_decay_given();                   /* tells whether the user set a crustal decay function for the current load*/
00110 boolean         crusde_load_history_given();                    /* tells whether the user set a load history function for the current load*/
00111 
00112 
00113 /*functions to request pointers to the run time function of other plugins of the same category*/
00114 green_exec_function         crusde_request_green_plugin(char* plugin);
00115 load_exec_function          crusde_request_load_plugin(char* plugin);
00116 run_function                crusde_request_kernel_plugin(char* plugin);
00117 run_function                crusde_request_postprocessor_plugin(char* plugin);
00118 loadhistory_exec_function   crusde_request_loadhistory_plugin(char* plugin);
00119 crustaldecay_exec_function  crusde_request_crustaldecay_plugin(char* plugin);
00120 
00121         
00122 /*void  crusde_print_green_params();
00123 void    crusde_print_load_params();
00124 void    crusde_print_kernel_params();
00125 */
00126 
00127 /*double* crusde_get_green_array();
00128 double* crusde_get_load_array();
00129 */
00130 
00131 #ifdef __cplusplus
00132 }
00133 #endif
00134 
00135 #endif // _green_api_h

Generated on Sun Aug 31 13:18:59 2008 for CrusDe by  doxygen 1.5.0