00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef SAKURA_IS_INCLUDED
00022 # define SAKURA_IS_INCLUDED
00023
00024 #include <stdio.h>
00025 #include <glib.h>
00026 #include <utils/utils.h>
00027 #include <sed/sed_sedflux.h>
00028
00029 #include <sed/datadir_path.h>
00030 #if !defined( DATADIR )
00031 # define DATADIR "/usr/local/share"
00032 #endif
00033 #define SAKURA_TEST_PARAM_FILE DATADIR "/ew/sakura_param.kvf"
00034 #define SAKURA_TEST_BATHY_FILE DATADIR "/ew/sakura_bathy.csv"
00035 #define SAKURA_TEST_FLOOD_FILE DATADIR "/ew/sakura_flood.kvf"
00036
00037 typedef enum
00038 {
00039 SAKURA_ERROR_BAD_PARAMETER
00040 }
00041 Sakura_error;
00042
00043 #define SAKURA_ERROR sakura_error_quark()
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 typedef struct
00057 {
00058 double* phe;
00059 gint n_grains;
00060 double val;
00061 }
00062 Sakura_phe_st;
00063
00064 typedef struct
00065 {
00066 gint id;
00067 double t;
00068 }
00069 Sakura_cell_st;
00070
00071 typedef double (*Sakura_phe_func) ( gpointer data , double x , Sakura_phe_st* s );
00072 typedef double (*Sakura_add_func) ( gpointer data , double x , Sakura_cell_st* s );
00073 typedef double (*Sakura_get_func) ( gpointer data , double x );
00074
00075 typedef struct
00076 {
00077 double dt;
00078
00079 double e_a;
00080 double e_b;
00081 double sua;
00082 double sub;
00083 double c_drag;
00084 double rho_river_water;
00085 double rho_sea_water;
00086
00087 double tan_phi;
00088 double mu_water;
00089 double channel_width;
00090 double channel_len;
00091 double dep_start;
00092
00093 gint* data_id;
00094 FILE* data_fp;
00095 gint data_int;
00096
00097 Sakura_phe_func get_phe;
00098 Sakura_add_func add;
00099 Sakura_add_func remove;
00100 Sakura_get_func get_depth;
00101
00102 gpointer get_phe_data;
00103 gpointer add_data;
00104 gpointer remove_data;
00105 gpointer depth_data;
00106 }
00107 Sakura_const_st;
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119 double**
00120 sakura( double u_riv , double c_riv , double h_riv , double* f_riv ,
00121 double dt , double duration ,
00122 double* x , double* z , double* w , gint len ,
00123 double* rho_grain , double* rho_dep , double* u_fall , gint n_grains ,
00124 Sakura_const_st* c );
00125 Sed_hydro sakura_flood_from_cell( Sed_cell c , double area );
00126 gboolean sed_sakura( Sed_cube p ,
00127 Sed_hydro f ,
00128 gint i_start ,
00129 double dx ,
00130 Sakura_const_st* c );
00131
00132 #endif