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

#include <glib.h>
#include <utils/utils.h>
#include <sed/sed_sedflux.h>
#include "sakura.h"
#include "sakura_utils.h"

Go to the source code of this file.

Classes

struct  Sakura_sediment
struct  Sakura_node
struct  Sakura_array
struct  Sakura_bathy_st
struct  Sakura_flood_st
struct  Sakura_sediment_st
struct  Sakura_arch_st
struct  Sakura_param_st

Defines

#define TURBIDITY_CURRENT_DEFAULT_EA   (0.00153)
#define TURBIDITY_CURRENT_DEFAULT_EB   (0.00204)
#define TURBIDITY_CURRENT_DEFAULT_SUA   (400.)
#define TURBIDITY_CURRENT_DEFAULT_SUB   (2.0)
#define TURBIDITY_CURRENT_DEFAULT_CD   (0.004)
#define TURBIDITY_CURRENT_DEFAULT_TAN_PHI   (0.36397023426620)
#define TURBIDITY_CURRENT_DEFAULT_MU   (1.3e-6)
#define TURBIDITY_CURRENT_DEFAULT_DENSITY_SEA_WATER   (1028.)
#define TURBIDITY_CURRENT_DEFAULT_CHANNEL_WIDTH   (100.0)
#define TURBIDITY_CURRENT_DEFAULT_CHANNEL_LENGTH   (30000.0)
#define HMIN   0.0000001
#define UPPERLIMIT   20
#define SAKURA_DEFAULT_BASIN_LEN   (80.)
#define SAKURA_DEFAULT_DX   (100.)
#define SAKURA_DEFAULT_DT   (30.)
#define SAKURA_DEFAULT_OUT_TIME   (3600.)
#define SAKURA_DEFAULT_MAX_TIME   (86400.)
#define SAKURA_DEFAULT_RHO_SEA_WATER   (1028.)
#define SAKURA_DEFAULT_RHO_RIVER_WATER   (1028.)
#define SAKURA_DEFAULT_LAMBDA   { 25. , 16.8 , 9. , 3.2 , 2.4 }
#define SAKURA_DEFAULT_SIZE_EQUIV   { 202. , 105. , 69. , 25. , 10. }
#define SAKURA_DEFAULT_SIZE_COMP   { 150. , 50. , 25. , 5. , 1. }
#define SAKURA_DEFAULT_GRAIN_FRACTION   { 0. , .1 , .2 , .3 , .4 }
#define SAKURA_DEFAULT_FLOW_FRACTION   { 1. , 1. , 1. , 1. , 1. }
#define SAKURA_DEFAULT_BULK_DENSITY   { 1850. , 1600. , 1400. , 1300. , 1200. }
#define SAKURA_DEFAULT_GRAIN_DENSITY   { 2650. , 2650. , 2650. , 2650. , 2650. }
#define SAKURA_DEFAULT_DEP_START   (2.)
#define SAKURA_DEFAULT_SIZE_BOTTOM   (64.)
#define SAKURA_DEFAULT_BULK_DENSITY_BOTTOM   (1600.)
#define SAKURA_DEFAULT_BOTTOM_FRACTION   { .2 , .2 , .2 , .2 , .2 }
#define SAKURA_DEFAULT_N_GRAINS   (5)
#define SAKURA_DEFAULT_SUA   (30.)
#define SAKURA_DEFAULT_SUB   (.5)
#define SAKURA_DEFAULT_EA   (0.00153)
#define SAKURA_DEFAULT_EB   (0.0204)
#define SAKURA_DEFAULT_CD   (0.004)
#define SAKURA_DEFAULT_FRICTION_ANGLE   (20.)
#define SAKURA_DEFAULT_MU_WATER   (1.3)
#define SAKURA_DEFAULT_FLOOD_FILE   "sakura_flood.kvf"
Physical Constants


#define G   (9.81)
 gravitational acceleration (m/s/s)
#define R   (1.65)
 submerged specific gravity of quartz
#define Ro   (2.0)
 near-bed bulk concentration ratio
#define DAY   (86400.)
 Length of a day in seconds.

Functions

