/Users/huttone/Devel/sedflux-new/sedflux/trunk/ew/sed/sed_column.c File Reference

#include <glib.h>
#include <stdio.h>
#include "utils/utils.h"
#include "sed_column.h"

Go to the source code of this file.

Functions

 CLASS (Sed_column)
Sed_column sed_column_new (gssize n_bins)
Sed_column sed_column_new_filled (double t, Sed_size_class size)
Sed_column sed_column_destroy (Sed_column s)
Sed_column sed_column_clear (Sed_column s)
Sed_column sed_column_copy (Sed_column dest, const Sed_column src)
gboolean sed_column_is_same (const Sed_column c_1, const Sed_column c_2)
gboolean sed_column_is_same_data (const Sed_column c_1, const Sed_column c_2)
Sed_column sed_column_copy_data (Sed_column dest, const Sed_column src)
Sed_column sed_column_copy_public_data (Sed_column dest, const Sed_column src)
Sed_column sed_column_dup (const Sed_column src)
double * sed_column_cell_fraction (const Sed_column col, gssize i)
double sed_column_base_height (const Sed_column col)
double sed_column_position (const Sed_column col)
double sed_column_x_position (const Sed_column col)
double sed_column_y_position (const Sed_column col)
double sed_column_age (const Sed_column col)
double sed_column_sea_level (const Sed_column col)
Sed_column sed_column_set_position (Sed_column col, double x)
Sed_column sed_column_set_x_position (Sed_column col, double x)
Sed_column sed_column_set_y_position (Sed_column col, double y)
Sed_column sed_column_set_age (Sed_column c, double age)
Sed_column sed_column_set_sea_level (Sed_column c, double sl)
Sed_column sed_column_set_base_height (Sed_column c, double z)
Sed_column sed_column_adjust_base_height (Sed_column c, double dz)
double sed_column_cell_height (const Sed_column col)
double sed_column_z_res (const Sed_column col)
Sed_column sed_column_set_z_res (Sed_column col, double new_dz)
double sed_column_top_height (const Sed_column col)
gboolean sed_column_is_below (Sed_column col, double z)
gboolean sed_column_is_above (Sed_column col, double z)
double sed_column_mass (const Sed_column s)
double sed_column_sediment_mass (const Sed_column s)
double * sed_column_total_load (const Sed_column s, gssize start, gssize n_bins, double overlying_load, double *load)
double * sed_column_load (const Sed_column s, gssize start, gssize n_bins, double *load)
double * sed_column_load_with_water (const Sed_column s, gssize start, gssize n_bins, double *load)
double sed_column_water_pressure (const Sed_column s)
double * sed_column_total_property (Sed_property f, Sed_column c, gssize start, gssize n_bins, double *val)
double * sed_column_avg_property_with_load (Sed_property f, Sed_column c, gssize start, gssize n_bins, double *val)
double * sed_column_avg_property (Sed_property f, Sed_column c, gssize start, gssize n_bins, double *val)
double * sed_column_at_property (Sed_property f, Sed_column c, gssize start, gssize n_bins, double *val)
double sed_column_load_at (const Sed_column s, gssize n)
double sed_column_property_0 (Sed_property f, const Sed_column c)
double sed_column_property (Sed_property f, const Sed_column s)
Sed_column sed_column_resize_cell (Sed_column s, gssize i, double new_t)
Sed_column sed_column_compact_cell (Sed_column s, gssize i, double new_t)
double sed_column_add_cell_real (Sed_column col, Sed_cell cell, gboolean update_pressure)
double sed_column_add_cell (Sed_column col, Sed_cell cell)
double sed_column_add_cell_avg_pressure (Sed_column col, Sed_cell cell)
double sed_column_add_vec (Sed_column c, const double *t)
Sed_cell sed_column_top_cell (const Sed_column col)
Sed_cell sed_column_nth_cell (const Sed_column col, gssize n)
Sed_column sed_column_resize (Sed_column col, gssize n)
Sed_cell sed_column_extract_top_cell (Sed_column col, double f, Sed_cell dest)
Sed_column sed_column_remove_top_cell (Sed_column col, double f)
Sed_cell sed_column_extract_top (Sed_column col, double t, Sed_cell dest)
Sed_cell sed_column_extract_top_fill (Sed_column col, double t, Sed_cell fill, Sed_cell dest)
Sed_column sed_column_remove_top (Sed_column col, double t)
Sed_column sed_column_remove_top_erode (Sed_column col, double t)
Sed_cell sed_column_separate_top (Sed_column col, double t, double f[], Sed_cell rem_cell)
Sed_cell sed_column_separate_top_amounts (Sed_column col, double total_t, double t[], Sed_cell rem_cell)
Sed_cell sed_column_separate_top_amounts_fill (Sed_column col, double total_t, double t[], Sed_cell fill, Sed_cell rem_cell)
Sed_cell sed_column_top (const Sed_column col, double t, Sed_cell dest)
double sed_column_top_property_0 (Sed_property property, const Sed_column s, double top)
double sed_column_top_property (Sed_property property, const Sed_column s, double top)
double sed_column_top_rho (const Sed_column s, double top)
double sed_column_top_age (const Sed_column s, double top)
gssize sed_column_top_nbins (Sed_column s, double z)
gssize sed_column_index_at (const Sed_column s, double z)
gssize sed_column_write (FILE *fp, const Sed_column s)
gssize sed_column_write_to_byte_order (FILE *fp, const Sed_column s, gint order)
Sed_column sed_column_read (FILE *fp)
Sed_column sed_column_height_copy (const Sed_column src, double z, Sed_column dest)
Sed_column sed_column_chomp (Sed_column col, double bottom)
Sed_column sed_column_chop (Sed_column col, double top)
Sed_column sed_column_strip (Sed_column col, double bottom, double top)
double sed_column_water_depth (const Sed_column col)
int sed_get_column_size (const Sed_column col)
gssize sed_column_len (const Sed_column col)
gboolean sed_column_is_empty (const Sed_column col)
gboolean sed_column_is_valid_index (const Sed_column c, gssize n)
gboolean sed_column_is_get_index (const Sed_column c, gssize n)
gboolean sed_column_is_set_index (const Sed_column c, gssize n)
gssize sed_column_top_index (const Sed_column col)
double sed_column_thickness (const Sed_column col)
Sed_column sed_column_set_thickness (Sed_column col, double new_t)
gboolean sed_column_size_is (const Sed_column col, double t)
gboolean sed_column_mass_is (const Sed_column c, double m)
gboolean sed_column_sediment_mass_is (const Sed_column c, double m)
gboolean sed_column_base_height_is (const Sed_column c, double z)
gboolean sed_column_top_height_is (const Sed_column c, double z)
double sed_column_thickness_index (const Sed_column col, gssize ind)
double sed_column_depth_age (const Sed_column col, double age)
gssize sed_column_index_thickness (const Sed_column col, double t)
gssize sed_column_index_depth (const Sed_column col, double d)
Sed_cell sed_cell_add_column (Sed_cell dest, const Sed_column src)
Sed_column sed_column_add (Sed_column dest, const Sed_column src)
Sed_column sed_column_append (Sed_column dest, const Sed_column src)
Sed_column sed_column_remove (Sed_column s1, const Sed_column s2)
Sed_column sed_column_rebin (Sed_column col)
Sed_cell sed_column_extract_top_cell_loc (Sed_column col)
Sed_cellsed_column_extract_cells_above (Sed_column col, double z)
Sed_cellsed_column_extract_top_n_cells (Sed_column col, gint n_cells)
Sed_column sed_column_stack_cells (Sed_column dest, Sed_cell *src)
Sed_column sed_column_stack_cells_loc (Sed_column dest, Sed_cell *src)
double sed_column_stack_cell_real (Sed_column col, Sed_cell cell, gboolean update_pressure)
double sed_column_stack_cell_loc_real (Sed_column col, Sed_cell cell, gboolean update_pressure)
double sed_column_stack_cell (Sed_column col, Sed_cell cell)
double sed_column_stack_cell_loc (Sed_column col, Sed_cell cell)


