/Users/huttone/Devel/sedflux-new/sedflux/trunk/ew/subside/subside_main.c

Go to the documentation of this file.
00001 #include <glib.h>
00002 #include <utils/utils.h>
00003 #include "subside.h"
00004 
00005 #define DEFAULT_RHO_W   (1030.)
00006 #define DEFAULT_RHO_M   (3300.)
00007 #define DEFAULT_EET     (5000.)
00008 #define DEFAULT_Y       (7.e10)
00009 #define DEFAULT_LOAD    (1000.)
00010 #define DEFAULT_SLOPE   (.001)
00011 #define DEFAULT_NDIM    (1)
00012 #define DEFAULT_VERBOSE (FALSE)
00013 
00014 static Eh_opt_entry entries[] =
00015 {
00016    { "eet"    , 'h' , "Effective elastic thickness" , "VAL" , "5000" } ,
00017    { "youngs" , 'y' , "Young's modulus"             , "VAL" , "7e10" } ,
00018    { "load"   , 'q' , "Load"                        , "VAL" , "1e3"  } ,
00019    { "slope"  , 's' , "Bathymetric slope"           , "VAL" , ".001" } ,
00020    { "ndim"   , 'D' , "Number of dimensions"        , "VAL" , "1"    } ,
00021    { NULL }
00022 };
00023 
00024 int main( int argc , char *argv[] )
00025 {
00026    Eh_opt_context opt;
00027    Eh_dbl_grid z;
00028    double eet, y, slope, load;
00029    gint n_dim;
00030 
00031    eh_init_glib();
00032 
00033    opt = eh_opt_create_context( "subside" ,
00034                                 "flexural subsidence model" ,
00035                                 "Show subsidence options" );
00036    opt = eh_opt_set_context( opt , entries );
00037    eh_opt_parse_context( opt , &argc , &argv , NULL );
00038 
00039    eh_opt_print_key_file( opt , stdout );
00040 
00041    eet    = eh_opt_dbl_value( opt , "eet" );
00042    y      = eh_opt_dbl_value( opt , "youngs" );
00043    slope  = eh_opt_dbl_value( opt , "slope" );
00044    load   = eh_opt_dbl_value( opt , "load" );
00045    n_dim  = eh_opt_int_value( opt , "ndim" );
00046 
00047 /*
00048    verbose = DEFAULT_VERBOSE;
00049    opt_context = g_option_context_new( "flexural subsidence model" );
00050    g_option_context_add_main_entries( opt_context , entries , NULL );
00051    g_option_context_parse( opt_context , &argc , &argv , NULL );
00052 */
00053 
00054    // Set up the initial profile.
00055    {
00056       gssize n_x = 1, n_y = 100;
00057       gssize dx = 1, dy = 10;
00058 
00059       z = eh_grid_new( double , n_x , n_y );
00060 
00061       eh_grid_set_x_lin( z , 0 , dx );
00062       eh_grid_set_y_lin( z , 0 , dy );
00063 
00064       eh_dbl_grid_set( z , 0. );
00065    }
00066 
00067    // Subside due to external load.
00068    {
00069    }
00070 
00071    subside_point_load( z , load , eet , y , 0 , 0 );
00072 
00073    // Subside due to change in water load.
00074 
00075    // Print the new elevations.
00076    {
00077       gssize i, j;
00078 
00079       for ( i=0 ; i<eh_grid_n_x(z) ; i++ )
00080       {
00081          for ( j=0 ; j<eh_grid_n_y(z) ; j++ )
00082             fprintf( stdout , "%f " , eh_dbl_grid_val(z,i,j) );
00083          fprintf( stdout , "\n" );
00084       }
00085 
00086    }
00087 
00088    // Print the deflections.
00089 
00090    eh_destroy_context( opt );
00091 
00092    return 0;
00093 }
00094 

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