Sakura_sedimentsakura_sediment_new (gint n_grains)
Sakura_sedimentsakura_sediment_destroy (Sakura_sediment *s)
Sakura_sedimentsakura_sediment_set_rho_grain (Sakura_sediment *s, double *x)
Sakura_sedimentsakura_sediment_set_rho_dep (Sakura_sediment *s, double *x)
Sakura_sedimentsakura_sediment_set_u_settling (Sakura_sediment *s, double *x)
Sakura_arraysakura_array_new (gint len, gint n_grain)
Sakura_arraysakura_array_destroy (Sakura_array *a)
Sakura_arraysakura_array_copy (Sakura_array *d, Sakura_array *s)
Sakura_arraysakura_array_set_x (Sakura_array *a, double *x)
Sakura_arraysakura_array_set_w (Sakura_array *a, double *w)
Sakura_arraysakura_array_set_bc (Sakura_array *a, Sakura_node *inflow, Sakura_node *outflow)
double sakura_array_mass_in_susp (Sakura_array *a, Sakura_sediment *s)
double sakura_array_mass_eroded (Sakura_array *a, Sakura_sediment *s)
double sakura_array_mass_deposited (Sakura_array *a, Sakura_sediment *s)
Sakura_nodesakura_node_new (double u, double c, double h, double *c_grain, gint len)
Sakura_nodesakura_node_set (Sakura_node *x, double u, double c, double h, double *c_grain, gint len)
Sakura_nodesakura_node_destroy (Sakura_node *x)
gboolean sakura_set_outflow (Sakura_node *out, Sakura_array *a, double x_head, double dt, double dx)
double sakura_get_sin_slope (Sakura_get_func f, gpointer data, Sakura_array *a, gint i)
gboolean calculate_mid_vel (Sakura_array *a_mid, Sakura_array *a, gint ind_head, Sakura_const_st *Const)
gboolean calculate_next_vel (Sakura_array *a_last, Sakura_array *a_mid, Sakura_array *a_next, gint ind_head, Sakura_const_st *Const)
gboolean compute_c_grain (Sakura_array *a, Sakura_array *a_last, double *u, gint i, double dx, Sakura_const_st *Const, Sakura_sediment *sed)
gboolean calculate_next_c_and_h (Sakura_array *a_new, Sakura_array *a_last, double *u_temp, gint ind_head, Sakura_const_st *Const, Sakura_sediment *sed)
gboolean calculate_mid_c_and_h (Sakura_array *a_mid, Sakura_array *a_last, Sakura_array *a_next)
gint calculate_head_index (Sakura_array *a, double *u, gint ind_head, double dx, double dt, double *x_head)
double ** sakura_wrapper (Sakura_bathy_st *b, Sakura_flood_st *f, Sakura_sediment_st *s, Sakura_const_st *c, gint *n_grains, gint *len)
void sakura_set_width (Sakura_bathy_st *bathy_data, double river_width, double spreading_angle)
Sakura_param_stsakura_scan_parameter_file (const gchar *file, GError **error)
Sakura_param_stsakura_check_params (Sakura_param_st *p, GError **error)
Sakura_bathy_stsakura_scan_bathy_file (const gchar *file, Sakura_param_st *p, GError **error)
Sakura_flood_st ** sakura_scan_flood_file (const gchar *file, Sakura_param_st *p, GError **error)
Sakura_flood_stsakura_set_flood_data (Sed_hydro h, double rho_river_water)
Sakura_flood_stsakura_sed_set_flood_data (Sed_hydro h, double rho_river_water)
Sakura_flood_stsakura_destroy_flood_data (Sakura_flood_st *f)
Sakura_sediment_stsakura_set_sediment_data (Sakura_param_st *p)
Sakura_const_stsakura_set_constant_data (Sakura_param_st *p, Sakura_bathy_st *b)
Sakura_const_stsakura_set_constant_output_data (Sakura_const_st *c, const gchar *file, gint *id, gint dt)
Sakura_bathy_stsakura_set_bathy_data (double **bathy, gint len, double dx, gint n_grains)
Sakura_bathy_stsakura_new_bathy_data (gint n_grains, gint len)
Sakura_bathy_stsakura_copy_bathy_data (Sakura_bathy_st *d, const Sakura_bathy_st *s)
Sakura_bathy_stsakura_destroy_bathy_data (Sakura_bathy_st *b)
Sakura_bathy_stsakura_update_bathy_data (Sakura_bathy_st *b, double **deposition, double **erosion, gint n_grains)
gint sakura_write_data (const gchar *file, Eh_dbl_grid deposit)
gint sakura_write_output (const gchar *file, Sakura_bathy_st *b, double **deposit, gssize n_grains)
double sakura_reynolds_number (double rho_grain, double equiv_dia, double rho_river_water, double mu_river_water)
double sakura_settling_velocity (double rho_grain, double equiv_dia, double rho_river_water, double mu_river_water)
void sakura_get_phe (Sakura_arch_st *data, double x, Sakura_phe_st *phe_data)
double sakura_add (Sakura_arch_st *data, double x, Sakura_cell_st *s)
double sakura_remove (Sakura_arch_st *data, double x, Sakura_cell_st *s)
double sakura_get_depth (Sakura_arch_st *data, double x)
void sakura_sed_get_phe (Sed_cube p, double y, Sakura_phe_st *phe_data)
double sakura_sed_add_sediment (Sed_cube p, double y, Sakura_cell_st *s)
double sakura_sed_remove_sediment (Sed_cube p, double y, Sakura_cell_st *s)
double sakura_sed_get_depth (Sed_cube p, double y)


Define Documentation

#define DAY   (86400.)

Length of a day in seconds.

Definition at line 58 of file sakura_local.h.

Referenced by getTime().

#define G   (9.81)

gravitational acceleration (m/s/s)

Definition at line 49 of file sakura_local.h.

Referenced by calculate_head_index(), calculate_next_c_and_h(), compute_next_h(), dudt(), sakura_reynolds_number(), and sakura_settling_velocity().

#define HMIN   0.0000001

Definition at line 43 of file sakura_local.h.

Referenced by calculate_mid_vel(), compute_c_grain(), dudt(), sakura(), sakura_erode(), sakura_next_c_grain(), tvdleft(), and tvdright().

#define R   (1.65)

submerged specific gravity of quartz

Definition at line 52 of file sakura_local.h.

Referenced by calculate_head_index(), calculate_next_c_and_h(), compute_c_grain(), compute_next_h(), and dudt().

#define Ro   (2.0)

near-bed bulk concentration ratio

Definition at line 55 of file sakura_local.h.