Function Documentation

CLASS ( Sed_column   ) 

< Array of cells making up the column

< Height from some datum to bottom of column

< The thickness of the column

< Number of filled cells in the column

< Total amount of cells available in column

< Height of a cell of sediment

< x-position of this column

< y-position of this column

< age of this column

< sea level

Definition at line 30 of file sed_column.c.

Sed_cell sed_cell_add_column ( Sed_cell  dest,
const Sed_column  src 
)

Add the sediment from a portion of a column to a cell.

Sediment is added from the source column to the destination cell. The destination cell is not cleared before the addition of the new sediment.

Parameters:
dest A pointer to the destination Sed_cell.
src A pointer to the source Sed_column.
Returns:
A pointer the the destination Sed_cell.

Definition at line 2355 of file sed_column.c.

References eh_return_val_if_fail, sed_cell_add(), sed_cell_new(), and sed_sediment_env_n_types().

Sed_column sed_column_add ( Sed_column  dest,
const Sed_column  src 
)

Add the contents of one column to the top of another.

The contents of one column is added to the top of another. No sediment is removed from the source column. The sediment is copied and then added to the destination column.

Parameters:
dest A pointer to the destination Sed_column.
src A pointer to the source Sed_column.
Returns:
A pointer to the destination Sed_column.

Definition at line 2384 of file sed_column.c.

References eh_return_val_if_fail, sed_column_add_cell(), and sed_column_new().

Referenced by sed_cube_add().

double sed_column_add_cell ( Sed_column  col,
Sed_cell  cell 
)

Add a Sed_cell to the top of a Sed_column.

The contents of a Sed_cell is added to the top of a Sed_column. This is the default mode. In this case the pressures of the cells of the column are updated to reflect the increase in overlying load due to the new sediment.

Parameters:
col A pointer to a Sed_column.
cell A pointer to a Sed_cell.
Returns:
The amount of sediment that is to be added to the column. This is just the thickness of the input cell.
See also:
sed_add_cell_to_column_avg_pressure .

Definition at line 1184 of file sed_column.c.

References sed_column_add_cell_real().

Referenced by _scan_sediment_column(), add_sediment_from_external_source(), add_suspended_sediment(), deposit_in_river(), deposit_sediment_helper(), diffuse_sediment(), diffuse_sediment_2(), fill_to_bruun(), fill_to_bruun_profile(), inflow_deposit_sediment(), main(), move_sediment(), rain_3(), run_debris_flow(), sakura_deposit_sediment(), sed_column_add(), sed_column_add_vec(), sed_column_extract_cells_above(), sed_column_new_filled(), sed_column_separate_top(), sed_column_separate_top_amounts(), sed_column_separate_top_amounts_fill(), squall(), and test_2d().

double sed_column_add_cell_avg_pressure ( Sed_column  col,
Sed_cell  cell 
)

Add a Sed_cell to the top of a Sed_column.

The contents of a Sed_cell is added to the top of a Sed_column. This is different from sed_add_cell_to_column: In this case, the pressure of the top cell is averaged with the new cell.

Parameters:
col A pointer to a Sed_column.
cell A pointer to a Sed_cell.
Returns:
The amount of sediment that is to be added to the column. This is just the thickness of the input cell.
See also:
sed_add_cell_to_column .

Definition at line 1203 of file sed_column.c.

References sed_column_add_cell_real().

Referenced by sed_column_rebin().

double sed_column_add_cell_real ( Sed_column  col,
Sed_cell  cell,
gboolean  update_pressure 
)

Add a Sed_cell to the top of a Sed_column.

This interface should not be used. Rather, the user should use the short cuts sed_add_cell_to_column or sed_add_cell_to_column_avg_pressure instead, depending weather the pressures should be updated or just averaged.

Parameters:
col A pointer to a Sed_column.
cell A pointer to a Sed_cell.
update_pressure Should the cell pressures be updated or averaged.
Returns:
The amount of sediment that is to be added to the column. This is just the thickness of the input cell.
See also:
sed_add_cell_to_column , sed_add_cell_to_column_avg_pressure .

Definition at line 1090 of file sed_column.c.

References eh_require, sed_cell_add(), sed_cell_copy(), sed_cell_destroy(), sed_cell_dup(), sed_cell_is_empty(), sed_cell_load(), sed_cell_pressure(), sed_cell_resize(), sed_cell_set_pressure(), sed_cell_size(), sed_column_is_empty(), sed_column_len(), sed_column_nth_cell(), sed_column_resize(), sed_column_set_thickness(), sed_column_thickness(), sed_column_top_cell(), sed_column_water_pressure(), and sed_column_z_res().

Referenced by sed_column_add_cell(), and sed_column_add_cell_avg_pressure().

double sed_column_add_vec ( Sed_column  c,
const double *  t 
)

Add a vector of thicknesses to a Sed_column.

Add sediment to a column based on the amounts in an array. The input array should be the same length as the number of sediment types used in the sediment column. The order of the sediment types is also the same.

Parameters:
c A pointer to a Sed_column.
t An array of sediment thicknesses.
Returns:
The total amount of sediment that was added to the column.

Definition at line 1219 of file sed_column.c.

References eh_require, sed_cell_add_amount(), sed_cell_destroy(), sed_cell_new(), sed_column_add_cell(), and sed_sediment_env_n_types().

Referenced by muddy(), and sakura_sed_add_sediment().

Sed_column sed_column_adjust_base_height ( Sed_column  c,
double  dz 
)

Definition at line 436 of file sed_column.c.

Referenced by sed_column_extract_top_fill().

double sed_column_age ( const Sed_column  col  ) 

Definition at line 350 of file sed_column.c.

Referenced by sed_column_property(), and sed_column_top_property().

Sed_column sed_column_append ( Sed_column  dest,
const Sed_column  src 
)

Definition at line 2401 of file sed_column.c.

References eh_require, and sed_column_stack_cell().

double* sed_column_at_property ( Sed_property  f,
Sed_column  c,
gssize  start,
gssize  n_bins,
double *  val 
)

Get the value of a specified property for a series of Sed_cell's

This function will get specifed property for a series of Sed_cell's within a Sed_column. The property will be obtained using the Sed_property_func, f. The first query will be at the start'th cell and work up the Sed_column. If a value of NULL is passed for the val parameter, an array will be created. If n_bins<=0, the query will run to the top of the sediment column. If non-NULL value is passed for val, care should be taken to assure that there is enough memory to hold all of the total values.

Parameters:
f A function to get a property from a Sed_cell.
c A pointer to a Sed_column.
start Index to the Sed_cell to begin at.
n_bins The number of Sed_cell's to consider.
val A pointer to an array that will hold the values.
Returns:
A pointer to a possibly newly created array of average values.
See also:
sed_get_column_load , sed_get_column_avg_property_with_load . sed_get_column_avg_property .

Definition at line 852 of file sed_column.c.

References eh_new, eh_require, and sed_property_measure().

double* sed_column_avg_property ( Sed_property  f,
Sed_column  c,
gssize  start,
gssize  n_bins,
double *  val 
)

Get the average of a specified property for a series of Sed_cell's

This function will average a specifed property of a series of Sed_cell's within a Sed_column. The property will be obtained using the Sed_property_with_load_func, f. The average will begin at the start'th cell and work up the Sed_column. The average for each cell will be the average of the property values of the cells preceding it as well as its own. If a value of NULL is passed for the val parameter, an array will be created. If n_bins<=0, the total will run to the top of the sediment column. If non-NULL value is passed for val, care should be taken to assure that there is enough memory to hold all of the total values.

This is the same as the sed_get_avg_property_with_load function except that here the parameter, f is a Sed_property_func.

Parameters:
f A function to get a property from a Sed_cell.
c A pointer to a Sed_column.
start Index to the Sed_cell to begin at.
n_bins The number of Sed_cell's to consider.
val A pointer to an array that will hold the average values.
Returns:
A pointer to a possibly newly created array of average values.
See also:
sed_get_column_load , sed_get_column_avg_property_with_load .

