/Users/huttone/Devel/sedflux-new/sedflux/trunk/ew/sakura/sakura.h

Go to the documentation of this file.
00001 //---
00002 //
00003 // This file is part of sedflux.
00004 //
00005 // sedflux is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation; either version 2 of the License, or
00008 // (at your option) any later version.
00009 //
00010 // sedflux is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with sedflux; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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 typedef struct
00046 {
00047    double  x;            //< Position to query
00048    double  dx;           //< Grid spacing
00049    double  erode_depth;  //< Burial depth to query
00050    double *phe;         //< Fraction of each grain size
00051 }
00052 Sakura_phe_query_st;
00053 
00054 typedef void (*Sakura_query_func) ( Sakura_phe_query_st* data , gpointer user_data );
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; //< Id that identifies the sediment type of the cell
00067    double t;  //< The amount of sediment in the cell
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 gboolean sakura ( double dx         , double dt              , double basin_Len ,
00111                   int n_nodes       , int n_grains           , double* x      ,
00112                   double* depth     , double *width            , double Init_U[]  ,
00113                   double Init_C[]   , double *lambda         , double *Stv      ,
00114                   double *Rey       , double *rho_grain          , double init_h     ,
00115                   double supply_time , double dep_start , double *fraction ,
00116                   double *phe_bot , double *rho_bot , double OutTime   ,
00117                   Sakura_const_st* c   , double **deposit       , FILE *fp_data );
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 /* sakura.h is included */

Generated on Fri Jan 4 18:04:15 2008 for sedflux by  doxygen 1.5.2