Referenced by compute_c_grain(), sakura_deposit(), and sakura_next_c_grain().

#define SAKURA_DEFAULT_BASIN_LEN   (80.)

Definition at line 172 of file sakura_local.h.

#define SAKURA_DEFAULT_BOTTOM_FRACTION   { .2 , .2 , .2 , .2 , .2 }

Definition at line 190 of file sakura_local.h.

#define SAKURA_DEFAULT_BULK_DENSITY   { 1850. , 1600. , 1400. , 1300. , 1200. }

Definition at line 185 of file sakura_local.h.

#define SAKURA_DEFAULT_BULK_DENSITY_BOTTOM   (1600.)

Definition at line 189 of file sakura_local.h.

#define SAKURA_DEFAULT_CD   (0.004)

Definition at line 197 of file sakura_local.h.

#define SAKURA_DEFAULT_DEP_START   (2.)

Definition at line 187 of file sakura_local.h.

#define SAKURA_DEFAULT_DT   (30.)

Definition at line 174 of file sakura_local.h.

#define SAKURA_DEFAULT_DX   (100.)

Definition at line 173 of file sakura_local.h.

#define SAKURA_DEFAULT_EA   (0.00153)

Definition at line 195 of file sakura_local.h.

#define SAKURA_DEFAULT_EB   (0.0204)

Definition at line 196 of file sakura_local.h.

#define SAKURA_DEFAULT_FLOOD_FILE   "sakura_flood.kvf"

Definition at line 201 of file sakura_local.h.

#define SAKURA_DEFAULT_FLOW_FRACTION   { 1. , 1. , 1. , 1. , 1. }

Definition at line 184 of file sakura_local.h.

#define SAKURA_DEFAULT_FRICTION_ANGLE   (20.)

Definition at line 198 of file sakura_local.h.

#define SAKURA_DEFAULT_GRAIN_DENSITY   { 2650. , 2650. , 2650. , 2650. , 2650. }

Definition at line 186 of file sakura_local.h.

#define SAKURA_DEFAULT_GRAIN_FRACTION   { 0. , .1 , .2 , .3 , .4 }

Definition at line 183 of file sakura_local.h.

#define SAKURA_DEFAULT_LAMBDA   { 25. , 16.8 , 9. , 3.2 , 2.4 }

Definition at line 180 of file sakura_local.h.

#define SAKURA_DEFAULT_MAX_TIME   (86400.)

Definition at line 176 of file sakura_local.h.

#define SAKURA_DEFAULT_MU_WATER   (1.3)

Definition at line 199 of file sakura_local.h.

#define SAKURA_DEFAULT_N_GRAINS   (5)

Definition at line 191 of file sakura_local.h.

#define SAKURA_DEFAULT_OUT_TIME   (3600.)

Definition at line 175 of file sakura_local.h.

#define SAKURA_DEFAULT_RHO_RIVER_WATER   (1028.)

Definition at line 178 of file sakura_local.h.

#define SAKURA_DEFAULT_RHO_SEA_WATER   (1028.)

Definition at line 177 of file sakura_local.h.

#define SAKURA_DEFAULT_SIZE_BOTTOM   (64.)

Definition at line 188 of file sakura_local.h.

#define SAKURA_DEFAULT_SIZE_COMP   { 150. , 50. , 25. , 5. , 1. }

Definition at line 182 of file sakura_local.h.

#define SAKURA_DEFAULT_SIZE_EQUIV   { 202. , 105. , 69. , 25. , 10. }

Definition at line 181 of file sakura_local.h.

#define SAKURA_DEFAULT_SUA   (30.)

Definition at line 193 of file sakura_local.h.

#define SAKURA_DEFAULT_SUB   (.5)

Definition at line 194 of file sakura_local.h.

#define TURBIDITY_CURRENT_DEFAULT_CD   (0.004)

Definition at line 28 of file sakura_local.h.

#define TURBIDITY_CURRENT_DEFAULT_CHANNEL_LENGTH   (30000.0)

Definition at line 33 of file sakura_local.h.

#define TURBIDITY_CURRENT_DEFAULT_CHANNEL_WIDTH   (100.0)

Definition at line 32 of file sakura_local.h.

#define TURBIDITY_CURRENT_DEFAULT_DENSITY_SEA_WATER   (1028.)

Definition at line 31 of file sakura_local.h.

#define TURBIDITY_CURRENT_DEFAULT_EA   (0.00153)

Definition at line 24 of file sakura_local.h.

#define TURBIDITY_CURRENT_DEFAULT_EB   (0.00204)

Definition at line 25 of file sakura_local.h.

#define TURBIDITY_CURRENT_DEFAULT_MU   (1.3e-6)

Definition at line 30 of file sakura_local.h.

#define TURBIDITY_CURRENT_DEFAULT_SUA   (400.)

Definition at line 26 of file sakura_local.h.

#define TURBIDITY_CURRENT_DEFAULT_SUB   (2.0)

Definition at line 27 of file sakura_local.h.

#define TURBIDITY_CURRENT_DEFAULT_TAN_PHI   (0.36397023426620)

Definition at line 29 of file sakura_local.h.

#define UPPERLIMIT   20

Definition at line 44 of file sakura_local.h.

Referenced by calculate_next_vel().


Function Documentation

gint calculate_head_index ( Sakura_array a,
double *  u,
gint  ind_head,
double  dx,
double  dt,
double *  x_head 
)