Definition at line 789 of file sed_column.c.

References eh_free, eh_new, eh_require, sed_cell_size(), and sed_property_measure().

Referenced by fail_reinit_fail_column().

double* sed_column_avg_property_with_load ( Sed_property  f,
Sed_column  c,
gssize  start,
gssize  n_bins,
double *  val 
)

Get the average of a specified property for a series of Sed_cell's

This function will average a specifed property of a series of Sed_cell's within a Sed_column. The property will be obtained using the Sed_property_with_load_func, f. The average will begin at the start'th cell and work up the Sed_column. The average for each cell will be the average of the property values of the cells preceding it as well as its own. If a value of NULL is passed for the val parameter, an array will be created. If n_bins<=0, the total will run to the top of the sediment column. If non-NULL value is passed for val, care should be taken to assure that there is enough memory to hold all of the total values.

This is the same as the sed_get_avg_property function except that here the parameter, f is a Sed_property_with_load_func.

Parameters:
f A function to get a property from a Sed_cell.
c A pointer to a Sed_column.
start Index to the Sed_cell to begin at.
n_bins The number of Sed_cell's to consider.
val A pointer to an array that will hold the total values.
Returns:
A pointer to a possibly newly created array of average values.
See also:
sed_get_column_load , sed_get_column_avg_property .

Definition at line 723 of file sed_column.c.

References eh_free, eh_new, eh_require, sed_cell_size(), sed_column_load(), and sed_property_measure().

Referenced by fail_reinit_fail_column().

double sed_column_base_height ( const Sed_column  col  ) 

Get the height of a Sed_column

Parameters:
col A pointer to a Sed_column.
Returns:
The height to the bottom of a Sed_column.

Definition at line 294 of file sed_column.c.

References eh_return_val_if_fail.

Referenced by fail_reinit_fail_column(), sed_column_base_height_is(), sed_column_chomp(), sed_column_chop(), sed_column_height_copy(), sed_column_index_at(), sed_column_remove(), sed_column_top_nbins(), sed_cube_adjust_base_height(), and sed_cube_base_height().

gboolean sed_column_base_height_is ( const Sed_column  c,
double  z 
)

Definition at line 2222 of file sed_column.c.

References eh_compare_dbl(), and sed_column_base_height().

double* sed_column_cell_fraction ( const Sed_column  col,
gssize  i 
)

Get fraction information from a Sed_cell of a Sed_column.

Get an array of fractions for each grain type contained within the specified Sed_cell. The index is counted from the bottom of the Sed_column to the top. That is, i=0 refers to the lowest cell within the column.

Parameters:
col A pointer to a Sed_column.
i Index to a Sed_cell of the column.
Returns:
A pointer to the fraction information for the requested Sed_cell.

Definition at line 283 of file sed_column.c.

References sed_cell_fraction_ptr().

double sed_column_cell_height ( const Sed_column  col  ) 

Get the vertical resolution of a Sed_column

The vertical resolution of a Sed_column is the initial thickness of the Sed_cell's that make it up. Sediment can be added to the cell until it reached this thickness. After it is full, sediment is then added to the cell above. Also, it can later be squeezed to a new thickness.

Parameters:
col A pointer to a Sed_column.
Returns:
The vertical resolution of the Sed_column.

Definition at line 453 of file sed_column.c.

Sed_column sed_column_chomp ( Sed_column  col,
double  bottom 
)

Bite off the begining of a column.

Remove the bottom portion of a column starting at an elevation, bottom.

Parameters:
col A pointer to a Sed_column.
bottom The elevation where the bite will end.
See also:
sed_chop_column , sed_strip_column .

Definition at line 2046 of file sed_column.c.

References eh_return_val_if_fail, sed_column_base_height(), sed_column_copy(), sed_column_destroy(), and sed_column_height_copy().

Referenced by sed_column_strip().

Sed_column sed_column_chop ( Sed_column  col,
double  top 
)

Cut off the last portion of a column.

Cut off the top part of a column starting at an elevation, top.

Parameters:
col A pointer to a Sed_column.
top The elevation where the cut is to be made.
See also:
sed_chomp_column , sed_strip_column .

Definition at line 2070 of file sed_column.c.

References eh_return_val_if_fail, sed_column_base_height(), sed_column_remove_top(), sed_column_set_base_height(), and sed_column_top_height().

Referenced by sed_column_strip().

Sed_column sed_column_clear ( Sed_column  s  ) 

Remove all of the sediment from a column.

Parameters:
s The column to remove the sediment from.

Definition at line 122 of file sed_column.c.

References sed_cell_clear().

Referenced by sed_column_rebin().

Sed_column sed_column_compact_cell ( Sed_column  s,
gssize  i,
double  new_t 
)

Compact a cell within a column.

Change the thickness of a cell within a column. The thickness of the specifed cell is changed as well as the thickness of the sediment column. The current thickness of the cell is changed but its original thickness not changed. This will therefore cause the sediment to become more dense.

Parameters:
s A pointer to a Sed_column.
i Index to a Sed_cell within a Sed_column.
new_t The new thickness of the Sed_cell.
Returns:
A pointer to the input Sed_column.
See also:
sed_compact_cell_in_column .

Definition at line 1061 of file sed_column.c.

References eh_require, sed_cell_compact(), sed_cell_size(), sed_column_is_get_index(), sed_column_set_thickness(), and sed_column_thickness().

Referenced by compact().

Sed_column sed_column_copy ( Sed_column  dest,
const Sed_column  src 
)

Copy one column to another.

Copy the contents of one Sed_column into another. Memory must already be allocated for the destination column. Any sediment information that is stored in the destination column will be destroyed and replaced with the information from the source column.

Parameters:
dest The destination column.
src The source column.
Returns:
The destination column is returned.
See also:
sed_dup_column

Definition at line 151 of file sed_column.c.

References eh_require, sed_cell_copy(), sed_column_new(), and sed_column_resize().

Referenced by sed_column_chomp(), sed_column_dup(), sed_column_rebin(), and sed_cube_property_subgrid().

Sed_column sed_column_copy_data ( Sed_column  dest,
const Sed_column  src 
)

Definition at line 223 of file sed_column.c.

References eh_require.

Sed_column sed_column_copy_public_data ( Sed_column  dest,
const Sed_column  src 
)

Definition at line 241 of file sed_column.c.

References eh_require.

Referenced by sed_column_height_copy().

double sed_column_depth_age ( const Sed_column  col,
double  age 
)

Get the burial depth to sediment of a specified age.

Parameters:
col A pointer to a Sed_column.
age The age of the buried sediment.
Returns:
The depth from the top of a Sed_column to sediment of the specified age.

Definition at line 2267 of file sed_column.c.

References eh_require, sed_cell_age(), and sed_cell_size().

Referenced by muddy().

Sed_column sed_column_destroy ( Sed_column  s  ) 

Destroy a column of sediment.

Parameters:
s The Sed_column to be destroyed.
See also:
sed_column_new

Definition at line 101 of file sed_column.c.

References eh_free, and sed_cell_destroy().

Referenced by _scan_sediment_column(), main(), sed_column_chomp(), sed_column_rebin(), sed_cube_free(), and sed_cube_property_subgrid().

Sed_column sed_column_dup ( const Sed_column  src  ) 

Create a column as a copy of another.

This is the copy constructor for a Sed_column.

Parameters:
src The source column.
Returns:
The newly created column is returned.
See also:
sed_dup_column

Definition at line 266 of file sed_column.c.

References sed_column_copy().

Referenced by sed_cube_property_subgrid().

Sed_cell* sed_column_extract_cells_above ( Sed_column  col,
double  z 
)

Definition at line 2495 of file sed_column.c.

References eh_require, sed_cell_destroy(), sed_cell_resize(), sed_cell_size(), sed_column_add_cell(), sed_column_extract_top_n_cells(), sed_column_is_empty(), sed_column_top_height(), and sed_column_top_nbins().

Referenced by sed_column_bioturbate().

Sed_cell sed_column_extract_top ( Sed_column  col,
double  t,
Sed_cell  dest 
)

Remove the top of a column and save the sediment.

The top thickness units is removed from the cells at the top of a sediment column. The removed sediment is placed into the destination cell. The destination cell is cleared before the new sediment is added. If a NULL value is passed as the destination cell, a new cell is created to hold the sediment.

Parameters:
col A pointer to a Sed_column.
t The amount of sediment to remove from the top of the column.
dest A pointer to a Sed_cell to hold the removed sediment.
Returns:
A pointer to a Sed_cell that holds the removed sediment.
See also:
sed_remove_top_from_column , sed_get_top_from_column.

Definition at line 1416 of file sed_column.c.

References sed_column_extract_top_fill().

Referenced by erode_profile(), muddy(), sakura_sed_get_phe(), sed_column_separate_top(), sed_column_separate_top_amounts(), sed_get_phe(), and squall().

Sed_cell sed_column_extract_top_cell ( Sed_column  col,
double  f,
Sed_cell  dest 
)

Remove part of the top cell of a column and save the sediment.

The top fraction (given by f) is removed from the cell at the top of a sediment column. The removed sediment is placed into the destination cell. The destination cell is cleared before the new sediment is added. If a NULL value is passed as the destination cell, a new cell is created to hold the sediment.

Parameters:
col A pointer to a Sed_column.
f The fraction of the top cell to remove.
dest A pointer to a Sed_cell to hold the removed sediment.
Returns:
A pointer to a Sed_cell that holds the removed sediment.
See also:
sed_column_remove_cell.

Definition at line 1336 of file sed_column.c.

References eh_clamp, eh_require, sed_cell_copy(), sed_cell_resize(), sed_cell_size(), sed_column_is_empty(), sed_column_remove_top_cell(), and sed_column_top_cell().

Referenced by sed_column_extract_top_fill().

Sed_cell sed_column_extract_top_cell_loc ( Sed_column  col  ) 

Definition at line 2472 of file sed_column.c.

References eh_require, eh_require_not_reached, sed_cell_size(), sed_column_is_empty(), sed_column_len(), sed_column_set_thickness(), and sed_column_thickness().

Sed_cell sed_column_extract_top_fill ( Sed_column  col,
double  t,
Sed_cell  fill,
Sed_cell  dest 
)

Definition at line 1423 of file sed_column.c.

References eh_require, eh_watch_dbl, sed_cell_add(), sed_cell_clear(), sed_cell_destroy(), sed_cell_new(), sed_cell_new_env(), sed_cell_resize(), sed_cell_size(), sed_column_adjust_base_height(), sed_column_extract_top_cell(), sed_column_is_empty(), sed_column_top_cell(), and sed_sediment_env_n_types().

Referenced by sed_column_extract_top(), and sed_column_separate_top_amounts_fill().

Sed_cell* sed_column_extract_top_n_cells ( Sed_column  col,
gint  n_cells 
)

Definition at line 2560 of file sed_column.c.

References eh_clamp, eh_new, eh_require, sed_cell_new_env(), sed_cell_size(), sed_column_len(), sed_column_set_thickness(), and sed_column_thickness().

Referenced by sed_column_extract_cells_above().

Sed_column sed_column_height_copy ( const Sed_column  src,
double  z,
Sed_column  dest 
)

Get a column from a portion of another.

Get a portion of one column from another. The copy begins at an elevation, height from the source column. No sediment is removed from the source column. Information is only copied. If NULL is passed for the destination column, a new column is created.

Parameters:
src A pointer to the source Sed_column.
z The elevation to start the copy.
dest A pointer to the destination Sed_column.
Returns:
A pointer to the destination column.

Definition at line 1994 of file sed_column.c.

References eh_return_val_if_fail, sed_cell_resize(), sed_column_base_height(), sed_column_copy_public_data(), sed_column_index_thickness(), sed_column_len(), sed_column_new(), sed_column_set_base_height(), sed_column_stack_cell(), and sed_column_thickness_index().

Referenced by sed_column_chomp(), sed_cube_copy_cols(), and sed_cube_copy_line().

gssize sed_column_index_at ( const Sed_column  s,
double  z 
)

Get the index of a cell at a specified elevation within a column.

Parameters:
s A pointer to a Sed_column.
z The elevation of a Sed_cell within a Sed_column.
Returns:
The index to a cell at a given elevation.

Definition at line 1870 of file sed_column.c.

References eh_return_val_if_fail, sed_column_base_height(), and sed_column_index_thickness().

Referenced by fail_reinit_fail_column().

gssize sed_column_index_depth ( const Sed_column  col,
double  d 
)

Get the index to a cell that is at a specified burial depth.

Parameters:
col A pointer to a Sed_column.
d Burial depth of a Sed_cell.
Returns:
The index to a Sed_cell that is buried at a specified depth.

Definition at line 2322 of file sed_column.c.

References eh_lower_bound, eh_return_val_if_fail, sed_cell_size(), sed_column_index_thickness(), and sed_column_thickness().

Referenced by get_m(), and sed_column_index_thickness().

gssize sed_column_index_thickness ( const Sed_column  col,
double  t 
)

Get the index to the cell that is a specified height above a column bottom.

Parameters:
col A pointer to a Sed_column.
t Sediment thickness to a Sed_cell within a Sed_column.
Returns:
The index to the Sed_cell that is a specifed distance from the bottom of a Sed_column.

Definition at line 2291 of file sed_column.c.

References eh_lower_bound, eh_return_val_if_fail, sed_cell_size(), sed_column_index_depth(), and sed_column_thickness().

Referenced by sed_column_height_copy(), sed_column_index_at(), sed_column_index_depth(), and sed_column_top_nbins().

gboolean sed_column_is_above ( Sed_column  col,
double  z 
)

Test if the top of a column is above some elevation.

Parameters:
col A pointer to a Sed_column.
z The reference elevation.
Returns:
TRUE if the top of the column is above the elevation.
See also:
sed_column_below .

Definition at line 506 of file sed_column.c.

References sed_column_top_height().

Referenced by sed_cube_count_above(), and sed_cube_find_line_path().

gboolean sed_column_is_below ( Sed_column  col,
double  z 
)

Test if the top of a column is below some elevation.

Parameters:
col A pointer to a Sed_column.
z The reference elevation.
Returns:
TRUE if the top of the column is below the elevation.
See also:
sed_column_above .

Definition at line 492 of file sed_column.c.

References sed_column_top_height().

Referenced by is_shore_cell(), sed_cube_find_line_path(), sed_cube_find_shore(), sed_cube_find_shore_edge(), and sed_cube_is_shore_edge().

gboolean sed_column_is_empty ( const Sed_column  col  ) 

Definition at line 2137 of file sed_column.c.

References eh_return_val_if_fail.

Referenced by sed_column_add_cell_real(), sed_column_extract_cells_above(), sed_column_extract_top_cell(), sed_column_extract_top_cell_loc(), sed_column_extract_top_fill(), sed_column_remove(), sed_column_remove_top(), sed_column_remove_top_cell(), sed_column_top(), sed_column_top_cell(), sed_column_top_nbins(), and sed_cube_col_is_empty().

gboolean sed_column_is_get_index ( const Sed_column  c,
gssize  n 
)

Is the index to a cell that can be read.

Definition at line 2153 of file sed_column.c.

References eh_return_val_if_fail.

Referenced by sed_column_compact_cell(), and sed_column_resize_cell().

gboolean sed_column_is_same ( const Sed_column  c_1,
const Sed_column  c_2 
)

Definition at line 183 of file sed_column.c.

References sed_cell_is_same(), sed_column_is_same_data(), and sed_column_len().

gboolean sed_column_is_same_data ( const Sed_column  c_1,
const Sed_column  c_2 
)

Definition at line 204 of file sed_column.c.

References eh_compare_dbl().

Referenced by sed_column_is_same().

gboolean sed_column_is_set_index ( const Sed_column  c,
gssize  n 
)

Is the index to a cell that can be added to.