Definition at line 1432 of file sakura.c.

References Sakura_array::c, eh_exit(), eh_max, eh_min, eh_require, eh_watch_dbl, eh_watch_int, floor, G, Sakura_array::h, Sakura_array::len, R, and Sakura_array::x.

Referenced by sakura().

gboolean calculate_mid_c_and_h ( Sakura_array a_mid,
Sakura_array a_last,
Sakura_array a_next 
)

Definition at line 1413 of file sakura.c.

References Sakura_array::c, Sakura_array::h, and Sakura_array::len.

Referenced by sakura().

gboolean calculate_mid_vel ( Sakura_array a_mid,
Sakura_array a,
gint  ind_head,
Sakura_const_st Const 
)

Definition at line 500 of file sakura.c.

References Sakura_array::c, Sakura_const_st::c_drag, Sakura_const_st::depth_data, Sakura_const_st::dt, dudt(), eh_min, eh_require, Sakura_const_st::get_depth, Sakura_array::h, HMIN, Sakura_array::len, Sakura_const_st::mu_water, sakura_get_sin_slope(), Sakura_array::u, and Sakura_array::x.

Referenced by sakura().

gboolean calculate_next_c_and_h ( Sakura_array a_new,
Sakura_array a_last,
double *  u_temp,
gint  ind_head,
Sakura_const_st Const,
Sakura_sediment sed 
)

Definition at line 1324 of file sakura.c.

References Sakura_array::c, compute_c_grain_new(), dfdt(), Sakura_const_st::dt, Sakura_const_st::e_a, Sakura_const_st::e_b, eh_compare_dbl(), eh_require, eh_sqr, G, Sakura_array::h, Sakura_array::len, R, Sakura_array::w, and Sakura_array::x.

gboolean calculate_next_vel ( Sakura_array a_last,
Sakura_array a_mid,
Sakura_array a_next,
gint  ind_head,
Sakura_const_st Const 
)

Definition at line 587 of file sakura.c.

References Sakura_array::c, Sakura_const_st::c_drag, Sakura_const_st::depth_data, Sakura_const_st::dt, dudt(), eh_min, eh_require, Sakura_const_st::get_depth, Sakura_array::h, Sakura_array::len, Sakura_const_st::mu_water, sakura_get_sin_slope(), Sakura_array::u, UPPERLIMIT, and Sakura_array::x.

Referenced by sakura().

gboolean compute_c_grain ( Sakura_array a,
Sakura_array a_last,
double *  u,
gint  i,
double  dx,
Sakura_const_st Const,
Sakura_sediment sed 
)

Definition at line 1014 of file sakura.c.

References Sakura_const_st::add, Sakura_const_st::add_data, Sakura_array::c, Sakura_const_st::c_drag, Sakura_array::c_grain, Sakura_array::d, Sakura_const_st::dep_start, Sakura_const_st::depth_data, dfdt(), Sakura_const_st::dt, Sakura_array::e, eh_dbl_array_mean_weighted(), eh_free, eh_max, eh_new, eh_require, Sakura_const_st::get_depth, Sakura_const_st::get_phe, Sakura_const_st::get_phe_data, Sakura_array::h, HMIN, Sakura_cell_st::id, Sakura_array::n_grain, Sakura_phe_st::n_grains, Sakura_phe_st::phe, R, Sakura_const_st::remove, Sakura_const_st::remove_data, Sakura_sediment::rho_dep, Sakura_sediment::rho_grain, Sakura_const_st::rho_sea_water, Ro, S_DAYS_PER_SECOND, Sakura_const_st::sua, Sakura_const_st::sub, Sakura_cell_st::t, Sakura_sediment::u_settling, Sakura_phe_st::val, Sakura_array::w, and Sakura_array::x.

double sakura_add ( Sakura_arch_st data,
double  x,
Sakura_cell_st s 
)

Definition at line 928 of file sakura_io.c.

References Sakura_arch_st::b, Sakura_bathy_st::dep, Sakura_bathy_st::depth, Sakura_bathy_st::dx, eh_require, Sakura_cell_st::id, Sakura_bathy_st::len, Sakura_cell_st::t, and Sakura_bathy_st::x.

Referenced by sakura_set_constant_data().

Sakura_array* sakura_array_copy ( Sakura_array d,
Sakura_array s 
)

Definition at line 160 of file sakura.c.

References Sakura_array::c, Sakura_array::c_grain, Sakura_array::d, Sakura_array::e, eh_dbl_array_copy(), Sakura_array::h, Sakura_array::len, Sakura_array::n_grain, sakura_array_new(), Sakura_array::u, Sakura_array::w, and Sakura_array::x.

Referenced by sakura().

Sakura_array* sakura_array_destroy ( Sakura_array a  ) 

Definition at line 127 of file sakura.c.

References Sakura_array::c, Sakura_array::c_grain, Sakura_array::d, Sakura_array::e, eh_free, Sakura_array::h, Sakura_array::u, Sakura_array::w, and Sakura_array::x.

Referenced by sakura().

double sakura_array_mass_deposited ( Sakura_array a,
Sakura_sediment s 
)

Definition at line 339 of file sakura.c.

References Sakura_array::d, eh_require, Sakura_sediment::len, Sakura_array::len, and Sakura_sediment::rho_grain.

Referenced by sakura().

double sakura_array_mass_eroded ( Sakura_array a,
Sakura_sediment s 
)