Definition at line 2161 of file sed_column.c.

References eh_return_val_if_fail.

Referenced by sed_column_nth_cell().

gboolean sed_column_is_valid_index ( const Sed_column  c,
gssize  n 
)

Is the index in bounds.

Definition at line 2145 of file sed_column.c.

References eh_return_val_if_fail.

gssize sed_column_len ( const Sed_column  col  ) 

Definition at line 2130 of file sed_column.c.

References eh_return_val_if_fail.

Referenced by _print_sediment_column(), compact(), get_janbu_parameters(), run_darcy_flow(), run_exponential_flow(), run_flow(), run_terzaghi_flow(), sed_column_add_cell_real(), sed_column_extract_top_cell_loc(), sed_column_extract_top_n_cells(), sed_column_height_copy(), sed_column_is_same(), sed_column_mass(), sed_column_property(), sed_column_property_0(), sed_column_rebin(), sed_column_sediment_mass(), sed_column_stack_cell_loc_real(), sed_column_stack_cell_real(), sed_column_thickness_index(), sed_column_top(), sed_cube_n_rows_between(), and sed_cube_property_subgrid().

double* sed_column_load ( const Sed_column  s,
gssize  start,
gssize  n_bins,
double *  load 
)

Definition at line 610 of file sed_column.c.

References sed_column_total_load().

Referenced by compact(), run_darcy_flow(), sed_column_avg_property_with_load(), sed_column_property(), and sed_cube_property_subgrid().

double sed_column_load_at ( const Sed_column  s,
gssize  n 
)

Get the load felt by the cell n cells from the bottom of the column.

Parameters:
s A pointer to a Sed_column.
n The index of the cell where the load is felt.
Returns:
The load felt by the n-th cell.

Definition at line 887 of file sed_column.c.

References eh_lower_bound, eh_require, and sed_cell_load().

Referenced by sed_cube_load().

double* sed_column_load_with_water ( const Sed_column  s,
gssize  start,
gssize  n_bins,
double *  load 
)

Definition at line 618 of file sed_column.c.

References sed_column_total_load(), and sed_column_water_pressure().

double sed_column_mass ( const Sed_column  s  ) 

Get the mass of sediment within a column.

Parameters:
s A pointer to a Sed_column.
Returns:
The total mass of sediment contained within a Sed_column.

Definition at line 517 of file sed_column.c.

References eh_require, sed_cell_mass(), and sed_column_len().

Referenced by move_sediment(), sed_column_bioturbate(), sed_column_mass_is(), and sed_cube_mass().

gboolean sed_column_mass_is ( const Sed_column  c,
double  m 
)

Definition at line 2212 of file sed_column.c.

References eh_compare_dbl(), and sed_column_mass().

Sed_column sed_column_new ( gssize  n_bins  ) 

Create a column of sediment

Parameters:
n_bins the number of Sed_cell's in the column.
Returns:
A newly created Sed_column. NULL is returned if there was a problem allocating memory.
See also:
sed_column_destroy

Definition at line 56 of file sed_column.c.

References NEW_OBJECT, and sed_column_resize().

Referenced by _scan_sediment_column(), main(), sed_column_add(), sed_column_copy(), sed_column_height_copy(), sed_column_new_filled(), sed_column_rebin(), and sed_cube_new().

Sed_column sed_column_new_filled ( double  t,
Sed_size_class  size 
)

Definition at line 82 of file sed_column.c.

References sed_cell_destroy(), sed_cell_new_classed(), sed_column_add_cell(), and sed_column_new().

Sed_cell sed_column_nth_cell ( const Sed_column  col,
gssize  n 
)

Get the n-th cell from a column.

Get a pointer to the Sed_cell that is n cells from the bottom of a Sed_column.

Parameters:
col A pointer to a Sed_column.
n The index of the cell.
Returns:
A pointer to the n-th Sed_cell of a Sed_column.

Definition at line 1266 of file sed_column.c.

References eh_return_val_if_fail, and sed_column_is_set_index().

Referenced by _print_sediment_column(), compact(), fail_reinit_fail_column(), get_janbu_parameters(), get_m(), run_darcy_flow(), run_exponential_flow(), run_terzaghi_flow(), sed_column_add_cell_real(), sed_column_top(), sed_cube_property_subgrid(), sed_measure_cube_age(), sed_measure_cube_clay_fraction(), sed_measure_cube_density(), sed_measure_cube_facies(), sed_measure_cube_grain_size(), sed_measure_cube_mud_fraction(), sed_measure_cube_permeability(), sed_measure_cube_porosity(), sed_measure_cube_sand_fraction(), and sed_measure_cube_silt_fraction().

double sed_column_position ( const Sed_column  col  ) 

Get the position of a Sed_column

Get the horizontal position of a Sed_column. Currently this is only designed for 2d and so the position only contains one horizontal coordinate.

Parameters:
col A pointer to a Sed_column.
Returns:
The position of the Sed_column.
See also:
sed_get_column_x_position , sed_get_column_y_position .

Definition at line 311 of file sed_column.c.

double sed_column_property ( Sed_property  f,
const Sed_column  s 
)

Get the average property from over the cells within a column.

Use the Sed_property_with_load_func, f, to get the average property value of all the Sed_cell's in a Sed_column.

This is the same as sed_get_column_property except here f is of type Sed_property_with_load_func.

Parameters:
f A function to get a property from a Sed_cell.
s A pointer to a Sed_column.
Returns:
The average property value for the column.
See also:
sed_get_column_property .

Definition at line 959 of file sed_column.c.

References eh_free, eh_new, eh_require, sed_cell_size(), sed_column_age(), sed_column_len(), sed_column_load(), sed_column_thickness(), sed_property_is_named(), sed_property_measure(), and sed_property_n_args().

double sed_column_property_0 ( Sed_property  f,
const Sed_column  c 
)

Get the average property from over the cells within a column.

Use the Sed_property_func, f, to get the average property value of all the Sed_cell's in a Sed_column.

This is the same as sed_get_column_property_with_load except here f is of type Sed_property_func.

Parameters:
f A function to get a property from a Sed_cell.
c A pointer to a Sed_column.
Returns:
The average property value for the column.
See also:
sed_get_column_property .

Definition at line 921 of file sed_column.c.

References eh_require, sed_cell_size(), sed_column_len(), sed_column_thickness(), and sed_property_measure().

Sed_column sed_column_read ( FILE *  fp  ) 

Read Sed_column information from a binary file.

Parameters:
fp A pointer to an open file.
Returns:
A pointer to the loaded Sed_column.

Definition at line 1944 of file sed_column.c.

References eh_new, eh_require, NEW_OBJECT, and sed_cell_read().

Referenced by sed_cube_read().

Sed_column sed_column_rebin ( Sed_column  col  ) 

Rebin the cells of a column to their original size.

Parameters:
col A pointer to a Sed_column.
Returns:
A pointer to the input Sed_column.

Definition at line 2442 of file sed_column.c.

References eh_require, sed_column_add_cell_avg_pressure(), sed_column_clear(), sed_column_copy(), sed_column_destroy(), sed_column_len(), and sed_column_new().

Referenced by main(), and sed_cube_property_subgrid().

Sed_column sed_column_remove ( Sed_column  s1,
const Sed_column  s2 
)

Definition at line 2417 of file sed_column.c.

References eh_return_val_if_fail, sed_column_base_height(), sed_column_is_empty(), sed_column_remove_top(), sed_column_set_base_height(), and sed_column_top_height().

Referenced by sed_cube_remove().

Sed_column sed_column_remove_top ( Sed_column  col,
double  t 
)

Remove the top of a column.

The top thickness units is removed from the cells at the top of a sediment column. The removed sediment is discarded.

Parameters:
col A pointer to a Sed_column.
t The amount of sediment to remove from the top of the column.
See also:
sed_extract_top_from_column , sed_get_top_from_column .

Definition at line 1506 of file sed_column.c.

References eh_require, sed_cell_size(), sed_column_is_empty(), sed_column_remove_top_cell(), and sed_column_top_cell().