Definition at line 318 of file sakura.c.

References Sakura_array::e, eh_require, Sakura_sediment::len, Sakura_array::len, and Sakura_sediment::rho_grain.

Referenced by sakura().

double sakura_array_mass_in_susp ( Sakura_array a,
Sakura_sediment s 
)

Definition at line 269 of file sakura.c.

References Sakura_array::c_grain, eh_require, Sakura_array::h, Sakura_sediment::len, Sakura_array::len, Sakura_sediment::rho_grain, Sakura_array::w, and Sakura_array::x.

Referenced by sakura().

Sakura_array* sakura_array_new ( gint  len,
gint  n_grain 
)

Definition at line 87 of file sakura.c.

References Sakura_array::c, Sakura_array::c_grain, Sakura_array::d, Sakura_array::e, eh_new, eh_new0, Sakura_array::h, Sakura_array::len, Sakura_array::n_grain, Sakura_array::u, Sakura_array::w, and Sakura_array::x.

Referenced by sakura(), and sakura_array_copy().

Sakura_array* sakura_array_set_bc ( Sakura_array a,
Sakura_node inflow,
Sakura_node outflow 
)

Definition at line 234 of file sakura.c.

References Sakura_node::c, Sakura_array::c, Sakura_node::c_grain, Sakura_array::c_grain, eh_dbl_array_copy(), Sakura_node::h, Sakura_array::h, inflow(), Sakura_array::len, Sakura_array::n_grain, Sakura_node::u, and Sakura_array::u.

Referenced by sakura().

Sakura_array* sakura_array_set_w ( Sakura_array a,
double *  w 
)

Definition at line 213 of file sakura.c.

References eh_dbl_array_copy(), eh_require, Sakura_array::len, and Sakura_array::w.

Referenced by sakura().

Sakura_array* sakura_array_set_x ( Sakura_array a,
double *  x 
)

Definition at line 182 of file sakura.c.

References eh_dbl_array_copy(), eh_require, Sakura_array::len, and Sakura_array::x.

Referenced by sakura().

Sakura_param_st* sakura_check_params ( Sakura_param_st p,
GError **  error 
)

Definition at line 173 of file sakura_io.c.

References Sakura_param_st::bulk_density, Sakura_param_st::c_drag, Sakura_param_st::dep_start, Sakura_param_st::dt, Sakura_param_st::dx, Sakura_param_st::e_a, Sakura_param_st::e_b, eh_check_to_s(), eh_dbl_array_cmp_ge(), eh_dbl_array_each_ge(), eh_dbl_array_each_le(), eh_require, eh_return_val_if_fail, eh_set_error_strv(), Sakura_param_st::flow_fraction, Sakura_param_st::grain_density, Sakura_param_st::lambda, Sakura_param_st::mu_water, Sakura_param_st::n_grains, Sakura_param_st::rho_river_water, Sakura_param_st::rho_sea_water, SAKURA_ERROR, SAKURA_ERROR_BAD_PARAMETER, Sakura_param_st::sua, Sakura_param_st::sub, and Sakura_param_st::tan_phi.

Referenced by sakura_scan_parameter_file().

Sakura_bathy_st* sakura_copy_bathy_data ( Sakura_bathy_st d,
const Sakura_bathy_st s 
)

Definition at line 373 of file sakura_io.c.

References Sakura_bathy_st::dep, Sakura_bathy_st::depth, Sakura_bathy_st::dx, eh_require, Sakura_bathy_st::len, Sakura_bathy_st::n_grains, sakura_new_bathy_data(), Sakura_bathy_st::slope, Sakura_bathy_st::width, and Sakura_bathy_st::x.

Referenced by main().

Sakura_bathy_st* sakura_destroy_bathy_data ( Sakura_bathy_st b  ) 

Definition at line 400 of file sakura_io.c.

References Sakura_bathy_st::dep, Sakura_bathy_st::depth, eh_free, eh_free_2, Sakura_bathy_st::slope, Sakura_bathy_st::width, and Sakura_bathy_st::x.

Referenced by sed_sakura().

Sakura_flood_st* sakura_destroy_flood_data ( Sakura_flood_st f  ) 

Definition at line 509 of file sakura_io.c.

References eh_free, and Sakura_flood_st::fraction.

Referenced by sed_sakura().

double sakura_get_depth ( Sakura_arch_st data,
double  x 
)

Definition at line 1003 of file sakura_io.c.

References Sakura_arch_st::b, Sakura_bathy_st::depth, Sakura_bathy_st::dx, eh_require, Sakura_bathy_st::len, and Sakura_bathy_st::x.

Referenced by sakura_set_constant_data().

void sakura_get_phe ( Sakura_arch_st data,
double  x,
Sakura_phe_st phe_data 
)

Get the grain size distribution of bottom sediments.

Get the fractions of each grain type of bottom sediments from a Sed_cube. This function is intended to be used within another program that needs to communicate with the sedflux architecture but is otherwise separate from sedflux.

Note that the member, eroded_depth may be changed to reflect the actual amount of bottom sediment available to be eroded. That is, we may be trying to erode more sediment than is actually present.

In this case, the data pointer should point to a Sakura_get_phe_t structure that contains the grain size distribution and the number of grains. This information is simply copied to the location pointed to by phe.