Referenced by inflow_erode_sediment(), sakura_erode_sediment(), sed_column_chop(), sed_column_remove(), and sed_column_remove_top_erode().

Sed_column sed_column_remove_top_cell ( Sed_column  col,
double  f 
)

Remove part of the top cell of a column.

The top fraction (given by f) is removed from the cell at the top of a sediment column. The removed sediment is discarded.

Parameters:
col A pointer to a Sed_column.
f The fraction of the top cell to remove.
See also:
sed_extract_cell_from_column .

Definition at line 1372 of file sed_column.c.

References eh_clamp, eh_require, eh_require_not_reached, sed_cell_clear(), sed_cell_resize(), sed_cell_size(), sed_column_is_empty(), sed_column_set_thickness(), sed_column_thickness(), and sed_column_top_cell().

Referenced by sed_column_extract_top_cell(), and sed_column_remove_top().

Sed_column sed_column_remove_top_erode ( Sed_column  col,
double  t 
)

Definition at line 1541 of file sed_column.c.

References eh_require, sed_column_remove_top(), and sed_column_thickness().

Sed_column sed_column_resize ( Sed_column  col,
gssize  n 
)

Change the number of cells within a column.

Change the number of cells that are contained within a column. If the new size is greater than the current size, more memory is allocated and new (cleared) Sed_cell's are added to the top of the Sed_column. If the new size is smaller, the cells from the smaller size to the current size are cleared. In this case, no memory is freed.

Parameters:
col A pointer to a Sed_column.
n The new size of the Sed_column.

Definition at line 1290 of file sed_column.c.

References eh_new, eh_renew, eh_require, S_ADDBINS, sed_cell_clear(), and sed_cell_new_env().

Referenced by sed_column_add_cell_real(), sed_column_copy(), sed_column_new(), sed_column_stack_cell_loc_real(), and sed_column_stack_cell_real().

Sed_column sed_column_resize_cell ( Sed_column  s,
gssize  i,
double  new_t 
)

Change the thickness of a cell within a column.

Change the thickness of a cell within a column. The thickness of the specifed cell is changed as well as the thickness of the sediment column. The cell thickness is changed in such a way so as to retain its degree of compactedness.

Parameters:
s A pointer to a Sed_column.
i Index to a Sed_cell within a Sed_column.
new_t The new thickness of the Sed_cell.
Returns:
A pointer to the input Sed_column.
See also:
sed_compact_cell_in_column .

Definition at line 1029 of file sed_column.c.

References eh_lower_bound, eh_require, sed_cell_resize(), sed_cell_size(), sed_column_is_get_index(), sed_column_set_thickness(), and sed_column_thickness().

Referenced by _scan_sediment_column().

double sed_column_sea_level ( const Sed_column  col  ) 

Definition at line 355 of file sed_column.c.

Referenced by sed_column_water_depth().

double sed_column_sediment_mass ( const Sed_column  s  ) 

Definition at line 534 of file sed_column.c.

References eh_require, sed_cell_sediment_mass(), and sed_column_len().

Referenced by _sed_diag_mass(), sed_column_sediment_mass_is(), and sed_cube_sediment_mass().

gboolean sed_column_sediment_mass_is ( const Sed_column  c,
double  m 
)

Definition at line 2217 of file sed_column.c.

References eh_compare_dbl(), and sed_column_sediment_mass().

Sed_cell sed_column_separate_top ( Sed_column  col,
double  t,
double  f[],
Sed_cell  rem_cell 
)

Definition at line 1560 of file sed_column.c.

References sed_cell_destroy(), sed_cell_new(), sed_cell_separate_fraction(), sed_column_add_cell(), sed_column_extract_top(), and sed_sediment_env_n_types().

Referenced by diffuse_sediment(), diffuse_sediment_2(), and sakura_sed_remove_sediment().

Sed_cell sed_column_separate_top_amounts ( Sed_column  col,
double  total_t,
double  t[],
Sed_cell  rem_cell 
)

Definition at line 1575 of file sed_column.c.

References sed_cell_destroy(), sed_cell_new(), sed_cell_separate_amount(), sed_column_add_cell(), sed_column_extract_top(), and sed_sediment_env_n_types().

Sed_cell sed_column_separate_top_amounts_fill ( Sed_column  col,
double  total_t,
double  t[],
Sed_cell  fill,
Sed_cell  rem_cell 
)

Definition at line 1590 of file sed_column.c.

References sed_cell_destroy(), sed_cell_new_env(), sed_cell_separate_amount(), sed_column_add_cell(), and sed_column_extract_top_fill().

Referenced by move_sediment().

Sed_column sed_column_set_age ( Sed_column  c,
double  age 
)

Definition at line 418 of file sed_column.c.

Referenced by main().

Sed_column sed_column_set_base_height ( Sed_column  c,
double  z 
)

Definition at line 430 of file sed_column.c.

Referenced by main(), sed_column_chop(), sed_column_height_copy(), sed_column_remove(), sed_cube_adjust_base_height(), sed_cube_new_from_file(), sed_cube_set_base_height(), and sed_cube_set_bathy().

Sed_column sed_column_set_position ( Sed_column  col,
double  x 
)

Set the position of a Sed_column

Set the horizontal position of a Sed_column. Currently this is only designed for 2d and so the position only contains one horizontal coordinate.

NOTE: This function is now deprecated. Use sed_set_column_x_position instead.

Parameters:
col A pointer to a Sed_column.
x The new horizontal location of the Sed_column.
Returns:
A pointer to the input Sed_column.
See also:
sed_set_column_x_position , sed_set_column_y_position .

Definition at line 374 of file sed_column.c.

Sed_column sed_column_set_sea_level ( Sed_column  c,
double  sl 
)

Definition at line 424 of file sed_column.c.

Referenced by sed_cube_set_sea_level().

Sed_column sed_column_set_thickness ( Sed_column  col,
double  new_t 
)

Set the thickness of sediment in a Sed_column.

Parameters:
col A pointer to a Sed_column.
new_t The new thickness of a Sed_column.
Returns:
A pointer to the input Sed_column.

Definition at line 2200 of file sed_column.c.

Referenced by sed_column_add_cell_real(), sed_column_compact_cell(), sed_column_extract_top_cell_loc(), sed_column_extract_top_n_cells(), sed_column_remove_top_cell(), sed_column_resize_cell(), sed_column_stack_cell_loc_real(), and sed_column_stack_cell_real().

Sed_column sed_column_set_x_position ( Sed_column  col,
double  x 
)

Set the x-position of a Sed_column

Set the x-coordinate of the horizontal position of a Sed_column. This is the favored version to set a columns position. sed_set_column_position should no longer be used.

Parameters:
col A pointer to a Sed_column.
x The new x-coordinate of the horizontal location of the Sed_column.
Returns:
A pointer to the input Sed_column.
See also:
sed_set_column_y_position .

Definition at line 393 of file sed_column.c.

Referenced by main(), sed_cube_new(), and sed_cube_new_from_file().

Sed_column sed_column_set_y_position ( Sed_column  col,
double  y 
)

Set the y-position of a Sed_column

Set the y-coordinate of the horizontal position of a Sed_column. This is the favored version to set a columns position. sed_set_column_position should no longer be used.

Parameters:
col A pointer to a Sed_column.
y The new y-coordinate of the horizontal location of the Sed_column.
Returns:
A pointer to the input Sed_column.
See also:
sed_set_column_x_position .

Definition at line 412 of file sed_column.c.

Referenced by main(), run_slump(), sed_cube_new(), and sed_cube_new_from_file().

Sed_column sed_column_set_z_res ( Sed_column  col,
double  new_dz 
)

Definition at line 463 of file sed_column.c.

Referenced by _scan_sediment_column(), main(), sed_cube_property_subgrid(), sed_cube_set_dz(), and sed_cube_set_z_res().

gboolean sed_column_size_is ( const Sed_column  col,
double  t 
)

Definition at line 2206 of file sed_column.c.

References eh_compare_dbl().

double sed_column_stack_cell ( Sed_column  col,
Sed_cell  cell 
)

Definition at line 2725 of file sed_column.c.

References sed_column_stack_cell_real().

Referenced by sed_column_append(), sed_column_height_copy(), and sed_column_stack_cells().

double sed_column_stack_cell_loc ( Sed_column  col,
Sed_cell  cell 
)

Definition at line 2731 of file sed_column.c.

References sed_column_stack_cell_loc_real().

Referenced by sed_column_stack_cells_loc().

double sed_column_stack_cell_loc_real ( Sed_column  col,
Sed_cell  cell,
gboolean  update_pressure 
)

Definition at line 2678 of file sed_column.c.

References eh_require, sed_cell_destroy(), sed_cell_is_valid(), sed_cell_load(), sed_cell_pressure(), sed_cell_set_pressure(), sed_cell_size(), sed_column_len(), sed_column_resize(), sed_column_set_thickness(), and sed_column_thickness().

Referenced by sed_column_stack_cell_loc().

double sed_column_stack_cell_real ( Sed_column  col,
Sed_cell  cell,
gboolean  update_pressure 
)

Definition at line 2643 of file sed_column.c.

References eh_require, sed_cell_copy(), sed_cell_load(), sed_cell_pressure(), sed_cell_set_pressure(), sed_cell_size(), sed_column_len(), sed_column_resize(), sed_column_set_thickness(), and sed_column_thickness().

Referenced by sed_column_stack_cell().

Sed_column sed_column_stack_cells ( Sed_column  dest,
Sed_cell src 
)

Definition at line 2598 of file sed_column.c.

References eh_require, eh_watch_int, sed_cell_array_fprint(), sed_cell_is_clear(), and sed_column_stack_cell().

Sed_column sed_column_stack_cells_loc ( Sed_column  dest,
Sed_cell src 
)

Definition at line 2622 of file sed_column.c.

References eh_require, eh_watch_int, sed_cell_is_clear(), sed_cell_is_empty(), sed_cell_is_valid(), and sed_column_stack_cell_loc().

Referenced by sed_column_bioturbate().

Sed_column sed_column_strip ( Sed_column  col,
double  bottom,
double  top 
)

Remove the begining and end of a column.

Remove the cells of a column starting at the bottom and going to an elevation, bottom. Also, remove the cells starting at an elevation, top and running to the top of the column. That is, keep only the cells between bottom and top.

Parameters:
col A pointer to a Sed_column.
bottom Elevation where the chomp will end.
top Elevation where the chop will begin.
See also:
sed_chomp_column , sed_chop_column .

Definition at line 2099 of file sed_column.c.

References sed_column_chomp(), and sed_column_chop().

Referenced by sed_cube_property_subgrid().

double sed_column_thickness ( const Sed_column  col  ) 

Get the sediment thickness of a Sed_column.

Parameters:
col A pointer to a Sed_column.
Returns:
The thickness of sediment housed in a Sed_column.

Definition at line 2187 of file sed_column.c.

References eh_return_val_if_fail.

Referenced by get_failure_surface(), get_m(), main(), move_sediment(), run_terzaghi_flow(), sed_column_add_cell_real(), sed_column_compact_cell(), sed_column_extract_top_cell_loc(), sed_column_extract_top_n_cells(), sed_column_index_depth(), sed_column_index_thickness(), sed_column_property(), sed_column_property_0(), sed_column_remove_top_cell(), sed_column_remove_top_erode(), sed_column_resize_cell(), sed_column_stack_cell_loc_real(), sed_column_stack_cell_real(), sed_column_top_height(), and sed_cube_thickness().

double sed_column_thickness_index ( const Sed_column  col,
gssize  ind 
)

Get the thickness of sediment up to (and including) a cell.

Parameters:
col A pointer to a Sed_column.
ind Index to a cell within a Sed_column.
Returns:
The total sediment thickness from the bottom of a column up to (and including) the ind-th cell.

Definition at line 2240 of file sed_column.c.

References eh_clamp, eh_return_val_if_fail, sed_cell_size(), and sed_column_len().

Referenced by sed_column_height_copy().

Sed_cell sed_column_top ( const Sed_column  col,
double  t,
Sed_cell  dest 
)

Get the top of a column.

The top thickness units is copied from the cells at the top of a sediment column. A copy of the sediment is placed into the destination cell. The destination cell is cleared before the new sediment is added. If a NULL value is passed as the destination cell, a new cell is created to hold the sediment. No sediment is removed from the Sed_column.

Parameters:
col A pointer to a Sed_column.
t The amount of sediment to copy from the top of the column.
dest A pointer to a Sed_cell to hold the copied sediment.
Returns:
A pointer to a Sed_cell that holds the copied sediment.
See also:
sed_remove_top_from_column , sed_extract_top_from_column .

Definition at line 1645 of file sed_column.c.

References eh_return_val_if_fail, sed_cell_add(), sed_cell_clear(), sed_cell_new(), sed_cell_resize(), sed_cell_size(), sed_column_is_empty(), sed_column_len(), sed_column_nth_cell(), and sed_sediment_env_n_types().

Referenced by decider(), diffuse_sediment_2(), run_debris_flow(), sed_column_top_age(), sed_column_top_property(), sed_column_top_property_0(), sed_column_top_rho(), and sed_cube_to_cell().

double sed_column_top_age ( const Sed_column  s,
double  top 
)

Get the age of the top of a column.

Get the age of the top (units of depth) of a column. This function is essentially a convenience function for sed_get_top_property (S_AGE,s,top) .

Parameters:
s A pointer to a Sed_column.
top The depth of sediment to query.
Returns:
The age of the top of a column.

Definition at line 1809 of file sed_column.c.

References eh_require, sed_cell_age(), sed_cell_destroy(), sed_cell_new(), sed_column_top(), and sed_sediment_env_n_types().

Sed_cell sed_column_top_cell ( const Sed_column  col  ) 

Get the Sed_cell at the top of a column.

Parameters:
col A pointer to a Sed_column.
Returns:
A pointer to the Sed_cell at the top of a Sed_column.

Definition at line 1245 of file sed_column.c.

References sed_column_is_empty().

Referenced by sed_column_add_cell_real(), sed_column_extract_top_cell(), sed_column_extract_top_fill(), sed_column_remove_top(), and sed_column_remove_top_cell().

double sed_column_top_height ( const Sed_column  col  ) 

Get the elevation to the top of Sed_column.

Parameters:
col A pointer to a Sed_column.
Returns:
The elevation to the last filled Sed_cell in a Sed_column.

Definition at line 477 of file sed_column.c.

References eh_return_val_if_fail, and sed_column_thickness().

Referenced by fail_reinit_fail_column(), fail_update_fail_profile(), sed_column_bioturbate(), sed_column_chop(), sed_column_extract_cells_above(), sed_column_is_above(), sed_column_is_below(), sed_column_remove(), sed_column_top_height_is(), sed_column_water_depth(), sed_cube_find_column_above(), sed_cube_find_column_below(), sed_cube_property_subgrid(), and sed_cube_top_height().

gboolean sed_column_top_height_is ( const Sed_column  c,
double  z 
)

Definition at line 2227 of file sed_column.c.

References eh_compare_dbl(), and sed_column_top_height().

gssize sed_column_top_index ( const Sed_column  col  ) 

Get the index to the top cell in a Sed_column.

Parameters:
col A pointer to a Sed_column.
Returns:
The index of the top cell in a Sed_column.

Definition at line 2174 of file sed_column.c.

References eh_return_val_if_fail.

Referenced by sed_measure_cube_age(), sed_measure_cube_clay_fraction(), sed_measure_cube_density(), sed_measure_cube_facies(), sed_measure_cube_grain_size(), sed_measure_cube_mud_fraction(), sed_measure_cube_permeability(), sed_measure_cube_porosity(), sed_measure_cube_sand_fraction(), and sed_measure_cube_silt_fraction().

gssize sed_column_top_nbins ( Sed_column  s,
double  z 
)

Get the number of cells contained within the top of a column.