Parameters:
query_data The fraction of each grain type in the bottom sediments.
bed_data A structure that contains the necessary data for the function to retreive the grain type fracitons.
Returns:
A pointer to the array of grain type fractions.

Definition at line 901 of file sakura_io.c.

References eh_new, eh_require, Sakura_arch_st::n_grains, Sakura_phe_st::n_grains, Sakura_arch_st::phe, and Sakura_phe_st::phe.

Referenced by sakura_set_constant_data().

double sakura_get_sin_slope ( Sakura_get_func  f,
gpointer  data,
Sakura_array a,
gint  i 
)

Definition at line 480 of file sakura.c.

References eh_require, and Sakura_array::x.

Referenced by calculate_mid_vel(), and calculate_next_vel().

Sakura_bathy_st* sakura_new_bathy_data ( gint  n_grains,
gint  len 
)

Definition at line 350 of file sakura_io.c.

References Sakura_bathy_st::dep, Sakura_bathy_st::depth, Sakura_bathy_st::dx, eh_new, eh_new_2, Sakura_bathy_st::len, Sakura_bathy_st::n_grains, Sakura_bathy_st::slope, Sakura_bathy_st::width, and Sakura_bathy_st::x.

Referenced by sakura_copy_bathy_data().

Sakura_node* sakura_node_destroy ( Sakura_node x  ) 

Definition at line 399 of file sakura.c.

References Sakura_node::c_grain, and eh_free.

Referenced by sakura().

Sakura_node* sakura_node_new ( double  u,
double  c,
double  h,
double *  c_grain,
gint  len 
)

Definition at line 393 of file sakura.c.

References sakura_node_set().

Referenced by sakura().

Sakura_node* sakura_node_set ( Sakura_node x,
double  u,
double  c,
double  h,
double *  c_grain,
gint  len 
)

Definition at line 410 of file sakura.c.

References Sakura_node::c, Sakura_node::c_grain, eh_dbl_array_copy(), eh_dbl_array_set(), eh_free, eh_new, eh_new0, Sakura_node::h, Sakura_node::n_grain, and Sakura_node::u.

Referenced by sakura_node_new(), and sakura_set_outflow().

double sakura_remove ( Sakura_arch_st data,
double  x,
Sakura_cell_st s 
)

Definition at line 972 of file sakura_io.c.

References Sakura_arch_st::b, Sakura_bathy_st::dep, Sakura_bathy_st::depth, Sakura_bathy_st::dx, eh_require, Sakura_cell_st::id, Sakura_bathy_st::len, Sakura_cell_st::t, Sakura_bathy_st::width, and Sakura_bathy_st::x.

Referenced by sakura_set_constant_data().

double sakura_reynolds_number ( double  rho_grain,
double  equiv_dia,
double  rho_river_water,
double  mu_river_water 
)

Definition at line 632 of file sakura_io.c.

References eh_require, G, log10, and sed_gravity().

Sakura_bathy_st* sakura_scan_bathy_file ( const gchar *  file,
Sakura_param_st p,
GError **  error 
)

Definition at line 237 of file sakura_io.c.

References Sakura_param_st::dx, eh_dlm_read_swap(), eh_free_2, eh_require, eh_return_val_if_fail, Sakura_param_st::n_grains, sakura_set_bathy_data(), and SAKURA_TEST_BATHY_FILE.

Referenced by main().

Sakura_flood_st** sakura_scan_flood_file ( const gchar *  file,
Sakura_param_st p,
GError **  error 
)

Definition at line 415 of file sakura_io.c.

References eh_free, eh_new0, eh_return_val_if_fail, Sakura_param_st::rho_river_water, sakura_set_flood_data(), SAKURA_TEST_FLOOD_FILE, sed_hydro_destroy(), and sed_hydro_scan().

Referenced by main().

Sakura_param_st* sakura_scan_parameter_file ( const gchar *  file,
GError **  error 
)

Definition at line 128 of file sakura_io.c.

References Sakura_param_st::dep_start, eh_dbl_array_mult(), eh_free, eh_key_file_scan_from_template(), eh_new, eh_return_val_if_fail, Sakura_param_st::lambda, Sakura_param_st::mu_water, Sakura_param_st::n_grains, S_DAYS_PER_SECOND, sakura_check_params(), SAKURA_TEST_PARAM_FILE, and Sakura_param_st::tan_phi.

Referenced by main().

double sakura_sed_add_sediment ( Sed_cube  p,
double  y,
Sakura_cell_st s 
)

Definition at line 470 of file sakura_sedflux_interface.c.

References eh_free, eh_new0, eh_require, Sakura_cell_st::id, sed_column_add_vec(), sed_column_water_depth(), sed_cube_col_pos(), sed_cube_x_res(), sed_cube_y_res(), sed_sediment_env_n_types(), and Sakura_cell_st::t.

Referenced by sed_sakura().

double sakura_sed_get_depth ( Sed_cube  p,
double  y 
)

Definition at line 501 of file sakura_sedflux_interface.c.

References eh_require, sed_cube_column_id(), and sed_cube_water_depth().

Referenced by sed_sakura().

void sakura_sed_get_phe ( Sed_cube  p,
double  y,
Sakura_phe_st phe_data 
)

Get the grain size distribution of bottom sediments.

Get the fractions of each grain type of bottom sediments from a Sed_cube. This function is intended to be used within another program that needs to communicate with the sedflux architecture but is otherwise separate from sedflux.