Return the number of sediment bins that make up the top height-th units of a sediment column. The bins may be of a size that is different from the vertical resolution of the column.

Parameters:
s A pointer to a Sed_column.
z The thickness of a Sed_column top.
Returns:
The number of sediment bins within the top of a Sed_column.

Definition at line 1840 of file sed_column.c.

References eh_require, sed_column_base_height(), sed_column_index_thickness(), and sed_column_is_empty().

Referenced by fail_reinit_fail_column(), and sed_column_extract_cells_above().

double sed_column_top_property ( Sed_property  property,
const Sed_column  s,
double  top 
)

Get a bulk property from the top of a column.

This is the same as sed_get_top_property except that here we use Sed_property_func_with_load. As we examine only the top portion of a column, in this case the load is that of the sediment we are examining.

Parameters:
property A function to get a property from a Sed_cell.
s A pointer to a Sed_column.
top The depth of sediment to query.
Returns:
The bulk property value.
See also:
sed_get_top_property .

Definition at line 1739 of file sed_column.c.

References eh_return_val_if_fail, sed_cell_destroy(), sed_cell_load(), sed_column_age(), sed_column_top(), sed_property_is_named(), sed_property_measure(), and sed_property_n_args().

double sed_column_top_property_0 ( Sed_property  property,
const Sed_column  s,
double  top 
)

Get a bulk property from the top of a column.

This is the same as sed_get_top_property_with_load except that here we use Sed_property_func.

Parameters:
property A function to get a property from a Sed_cell.
s A pointer to a Sed_column.
top The depth of sediment to query.
Returns:
The bulk property value.
See also:
sed_get_top_property_with_load .

Definition at line 1702 of file sed_column.c.

References eh_require, sed_cell_destroy(), sed_cell_new(), sed_column_top(), sed_property_measure(), and sed_sediment_env_n_types().

double sed_column_top_rho ( const Sed_column  s,
double  top 
)

Get the density of the top of a column.

Get the bulk density of the top (units of depth) of a column. This function is a convenience function for sed_get_top_property (S_DENSITY,s,top) .

Parameters:
s A pointer to a Sed_column.
top The depth of sediment to query.
Returns:
The bulk density of the top of a column.

Definition at line 1779 of file sed_column.c.

References eh_return_val_if_fail, sed_cell_density(), sed_cell_destroy(), sed_cell_new(), sed_column_top(), and sed_sediment_env_n_types().

Referenced by fail_reinit_fail_column(), and get_janbu_parameters().

double* sed_column_total_load ( const Sed_column  s,
gssize  start,
gssize  n_bins,
double  overlying_load,
double *  load 
)

Get the total load felt by each cell of sediment in a Sed_column.

Get the load felt by each cell of sediment due to its overlying cells. Returns an array containing the load felt by each cell (in units of Pa). The returned array should be freed using free. If a value of NULL is given for the load pointer, a newly allocated array will be used. The zero-th element of the array will be the load on the start-th bin from the bottom of the column. If n_bins <= 0, we go from the start-th bin to the top. If a value of NULL is given for the load pointer, a newly allocated array will be used.

Parameters:
s A pointer to a Sed_column.
start Index to the Sed_cell to begin at.
n_bins The number of Sed_cell's to consider.
overlying_load The load overlying the Sed_column.
load A pointer to an array that will hold the load values.
Returns:
A pointer to an array of loads.

Definition at line 569 of file sed_column.c.

References eh_lower_bound, eh_new0, eh_require, and sed_cell_sediment_load().

Referenced by sed_column_load(), and sed_column_load_with_water().

double* sed_column_total_property ( Sed_property  f,
Sed_column  c,
gssize  start,
gssize  n_bins,
double *  val 
)

Get the total of a specified property for a series of Sed_cell's

This function will total a specifed property of a series of Sed_cell's within a Sed_column. The property will be obtained using the Sed_property_func, f. The total will begin at the start'th cell and work up the Sed_column. The total for each cell will be the sum of the property values of the cells preceding it as well as its own. If a value of NULL is passed for the val parameter, an array will be created. If n_bins<=0, the total will run to the top of the sediment column. If non-NULL value is passed for val, care should be taken to assure that there is enough memory to hold all of the total values.

Parameters:
f A function to get a property from a Sed_cell.
c A pointer to a Sed_column.
start Index to the Sed_cell to begin at.
n_bins The number of Sed_cell's to consider.
val A pointer to an array that will hold the total values.
Returns:
A pointer to a possibly newly created array of total values.
See also:
sed_get_column_load , sed_get_column_avg_property_with_load , sed_get_column_avg_property .

Definition at line 661 of file sed_column.c.

References eh_new0, eh_require, and sed_property_measure().

double sed_column_water_depth ( const Sed_column  col  ) 

Get the depth to the top of a column.

Get the depth to the top of a Sed_column.

Parameters:
col A pointer to a Sed_column
Returns:
The depth to the top of a column.
See also:
sed_get_depth_from_cube .

Definition at line 2114 of file sed_column.c.

References sed_column_sea_level(), and sed_column_top_height().

Referenced by deposit_sediment_helper(), sakura_sed_add_sediment(), sed_column_water_pressure(), and sed_cube_water_depth().

double sed_column_water_pressure ( const Sed_column  s  ) 

Definition at line 628 of file sed_column.c.

References sed_column_water_depth(), sed_gravity(), and sed_rho_sea_water().

Referenced by compact(), fail_reinit_fail_column(), get_janbu_parameters(), run_darcy_flow(), sed_column_add_cell_real(), sed_column_load_with_water(), and sed_cube_property_subgrid().

gssize sed_column_write ( FILE *  fp,
const Sed_column  s 
)

Write the contents of Sed_column to a binary file.

Parameters:
fp A pointer to an open file.
s A pointer to a Sed_column.
See also:
sed_load_column .

Definition at line 1884 of file sed_column.c.

References sed_column_write_to_byte_order().

Referenced by sed_cube_write().

gssize sed_column_write_to_byte_order ( FILE *  fp,
const Sed_column  s,
gint  order 
)

Definition at line 1889 of file sed_column.c.

References eh_fwrite_dbl_swap, eh_fwrite_int32_swap, sed_cell_write(), and sed_cell_write_to_byte_order().

Referenced by main(), and sed_column_write().

double sed_column_x_position ( const Sed_column  col  ) 

Get the x-position of a Sed_column

Get the x-coordinate of the horizontal position of a Sed_column. This is now the favored version to get the position of a column. sed_get_column_position should no longer be used.

Parameters:
col A pointer to a Sed_column.
Returns:
The x-position of the Sed_column.
See also:
sed_get_column_y_position .

Definition at line 328 of file sed_column.c.

Referenced by sed_column_x_index(), sed_cube_add(), sed_cube_col_x(), sed_cube_col_x_ij(), sed_cube_column_id(), sed_cube_is_in_domain_pos(), sed_cube_remove(), and sed_cube_x().

double sed_column_y_position ( const Sed_column  col  ) 

Get the y-position of a Sed_column

Get the y-coordinate of the horizontal position of a Sed_column. This is now the favored version to get the position of a column. sed_get_column_position should no longer be used.

Parameters:
col A pointer to a Sed_column.
Returns:
The y-position of the Sed_column.
See also:
sed_get_column_x_position .

Definition at line 345 of file sed_column.c.

Referenced by sed_column_y_index(), sed_cube_add(), sed_cube_col_y(), sed_cube_col_y_ij(), sed_cube_column_id(), sed_cube_is_in_domain_pos(), sed_cube_remove(), and sed_cube_y().

double sed_column_z_res ( const Sed_column  col  ) 

Definition at line 458 of file sed_column.c.

Referenced by run_darcy_flow(), sed_column_add_cell_real(), and sed_column_bioturbate().

int sed_get_column_size ( const Sed_column  col  ) 

Get the number of filled (or partially filled) cells within a column.

Parameters:
col A pointer to a Sed_column.
Returns:
The number of filled (or partially filled) cells in a Sed_column

Definition at line 2125 of file sed_column.c.


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