Note that the member, eroded_depth may be changed to reflect the actual amount of bottom sediment available to be eroded. That is, we may be trying to erode more sediment than is actually present.

Parameters:
data A structure that contains the necessary data for the function to retreive the grain type fracitons.
p A Sed_cube to query

Definition at line 383 of file sakura_sedflux_interface.c.

References eh_dbl_array_set(), eh_require, eh_upper_bound, Sakura_phe_st::phe, sed_cell_copy_fraction(), sed_cell_destroy(), sed_cell_new_env(), sed_cell_size(), sed_column_extract_top(), sed_cube_col(), sed_cube_column_id(), sed_cube_is_in_domain(), sed_cube_thickness(), sed_cube_x_res(), sed_cube_y_res(), sed_sediment_env_n_types(), and Sakura_phe_st::val.

Referenced by sed_sakura().

double sakura_sed_remove_sediment ( Sed_cube  p,
double  y,
Sakura_cell_st s 
)

Definition at line 443 of file sakura_sedflux_interface.c.

References eh_free, eh_new0, eh_require, Sakura_cell_st::id, sed_cell_destroy(), sed_cell_size(), sed_column_separate_top(), sed_cube_col_pos(), sed_cube_x_res(), sed_cube_y_res(), sed_sediment_env_n_types(), and Sakura_cell_st::t.

Referenced by sed_sakura().

Sakura_flood_st* sakura_sed_set_flood_data ( Sed_hydro  h,
double  rho_river_water 
)

Definition at line 475 of file sakura_io.c.

References Sakura_flood_st::depth, Sakura_flood_st::duration, eh_free, eh_new, Sakura_flood_st::fraction, Sakura_flood_st::n_grains, Sakura_flood_st::q, Sakura_flood_st::rho_flow, sed_hydro_depth(), sed_hydro_duration_in_seconds(), sed_hydro_flow_density(), sed_hydro_fraction(), sed_hydro_size(), sed_hydro_velocity(), sed_hydro_water_flux(), sed_hydro_width(), Sakura_flood_st::velocity, and Sakura_flood_st::width.

Referenced by sed_sakura().

Sakura_sediment* sakura_sediment_destroy ( Sakura_sediment s  ) 

Definition at line 44 of file sakura.c.

References eh_free, Sakura_sediment::rho_dep, Sakura_sediment::rho_grain, and Sakura_sediment::u_settling.

Referenced by sakura().

Sakura_sediment* sakura_sediment_new ( gint  n_grains  ) 

Definition at line 26 of file sakura.c.

References eh_new, eh_new0, Sakura_sediment::len, Sakura_sediment::rho_dep, Sakura_sediment::rho_grain, and Sakura_sediment::u_settling.

Referenced by sakura().

Sakura_sediment* sakura_sediment_set_rho_dep ( Sakura_sediment s,
double *  x 
)

Definition at line 67 of file sakura.c.

References eh_dbl_array_copy(), Sakura_sediment::len, and Sakura_sediment::rho_dep.

Referenced by sakura().

Sakura_sediment* sakura_sediment_set_rho_grain ( Sakura_sediment s,
double *  x 
)

Definition at line 57 of file sakura.c.

References eh_dbl_array_copy(), Sakura_sediment::len, and Sakura_sediment::rho_grain.

Referenced by sakura().

Sakura_sediment* sakura_sediment_set_u_settling ( Sakura_sediment s,
double *  x 
)

Definition at line 77 of file sakura.c.

References eh_dbl_array_copy(), Sakura_sediment::len, and Sakura_sediment::u_settling.

Referenced by sakura().

Sakura_bathy_st* sakura_set_bathy_data ( double **  bathy,
gint  len,
double  dx,
gint  n_grains 
)

Definition at line 299 of file sakura_io.c.

References Sakura_bathy_st::dep, Sakura_bathy_st::depth, Sakura_bathy_st::dx, eh_new, eh_new_2, eh_require, eh_uniform_array(), interpolate(), Sakura_bathy_st::len, Sakura_bathy_st::n_grains, Sakura_bathy_st::slope, Sakura_bathy_st::width, and Sakura_bathy_st::x.

Referenced by sakura_scan_bathy_file(), and sakura_set_bathy_data_from_cube().

Sakura_const_st* sakura_set_constant_data ( Sakura_param_st p,
Sakura_bathy_st b 
)

Definition at line 659 of file sakura_io.c.

References Sakura_const_st::add, Sakura_const_st::add_data, Sakura_arch_st::b, Sakura_param_st::bottom_fraction, Sakura_param_st::c_drag, Sakura_const_st::c_drag, Sakura_param_st::channel_len, Sakura_const_st::channel_len, Sakura_param_st::channel_width, Sakura_const_st::channel_width, Sakura_param_st::dep_start, Sakura_const_st::dep_start, Sakura_const_st::depth_data, Sakura_param_st::dt, Sakura_const_st::dt, Sakura_param_st::e_a, Sakura_const_st::e_a, Sakura_param_st::e_b, Sakura_const_st::e_b, eh_new, Sakura_const_st::get_depth, Sakura_const_st::get_phe, Sakura_const_st::get_phe_data, Sakura_param_st::mu_water, Sakura_const_st::mu_water, Sakura_param_st::n_grains, Sakura_arch_st::n_grains, Sakura_arch_st::phe, Sakura_const_st::remove, Sakura_const_st::remove_data, Sakura_param_st::rho_river_water, Sakura_const_st::rho_river_water, Sakura_param_st::rho_sea_water, Sakura_const_st::rho_sea_water, sakura_add(), sakura_get_depth(), sakura_get_phe(), sakura_remove(), Sakura_param_st::sua, Sakura_const_st::sua, Sakura_param_st::sub, Sakura_const_st::sub, Sakura_param_st::tan_phi, and Sakura_const_st::tan_phi.

Referenced by main().

Sakura_const_st* sakura_set_constant_output_data ( Sakura_const_st c,
const gchar *  file,
gint *  id,
gint  dt 
)

Definition at line 698 of file sakura_io.c.

References Sakura_const_st::data_fp, Sakura_const_st::data_id, Sakura_const_st::data_int, eh_fopen(), and eh_require.

Referenced by main().

Sakura_flood_st* sakura_set_flood_data ( Sed_hydro  h,
double  rho_river_water 
)

Definition at line 454 of file sakura_io.c.

References Sakura_flood_st::depth, Sakura_flood_st::duration, eh_new, Sakura_flood_st::fraction, Sakura_flood_st::n_grains, Sakura_flood_st::q, Sakura_flood_st::rho_flow, sed_hydro_depth(), sed_hydro_duration_in_seconds(), sed_hydro_flow_density(), sed_hydro_fraction(), sed_hydro_size(), sed_hydro_velocity(), sed_hydro_water_flux(), sed_hydro_width(), Sakura_flood_st::velocity, and Sakura_flood_st::width.

Referenced by sakura_scan_flood_file().

gboolean sakura_set_outflow ( Sakura_node out,
Sakura_array a,
double  x_head,
double  dt,
double  dx 
)

Definition at line 438 of file sakura.c.

References Sakura_array::c, Sakura_node::c_grain, Sakura_array::c_grain, eh_dbl_array_copy(), eh_free, eh_new0, eh_require, Sakura_node::h, Sakura_array::h, Sakura_array::len, Sakura_array::n_grain, sakura_node_set(), Sakura_array::u, and Sakura_array::x.

Referenced by sakura().

Sakura_sediment_st* sakura_set_sediment_data ( Sakura_param_st p  ) 

Definition at line 536 of file sakura_io.c.

References Sakura_param_st::bulk_density, Sakura_sediment_st::bulk_density, eh_dbl_array_dup(), eh_new, Sakura_param_st::flow_fraction, Sakura_param_st::grain_density, Sakura_sediment_st::grain_density, Sakura_param_st::lambda, Sakura_sediment_st::lambda, Sakura_sediment_st::n_grains, Sakura_param_st::n_grains, S_DAYS_PER_SECOND, S_SECONDS_PER_DAY, sed_removal_rate_to_settling_velocity(), and Sakura_sediment_st::u_settling.

Referenced by main().

void sakura_set_width ( Sakura_bathy_st bathy_data,
double  river_width,
double  spreading_angle 
)

Definition at line 574 of file sakura_io.c.

References Sakura_bathy_st::len, Sakura_bathy_st::width, and Sakura_bathy_st::x.

Referenced by main(), and sed_sakura().

double sakura_settling_velocity ( double  rho_grain,
double  equiv_dia,
double  rho_river_water,
double  mu_river_water 
)

Definition at line 600 of file sakura_io.c.

References eh_require, eh_watch_dbl, G, log10, and sed_gravity().

Sakura_bathy_st* sakura_update_bathy_data ( Sakura_bathy_st b,
double **  deposition,
double **  erosion,
gint  n_grains 
)

Definition at line 274 of file sakura_io.c.

References Sakura_bathy_st::depth, Sakura_bathy_st::len, Sakura_bathy_st::slope, and Sakura_bathy_st::x.

double** sakura_wrapper ( Sakura_bathy_st b,
Sakura_flood_st f,
Sakura_sediment_st s,
Sakura_const_st c,
gint *  n_grains,
gint *  len 
)

Definition at line 49 of file sakura_io.c.

References Sakura_sediment_st::bulk_density, Sakura_flood_st::depth, Sakura_bathy_st::depth, Sakura_const_st::dt, Sakura_flood_st::duration, Sakura_bathy_st::dx, eh_free, eh_new, eh_require, Sakura_flood_st::fraction, Sakura_sediment_st::grain_density, Sakura_sediment_st::lambda, Sakura_bathy_st::len, Sakura_sediment_st::n_grains, Sakura_flood_st::rho_flow, sakura(), Sakura_sediment_st::u_settling, Sakura_flood_st::velocity, Sakura_bathy_st::width, and Sakura_bathy_st::x.

Referenced by sakura_run_flood(), and sed_sakura().

gint sakura_write_data ( const gchar *  file,
Eh_dbl_grid  deposit 
)

Definition at line 722 of file sakura_io.c.

References eh_dbl_grid_data(), eh_grid_n_x(), eh_grid_n_y(), eh_open_file(), and eh_require.

Referenced by main().

gint sakura_write_output ( const gchar *  file,
Sakura_bathy_st b,
double **  deposit,
gssize  n_grains 
)

Definition at line 754 of file sakura_io.c.

References Sakura_bathy_st::depth, eh_open_file(), Sakura_bathy_st::len, Sakura_bathy_st::width, and Sakura_bathy_st::x.

Referenced by main().


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