Loading...
Searching...
No Matches
N_pde.h File Reference
`#include <grass/gis.h>`
`#include <grass/raster3d.h>`
`#include <grass/glocale.h>`
`#include <grass/gmath.h>`
Include dependency graph for N_pde.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures

struct | N_les
| The linear equation system (les) structure. More...
struct | N_geom_data
| Geometric information about the structured grid. More...
struct | N_array_2d
struct | N_array_3d
struct | N_data_star
| Matrix entries for a mass balance 5/7/9 star system. More...
struct | N_les_callback_3d
| callback structure for 3d matrix assembling More...
struct | N_les_callback_2d
| callback structure for 2d matrix assembling More...
struct | N_gradient_2d
| Gradient between the cells in X and Y direction. More...
struct | N_gradient_3d
| Gradient between the cells in X, Y and Z direction. More...
struct | N_gradient_neighbours_x
| Gradient between the cell neighbours in X direction. More...
struct | N_gradient_neighbours_y
| Gradient between the cell neighbours in Y direction. More...
struct | N_gradient_neighbours_z
| Gradient between the cell neighbours in Z direction. More...
struct | N_gradient_neighbours_2d
| Gradient between the cell neighbours in X and Y direction. More...
struct | N_gradient_neighbours_3d
| Gradient between the cell neighbours in X, Y and Z direction. More...
struct | N_gradient_field_2d
struct | N_gradient_field_3d

## Macros

#define | N_NORMAL_LES 0
#define | N_SPARSE_LES 1
#define | N_CELL_INACTIVE 0
#define | N_CELL_ACTIVE 1
#define | N_CELL_DIRICHLET 2
#define | N_CELL_TRANSMISSION 3
#define | N_MAX_CELL_STATE 20
| the maximum number of available cell states (eg: boundary condition, inactiven active)
#define | N_5_POINT_STAR 0
#define | N_7_POINT_STAR 1
#define | N_9_POINT_STAR 2
#define | N_27_POINT_STAR 3
#define | N_MAXIMUM_NORM 0
#define | N_EUKLID_NORM 1
#define | N_ARRAY_SUM 0 /* summ two arrays */
#define | N_ARRAY_DIF 1 /* calc the difference between two arrays */
#define | N_ARRAY_MUL 2 /* multiply two arrays */
#define | N_ARRAY_DIV
#define | N_UPWIND_FULL 0 /*full upwinding stabilization */
#define | N_UPWIND_EXP 1 /*exponential upwinding stabilization */
#define | N_UPWIND_WEIGHT 2 /*weighted upwinding stabilization */

## Enumerations

enum | N_STD_OPT { N_OPT_SOLVER_SYMM , N_OPT_SOLVER_UNSYMM , N_OPT_MAX_ITERATIONS , N_OPT_ITERATION_ERROR , N_OPT_SOR_VALUE , N_OPT_CALC_TIME }
| Standard options of the gpde library. More...

## Functions

N_les * | N_alloc_les_param (int cols, int rows, int type, int param)
| Allocate memory for a quadratic or not quadratic linear equation system.
N_les * | N_alloc_les (int rows, int type)
| Allocate memory for a quadratic linear equation system which includes the Matrix A, vector x and vector b.
N_les * | N_alloc_les_A (int rows, int type)
| Allocate memory for a quadratic linear equation system which includes the Matrix A.
N_les * | N_alloc_les_Ax (int rows, int type)
| Allocate memory for a quadratic linear equation system which includes the Matrix A and vector x.
N_les * | N_alloc_les_Ax_b (int rows, int type)
| Allocate memory for a quadratic linear equation system which includes the Matrix A, vector x and vector b.
N_les * | N_alloc_nquad_les (int cols, int rows, int type)
| Allocate memory for a (not) quadratic linear equation system which includes the Matrix A, vector x and vector b.
N_les * | N_alloc_nquad_les_A (int cols, int rows, int type)
| Allocate memory for a (not) quadratic linear equation system which includes the Matrix A.
N_les * | N_alloc_nquad_les_Ax (int cols, int rows, int type)
| Allocate memory for a (not) quadratic linear equation system which includes the Matrix A and vector x.
N_les * | N_alloc_nquad_les_Ax_b (int cols, int rows, int type)
| Allocate memory for a (not) quadratic linear equation system which includes the Matrix A, vector x and vector b.
void | N_print_les (N_les *les)
| prints the linear equation system to stdout
void | N_free_les (N_les *les)
| Release the memory of the linear equation system.
N_geom_data * | N_alloc_geom_data (void)
| Allocate the pde geometry data structure and return a pointer to the new allocated structure.
void | N_free_geom_data (N_geom_data *geodata)
| Release memory of a pde geometry data structure.
N_geom_data * | N_init_geom_data_3d (RASTER3D_Region *region3d, N_geom_data *geodata)
| Initiate a pde geometry data structure with a 3d region.
N_geom_data * | N_init_geom_data_2d (struct Cell_head *region, N_geom_data *geodata)
| Initiate a pde geometry data structure with a 2d region.
double | N_get_geom_data_area_of_cell (N_geom_data *geom, int row)
| Get the areay size in square meter of one cell (x*y) at row.
N_array_2d * | N_alloc_array_2d (int cols, int rows, int offset, int type)
| Allocate memory for a N_array_2d data structure.
void | N_free_array_2d (N_array_2d *data_array)
| Release the memory of a N_array_2d structure.
int | N_get_array_2d_type (N_array_2d *array2d)
| Return the data type of the N_array_2d struct.
void | N_get_array_2d_value (N_array_2d *array2d, int col, int row, void *value)
| Write the value of the N_array_2d struct at position col, row to value.
CELL | N_get_array_2d_c_value (N_array_2d *array2d, int col, int row)
| Returns the value of type CELL at position col, row.
FCELL | N_get_array_2d_f_value (N_array_2d *array2d, int col, int row)
| Returns the value of type FCELL at position col, row.
DCELL | N_get_array_2d_d_value (N_array_2d *array2d, int col, int row)
| Returns the value of type DCELL at position col, row.
void | N_put_array_2d_value (N_array_2d *array2d, int col, int row, char *value)
| Writes a value to the N_array_2d struct at position col, row.
void | N_put_array_2d_c_value (N_array_2d *array2d, int col, int row, CELL value)
| Writes a CELL value to the N_array_2d struct at position col, row.
void | N_put_array_2d_f_value (N_array_2d *array2d, int col, int row, FCELL value)
| Writes a FCELL value to the N_array_2d struct at position col, row.
void | N_put_array_2d_d_value (N_array_2d *array2d, int col, int row, DCELL value)
| Writes a DCELL value to the N_array_2d struct at position col, row.
int | N_is_array_2d_value_null (N_array_2d *array2d, int col, int row)
| Returns 1 if the value of N_array_2d struct at position col, row is of type null, otherwise 0.
void | N_put_array_2d_value_null (N_array_2d *array2d, int col, int row)
| Writes the null value to the N_array_2d struct at position col, row.
void | N_print_array_2d (N_array_2d *data)
| Write info and content of the N_array_2d struct to stdout.
void | N_print_array_2d_info (N_array_2d *data)
| This function writes the data info of the array data to stdout.
void | N_copy_array_2d (N_array_2d *source, N_array_2d *target)
| Copy the source N_array_2d struct to the target N_array_2d struct.
double | N_norm_array_2d (N_array_2d *array1, N_array_2d *array2, int type)
| Calculate the norm of the two input arrays.
N_array_2d * | N_math_array_2d (N_array_2d *array1, N_array_2d *array2, N_array_2d *result, int type)
| Perform calculations with two input arrays, the result is written to a third array.
int | N_convert_array_2d_null_to_zero (N_array_2d *a)
| Convert all null values to zero values.
N_array_2d * | N_read_rast_to_array_2d (char *name, N_array_2d *array)
| Read a raster map into a N_array_2d structure.
void | N_write_array_2d_to_rast (N_array_2d *array, char *name)
| Write a N_array_2d struct to a raster map.
void | N_calc_array_2d_stats (N_array_2d *a, double *min, double *max, double *sum, int *nonzero, int withoffset)
| Calculate basic statistics of the N_array_2d struct.
N_array_3d * | N_alloc_array_3d (int cols, int rows, int depths, int offset, int type)
| Allocate memory for a N_array_3d data structure.
void | N_free_array_3d (N_array_3d *data_array)
| Release the memory of a N_array_3d.
int | N_get_array_3d_type (N_array_3d *array3d)
| Return the data type of the N_array_3d.
void | N_get_array_3d_value (N_array_3d *array3d, int col, int row, int depth, void *value)
| This function writes the value of N_array_3d data at position col, row, depth to the variable value.
float | N_get_array_3d_f_value (N_array_3d *array3d, int col, int row, int depth)
| This function returns the value of type float at position col, row, depth.
double | N_get_array_3d_d_value (N_array_3d *array3d, int col, int row, int depth)
| This function returns the value of type float at position col, row, depth.
void | N_put_array_3d_value (N_array_3d *array3d, int col, int row, int depth, char *value)
| This function writes a value to the N_array_3d data at position col, row, depth.
void | N_put_array_3d_f_value (N_array_3d *array3d, int col, int row, int depth, float value)
| This function writes a float value to the N_array_3d data at position col, row, depth.
void | N_put_array_3d_d_value (N_array_3d *array3d, int col, int row, int depth, double value)
| Writes a double value to the N_array_3d struct at position col, row, depth.
int | N_is_array_3d_value_null (N_array_3d *array3d, int col, int row, int depth)
| This function returns 1 if value of N_array_3d data at position col, row, depth is of type null, otherwise 0.
void | N_put_array_3d_value_null (N_array_3d *array3d, int col, int row, int depth)
| This function writes a null value to the N_array_3d data at position col, row, depth.
void | N_print_array_3d (N_array_3d *data)
| Write info and content of the array data to stdout.
void | N_print_array_3d_info (N_array_3d *data)
| Write the info of the array to stdout.
void | N_copy_array_3d (N_array_3d *source, N_array_3d *target)
| Copy the source N_array_3d struct to the target N_array_3d struct.
double | N_norm_array_3d (N_array_3d *array1, N_array_3d *array2, int type)
| Calculate the norm of the two input arrays.
N_array_3d * | N_math_array_3d (N_array_3d *array1, N_array_3d *array2, N_array_3d *result, int type)
| Perform calculations with two input arrays, the result is written to a third array.
int | N_convert_array_3d_null_to_zero (N_array_3d *a)
| Convert all null values to zero values.
N_array_3d * | N_read_rast3d_to_array_3d (char *name, N_array_3d *array, int mask)
| Read a volume map into a N_array_3d structure.
void | N_write_array_3d_to_rast3d (N_array_3d *array, char *name, int mask)
| Write a N_array_3d struct to a volume map.
void | N_calc_array_3d_stats (N_array_3d *a, double *min, double *max, double *sum, int *nonzero, int withoffset)
| Calculate basic statistics of the N_array_3d struct.
void | N_set_les_callback_3d_func (N_les_callback_3d *data, N_data_star *(*callback_func_3d)(void *, N_geom_data *, int, int, int))
| Set the callback function which is called while assembling the les in 3d.
void | N_set_les_callback_2d_func (N_les_callback_2d *data, N_data_star *(*callback_func_2d)(void *, N_geom_data *, int, int))
| Set the callback function which is called while assembling the les in 2d.
N_les_callback_3d * | N_alloc_les_callback_3d (void)
| Allocate the structure holding the callback function.
N_les_callback_2d * | N_alloc_les_callback_2d (void)
| Allocate the structure holding the callback function.
N_data_star * | N_alloc_5star (void)
| allocate a 5 point star data structure
N_data_star * | N_alloc_7star (void)
| allocate a 7 point star data structure
N_data_star * | N_alloc_9star (void)
| allocate a 9 point star data structure
N_data_star * | N_alloc_27star (void)
| allocate a 27 point star data structure
N_data_star * | N_create_5star (double C, double W, double E, double N, double S, double V)
| allocate and initialize a 5 point star data structure
N_data_star * | N_create_7star (double C, double W, double E, double N, double S, double T, double B, double V)
| allocate and initialize a 7 point star data structure
N_data_star * | N_create_9star (double C, double W, double E, double N, double S, double NW, double SW, double NE, double SE, double V)
| allocate and initialize a 9 point star data structure
N_data_star * | N_create_27star (double C, double W, double E, double N, double S, double NW, double SW, double NE, double SE, double T, double W_T, double E_T, double N_T, double S_T, double NW_T, double SW_T, double NE_T, double SE_T, double B, double W_B, double E_B, double N_B, double S_B, double NW_B, double SW_B, double NE_B, double SE_B, double V)
| allocate and initialize a 27 point star data structure
N_data_star * | N_callback_template_3d (void *data, N_geom_data *geom, int col, int row, int depth)
| A callback template creates a 7 point star structure.
N_data_star * | N_callback_template_2d (void *data, N_geom_data *geom, int col, int row)
| A callback template creates a 9 point star structure.
N_les * | N_assemble_les_3d (int les_type, N_geom_data *geom, N_array_3d *status, N_array_3d *start_val, void *data, N_les_callback_3d *callback)
| Assemble a linear equation system (les) based on 3d location data (g3d) active cells.
N_les * | N_assemble_les_3d_active (int les_type, N_geom_data *geom, N_array_3d *status, N_array_3d *start_val, void *data, N_les_callback_3d *callback)
| Assemble a linear equation system (les) based on 3d location data (g3d) active cells.
N_les * | N_assemble_les_3d_dirichlet (int les_type, N_geom_data *geom, N_array_3d *status, N_array_3d *start_val, void *data, N_les_callback_3d *callback)
| Assemble a linear equation system (les) based on 3d location data (g3d) active and dirichlet cells.
N_les * | N_assemble_les_3d_param (int les_type, N_geom_data *geom, N_array_3d *status, N_array_3d *start_val, void *data, N_les_callback_3d *callback, int cell_type)
| Assemble a linear equation system (les) based on 3d location data (g3d).
N_les * | N_assemble_les_2d (int les_type, N_geom_data *geom, N_array_2d *status, N_array_2d *start_val, void *data, N_les_callback_2d *callback)
| Assemble a linear equation system (les) based on 2d location data (raster) and active cells.
N_les * | N_assemble_les_2d_active (int les_type, N_geom_data *geom, N_array_2d *status, N_array_2d *start_val, void *data, N_les_callback_2d *callback)
| Assemble a linear equation system (les) based on 2d location data (raster) and active cells.
N_les * | N_assemble_les_2d_dirichlet (int les_type, N_geom_data *geom, N_array_2d *status, N_array_2d *start_val, void *data, N_les_callback_2d *callback)
| Assemble a linear equation system (les) based on 2d location data (raster) and active and dirichlet cells.
N_les * | N_assemble_les_2d_param (int les_type, N_geom_data *geom, N_array_2d *status, N_array_2d *start_val, void *data, N_les_callback_2d *callback, int cell_Type)
| Assemble a linear equation system (les) based on 2d location data (raster).
int | N_les_pivot_create (N_les *les)
int | N_les_integrate_dirichlet_2d (N_les *les, N_geom_data *geom, N_array_2d *status, N_array_2d *start_val)
| Integrate Dirichlet or Transmission boundary conditions into the les (2s).
int | N_les_integrate_dirichlet_3d (N_les *les, N_geom_data *geom, N_array_3d *status, N_array_3d *start_val)
| Integrate Dirichlet or Transmission boundary conditions into the les (3d).
struct Option * | N_define_standard_option (int opt)
| Create standardised Option structure related to the gpde library.
double | N_calc_arith_mean (double a, double b)
| Calculate the arithmetic mean of values a and b.
double | N_calc_arith_mean_n (double *a, int size)
| Calculate the arithmetic mean of the values in vector a of size n.
double | N_calc_geom_mean (double a, double b)
| Calculate the geometrical mean of values a and b.
double | N_calc_geom_mean_n (double *a, int size)
| Calculate the geometrical mean of the values in vector a of size n.
double | N_calc_harmonic_mean (double a, double b)
| Calculate the harmonical mean of values a and b.
double | N_calc_harmonic_mean_n (double *a, int size)
| Calculate the harmonical mean of the values in vector a of size n.
double | N_calc_quad_mean (double a, double b)
| Calculate the quadratic mean of values a and b.
double | N_calc_quad_mean_n (double *a, int size)
| Calculate the quadratic mean of the values in vector a of size n.
double | N_full_upwinding (double sprod, double distance, double D)
| full upwinding stabilization algorithm
double | N_exp_upwinding (double sprod, double distance, double D)
| exponential upwinding stabilization algorithm
N_gradient_2d * | N_alloc_gradient_2d (void)
| Allocate a N_gradient_2d structure.
void | N_free_gradient_2d (N_gradient_2d *grad)
| Free's a N_gradient_2d structure.
N_gradient_2d * | N_create_gradient_2d (double NC, double SC, double WC, double EC)
| allocate and initialize a N_gradient_2d structure
int | N_copy_gradient_2d (N_gradient_2d *source, N_gradient_2d *target)
| copy a N_gradient_2d structure
N_gradient_2d * | N_get_gradient_2d (N_gradient_field_2d *field, N_gradient_2d *gradient, int col, int row)
| Return a N_gradient_2d structure calculated from the input gradient field at position [row][col].
N_gradient_3d * | N_alloc_gradient_3d (void)
| Allocate a N_gradient_3d structure.
void | N_free_gradient_3d (N_gradient_3d *grad)
| Free's a N_gradient_3d structure.
N_gradient_3d * | N_create_gradient_3d (double NC, double SC, double WC, double EC, double TC, double BC)
| allocate and initialize a N_gradient_3d structure
int | N_copy_gradient_3d (N_gradient_3d *source, N_gradient_3d *target)
| copy a N_gradient_3d structure
N_gradient_3d * | N_get_gradient_3d (N_gradient_field_3d *field, N_gradient_3d *gradient, int col, int row, int depth)
| Return a N_gradient_3d structure calculated from the input gradient field at position [depth][row][col].
N_gradient_neighbours_x * | N_alloc_gradient_neighbours_x (void)
| Allocate a N_gradient_neighbours_x structure.
void | N_free_gradient_neighbours_x (N_gradient_neighbours_x *grad)
| Free's a N_gradient_neighbours_x structure.
N_gradient_neighbours_x * | N_create_gradient_neighbours_x (double NWN, double NEN, double WC, double EC, double SWS, double SES)
| Allocate and initialize a N_gradient_neighbours_x structure.
int | N_copy_gradient_neighbours_x (N_gradient_neighbours_x *source, N_gradient_neighbours_x *target)
| copy a N_gradient_neighbours_x structure
N_gradient_neighbours_y * | N_alloc_gradient_neighbours_y (void)
| Allocate a N_gradient_neighbours_y structure.
void | N_free_gradient_neighbours_y (N_gradient_neighbours_y *grad)
| Free's a N_gradient_neighbours_y structure.
N_gradient_neighbours_y * | N_create_gradient_neighbours_y (double NWW, double NEE, double NC, double SC, double SWW, double SEE)
| Allocate and initialize a N_gradient_neighbours_y structure.
int | N_copy_gradient_neighbours_y (N_gradient_neighbours_y *source, N_gradient_neighbours_y *target)
| copy a N_gradient_neighbours_y structure
N_gradient_neighbours_z * | N_alloc_gradient_neighbours_z (void)
| Allocate a N_gradient_neighbours_z structure.
void | N_free_gradient_neighbours_z (N_gradient_neighbours_z *grad)
| Free's a N_gradient_neighbours_z structure.
N_gradient_neighbours_z * | N_create_gradient_neighbours_z (double NWZ, double NZ, double NEZ, double WZ, double CZ, double EZ, double SWZ, double SZ, double SEZ)
| Allocate and initialize a N_gradient_neighbours_z structure.
int | N_copy_gradient_neighbours_z (N_gradient_neighbours_z *source, N_gradient_neighbours_z *target)
| copy a N_gradient_neighbours_z structure
N_gradient_neighbours_2d * | N_alloc_gradient_neighbours_2d (void)
| Allocate a N_gradient_neighbours_2d structure.
void | N_free_gradient_neighbours_2d (N_gradient_neighbours_2d *grad)
| Free's a N_gradient_neighbours_2d structure.
N_gradient_neighbours_2d * | N_create_gradient_neighbours_2d (N_gradient_neighbours_x *x, N_gradient_neighbours_y *y)
| Allocate and initialize a N_gradient_neighbours_2d structure.
int | N_copy_gradient_neighbours_2d (N_gradient_neighbours_2d *source, N_gradient_neighbours_2d *target)
| copy a N_gradient_neighbours_2d structure
N_gradient_neighbours_2d * | N_get_gradient_neighbours_2d (N_gradient_field_2d *field, N_gradient_neighbours_2d *gradient, int col, int row)
| Return a N_gradient_neighbours_2d structure calculated from the input gradient field at position [row][col].
N_gradient_neighbours_3d * | N_alloc_gradient_neighbours_3d (void)
| Allocate a N_gradient_neighbours_3d structure.
void | N_free_gradient_neighbours_3d (N_gradient_neighbours_3d *grad)
| Free's a N_gradient_neighbours_3d structure.
N_gradient_neighbours_3d * | N_create_gradient_neighbours_3d (N_gradient_neighbours_x *xt, N_gradient_neighbours_x *xc, N_gradient_neighbours_x *xb, N_gradient_neighbours_y *yt, N_gradient_neighbours_y *yc, N_gradient_neighbours_y *yb, N_gradient_neighbours_z *zt, N_gradient_neighbours_z *zb)
| Allocate and initialize a N_gradient_neighbours_3d structure.
int | N_copy_gradient_neighbours_3d (N_gradient_neighbours_3d *source, N_gradient_neighbours_3d *target)
| copy a N_gradient_neighbours_3d structure
void | N_print_gradient_field_2d_info (N_gradient_field_2d *field)
| Print gradient field information to stdout.
void | N_calc_gradient_field_2d_stats (N_gradient_field_2d *field)
| Calculate basic statistics of a gradient field.
N_gradient_field_2d * | N_alloc_gradient_field_2d (int cols, int rows)
| Allocate a N_gradient_field_2d.
void | N_free_gradient_field_2d (N_gradient_field_2d *field)
| Free's a N_gradient_neighbours_2d structure.
int | N_copy_gradient_field_2d (N_gradient_field_2d *source, N_gradient_field_2d *target)
| Copy N_gradient_field_2d structure from source to target.
N_gradient_field_2d * | N_compute_gradient_field_2d (N_array_2d *pot, N_array_2d *weight_x, N_array_2d *weight_y, N_geom_data *geom, N_gradient_field_2d *gradfield)
| This function computes the gradient based on the input N_array_2d pot (potential), a weighting factor N_array_2d named weight and the distance between two cells saved in the N_geom_data struct.
void | N_compute_gradient_field_components_2d (N_gradient_field_2d *field, N_array_2d *x_comp, N_array_2d *y_comp)
| Calculate the x and y vector components from a gradient field for each cell and stores them in the provided N_array_2d structures.
void | N_print_gradient_field_3d_info (N_gradient_field_3d *field)
| Print gradient field information to stdout.
void | N_calc_gradient_field_3d_stats (N_gradient_field_3d *field)
| Calculate basic statistics of a gradient field.
N_gradient_field_3d * | N_alloc_gradient_field_3d (int cols, int rows, int depths)
| Allocate a N_gradient_field_3d.
void | N_free_gradient_field_3d (N_gradient_field_3d *field)
| Free's a N_gradient_neighbours_3d structure.
int | N_copy_gradient_field_3d (N_gradient_field_3d *source, N_gradient_field_3d *target)
| Copy N_gradient_field_3d structure from source to target.
N_gradient_field_3d * | N_compute_gradient_field_3d (N_array_3d *pot, N_array_3d *weight_x, N_array_3d *weight_y, N_array_3d *weight_z, N_geom_data *geom, N_gradient_field_3d *gradfield)
| This function computes the gradient based on the input N_array_3d pot (that means potential), a weighting factor N_array_3d named weight and the distance between two cells saved in the N_geom_data struct.
void | N_compute_gradient_field_components_3d (N_gradient_field_3d *field, N_array_3d *x_comp, N_array_3d *y_comp, N_array_3d *z_comp)
| Calculate the x, y and z vector components from a gradient field for each cell and store them in the provided N_array_3d structures.

## Macro Definition Documentation

## N_27_POINT_STAR

#define N_27_POINT_STAR 3

Definition at line 43 of file N_pde.h.

Referenced by N_alloc_27star(), and N_assemble_les_3d_param().

## N_5_POINT_STAR

#define N_5_POINT_STAR 0

Definition at line 40 of file N_pde.h.

Referenced by N_alloc_5star().

## N_7_POINT_STAR

#define N_7_POINT_STAR 1

Definition at line 41 of file N_pde.h.

Referenced by N_alloc_7star(), and N_assemble_les_3d_param().

## N_9_POINT_STAR

#define N_9_POINT_STAR 2

Definition at line 42 of file N_pde.h.

Referenced by N_alloc_9star(), and N_assemble_les_2d_param().

## N_ARRAY_DIF

#define N_ARRAY_DIF 1 /* calc the difference between two arrays */

Definition at line 49 of file N_pde.h.

Referenced by N_math_array_2d(), and N_math_array_3d().

## N_ARRAY_DIV

#define N_ARRAY_DIV

Value:
3 /* array division, if div with 0 the NULL value is set \
*/

Definition at line 51 of file N_pde.h.

Referenced by N_math_array_2d(), and N_math_array_3d().

## N_ARRAY_MUL

#define N_ARRAY_MUL 2 /* multiply two arrays */

Definition at line 50 of file N_pde.h.

Referenced by N_math_array_2d(), and N_math_array_3d().

## N_ARRAY_SUM

#define N_ARRAY_SUM 0 /* summ two arrays */

Definition at line 48 of file N_pde.h.

Referenced by N_math_array_2d(), and N_math_array_3d().

## N_CELL_ACTIVE

#define N_CELL_ACTIVE 1

Definition at line 31 of file N_pde.h.

Referenced by N_assemble_les_2d(), N_assemble_les_2d_active(), N_assemble_les_2d_param(), N_assemble_les_3d(), N_assemble_les_3d_active(), N_assemble_les_3d_param(), N_les_integrate_dirichlet_2d(), and N_les_integrate_dirichlet_3d().

## N_CELL_DIRICHLET

#define N_CELL_DIRICHLET 2

Definition at line 32 of file N_pde.h.

Referenced by N_assemble_les_2d_dirichlet(), N_assemble_les_2d_param(), N_assemble_les_3d_dirichlet(), and N_assemble_les_3d_param().

## N_CELL_INACTIVE

#define N_CELL_INACTIVE 0

Boundary conditions for cells

Definition at line 30 of file N_pde.h.

Referenced by N_assemble_les_2d_param(), N_assemble_les_3d_param(), N_gwflow_2d_calc_water_budget(), and N_gwflow_3d_calc_water_budget().

## N_CELL_TRANSMISSION

#define N_CELL_TRANSMISSION 3

Definition at line 33 of file N_pde.h.

Referenced by N_calc_solute_transport_transmission_2d(), and N_callback_solute_transport_2d().

## N_EUKLID_NORM

#define N_EUKLID_NORM 1

Definition at line 46 of file N_pde.h.

Referenced by N_norm_array_2d(), and N_norm_array_3d().

## N_MAX_CELL_STATE

#define N_MAX_CELL_STATE 20

the maximum number of available cell states (eg: boundary condition, inactiven active)

Definition at line 38 of file N_pde.h.

Referenced by N_assemble_les_2d_param(), N_assemble_les_3d_param(), N_les_integrate_dirichlet_2d(), and N_les_integrate_dirichlet_3d().

## N_MAXIMUM_NORM

#define N_MAXIMUM_NORM 0

Definition at line 45 of file N_pde.h.

Referenced by N_norm_array_2d(), and N_norm_array_3d().

## N_NORMAL_LES

#define N_NORMAL_LES 0

Definition at line 25 of file N_pde.h.

Referenced by N_alloc_les_param().

## N_SPARSE_LES

#define N_SPARSE_LES 1

Definition at line 26 of file N_pde.h.

Referenced by N_alloc_les_param(), N_assemble_les_2d_param(), N_assemble_les_3d_param(), N_free_les(), N_les_integrate_dirichlet_2d(), N_les_integrate_dirichlet_3d(), and N_print_les().

## N_UPWIND_EXP

#define N_UPWIND_EXP 1 /*exponential upwinding stabilization */

Definition at line 55 of file N_pde.h.

Referenced by N_alloc_solute_transport_data2d(), N_alloc_solute_transport_data3d(), and N_callback_solute_transport_2d().

## N_UPWIND_FULL

#define N_UPWIND_FULL 0 /*full upwinding stabilization */

Definition at line 54 of file N_pde.h.

Referenced by N_callback_solute_transport_2d().

## N_UPWIND_WEIGHT

#define N_UPWIND_WEIGHT 2 /*weighted upwinding stabilization */

Definition at line 56 of file N_pde.h.

## Enumeration Type Documentation

## N_STD_OPT

enum N_STD_OPT

Standard options of the gpde library.

Enumerator
N_OPT_SOLVER_SYMM |
N_OPT_SOLVER_UNSYMM | solver for symmetric, positive definite linear equation systems
N_OPT_MAX_ITERATIONS | solver for unsymmetric linear equation systems
N_OPT_ITERATION_ERROR | Maximum number of iteration used to solver the linear equation system
N_OPT_SOR_VALUE | Error break criteria for the iterative solver (jacobi, sor, cg or bicgstab)
N_OPT_CALC_TIME | The relaxation parameter used by the jacobi and sor solver for speedup or stabilizing The calculation time in seconds

Definition at line 391 of file N_pde.h.

## Function Documentation

## N_alloc_27star()

N_data_star * N_alloc_27star | ( | void |  | ) |

extern

allocate a 27 point star data structure

Returns
  N_data_star *

Attention
  The 27 point start is not yet implemented in the matrix assembling function

Definition at line 101 of file n_les_assemble.c.

References N_data_star::count, N_27_POINT_STAR, and N_data_star::type.

Referenced by N_create_27star().

## N_alloc_5star()

N_data_star * N_alloc_5star | ( | void |  | ) |

extern

allocate a 5 point star data structure

Returns
  N_data_star *

Definition at line 42 of file n_les_assemble.c.

References N_data_star::count, N_5_POINT_STAR, and N_data_star::type.

Referenced by N_create_5star().

## N_alloc_7star()

N_data_star * N_alloc_7star | ( | void |  | ) |

extern

allocate a 7 point star data structure

Returns
  N_data_star *

Definition at line 59 of file n_les_assemble.c.

References N_data_star::count, N_7_POINT_STAR, and N_data_star::type.

Referenced by N_callback_template_3d(), and N_create_7star().

## N_alloc_9star()

N_data_star * N_alloc_9star | ( | void |  | ) |

extern

allocate a 9 point star data structure

Returns
  N_data_star *

Attention
  The 9 point start is not yet implemented in the matrix assembling function

Definition at line 80 of file n_les_assemble.c.

References N_data_star::count, N_9_POINT_STAR, and N_data_star::type.

Referenced by N_callback_template_2d(), and N_create_9star().

## N_alloc_array_2d()

N_array_2d * N_alloc_array_2d | ( | int | cols,
|  | int | rows,
|  | int | offset,
|  | int | type )

extern

Allocate memory for a N_array_2d data structure.

This function allocates memory for an array of type N_array_2d and returns the pointer to the new allocated memory.
The data type of this array is set by "type" and must be CELL_TYPE, FCELL_TYPE or DCELL_TYPE accordingly to the raster map data types. The offset sets the number of boundary cols and rows. This option is useful to generate homogeneous Neumann boundary conditions around an array or to establish overlapping boundaries. The array is initialized with 0 by default.
If the offset is greater then 0, negative indices are possible.

The data structure of a array with 3 rows and cols and an offset of 1 will looks like this:

    0 0 0 0 0
    0 0 1 2 0
    0 3 4 5 0
    0 6 7 8 0
    0 0 0 0 0

0 is the boundary.
Internal a one dimensional array is allocated to save memory and to speed up the memory access. To access the one dimensional array with a two dimensional index use the provided get and put functions. The internal representation of the above data will look like this:

    0 0 0 0 0 0 0 1 2 0 0 3 4 5 0 0 6 7 8 0 0 0 0 0 0

Parameters

  cols | int
  rows | int
  offset | int
  type | int

Returns
  N_array_2d *

Definition at line 75 of file n_arrays.c.

References G_debug(), G_fatal_error(), and NULL.

Referenced by N_alloc_gradient_field_2d(), N_alloc_gwflow_data2d(), N_alloc_gwflow_data3d(), N_alloc_solute_transport_data2d(), N_assemble_les_2d_param(), N_math_array_2d(), and N_read_rast_to_array_2d().

## N_alloc_array_3d()

N_array_3d * N_alloc_array_3d | ( | int | cols,
|  | int | rows,
|  | int | depths,
|  | int | offset,
|  | int | type )

extern

Allocate memory for a N_array_3d data structure.

This functions allocates an array of type N_array_3d and returns a pointer to the new allocated memory.
The data type of this array set by "type" must be FCELL_TYPE or DCELL_TYPE accordingly to the raster3d map data types. The offsets sets the number of boundary cols, rows and depths. This option is useful to generate homogeneous Neumann boundary conditions around an array or to establish overlapping boundaries. The arrays are initialized with 0 by default.
If the offset is greater then 0, negative indices are possible. The data structure of a array with 3 depths, rows and cols and an offset of 1 will looks like this:

    0  0  0  0  0
    0  0  0  0  0
    0  0  0  0  0
    0  0  0  0  0
    0  0  0  0  0

    0  0  0  0  0
    0  0  1  2  0
    0  3  4  5  0
    0  6  7  8  0
    0  0  0  0  0

    0  0  0  0  0
    0  9 10 11  0
    0 12 13 14  0
    0 15 16 17  0
    0  0  0  0  0

    0  0  0  0  0
    0 18 19 20  0
    0 21 22 23  0
    0 24 25 26  0
    0  0  0  0  0

    0  0  0  0  0
    0  0  0  0  0
    0  0  0  0  0
    0  0  0  0  0
    0  0  0  0  0

The depth counts from the bottom to the top.

Internal a one dimensional array is allocated to speed up the memory access. To access the dimensional array with a three dimensional indexing use the provided get and put functions.

Parameters

  cols | int
  rows | int
  depths | int
  offset | int
  type | int

Returns
  N_array_3d *

Definition at line 719 of file n_arrays.c.

References G_debug(), G_fatal_error(), and NULL.

Referenced by N_alloc_gradient_field_3d(), N_alloc_gwflow_data3d(), N_alloc_solute_transport_data3d(), N_assemble_les_3d_param(), N_math_array_3d(), and N_read_rast3d_to_array_3d().

## N_alloc_geom_data()

N_geom_data * N_alloc_geom_data | ( | void |  | ) |

extern

Allocate the pde geometry data structure and return a pointer to the new allocated structure.

Returns
  N_geom_data *

Definition at line 29 of file n_geom.c.

References N_geom_data::area, N_geom_data::dim, NULL, and N_geom_data::planimetric.

Referenced by N_init_geom_data_2d(), and N_init_geom_data_3d().

## N_alloc_gradient_2d()

N_gradient_2d * N_alloc_gradient_2d | ( | void |  | ) |

extern

Allocate a N_gradient_2d structure.

Returns
  N_gradient_2d *

Definition at line 26 of file n_gradient.c.

Referenced by N_create_gradient_2d().

## N_alloc_gradient_3d()

N_gradient_3d * N_alloc_gradient_3d | ( | void |  | ) |

extern

Allocate a N_gradient_3d structure.

Returns
  N_gradient_3d *

Definition at line 149 of file n_gradient.c.

Referenced by N_create_gradient_3d().

## N_alloc_gradient_field_2d()

N_gradient_field_2d * N_alloc_gradient_field_2d | ( | int | cols,
|  | int | rows )

extern

Allocate a N_gradient_field_2d.

The field arrays are of type DCELL.

Parameters

  rows | - number of rows of the 2d array from which the gradient should be calculated
  cols | - number of cols of the 2d array from which the gradient should be calculated

Returns
  N_gradient_field_2d *

Definition at line 896 of file n_gradient.c.

References N_gradient_field_2d::cols, G_debug(), N_alloc_array_2d(), N_gradient_field_2d::rows, N_gradient_field_2d::x_array, and N_gradient_field_2d::y_array.

Referenced by N_alloc_solute_transport_data2d(), and N_compute_gradient_field_2d().

## N_alloc_gradient_field_3d()

N_gradient_field_3d * N_alloc_gradient_field_3d | ( | int | cols,
|  | int | rows,
|  | int | depths )

extern

Allocate a N_gradient_field_3d.

The field arrays are always of type DCELL_TYPE.

Parameters

  cols | - number of cols of the 3d array from which the gradient should be calculated
  rows | - number of rows of the 3d array from which the gradient should be calculated
  depths | - number of depths of the 3d array from which the gradient should be calculated

Returns
  N_gradient_field_3d *

Definition at line 993 of file n_gradient.c.

References N_gradient_field_3d::cols, N_gradient_field_3d::depths, G_debug(), N_alloc_array_3d(), N_gradient_field_3d::rows, N_gradient_field_3d::x_array, N_gradient_field_3d::y_array, and N_gradient_field_3d::z_array.

Referenced by N_alloc_solute_transport_data3d(), and N_compute_gradient_field_3d().

## N_alloc_gradient_neighbours_2d()

N_gradient_neighbours_2d * N_alloc_gradient_neighbours_2d | ( | void |  | ) |

extern

Allocate a N_gradient_neighbours_2d structure.

This structure contains all neighbour gradients in all directions of one cell in a 2d raster layer

Returns
  N_gradient_neighbours_2d *

Definition at line 577 of file n_gradient.c.

References N_alloc_gradient_neighbours_x(), N_alloc_gradient_neighbours_y(), N_gradient_neighbours_2d::x, and N_gradient_neighbours_2d::y.

Referenced by N_create_gradient_neighbours_2d().

## N_alloc_gradient_neighbours_3d()

N_gradient_neighbours_3d * N_alloc_gradient_neighbours_3d | ( | void |  | ) |

extern

Allocate a N_gradient_neighbours_3d structure.

This structure contains all neighbour gradients in all directions of one cell in a 3d raster layer

Returns
  N_gradient_neighbours_3d *

Definition at line 752 of file n_gradient.c.

References N_alloc_gradient_neighbours_x(), N_alloc_gradient_neighbours_y(), N_alloc_gradient_neighbours_z(), N_gradient_neighbours_3d::xb, N_gradient_neighbours_3d::xc, N_gradient_neighbours_3d::xt, N_gradient_neighbours_3d::yb, N_gradient_neighbours_3d::yc, N_gradient_neighbours_3d::yt, N_gradient_neighbours_3d::zb, and N_gradient_neighbours_3d::zt.

Referenced by N_create_gradient_neighbours_3d().

## N_alloc_gradient_neighbours_x()

N_gradient_neighbours_x * N_alloc_gradient_neighbours_x | ( | void |  | ) |

extern

Allocate a N_gradient_neighbours_x structure.

This structure contains all neighbour gradients in x direction of one cell

Returns
  N_gradient_neighbours_x *

Definition at line 289 of file n_gradient.c.

Referenced by N_alloc_gradient_neighbours_2d(), N_alloc_gradient_neighbours_3d(), and N_create_gradient_neighbours_x().

## N_alloc_gradient_neighbours_y()

N_gradient_neighbours_y * N_alloc_gradient_neighbours_y | ( | void |  | ) |

extern

Allocate a N_gradient_neighbours_y structure.

This structure contains all neighbour gradients in y direction of one cell

Returns
  N_gradient_neighbours_y *

Definition at line 381 of file n_gradient.c.

Referenced by N_alloc_gradient_neighbours_2d(), N_alloc_gradient_neighbours_3d(), and N_create_gradient_neighbours_y().

## N_alloc_gradient_neighbours_z()

N_gradient_neighbours_z * N_alloc_gradient_neighbours_z | ( | void |  | ) |

extern

Allocate a N_gradient_neighbours_z structure.

This structure contains all neighbour gradients in z direction of one cell

Returns
  N_gradient_neighbours_z *

Definition at line 473 of file n_gradient.c.

Referenced by N_alloc_gradient_neighbours_3d(), and N_create_gradient_neighbours_z().

## N_alloc_les()

N_les * N_alloc_les | ( | int | rows,
|  | int | type )

extern

Allocate memory for a quadratic linear equation system which includes the Matrix A, vector x and vector b.

This function calls N_alloc_les_param

Parameters

  rows | int
  type | int

Returns
  N_les *

Definition at line 101 of file n_les.c.

References N_alloc_les_param().

## N_alloc_les_A()

N_les * N_alloc_les_A | ( | int | rows,
|  | int | type )

extern

Allocate memory for a quadratic linear equation system which includes the Matrix A.

This function calls N_alloc_les_param

Parameters

  rows | int
  type | int

Returns
  N_les *

Definition at line 133 of file n_les.c.

References N_alloc_les_param().

## N_alloc_les_Ax()

N_les * N_alloc_les_Ax | ( | int | rows,
|  | int | type )

extern

Allocate memory for a quadratic linear equation system which includes the Matrix A and vector x.

This function calls N_alloc_les_param

Parameters

  rows | int
  type | int

Returns
  N_les *

Definition at line 117 of file n_les.c.

References N_alloc_les_param().

## N_alloc_les_Ax_b()

N_les * N_alloc_les_Ax_b | ( | int | rows,
|  | int | type )

extern

Allocate memory for a quadratic linear equation system which includes the Matrix A, vector x and vector b.

This function calls N_alloc_les_param

Parameters

  rows | int
  type | int

Returns
  N_les *

Definition at line 149 of file n_les.c.

References N_alloc_les_param().

Referenced by N_assemble_les_2d_param(), and N_assemble_les_3d_param().

## N_alloc_les_callback_2d()

N_les_callback_2d * N_alloc_les_callback_2d | ( | void |  | ) |

extern

Allocate the structure holding the callback function.

A template callback is set. Use N_set_les_callback_2d_func to set up a specific function.

Returns
  N_les_callback_2d *

Definition at line 400 of file n_les_assemble.c.

References N_les_callback_2d::callback, and N_callback_template_2d().

## N_alloc_les_callback_3d()

N_les_callback_3d * N_alloc_les_callback_3d | ( | void |  | ) |

extern

Allocate the structure holding the callback function.

A template callback is set. Use N_set_les_callback_3d_func to set up a specific function.

Returns
  N_les_callback_3d *

Definition at line 379 of file n_les_assemble.c.

References N_les_callback_3d::callback, and N_callback_template_3d().

## N_alloc_les_param()

N_les * N_alloc_les_param | ( | int | cols,
|  | int | rows,
|  | int | type,
|  | int | parts )

extern

Allocate memory for a quadratic or not quadratic linear equation system.

The type of the linear equation system must be N_NORMAL_LES for a regular quadratic matrix or N_SPARSE_LES for a sparse matrix

In case of N_NORMAL_LES

A quadratic matrix of size rows*rows*sizeof(double) will allocated

In case of N_SPARSE_LES

a vector of size row will be allocated, ready to hold additional allocated sparse vectors. each sparse vector may have a different size.

Parameter parts defines which parts of the les should be allocated. The number of columns and rows defines if the matrix is quadratic.

Parameters

  cols | int
  rows | int
  type | int
  parts | int – 2 = A, x and b; 1 = A and x; 0 = A allocated

Returns
  N_les *

Definition at line 182 of file n_les.c.

References N_les::A, N_les::Asp, N_les::b, N_les::cols, G_alloc_matrix(), G_debug(), G_math_alloc_spmatrix(), N_NORMAL_LES, N_SPARSE_LES, NULL, N_les::quad, N_les::rows, N_les::type, and N_les::x.

Referenced by N_alloc_les(), N_alloc_les_A(), N_alloc_les_Ax(), N_alloc_les_Ax_b(), N_alloc_nquad_les(), N_alloc_nquad_les_A(), N_alloc_nquad_les_Ax(), and N_alloc_nquad_les_Ax_b().

## N_alloc_nquad_les()

N_les * N_alloc_nquad_les | ( | int | cols,
|  | int | rows,
|  | int | type )

extern

Allocate memory for a (not) quadratic linear equation system which includes the Matrix A, vector x and vector b.

This function calls N_alloc_les_param

Parameters

  cols | int
  rows | int
  type | int

Returns
  N_les *

Definition at line 34 of file n_les.c.

References N_alloc_les_param().

## N_alloc_nquad_les_A()

N_les * N_alloc_nquad_les_A | ( | int | cols,
|  | int | rows,
|  | int | type )

extern

Allocate memory for a (not) quadratic linear equation system which includes the Matrix A.

This function calls N_alloc_les_param

Parameters

  cols | int
  rows | int
  type | int

Returns
  N_les *

Definition at line 68 of file n_les.c.

References N_alloc_les_param().

## N_alloc_nquad_les_Ax()

N_les * N_alloc_nquad_les_Ax | ( | int | cols,
|  | int | rows,
|  | int | type )

extern

Allocate memory for a (not) quadratic linear equation system which includes the Matrix A and vector x.

This function calls N_alloc_les_param

Parameters

  cols | int
  rows | int
  type | int

Returns
  N_les *

Definition at line 51 of file n_les.c.

References N_alloc_les_param().

## N_alloc_nquad_les_Ax_b()

N_les * N_alloc_nquad_les_Ax_b | ( | int | cols,
|  | int | rows,
|  | int | type )

extern

Allocate memory for a (not) quadratic linear equation system which includes the Matrix A, vector x and vector b.

This function calls N_alloc_les_param

Parameters

  cols | int
  rows | int
  type | int

Returns
  N_les *

Definition at line 85 of file n_les.c.

References N_alloc_les_param().

## N_assemble_les_2d()

N_les * N_assemble_les_2d | ( | int | les_type,
|  | N_geom_data * | geom,
|  | N_array_2d * | status,
|  | N_array_2d * | start_val,
|  | void * | data,
|  | N_les_callback_2d * | call )

extern

Assemble a linear equation system (les) based on 2d location data (raster) and active cells.

This function calls N_assemble_les_2d_param

Definition at line 495 of file n_les_assemble.c.

References N_assemble_les_2d_param(), and N_CELL_ACTIVE.

## N_assemble_les_2d_active()

N_les * N_assemble_les_2d_active | ( | int | les_type,
|  | N_geom_data * | geom,
|  | N_array_2d * | status,
|  | N_array_2d * | start_val,
|  | void * | data,
|  | N_les_callback_2d * | call )

extern

Assemble a linear equation system (les) based on 2d location data (raster) and active cells.

This function calls N_assemble_les_2d_param

Definition at line 510 of file n_les_assemble.c.

References N_assemble_les_2d_param(), and N_CELL_ACTIVE.

## N_assemble_les_2d_dirichlet()

N_les * N_assemble_les_2d_dirichlet | ( | int | les_type,
|  | N_geom_data * | geom,
|  | N_array_2d * | status,
|  | N_array_2d * | start_val,
|  | void * | data,
|  | N_les_callback_2d * | call )

extern

Assemble a linear equation system (les) based on 2d location data (raster) and active and dirichlet cells.

This function calls N_assemble_les_2d_param

Definition at line 525 of file n_les_assemble.c.

References N_assemble_les_2d_param(), and N_CELL_DIRICHLET.

## N_assemble_les_2d_param()

N_les * N_assemble_les_2d_param | ( | int | les_type,
|  | N_geom_data * | geom,
|  | N_array_2d * | status,
|  | N_array_2d * | start_val,
|  | void * | data,
|  | N_les_callback_2d * | call,
|  | int | cell_type )

extern

Assemble a linear equation system (les) based on 2d location data (raster).

The linear equation system type can be set to N_NORMAL_LES to create a regular matrix, or to N_SPARSE_LES to create a sparse matrix. This function returns a new created linear equation system which can be solved with linear equation solvers. An 2d array with start values and an 2d status array must be provided as well as the location geometry and a void pointer to data passed to the callback which creates the les row entries. This callback must be defined in the N_les_callback_2d structure.

The creation of the les is parallelized with OpenMP. If you implement new callbacks, please make sure that the function calls are thread safe.

the les can be created in two ways, with dirichlet and similar cells and without them, to spare some memory. If the les is created with dirichlet cell, the dirichlet boundary condition must be added.

Parameters

  les_type | int
  geom | N_geom_data*
  status | N_array_2d *
  start_val | N_array_2d *
  data | void *
  cell_type | int – les assemble based on N_CELL_ACTIVE or N_CELL_DIRICHLET
  call | N_les_callback_2d *

Returns
  N_les *

Definition at line 563 of file n_les_assemble.c.

References N_les::A, N_les::Asp, N_les::b, N_data_star::C, N_les_callback_2d::callback, N_geom_data::cols, count, N_data_star::count, N_data_star::E, G_debug(), G_fatal_error(), G_free(), G_math_add_spvector(), G_math_alloc_spvector(), N_data_star::N, N_9_POINT_STAR, N_alloc_array_2d(), N_alloc_les_Ax_b(), N_CELL_ACTIVE, N_CELL_DIRICHLET, N_CELL_INACTIVE, N_free_array_2d(), N_get_array_2d_c_value(), N_get_array_2d_d_value(), N_MAX_CELL_STATE, N_put_array_2d_c_value(), N_SPARSE_LES, N_data_star::NE, NULL, N_data_star::NW, N_geom_data::rows, N_data_star::S, N_data_star::SE, N_data_star::SW, N_data_star::type, N_les::type, N_data_star::V, N_data_star::W, and N_les::x.

Referenced by N_assemble_les_2d(), N_assemble_les_2d_active(), and N_assemble_les_2d_dirichlet().

## N_assemble_les_3d()

N_les * N_assemble_les_3d | ( | int | les_type,
|  | N_geom_data * | geom,
|  | N_array_3d * | status,
|  | N_array_3d * | start_val,
|  | void * | data,
|  | N_les_callback_3d * | call )

extern

Assemble a linear equation system (les) based on 3d location data (g3d) active cells.

This function calls N_assemble_les_3d_param

Definition at line 958 of file n_les_assemble.c.

References N_assemble_les_3d_param(), and N_CELL_ACTIVE.

## N_assemble_les_3d_active()

N_les * N_assemble_les_3d_active | ( | int | les_type,
|  | N_geom_data * | geom,
|  | N_array_3d * | status,
|  | N_array_3d * | start_val,
|  | void * | data,
|  | N_les_callback_3d * | call )

extern

Assemble a linear equation system (les) based on 3d location data (g3d) active cells.

This function calls N_assemble_les_3d_param

Definition at line 972 of file n_les_assemble.c.

References N_assemble_les_3d_param(), and N_CELL_ACTIVE.

## N_assemble_les_3d_dirichlet()

N_les * N_assemble_les_3d_dirichlet | ( | int | les_type,
|  | N_geom_data * | geom,
|  | N_array_3d * | status,
|  | N_array_3d * | start_val,
|  | void * | data,
|  | N_les_callback_3d * | call )

extern

Assemble a linear equation system (les) based on 3d location data (g3d) active and dirichlet cells.

This function calls N_assemble_les_3d_param

Definition at line 986 of file n_les_assemble.c.

References N_assemble_les_3d_param(), and N_CELL_DIRICHLET.

## N_assemble_les_3d_param()

N_les * N_assemble_les_3d_param | ( | int | les_type,
|  | N_geom_data * | geom,
|  | N_array_3d * | status,
|  | N_array_3d * | start_val,
|  | void * | data,
|  | N_les_callback_3d * | call,
|  | int | cell_type )

extern

Assemble a linear equation system (les) based on 3d location data (g3d).

The linear equation system type can be set to N_NORMAL_LES to create a regular matrix, or to N_SPARSE_LES to create a sparse matrix. This function returns a new created linear equation system which can be solved with linear equation solvers. An 3d array with start values and an 3d status array must be provided as well as the location geometry and a void pointer to data passed to the callback which creates the les row entries. This callback must be defined in the N_les_callback_3d structure.

The creation of the les is parallelized with OpenMP. If you implement new callbacks, please make sure that the function calls are thread safe.

the les can be created in two ways, with dirichlet and similar cells and without them, to spare some memory. If the les is created with dirichlet cell, the dirichlet boundary condition must be added.

Parameters

  les_type | int
  geom | N_geom_data*
  status | N_array_3d *
  start_val | N_array_3d *
  data | void *
  call | N_les_callback_3d *
  cell_type | int – les assemble based on N_CELL_ACTIVE or N_CELL_DIRICHLET

Returns
  N_les *

Definition at line 1023 of file n_les_assemble.c.

References N_les::A, N_les::Asp, N_data_star::B, N_les::b, N_data_star::C, N_les_callback_3d::callback, N_geom_data::cols, count, N_data_star::count, N_geom_data::depths, N_data_star::E, G_debug(), G_fatal_error(), G_free(), G_math_add_spvector(), G_math_alloc_spvector(), N_data_star::N, N_27_POINT_STAR, N_7_POINT_STAR, N_alloc_array_3d(), N_alloc_les_Ax_b(), N_CELL_ACTIVE, N_CELL_DIRICHLET, N_CELL_INACTIVE, N_free_array_3d(), N_get_array_3d_d_value(), N_MAX_CELL_STATE, N_put_array_3d_d_value(), N_SPARSE_LES, NULL, N_geom_data::rows, N_data_star::S, N_data_star::T, N_data_star::type, N_les::type, N_data_star::V, N_data_star::W, and N_les::x.

Referenced by N_assemble_les_3d(), N_assemble_les_3d_active(), and N_assemble_les_3d_dirichlet().

## N_calc_arith_mean()

double N_calc_arith_mean | ( | double | a,
|  | double | b )

extern

Calculate the arithmetic mean of values a and b.

mean = (a+b)/2

Parameters

  a | double
  b | double

Returns
  val double

Definition at line 31 of file n_tools.c.

References b.

Referenced by N_callback_gwflow_2d().

## N_calc_arith_mean_n()

double N_calc_arith_mean_n | ( | double * | a,
|  | int | size )

extern

Calculate the arithmetic mean of the values in vector a of size n.

n = [0 ... size[ mean = (a[0] + a[1] + ... + a[n])/size

Parameters

  a | double * – the value vector
  size | int – the size of the vector a

Returns
  val double

Definition at line 51 of file n_tools.c.

## N_calc_array_2d_stats()

void N_calc_array_2d_stats | ( | N_array_2d * | a,
|  | double * | min,
|  | double * | max,
|  | double * | sum,
|  | int * | nonull,
|  | int | withoffset )

extern

Calculate basic statistics of the N_array_2d struct.

Calculates the minimum, maximum, sum and the number of non null values. The array offset can be included in the calculation.

Parameters

  a | N_array_2d * - input array
  min | double* - variable to store the computed minimum
  max | double* - variable to store the computed maximum
  sum | double* - variable to store the computed sum
  nonull | int* - variable to store the number of non null values
  withoffset | - if 1 include offset values in statistic calculation, 0 otherwise

Returns
  void

Definition at line 213 of file n_arrays_calc.c.

References G_debug(), max, min, N_get_array_2d_d_value(), and N_is_array_2d_value_null().

Referenced by N_calc_gradient_field_2d_stats().

## N_calc_array_3d_stats()

void N_calc_array_3d_stats | ( | N_array_3d * | a,
|  | double * | min,
|  | double * | max,
|  | double * | sum,
|  | int * | nonull,
|  | int | withoffset )

extern

Calculate basic statistics of the N_array_3d struct.

Calculates the minimum, maximum, sum and the number of non null values. The array offset can be included in the statistical calculation.

Parameters

  a | N_array_3d * - input array
  min | double* - variable to store the computed minimum
  max | double* - variable to store the computed maximum
  sum | double* - variable to store the computed sum
  nonull | int* - variable to store the number of non null values
  withoffset | - if 1 include offset values in statistic calculation, 0 otherwise

Returns
  void

Definition at line 627 of file n_arrays_calc.c.

References G_debug(), max, min, N_get_array_3d_d_value(), and N_is_array_3d_value_null().

Referenced by N_calc_gradient_field_3d_stats().

## N_calc_geom_mean()

double N_calc_geom_mean | ( | double | a,
|  | double | b )

extern

Calculate the geometrical mean of values a and b.

mean = sqrt(a*b)

Parameters

  a | double
  b | double

Returns
  val double

Definition at line 73 of file n_tools.c.

References b.

Referenced by N_callback_solute_transport_2d().

## N_calc_geom_mean_n()

double N_calc_geom_mean_n | ( | double * | a,
|  | int | size )

extern

Calculate the geometrical mean of the values in vector a of size n.

n = [0 ... size[ mean = pow((a[0] * a[1] * ... * a[n]), 1.0/size)

Parameters

  a | double * – the value vector
  size | int – the size of the vector a

Returns
  val double

Definition at line 93 of file n_tools.c.

## N_calc_gradient_field_2d_stats()

void N_calc_gradient_field_2d_stats | ( | N_gradient_field_2d * | field | ) |

extern

Calculate basic statistics of a gradient field.

The statistic is stored in the gradient field struct

Parameters

  field | N_gradient_2d_field *

Returns
  void

Definition at line 28 of file n_gradient_calc.c.

References G_debug(), N_gradient_field_2d::max, N_gradient_field_2d::mean, N_gradient_field_2d::min, N_calc_array_2d_stats(), N_gradient_field_2d::nonull, N_gradient_field_2d::sum, N_gradient_field_2d::x_array, and N_gradient_field_2d::y_array.

Referenced by N_compute_gradient_field_2d().

## N_calc_gradient_field_3d_stats()

void N_calc_gradient_field_3d_stats | ( | N_gradient_field_3d * | field | ) |

extern

Calculate basic statistics of a gradient field.

The statistic is stored in the gradient field struct

Parameters

  field | N_gradient_3d_field *

Returns
  void

Definition at line 303 of file n_gradient_calc.c.

References G_debug(), N_gradient_field_3d::max, N_gradient_field_3d::mean, N_gradient_field_3d::min, N_calc_array_3d_stats(), N_gradient_field_3d::nonull, N_gradient_field_3d::sum, N_gradient_field_3d::x_array, N_gradient_field_3d::y_array, and N_gradient_field_3d::z_array.

Referenced by N_compute_gradient_field_3d().

## N_calc_harmonic_mean()

double N_calc_harmonic_mean | ( | double | a,
|  | double | b )

extern

Calculate the harmonical mean of values a and b.

mean = 2*(a*b)/(a + b)

Parameters

  a | double
  b | double

Returns
  val double – if (a + b) == 0, a 0 is returned

Definition at line 115 of file n_tools.c.

References b.

Referenced by N_callback_gwflow_2d(), N_callback_gwflow_3d(), N_callback_solute_transport_2d(), N_callback_solute_transport_3d(), N_compute_gradient_field_2d(), and N_compute_gradient_field_3d().

## N_calc_harmonic_mean_n()

double N_calc_harmonic_mean_n | ( | double * | a,
|  | int | size )

extern

Calculate the harmonical mean of the values in vector a of size n.

n = [0 ... size[ mean = 1/(1/size *(1/a[0] + 1/a[1] + ... + 1/a[n]))

Parameters

  a | double * – the value vector
  size | int – the size of the vector a

Returns
  val double – if one division with 0 is detected, 0 will be returned

Definition at line 136 of file n_tools.c.

## N_calc_quad_mean()

double N_calc_quad_mean | ( | double | a,
|  | double | b )

extern

Calculate the quadratic mean of values a and b.

mean = sqrt((a*a + b*b)/2)

Parameters

  a | double
  b | double

Returns
  val double

Definition at line 164 of file n_tools.c.

References b.

## N_calc_quad_mean_n()

double N_calc_quad_mean_n | ( | double * | a,
|  | int | size )

extern

Calculate the quadratic mean of the values in vector a of size n.

n = [0 ... size[ mean = sqrt((a[0]*a[0] + a[1]*a[1] + ... + a[n]*a[n])/size)

Parameters

  a | double * – the value vector
  size | int – the size of the vector a

Returns
  val double

Definition at line 184 of file n_tools.c.

## N_callback_template_2d()

N_data_star * N_callback_template_2d | ( | void * | data,
|  | N_geom_data * | geom,
|  | int | col,
|  | int | row )

extern

A callback template creates a 9 point star structure.

This is a template callback for mass balance calculation with 9 point stars based on 2d data (raster).

Parameters

  data | void * (unused)
  geom | N_geom_data *
  col | int (unused)
  row | int (unused)

Returns
  N_data_star *

Definition at line 465 of file n_les_assemble.c.

References N_data_star::C, N_geom_data::dx, N_geom_data::dy, N_data_star::E, N_data_star::N, N_alloc_9star(), N_data_star::NE, N_data_star::NW, N_data_star::S, N_data_star::SE, N_data_star::SW, N_data_star::V, and N_data_star::W.

Referenced by N_alloc_les_callback_2d().

## N_callback_template_3d()

N_data_star * N_callback_template_3d | ( | void * | data,
|  | N_geom_data * | geom,
|  | int | col,
|  | int | row,
|  | int | depth )

extern

A callback template creates a 7 point star structure.

This is a template callback for mass balance calculation with 7 point stars based on 3d data (g3d).

Parameters

  data | void * (unused)
  geom | N_geom_data *
  depth | int (unused)
  row | int (unused)
  col | int (unused)

Returns
  N_data_star *

Definition at line 427 of file n_les_assemble.c.

References N_data_star::B, N_data_star::C, N_geom_data::dx, N_geom_data::dy, N_geom_data::dz, N_data_star::E, G_debug(), N_data_star::N, N_alloc_7star(), N_data_star::S, N_data_star::T, N_data_star::V, and N_data_star::W.

Referenced by N_alloc_les_callback_3d().

## N_compute_gradient_field_2d()

N_gradient_field_2d * N_compute_gradient_field_2d | ( | N_array_2d * | pot,
|  | N_array_2d * | weight_x,
|  | N_array_2d * | weight_y,
|  | N_geom_data * | geom,
|  | N_gradient_field_2d * | gradfield )

extern

This function computes the gradient based on the input N_array_2d pot (potential), a weighting factor N_array_2d named weight and the distance between two cells saved in the N_geom_data struct.

The gradient is calculated between cells for each cell and direction. An existing gradient field can be filled with new data or, if a NULL pointer is given, a new gradient field will be allocated with the appropriate size.

    ______________
    |    |    |    |
    |    |    |    |
    |----|-NC-|----|
    |    |    |    |
    |   WC    EC   |
    |    |    |    |
    |----|-SC-|----|
    |    |    |    |
    |____|____|____|

    x - direction:

    r = 2 * weight[row][col]*weight[row][col + 1] /
    (weight[row][col]*weight[row][col + 1]) EC = r * (pot[row][col] - pot[row][col
    + 1])/dx

    y - direction:

    r = 2 * weight[row][col]*weight[row + 1][col] / (weight[row][col]*weight[row +
    1][col]) SC = r * (pot[row][col] - pot[row + 1][col])/dy

    the values SC and EC are the values of the next row/col

Parameters

  pot | N_array_2d * - the potential N_array_2d
  weight_x | N_array_2d * - the weighting factor N_array_2d used to modify the gradient in x-direction
  weight_y | N_array_2d * - the weighting factor N_array_2d used to modify the gradient in y-direction
  geom | N_geom_data * - geometry data structure
  gradfield | N_gradient_field_2d * - a gradient field of the correct size, if a NULL pointer is provided this gradient field will be new allocated

Returns
  N_gradient_field_2d * - the pointer to the computed gradient field

Definition at line 109 of file n_gradient_calc.c.

References N_array_2d::cols, N_geom_data::cols, N_gradient_field_2d::cols, N_geom_data::dx, N_geom_data::dy, G_debug(), G_fatal_error(), N_alloc_gradient_field_2d(), N_calc_gradient_field_2d_stats(), N_calc_harmonic_mean(), N_get_array_2d_d_value(), N_is_array_2d_value_null(), N_put_array_2d_d_value(), NULL, N_array_2d::rows, N_geom_data::rows, N_gradient_field_2d::rows, N_gradient_field_2d::x_array, and N_gradient_field_2d::y_array.

## N_compute_gradient_field_3d()

N_gradient_field_3d * N_compute_gradient_field_3d | ( | N_array_3d * | pot,
|  | N_array_3d * | weight_x,
|  | N_array_3d * | weight_y,
|  | N_array_3d * | weight_z,
|  | N_geom_data * | geom,
|  | N_gradient_field_3d * | gradfield )

extern

This function computes the gradient based on the input N_array_3d pot (that means potential), a weighting factor N_array_3d named weight and the distance between two cells saved in the N_geom_data struct.

The gradient is calculated between cells for each cell and direction. An existing gradient field can be filled with new data or, if a NULL pointer is given, a new gradient field will be allocated with the appropriate size.

    |  /
    TC NC
    |/
    --WC-----EC--
    /|
    SC BC
    /  |

    x - direction:

    r = 2 * weight_x[depth][row][col]*weight_x[depth][row][col + 1] /
    (weight_X[depth][row][col]*weight_x[depth][row][col + 1]) EC = r *
    (pot[depth][row][col] - pot[depth][row][col + 1])/dx

    y - direction:

    r = 2 * weight_y[depth][row][col]*weight_y[depth][row + 1][col] /
    (weight_y[depth][row][col]*weight_y[depth][row + 1][col]) SC = r *
    (pot[depth][row][col] - pot[depth][row + 1][col])/dy

    z - direction:

    r = 2 * weight_z[depth][row][col]*weight_z[depth + 1][row][col] /
    (weight_z[depth][row][col]*weight_z[depth + 1][row][col]) TC = r *
    (pot[depth][row][col] - pot[depth + 1][row][col])/dy

    the values BC, NC, WC are the values of the next depth/row/col

Parameters

  pot | N_array_3d * - the potential N_array_2d
  weight_x | N_array_3d * - the weighting factor N_array_3d used to modify the gradient in x-direction
  weight_y | N_array_3d * - the weighting factor N_array_3d used to modify the gradient in y-direction
  weight_z | N_array_3d * - the weighting factor N_array_3d used to modify the gradient in z-direction
  geom | N_geom_data * - geometry data structure
  gradfield | N_gradient_field_3d * - a gradient field of the correct size, if a NULL pointer is provided this gradient field will be new allocated

Returns
  N_gradient_field_3d * - the pointer to the computed gradient field

Definition at line 400 of file n_gradient_calc.c.

References N_array_3d::cols, N_geom_data::cols, N_gradient_field_3d::cols, N_array_3d::depths, N_geom_data::depths, N_gradient_field_3d::depths, N_geom_data::dx, N_geom_data::dy, N_geom_data::dz, G_debug(), G_fatal_error(), N_alloc_gradient_field_3d(), N_calc_gradient_field_3d_stats(), N_calc_harmonic_mean(), N_get_array_3d_d_value(), N_is_array_3d_value_null(), N_put_array_3d_d_value(), NULL, N_array_3d::rows, N_geom_data::rows, N_gradient_field_3d::rows, N_gradient_field_3d::x_array, N_gradient_field_3d::y_array, and N_gradient_field_3d::z_array.

## N_compute_gradient_field_components_2d()

void N_compute_gradient_field_components_2d | ( | N_gradient_field_2d * | field,
|  | N_array_2d * | x_comp,
|  | N_array_2d * | y_comp )

extern

Calculate the x and y vector components from a gradient field for each cell and stores them in the provided N_array_2d structures.

The arrays must have the same size as the gradient field.

    Based on this storages scheme the gradient vector for each cell is
    calculated and stored in the provided  N_array_2d structures

    ______________
    |    |    |    |
    |    |    |    |
    |----|-NC-|----|
    |    |    |    |
    |   WC    EC   |
    |    |    |    |
    |----|-SC-|----|
    |    |    |    |
    |____|____|____|

    x vector component:

    x = (WC + EC) / 2

    y vector component:

    y = (NC + SC) / 2

Parameters

  field | N_gradient_field_2d *
  x_comp | N_array_2d * - the array in which the x component will be written
  y_comp | N_array_2d * - the array in which the y component will be written

Returns
  void

Definition at line 242 of file n_gradient_calc.c.

References N_array_2d::cols, N_gradient_2d::EC, G_fatal_error(), N_get_gradient_2d(), N_put_array_2d_d_value(), N_gradient_2d::NC, N_array_2d::rows, N_gradient_2d::SC, N_gradient_2d::WC, x, and N_gradient_field_2d::x_array.

## N_compute_gradient_field_components_3d()

void N_compute_gradient_field_components_3d | ( | N_gradient_field_3d * | field,
|  | N_array_3d * | x_comp,
|  | N_array_3d * | y_comp,
|  | N_array_3d * | z_comp )

extern

Calculate the x, y and z vector components from a gradient field for each cell and store them in the provided N_array_3d structures.

The arrays must have the same size as the gradient field.

    Based on this storages scheme the gradient vector for each cell is
    calculated and stored in the provided  N_array_3d structures

    |  /
    TC NC
    |/
    --WC-----EC--
    /|
    SC BC
    /  |

    x vector component:

    x = (WC + EC) / 2

    y vector component:

    y = (NC + SC) / 2

    z vector component:

    z = (TC + BC) / 2

Parameters

  field | N_gradient_field_3d *
  x_comp | N_array_3d * - the array in which the x component will be written
  y_comp | N_array_3d * - the array in which the y component will be written
  z_comp | N_array_3d * - the array in which the z component will be written

Returns
  void

Definition at line 595 of file n_gradient_calc.c.

References N_gradient_3d::BC, N_array_3d::cols, N_array_3d::depths, N_gradient_3d::EC, G_fatal_error(), N_get_gradient_3d(), N_put_array_3d_d_value(), N_gradient_3d::NC, N_array_3d::rows, N_gradient_3d::SC, N_gradient_3d::TC, N_gradient_3d::WC, x, and N_gradient_field_3d::x_array.

## N_convert_array_2d_null_to_zero()

int N_convert_array_2d_null_to_zero | ( | N_array_2d * | a | ) |

extern

Convert all null values to zero values.

The complete data array inclusively offsets is used. The array data types are automatically recognized.

Parameters

  a | N_array_2d *

Returns
  int - number of replaced values

Definition at line 418 of file n_arrays_calc.c.

References count, and G_debug().

## N_convert_array_3d_null_to_zero()

int N_convert_array_3d_null_to_zero | ( | N_array_3d * | a | ) |

extern

Convert all null values to zero values.

The complete data array inclusively offsets is used.

Parameters

  a | N_array_3d *

Returns
  int - number of replaced null values

Definition at line 832 of file n_arrays_calc.c.

References count, and G_debug().

## N_copy_array_2d()

void N_copy_array_2d | ( | N_array_2d * | source,
|  | N_array_2d * | target )

extern

Copy the source N_array_2d struct to the target N_array_2d struct.

The arrays must have the same size and the same offset.

The array types can be mixed, the values are automatically casted and the null values are set accordingly.
If you copy a cell array into a dcell array, the values are casted to dcell and the null values are converted from cell-null to dcell-null
This function can be called in a parallel region defined with OpenMP. The copy loop is parallelize with a openmp for pragma.

Parameters

  source | N_array_2d *
  target | N_array_2d *

Returns
  void

Definition at line 43 of file n_arrays_calc.c.

References N_array_2d::cell_array, N_array_2d::cols_intern, N_array_2d::dcell_array, N_array_2d::fcell_array, G_debug(), G_fatal_error(), N_array_2d::rows_intern, and N_array_2d::type.

Referenced by N_copy_gradient_field_2d().

## N_copy_array_3d()

void N_copy_array_3d | ( | N_array_3d * | source,
|  | N_array_3d * | target )

extern

Copy the source N_array_3d struct to the target N_array_3d struct.

The arrays must have the same size and the same offset.

The array data types can be mixed, the values are automatically casted and the null values are set accordingly.

If you copy a float array to a double array, the values are casted to DCELL and the null values are converted from FCELL-null to DCELL-null

Parameters

  source | N_array_3d *
  target | N_array_3d *

Returns
  void

Definition at line 485 of file n_arrays_calc.c.

References N_array_3d::cols_intern, N_array_3d::dcell_array, N_array_3d::depths_intern, N_array_3d::fcell_array, G_debug(), G_fatal_error(), N_array_3d::rows_intern, and N_array_3d::type.

Referenced by N_copy_gradient_field_3d().

## N_copy_gradient_2d()

int N_copy_gradient_2d | ( | N_gradient_2d * | source,
|  | N_gradient_2d * | target )

extern

copy a N_gradient_2d structure

Parameters

  source | - the source N_gradient_2d struct
  target | - the target N_gradient_2d struct

Returns
  int - 1 success, 0 failure while copying

Definition at line 83 of file n_gradient.c.

References N_gradient_2d::EC, G_debug(), N_gradient_2d::NC, N_gradient_2d::SC, and N_gradient_2d::WC.

## N_copy_gradient_3d()

int N_copy_gradient_3d | ( | N_gradient_3d * | source,
|  | N_gradient_3d * | target )

extern

copy a N_gradient_3d structure

Parameters

  source | - the source N_gradient_3d struct
  target | - the target N_gradient_3d struct

Returns
  int - 1 success, 0 failure while copying

Definition at line 211 of file n_gradient.c.

References N_gradient_3d::BC, N_gradient_3d::EC, G_debug(), N_gradient_3d::NC, N_gradient_3d::SC, N_gradient_3d::TC, and N_gradient_3d::WC.

## N_copy_gradient_field_2d()

int N_copy_gradient_field_2d | ( | N_gradient_field_2d * | source,
|  | N_gradient_field_2d * | target )

extern

Copy N_gradient_field_2d structure from source to target.

Parameters

  source | - the source N_gradient_field_2d struct
  target | - the target N_gradient_field_2d struct

Returns
  int - 1 success, 0 failure while copying

Definition at line 941 of file n_gradient.c.

References G_debug(), N_copy_array_2d(), N_gradient_field_2d::x_array, and N_gradient_field_2d::y_array.

## N_copy_gradient_field_3d()

int N_copy_gradient_field_3d | ( | N_gradient_field_3d * | source,
|  | N_gradient_field_3d * | target )

extern

Copy N_gradient_field_3d structure from source to target.

Parameters

  source | - the source N_gradient_field_3d struct
  target | - the target N_gradient_field_3d struct

Returns
  int - 1 success, 0 failure while copying

Definition at line 1041 of file n_gradient.c.

References G_debug(), N_copy_array_3d(), N_gradient_field_3d::x_array, N_gradient_field_3d::y_array, and N_gradient_field_3d::z_array.

## N_copy_gradient_neighbours_2d()

int N_copy_gradient_neighbours_2d | ( | N_gradient_neighbours_2d * | source,
|  | N_gradient_neighbours_2d * | target )

extern

copy a N_gradient_neighbours_2d structure

Parameters

  source | - the source N_gradient_neighbours_2d struct
  target | - the target N_gradient_neighbours_2d struct

Returns
  int - 1 success, 0 failure while copying

Definition at line 650 of file n_gradient.c.

References G_debug(), N_copy_gradient_neighbours_x(), N_copy_gradient_neighbours_y(), N_gradient_neighbours_2d::x, and N_gradient_neighbours_2d::y.

Referenced by N_get_gradient_neighbours_2d().

## N_copy_gradient_neighbours_3d()

int N_copy_gradient_neighbours_3d | ( | N_gradient_neighbours_3d * | source,
|  | N_gradient_neighbours_3d * | target )

extern

copy a N_gradient_neighbours_3d structure

Parameters

  source | - the source N_gradient_neighbours_3d struct
  target | - the target N_gradient_neighbours_3d struct

Returns
  int - 1 success, 0 failure while copying

Definition at line 852 of file n_gradient.c.

References G_debug(), N_copy_gradient_neighbours_x(), N_copy_gradient_neighbours_y(), N_copy_gradient_neighbours_z(), N_gradient_neighbours_3d::xb, N_gradient_neighbours_3d::xc, N_gradient_neighbours_3d::xt, N_gradient_neighbours_3d::yb, N_gradient_neighbours_3d::yc, N_gradient_neighbours_3d::yt, N_gradient_neighbours_3d::zb, and N_gradient_neighbours_3d::zt.

## N_copy_gradient_neighbours_x()

int N_copy_gradient_neighbours_x | ( | N_gradient_neighbours_x * | source,
|  | N_gradient_neighbours_x * | target )

extern

copy a N_gradient_neighbours_x structure

Parameters

  source | - the source N_gradient_neighbours_x struct
  target | - the target N_gradient_neighbours_x struct

Returns
  int - 1 success, 0 failure while copying

Definition at line 355 of file n_gradient.c.

References N_gradient_neighbours_x::EC, G_debug(), N_gradient_neighbours_x::NEN, N_gradient_neighbours_x::NWN, N_gradient_neighbours_x::SES, N_gradient_neighbours_x::SWS, and N_gradient_neighbours_x::WC.

Referenced by N_copy_gradient_neighbours_2d(), N_copy_gradient_neighbours_3d(), N_create_gradient_neighbours_2d(), and N_create_gradient_neighbours_3d().

## N_copy_gradient_neighbours_y()

int N_copy_gradient_neighbours_y | ( | N_gradient_neighbours_y * | source,
|  | N_gradient_neighbours_y * | target )

extern

copy a N_gradient_neighbours_y structure

Parameters

  source | - the source N_gradient_neighbours_y struct
  target | - the target N_gradient_neighbours_y struct

Returns
  int - 1 success, 0 failure while copying

Definition at line 447 of file n_gradient.c.

References G_debug(), N_gradient_neighbours_y::NC, N_gradient_neighbours_y::NEE, N_gradient_neighbours_y::NWW, N_gradient_neighbours_y::SC, N_gradient_neighbours_y::SEE, and N_gradient_neighbours_y::SWW.

Referenced by N_copy_gradient_neighbours_2d(), N_copy_gradient_neighbours_3d(), N_create_gradient_neighbours_2d(), and N_create_gradient_neighbours_3d().

## N_copy_gradient_neighbours_z()

int N_copy_gradient_neighbours_z | ( | N_gradient_neighbours_z * | source,
|  | N_gradient_neighbours_z * | target )

extern

copy a N_gradient_neighbours_z structure

Parameters

  source | - the source N_gradient_neighbours_z struct
  target | - the target N_gradient_neighbours_z struct

Returns
  int - 1 success, 0 failure while copying

Definition at line 547 of file n_gradient.c.

References N_gradient_neighbours_z::CZ, N_gradient_neighbours_z::EZ, G_debug(), N_gradient_neighbours_z::NEZ, N_gradient_neighbours_z::NWZ, N_gradient_neighbours_z::NZ, N_gradient_neighbours_z::SEZ, N_gradient_neighbours_z::SWZ, N_gradient_neighbours_z::SZ, and N_gradient_neighbours_z::WZ.

Referenced by N_copy_gradient_neighbours_3d(), and N_create_gradient_neighbours_3d().

## N_create_27star()

N_data_star * N_create_27star | ( | double | C,
|  | double | W,
|  | double | E,
|  | double | N,
|  | double | S,
|  | double | NW,
|  | double | SW,
|  | double | NE,
|  | double | SE,
|  | double | T,
|  | double | W_T,
|  | double | E_T,
|  | double | N_T,
|  | double | S_T,
|  | double | NW_T,
|  | double | SW_T,
|  | double | NE_T,
|  | double | SE_T,
|  | double | B,
|  | double | W_B,
|  | double | E_B,
|  | double | N_B,
|  | double | S_B,
|  | double | NW_B,
|  | double | SW_B,
|  | double | NE_B,
|  | double | SE_B,
|  | double | V )

extern

allocate and initialize a 27 point star data structure

Parameters

  C | double
  W | double
  E | double
  N | double
  S | double
  NW | double
  SW | double
  NE | double
  SE | double
  T | double
  W_T | double
  E_T | double
  N_T | double
  S_T | double
  NW_T | double
  SW_T | double
  NE_T | double
  SE_T | double
  B | double
  W_B | double
  E_B | double
  N_B | double
  S_B | double
  NW_B | double
  SW_B | double
  NE_B | double
  SE_B | double
  V | double

Returns
  N_data_star *

Definition at line 264 of file n_les_assemble.c.

References N_data_star::B, N_data_star::C, N_data_star::E, N_data_star::E_B, N_data_star::E_T, G_debug(), N_data_star::N, N_alloc_27star(), N_data_star::N_B, N_data_star::N_T, N_data_star::NE, NE, N_data_star::NE_B, N_data_star::NE_T, N_data_star::NW, NW, N_data_star::NW_B, N_data_star::NW_T, N_data_star::S, N_data_star::S_B, N_data_star::S_T, N_data_star::SE, SE, N_data_star::SE_B, N_data_star::SE_T, N_data_star::SW, SW, N_data_star::SW_B, N_data_star::SW_T, N_data_star::T, N_data_star::V, N_data_star::W, N_data_star::W_B, and N_data_star::W_T.

## N_create_5star()

N_data_star * N_create_5star | ( | double | C,
|  | double | W,
|  | double | E,
|  | double | N,
|  | double | S,
|  | double | V )

extern

allocate and initialize a 5 point star data structure

Parameters

  C | double
  W | double
  E | double
  N | double
  S | double
  V | double

Returns
  N_data_star *

Definition at line 124 of file n_les_assemble.c.

References N_data_star::C, N_data_star::E, G_debug(), N_data_star::N, N_alloc_5star(), N_data_star::S, N_data_star::V, and N_data_star::W.

Referenced by N_callback_gwflow_2d().

## N_create_7star()

N_data_star * N_create_7star | ( | double | C,
|  | double | W,
|  | double | E,
|  | double | N,
|  | double | S,
|  | double | T,
|  | double | B,
|  | double | V )

extern

allocate and initialize a 7 point star data structure

Parameters

  C | double
  W | double
  E | double
  N | double
  S | double
  T | double
  B | double
  V | double

Returns
  N_data_star *

Definition at line 159 of file n_les_assemble.c.

References N_data_star::B, N_data_star::C, N_data_star::E, G_debug(), N_data_star::N, N_alloc_7star(), N_data_star::S, N_data_star::T, N_data_star::V, and N_data_star::W.

Referenced by N_callback_gwflow_3d(), and N_callback_solute_transport_3d().

## N_create_9star()

N_data_star * N_create_9star | ( | double | C,
|  | double | W,
|  | double | E,
|  | double | N,
|  | double | S,
|  | double | NW,
|  | double | SW,
|  | double | NE,
|  | double | SE,
|  | double | V )

extern

allocate and initialize a 9 point star data structure

Parameters

  C | double
  W | double
  E | double
  N | double
  S | double
  NW | double
  SW | double
  NE | double
  SE | double
  V | double

Returns
  N_data_star *

Definition at line 200 of file n_les_assemble.c.

References N_data_star::C, N_data_star::E, G_debug(), N_data_star::N, N_alloc_9star(), N_data_star::NE, NE, N_data_star::NW, NW, N_data_star::S, N_data_star::SE, SE, N_data_star::SW, SW, N_data_star::V, and N_data_star::W.

Referenced by N_callback_solute_transport_2d().

## N_create_gradient_2d()

N_gradient_2d * N_create_gradient_2d | ( | double | NC,
|  | double | SC,
|  | double | WC,
|  | double | EC )

extern

allocate and initialize a N_gradient_2d structure

Parameters

  NC | double - the gradient between northern and center cell
  SC | double - the gradient between southern and center cell
  WC | double - the gradient between western and center cell
  EC | double - the gradient between eastern and center cell

Returns
  N_gradient_2d *

Definition at line 59 of file n_gradient.c.

References N_gradient_2d::EC, G_debug(), N_alloc_gradient_2d(), N_gradient_2d::NC, N_gradient_2d::SC, and N_gradient_2d::WC.

Referenced by N_get_gradient_2d().

## N_create_gradient_3d()

N_gradient_3d * N_create_gradient_3d | ( | double | NC,
|  | double | SC,
|  | double | WC,
|  | double | EC,
|  | double | TC,
|  | double | BC )

extern

allocate and initialize a N_gradient_3d structure

Parameters

  NC | double - the gradient between northern and center cell
  SC | double - the gradient between southern and center cell
  WC | double - the gradient between western and center cell
  EC | double - the gradient between eastern and center cell
  TC | double - the gradient between top and center cell
  BC | double - the gradient between bottom and center cell

Returns
  N_gradient_3d *

Definition at line 184 of file n_gradient.c.

References N_gradient_3d::BC, N_gradient_3d::EC, G_debug(), N_alloc_gradient_3d(), N_gradient_3d::NC, N_gradient_3d::SC, N_gradient_3d::TC, and N_gradient_3d::WC.

Referenced by N_get_gradient_3d().

## N_create_gradient_neighbours_2d()

N_gradient_neighbours_2d * N_create_gradient_neighbours_2d | ( | N_gradient_neighbours_x * | x,
|  | N_gradient_neighbours_y * | y )

extern

Allocate and initialize a N_gradient_neighbours_2d structure.

The parameter N_gradient_neighbours x and y are copied into the new allocated structure and can be deleted after the initializing

Returns
  N_gradient_neighbours_2d * – if failure NULL is returned

Definition at line 618 of file n_gradient.c.

References G_debug(), N_alloc_gradient_neighbours_2d(), N_copy_gradient_neighbours_x(), N_copy_gradient_neighbours_y(), N_free_gradient_neighbours_2d(), NULL, N_gradient_neighbours_2d::x, x, and N_gradient_neighbours_2d::y.

Referenced by N_get_gradient_neighbours_2d().

## N_create_gradient_neighbours_3d()

N_gradient_neighbours_3d * N_create_gradient_neighbours_3d | ( | N_gradient_neighbours_x * | xt,
|  | N_gradient_neighbours_x * | xc,
|  | N_gradient_neighbours_x * | xb,
|  | N_gradient_neighbours_y * | yt,
|  | N_gradient_neighbours_y * | yc,
|  | N_gradient_neighbours_y * | yb,
|  | N_gradient_neighbours_z * | zt,
|  | N_gradient_neighbours_z * | zb )

extern

Allocate and initialize a N_gradient_neighbours_3d structure.

The parameter N_gradient_neighbours x(tcb) and y(tcb) and z(tb) are copied into the new allocated structure and can be deleted after the initializing

Returns
  N_gradient_neighbours_3d * – if failure NULL is returned

Definition at line 806 of file n_gradient.c.

References G_debug(), N_alloc_gradient_neighbours_3d(), N_copy_gradient_neighbours_x(), N_copy_gradient_neighbours_y(), N_copy_gradient_neighbours_z(), NULL, N_gradient_neighbours_3d::xb, N_gradient_neighbours_3d::xc, N_gradient_neighbours_3d::xt, N_gradient_neighbours_3d::yb, N_gradient_neighbours_3d::yc, N_gradient_neighbours_3d::yt, N_gradient_neighbours_3d::zb, and N_gradient_neighbours_3d::zt.

## N_create_gradient_neighbours_x()

N_gradient_neighbours_x * N_create_gradient_neighbours_x | ( | double | NWN,
|  | double | NEN,
|  | double | WC,
|  | double | EC,
|  | double | SWS,
|  | double | SES )

extern

Allocate and initialize a N_gradient_neighbours_x structure.

Parameters

  NWN | double - the gradient between north-west and northern cell
  NEN | double - the gradient between north-east and northern cell
  WC | double - the gradient between western and center cell
  EC | double - the gradient between eastern and center cell
  SWS | double - the gradient between south-west and southern cell
  SES | double - the gradient between south-east and southern cell

Returns
  N_gradient_neighbours_x *

Definition at line 326 of file n_gradient.c.

References N_gradient_neighbours_x::EC, G_debug(), N_alloc_gradient_neighbours_x(), N_gradient_neighbours_x::NEN, N_gradient_neighbours_x::NWN, N_gradient_neighbours_x::SES, N_gradient_neighbours_x::SWS, and N_gradient_neighbours_x::WC.

Referenced by N_get_gradient_neighbours_2d().

## N_create_gradient_neighbours_y()

N_gradient_neighbours_y * N_create_gradient_neighbours_y | ( | double | NWW,
|  | double | NEE,
|  | double | NC,
|  | double | SC,
|  | double | SWW,
|  | double | SEE )

extern

Allocate and initialize a N_gradient_neighbours_y structure.

Parameters

  NWW | double - the gradient between north-west and western cell
  NEE | double - the gradient between north-east and eastern cell
  NC | double - the gradient between northern and center cell
  SC | double - the gradient between southern and center cell
  SWW | double - the gradient between south-west and western cell
  SEE | double - the gradient between south-east and eastern cell

Returns
  N_gradient_neighbours_y *

Definition at line 418 of file n_gradient.c.

References G_debug(), N_alloc_gradient_neighbours_y(), N_gradient_neighbours_y::NC, N_gradient_neighbours_y::NEE, N_gradient_neighbours_y::NWW, N_gradient_neighbours_y::SC, N_gradient_neighbours_y::SEE, and N_gradient_neighbours_y::SWW.

Referenced by N_get_gradient_neighbours_2d().

## N_create_gradient_neighbours_z()

N_gradient_neighbours_z * N_create_gradient_neighbours_z | ( | double | NWZ,
|  | double | NZ,
|  | double | NEZ,
|  | double | WZ,
|  | double | CZ,
|  | double | EZ,
|  | double | SWZ,
|  | double | SZ,
|  | double | SEZ )

extern

Allocate and initialize a N_gradient_neighbours_z structure.

Parameters

  NWZ | double - the gradient between upper and lower north-western cells
  NZ | double - the gradient between upper and lower northern cells
  NEZ | double - the gradient between upper and lower north-eastern cells
  WZ | double - the gradient between upper and lower western cells
  CZ | double - the gradient between upper and lower center cells
  EZ | double - the gradient between upper and lower eastern cells
  SWZ | double - the gradient between upper and lower south-western cells
  SZ | double - the gradient between upper and lower southern cells
  SEZ | double - the gradient between upper and lower south-eastern cells

Returns
  N_gradient_neighbours_z *

Definition at line 513 of file n_gradient.c.

References N_gradient_neighbours_z::CZ, N_gradient_neighbours_z::EZ, G_debug(), N_alloc_gradient_neighbours_z(), N_gradient_neighbours_z::NEZ, N_gradient_neighbours_z::NWZ, N_gradient_neighbours_z::NZ, N_gradient_neighbours_z::SEZ, N_gradient_neighbours_z::SWZ, N_gradient_neighbours_z::SZ, and N_gradient_neighbours_z::WZ.

## N_define_standard_option()

struct Option * N_define_standard_option | ( | int | opt | ) |

extern

Create standardised Option structure related to the gpde library.

This function will create a standardised Option structure defined by parameter opt. A list of valid parameters can be found in N_pde.h. It allocates memory for the Option structure and returns a pointer to this memory (of type struct Option *).

If an invalid parameter was specified an empty Option structure will be returned (not NULL).

This function is related to the gpde library, general standard options can be found in lib/gis/parser.c. These options are set with G_define_standard_option ();

Parameters

  [in] | opt | Type of Option struct to create

Returns
  Option * Pointer to an Option struct

Definition at line 42 of file n_parse_options.c.

References G_define_option(), N_OPT_CALC_TIME, N_OPT_ITERATION_ERROR, N_OPT_MAX_ITERATIONS, N_OPT_SOLVER_SYMM, N_OPT_SOLVER_UNSYMM, and N_OPT_SOR_VALUE.

## N_exp_upwinding()

double N_exp_upwinding | ( | double | sprod,
|  | double | distance,
|  | double | D )

extern

exponential upwinding stabilization algorithm

The arguments are values to compute the local peclet number

Parameters

  sprod | double – the scalar product between the velocity vector and the normal vector between two points
  distance | double – distance between two points
  D | double – diffusion/dispersion tensor part between two points

Returns
  the weighting factor

Definition at line 63 of file n_upwind.c.

References D.

Referenced by N_callback_solute_transport_2d(), and N_callback_solute_transport_3d().

## N_free_array_2d()

void N_free_array_2d | ( | N_array_2d * | data | ) |

extern

Release the memory of a N_array_2d structure.

Parameters

  data | N_array_2d *

Returns
  void

Definition at line 132 of file n_arrays.c.

References G_debug(), G_free(), and NULL.

Referenced by N_assemble_les_2d_param(), N_free_gradient_field_2d(), N_free_gwflow_data2d(), N_free_gwflow_data3d(), and N_free_solute_transport_data2d().

## N_free_array_3d()

void N_free_array_3d | ( | N_array_3d * | data | ) |

extern

Release the memory of a N_array_3d.

Parameters

  data | N_array_3d *

Returns
  void

Definition at line 774 of file n_arrays.c.

References G_debug(), G_free(), and NULL.

Referenced by N_assemble_les_3d_param(), N_free_gradient_field_3d(), N_free_gwflow_data3d(), and N_free_solute_transport_data3d().

## N_free_geom_data()

void N_free_geom_data | ( | N_geom_data * | geom | ) |

extern

Release memory of a pde geometry data structure.

Parameters

  geom | N_geom_data *

Returns
  void

Definition at line 49 of file n_geom.c.

References N_geom_data::area, G_free(), and NULL.

## N_free_gradient_2d()

void N_free_gradient_2d | ( | N_gradient_2d * | grad | ) |

extern

Free's a N_gradient_2d structure.

Returns
  void

Definition at line 41 of file n_gradient.c.

References G_free(), and NULL.

## N_free_gradient_3d()

void N_free_gradient_3d | ( | N_gradient_3d * | grad | ) |

extern

Free's a N_gradient_3d structure.

Returns
  void

Definition at line 164 of file n_gradient.c.

References G_free(), and NULL.

## N_free_gradient_field_2d()

void N_free_gradient_field_2d | ( | N_gradient_field_2d * | field | ) |

extern

Free's a N_gradient_neighbours_2d structure.

Returns
  void

Definition at line 920 of file n_gradient.c.

References G_free(), N_free_array_2d(), NULL, N_gradient_field_2d::x_array, and N_gradient_field_2d::y_array.

## N_free_gradient_field_3d()

void N_free_gradient_field_3d | ( | N_gradient_field_3d * | field | ) |

extern

Free's a N_gradient_neighbours_3d structure.

Returns
  void

Definition at line 1019 of file n_gradient.c.

References G_free(), N_free_array_3d(), NULL, N_gradient_field_3d::x_array, N_gradient_field_3d::y_array, and N_gradient_field_3d::z_array.

## N_free_gradient_neighbours_2d()

void N_free_gradient_neighbours_2d | ( | N_gradient_neighbours_2d * | grad | ) |

extern

Free's a N_gradient_neighbours_2d structure.

Returns
  void

Definition at line 596 of file n_gradient.c.

References G_free(), N_free_gradient_neighbours_x(), N_free_gradient_neighbours_y(), NULL, N_gradient_neighbours_2d::x, and N_gradient_neighbours_2d::y.

Referenced by N_create_gradient_neighbours_2d(), and N_get_gradient_neighbours_2d().

## N_free_gradient_neighbours_3d()

void N_free_gradient_neighbours_3d | ( | N_gradient_neighbours_3d * | grad | ) |

extern

Free's a N_gradient_neighbours_3d structure.

Returns
  void

Definition at line 777 of file n_gradient.c.

References G_free(), N_free_gradient_neighbours_x(), N_free_gradient_neighbours_y(), N_free_gradient_neighbours_z(), NULL, N_gradient_neighbours_3d::xb, N_gradient_neighbours_3d::xc, N_gradient_neighbours_3d::xt, N_gradient_neighbours_3d::yb, N_gradient_neighbours_3d::yc, N_gradient_neighbours_3d::yt, N_gradient_neighbours_3d::zb, and N_gradient_neighbours_3d::zt.

## N_free_gradient_neighbours_x()

void N_free_gradient_neighbours_x | ( | N_gradient_neighbours_x * | grad | ) |

extern

Free's a N_gradient_neighbours_x structure.

Returns
  void

Definition at line 305 of file n_gradient.c.

References G_free(), and NULL.

Referenced by N_free_gradient_neighbours_2d(), N_free_gradient_neighbours_3d(), and N_get_gradient_neighbours_2d().

## N_free_gradient_neighbours_y()

void N_free_gradient_neighbours_y | ( | N_gradient_neighbours_y * | grad | ) |

extern

Free's a N_gradient_neighbours_y structure.

Returns
  void

Definition at line 397 of file n_gradient.c.

References G_free(), and NULL.

Referenced by N_free_gradient_neighbours_2d(), N_free_gradient_neighbours_3d(), and N_get_gradient_neighbours_2d().

## N_free_gradient_neighbours_z()

void N_free_gradient_neighbours_z | ( | N_gradient_neighbours_z * | grad | ) |

extern

Free's a N_gradient_neighbours_z structure.

Returns
  void

Definition at line 489 of file n_gradient.c.

References G_free(), and NULL.

Referenced by N_free_gradient_neighbours_3d().

## N_free_les()

void N_free_les | ( | N_les * | les | ) |

extern

Release the memory of the linear equation system.

Parameters

  les | N_les *

Returns
  void

Definition at line 307 of file n_les.c.

References N_les::A, N_les::Asp, N_les::b, G_debug(), G_free(), G_free_matrix(), G_math_free_spmatrix(), N_SPARSE_LES, N_les::rows, N_les::type, and N_les::x.

## N_full_upwinding()

double N_full_upwinding | ( | double | sprod,
|  | double | distance,
|  | double | D )

extern

full upwinding stabilization algorithm

The arguments are values to compute the local peclet number

Parameters

  sprod | double – the scalar product between the velocity vector and the normal vector between two points
  distance | double – distance between two points
  D | double – diffusion/dispersion tensor part between two points

Returns
  the weighting factor

Definition at line 32 of file n_upwind.c.

References D.

Referenced by N_callback_solute_transport_2d().

## N_get_array_2d_c_value()

CELL N_get_array_2d_c_value | ( | N_array_2d * | data,
|  | int | col,
|  | int | row )

extern

Returns the value of type CELL at position col, row.

The data array can be of type CELL, FCELL or DCELL, the value will be casted to the CELL type.

Parameters

  data | N_array_2d *
  col | int
  row | int

Returns
  CELL

Definition at line 314 of file n_arrays.c.

References N_get_array_2d_value().

Referenced by N_assemble_les_2d_param(), N_gwflow_2d_calc_water_budget(), N_les_integrate_dirichlet_2d(), N_print_array_2d(), and N_write_array_2d_to_rast().

## N_get_array_2d_d_value()

DCELL N_get_array_2d_d_value | ( | N_array_2d * | data,
|  | int | col,
|  | int | row )

extern

Returns the value of type DCELL at position col, row.

The data array can be of type CELL, FCELL or DCELL, the value will be casted to the DCELL type.

Parameters

  data | N_array_2d *
  col | int
  row | int

Returns
  DCELL

Definition at line 380 of file n_arrays.c.

References N_get_array_2d_value().

Referenced by N_assemble_les_2d_param(), N_calc_array_2d_stats(), N_calc_solute_transport_transmission_2d(), N_callback_gwflow_2d(), N_callback_gwflow_3d(), N_callback_solute_transport_2d(), N_compute_gradient_field_2d(), N_get_gradient_2d(), N_get_gradient_neighbours_2d(), N_gwflow_2d_calc_water_budget(), N_les_integrate_dirichlet_2d(), N_math_array_2d(), N_print_array_2d(), and N_write_array_2d_to_rast().

## N_get_array_2d_f_value()

FCELL N_get_array_2d_f_value | ( | N_array_2d * | data,
|  | int | col,
|  | int | row )

extern

Returns the value of type FCELL at position col, row.

The data array can be of type CELL, FCELL or DCELL, the value will be casted to the FCELL type.

Parameters

  data | N_array_2d *
  col | int
  row | int

Returns
  FCELL

Definition at line 347 of file n_arrays.c.

References N_get_array_2d_value().

Referenced by N_print_array_2d(), and N_write_array_2d_to_rast().

## N_get_array_2d_type()

int N_get_array_2d_type | ( | N_array_2d * | array | ) |

extern

Return the data type of the N_array_2d struct.

The data type can be CELL_TYPE, FCELL_TYPE or DCELL_TYPE accordingly to the raster map data types.

Parameters

  array | N_array_2d *

Returns
  type int

Definition at line 164 of file n_arrays.c.

References N_array_2d::type.

## N_get_array_2d_value()

void N_get_array_2d_value | ( | N_array_2d * | data,
|  | int | col,
|  | int | row,
|  | void * | value )

extern

Write the value of the N_array_2d struct at position col, row to value.

The value must be of the same type as the array. Otherwise you will risk data losses.

Parameters

  data | N_array_2d *
  col | int
  row | int
  value | void * - this variable contains the array value at col, row position

Returns
  void

Definition at line 182 of file n_arrays.c.

References NULL.

Referenced by N_get_array_2d_c_value(), N_get_array_2d_d_value(), and N_get_array_2d_f_value().

## N_get_array_3d_d_value()

double N_get_array_3d_d_value | ( | N_array_3d * | data,
|  | int | col,
|  | int | row,
|  | int | depth )

extern

This function returns the value of type float at position col, row, depth.

The data type can be FCELL_TYPE or DCELL_TYPE accordingly to the raster map data types.

Parameters

  data | N_array_3d *
  col | int
  row | int
  depth | int

Returns
  double

Definition at line 979 of file n_arrays.c.

References N_get_array_3d_value().

Referenced by N_assemble_les_3d_param(), N_calc_array_3d_stats(), N_callback_gwflow_3d(), N_callback_solute_transport_3d(), N_compute_gradient_field_3d(), N_get_gradient_3d(), N_gwflow_3d_calc_water_budget(), N_les_integrate_dirichlet_3d(), N_math_array_3d(), N_print_array_3d(), and N_write_array_3d_to_rast3d().

## N_get_array_3d_f_value()

float N_get_array_3d_f_value | ( | N_array_3d * | data,
|  | int | col,
|  | int | row,
|  | int | depth )

extern

This function returns the value of type float at position col, row, depth.

The data type can be FCELL_TYPE or DCELL_TYPE accordingly to the raster map data types.

Parameters

  data | N_array_3d *
  col | int
  row | int
  depth | int

Returns
  float

Definition at line 948 of file n_arrays.c.

References N_get_array_3d_value().

Referenced by N_print_array_3d(), and N_write_array_3d_to_rast3d().

## N_get_array_3d_type()

int N_get_array_3d_type | ( | N_array_3d * | array | ) |

extern

Return the data type of the N_array_3d.

The data type can be FCELL_TYPE and DCELL_TYPE accordingly to the raster map data types.

Parameters

  array | N_array_3d *

Returns
  type int – FCELL_TYPE or DCELL_TYPE

Definition at line 803 of file n_arrays.c.

References N_array_3d::type.

## N_get_array_3d_value()

void N_get_array_3d_value | ( | N_array_3d * | data,
|  | int | col,
|  | int | row,
|  | int | depth,
|  | void * | value )

extern

This function writes the value of N_array_3d data at position col, row, depth to the variable value.

The value must be from the same type as the array. Otherwise you will risk data losses.

Parameters

  data | N_array_3d *
  col | int
  row | int
  depth | int
  value | void *

Returns
  void

Definition at line 822 of file n_arrays.c.

References NULL.

Referenced by N_get_array_3d_d_value(), and N_get_array_3d_f_value().

## N_get_geom_data_area_of_cell()

double N_get_geom_data_area_of_cell | ( | N_geom_data * | geom,
|  | int | row )

extern

Get the areay size in square meter of one cell (x*y) at row.

This function works for two and three dimensions

Parameters

  geom | N_geom_data *
  row | int

Returns
  area double

Definition at line 196 of file n_geom.c.

References N_geom_data::area, N_geom_data::Az, G_debug(), and N_geom_data::planimetric.

Referenced by N_callback_gwflow_2d(), N_callback_gwflow_3d(), N_callback_solute_transport_2d(), and N_callback_solute_transport_3d().

## N_get_gradient_2d()

N_gradient_2d * N_get_gradient_2d | ( | N_gradient_field_2d * | field,
|  | N_gradient_2d * | gradient,
|  | int | col,
|  | int | row )

extern

Return a N_gradient_2d structure calculated from the input gradient field at position [row][col].

This function returns the gradient of a cell at position [row][col] from the input gradient field. Returned is a new structure of type N_gradient_2d.

Parameters

  field | N_gradient_field_2d * - A two dimensional gradient field
  gradient | N_gradient_2d * - the gradient structure which should be filled with data, if a NULL pointer is given, a new structure will be created
  col | int
  row | int

Returns
  N_gradient_2d * - the new or filled gradient structure

Definition at line 114 of file n_gradient.c.

References N_gradient_2d::EC, G_debug(), N_create_gradient_2d(), N_get_array_2d_d_value(), N_gradient_2d::NC, N_gradient_2d::SC, N_gradient_2d::WC, N_gradient_field_2d::x_array, and N_gradient_field_2d::y_array.

Referenced by N_calc_solute_transport_disptensor_2d(), N_calc_solute_transport_transmission_2d(), N_callback_solute_transport_2d(), and N_compute_gradient_field_components_2d().

## N_get_gradient_3d()

N_gradient_3d * N_get_gradient_3d | ( | N_gradient_field_3d * | field,
|  | N_gradient_3d * | gradient,
|  | int | col,
|  | int | row,
|  | int | depth )

extern

Return a N_gradient_3d structure calculated from the input gradient field at position [depth][row][col].

This function returns the gradient of a 3d cell at position [depth][row][col] from the input gradient field. Returned is a new structure of type N_gradient_3d.

Parameters

  field | N_gradient_field_3d * - A three dimensional gradient field
  gradient | N_gradient_3d * - an existing gradient structure or a NULL pointer, if a NULL pointer is providet a new structure will be returned
  col | int
  row | int
  depth | int

Returns
  N_gradient_3d *

Definition at line 246 of file n_gradient.c.

References N_gradient_3d::BC, N_gradient_3d::EC, G_debug(), N_create_gradient_3d(), N_get_array_3d_d_value(), N_gradient_3d::NC, N_gradient_3d::SC, N_gradient_3d::TC, N_gradient_3d::WC, N_gradient_field_3d::x_array, N_gradient_field_3d::y_array, and N_gradient_field_3d::z_array.

Referenced by N_calc_solute_transport_disptensor_3d(), N_callback_solute_transport_3d(), and N_compute_gradient_field_components_3d().

## N_get_gradient_neighbours_2d()

N_gradient_neighbours_2d * N_get_gradient_neighbours_2d | ( | N_gradient_field_2d * | field,
|  | N_gradient_neighbours_2d * | gradient,
|  | int | col,
|  | int | row )

extern

Return a N_gradient_neighbours_2d structure calculated from the input gradient field at position [row][col].

This function returns the gradient neighbours in x and y dierection of a cell at position [row][col] from the input gradient field. Returned is a pointer to a structure of type N_gradient_neighbours_2d.

Parameters

  field | N_gradient_field_2d * - A two dimensional gradient field
  gradient | N_gradient_neighbours_2d * - the gradient structure which should be filled with data, if a NULL pointer is given, a new structure will be created
  col | int
  row | int

Returns
  N_gradient_neighbours_2d * - the new or filled gradient structure

Definition at line 689 of file n_gradient.c.

References G_debug(), N_copy_gradient_neighbours_2d(), N_create_gradient_neighbours_2d(), N_create_gradient_neighbours_x(), N_create_gradient_neighbours_y(), N_free_gradient_neighbours_2d(), N_free_gradient_neighbours_x(), N_free_gradient_neighbours_y(), N_get_array_2d_d_value(), NULL, N_gradient_field_2d::x_array, and N_gradient_field_2d::y_array.

## N_init_geom_data_2d()

N_geom_data * N_init_geom_data_2d | ( | struct Cell_head * | region,
|  | N_geom_data * | geodata )

extern

Initiate a pde geometry data structure with a 2d region.

If the projection is not planimetric, a double array will be created based on the number of rows of the provided region storing all computed areas for each row

Parameters

  region | struct Cell_head *
  geodata | N_geom_data * - if a NULL pointer is given, a new structure will be allocatet and returned

Returns
  N_geom_data *

Definition at line 117 of file n_geom.c.

References N_geom_data::area, N_geom_data::Az, N_geom_data::cols, N_geom_data::dim, N_geom_data::dx, N_geom_data::dy, G_area_of_cell_at_row(), G_begin_cell_area_calculations(), G_database_units_to_meters_factor(), G_debug(), G_free(), G_get_set_window(), N_alloc_geom_data(), NULL, N_geom_data::planimetric, and N_geom_data::rows.

Referenced by N_init_geom_data_3d().

## N_init_geom_data_3d()

N_geom_data * N_init_geom_data_3d | ( | RASTER3D_Region * | region3d,
|  | N_geom_data * | geodata )

extern

Initiate a pde geometry data structure with a 3d region.

If the projection is not planimetric, a double array will be created based on the number of rows of the provided region

Parameters

  region3d | RASTER3D_Region *
  geodata | N_geom_data * - if a NULL pointer is given, a new structure will be allocatet and returned

Returns
  N_geom_data *

Definition at line 73 of file n_geom.c.

References N_geom_data::depths, N_geom_data::dim, N_geom_data::dz, G_database_units_to_meters_factor(), G_debug(), G_get_set_window(), N_alloc_geom_data(), N_init_geom_data_2d(), and NULL.

## N_is_array_2d_value_null()

int N_is_array_2d_value_null | ( | N_array_2d * | data,
|  | int | col,
|  | int | row )

extern

Returns 1 if the value of N_array_2d struct at position col, row is of type null, otherwise 0.

This function checks automatically the type of the array and checks for the data type null value.

Parameters

  data | N_array_2d *
  col | int
  row | int

Returns
  int - 1 = is null, 0 otherwise

Definition at line 231 of file n_arrays.c.

References G_debug(), and NULL.

Referenced by N_calc_array_2d_stats(), N_calc_solute_transport_transmission_2d(), N_compute_gradient_field_2d(), and N_math_array_2d().

## N_is_array_3d_value_null()

int N_is_array_3d_value_null | ( | N_array_3d * | data,
|  | int | col,
|  | int | row,
|  | int | depth )

extern

This function returns 1 if value of N_array_3d data at position col, row, depth is of type null, otherwise 0.

This function checks automatically the type of the array and checks for the data type null value.

Parameters

  data | N_array_3d *
  col | int
  row | int
  depth | int

Returns
  void

Definition at line 873 of file n_arrays.c.

References G_debug(), and NULL.

Referenced by N_calc_array_3d_stats(), N_compute_gradient_field_3d(), and N_math_array_3d().

## N_les_integrate_dirichlet_2d()

int N_les_integrate_dirichlet_2d | ( | N_les * | les,
|  | N_geom_data * | geom,
|  | N_array_2d * | status,
|  | N_array_2d * | start_val )

Integrate Dirichlet or Transmission boundary conditions into the les (2s).

Dirichlet and Transmission boundary conditions will be integrated into the provided linear equation system. This is meaningful if the les was created with N_assemble_les_2d_dirichlet, because in this case Dirichlet boundary conditions are not automatically included.

The provided les will be modified:

Ax = b will be split into Ax_u + Ax_d = b

x_u - the unknowns x_d - the Dirichlet cells

Ax_u = b -Ax_d will be computed. Then the matrix A will be modified to

| A_u 0 | x_u | 0 I | x_d

Parameters

  les | N_les* – the linear equation system
  geom | N_geom_data* – geometrical data information
  status | N_array_2d* – the status array containing the cell types
  start_val | N_array_2d* – an array with start values

Returns
  int – 1 = success, 0 = failure

Definition at line 793 of file n_les_assemble.c.

References N_les::A, N_les::Asp, N_les::b, N_geom_data::cols, N_les::cols, count, G_debug(), G_free(), G_math_Ax_sparse(), G_math_d_Ax(), N_CELL_ACTIVE, N_get_array_2d_c_value(), N_get_array_2d_d_value(), N_MAX_CELL_STATE, N_SPARSE_LES, N_geom_data::rows, N_les::rows, N_les::type, and x.

## N_les_integrate_dirichlet_3d()

int N_les_integrate_dirichlet_3d | ( | N_les * | les,
|  | N_geom_data * | geom,
|  | N_array_3d * | status,
|  | N_array_3d * | start_val )

Integrate Dirichlet or Transmission boundary conditions into the les (3d).

Dirichlet and Transmission boundary conditions will be integrated into the provided linear equation system. This is meaningful if the les was created with N_assemble_les_2d_dirichlet, because in this case Dirichlet boundary conditions are not automatically included.

The provided les will be modified:

Ax = b will be split into Ax_u + Ax_d = b

x_u - the unknowns x_d - the Dirichlet cells

Ax_u = b -Ax_d will be computed. Then the matrix A will be modified to

| A_u 0 | x_u | 0 I | x_d

Parameters

  les | N_les* – the linear equation system
  geom | N_geom_data* – geometrical data information
  status | N_array_2d* – the status array containing the cell types
  start_val | N_array_2d* – an array with start values

Returns
  int – 1 = success, 0 = failure

Definition at line 1252 of file n_les_assemble.c.

References N_les::A, N_les::Asp, N_les::b, N_geom_data::cols, N_les::cols, count, N_geom_data::depths, G_debug(), G_free(), G_math_Ax_sparse(), G_math_d_Ax(), N_CELL_ACTIVE, N_get_array_3d_d_value(), N_MAX_CELL_STATE, N_SPARSE_LES, N_geom_data::rows, N_les::rows, N_les::type, and x.

## N_les_pivot_create()

int N_les_pivot_create | ( | N_les * | les | ) |

extern

## N_math_array_2d()

N_array_2d * N_math_array_2d | ( | N_array_2d * | a,
|  | N_array_2d * | b,
|  | N_array_2d * | result,
|  | int | type )

extern

Perform calculations with two input arrays, the result is written to a third array.

All arrays must have equal sizes and offsets. The complete data array inclusively offsets is used for calculations. Only non-null values are computed. If one array value is null, the result array value will be null too.
If a division with zero is detected, the resulting arrays value will set to null and not to NaN.
The result array is optional, if the result arrays points to NULL, a new array will be allocated with the largest arrays data type (CELL, FCELL or DCELL) used by the input arrays.
the array computations can be of the following forms:

- result = a + b -> N_ARRAY_SUM
- result = a - b -> N_ARRAY_DIF
- result = a * b -> N_ARRAY_MUL
- result = a / b -> N_ARRAY_DIV

Parameters

  a | N_array_2d * - first input array
  b | N_array_2d * - second input array
  result | N_array_2d * - the optional result array
  type | - the type of calculation

Returns
  N_array_2d * - the pointer to the result array

Definition at line 299 of file n_arrays_calc.c.

References b, G_debug(), G_fatal_error(), N_alloc_array_2d(), N_ARRAY_DIF, N_ARRAY_DIV, N_ARRAY_MUL, N_ARRAY_SUM, N_get_array_2d_d_value(), N_is_array_2d_value_null(), N_put_array_2d_c_value(), N_put_array_2d_d_value(), N_put_array_2d_f_value(), N_put_array_2d_value_null(), and NULL.

## N_math_array_3d()

N_array_3d * N_math_array_3d | ( | N_array_3d * | a,
|  | N_array_3d * | b,
|  | N_array_3d * | result,
|  | int | type )

extern

Perform calculations with two input arrays, the result is written to a third array.

All arrays must have equal sizes and offsets. The complete data array inclusively offsets is used for calculations. Only non-null values are used. If one array value is null, the result array value will be null too.

If a division with zero is detected, the resulting arrays value will set to null and not to NaN.

The result array is optional, if the result arrays points to NULL, a new array will be allocated with the largest arrays data type (FCELL_TYPE or DCELL_TYPE) used by the input arrays.

the calculations are of the following form:

- result = a + b -> N_ARRAY_SUM
- result = a - b -> N_ARRAY_DIF
- result = a * b -> N_ARRAY_MUL
- result = a / b -> N_ARRAY_DIV

Parameters

  a | N_array_3d * - first input array
  b | N_array_3d * - second input array
  result | N_array_3d * - the optional result array
  type | - the type of calculation

Returns
  N_array_3d * - the pointer to the result array

Definition at line 723 of file n_arrays_calc.c.

References b, G_debug(), G_fatal_error(), N_alloc_array_3d(), N_ARRAY_DIF, N_ARRAY_DIV, N_ARRAY_MUL, N_ARRAY_SUM, N_get_array_3d_d_value(), N_is_array_3d_value_null(), N_put_array_3d_d_value(), N_put_array_3d_f_value(), N_put_array_3d_value_null(), and NULL.

## N_norm_array_2d()

double N_norm_array_2d | ( | N_array_2d * | a,
|  | N_array_2d * | b,
|  | int | type )

extern

Calculate the norm of the two input arrays.

The norm can be of type N_MAXIMUM_NORM or N_EUKLID_NORM. All arrays must have equal sizes and offsets. The complete data array inclusively offsets is used for norm calculation. Only non-null values are used to calculate the norm.

Parameters

  a | N_array_2d *
  b | N_array_2d *
  type | the type of the norm -> N_MAXIMUM_NORM, N_EUKLID_NORM

Returns
  double the calculated norm

Definition at line 142 of file n_arrays_calc.c.

References b, G_debug(), G_fatal_error(), N_EUKLID_NORM, and N_MAXIMUM_NORM.

## N_norm_array_3d()

double N_norm_array_3d | ( | N_array_3d * | a,
|  | N_array_3d * | b,
|  | int | type )

extern

Calculate the norm of the two input arrays.

The norm can be of type N_MAXIMUM_NORM or N_EUKLID_NORM. All arrays must have equal sizes and offsets. The complete data array inclusively offsets is used for norm calculation. Only non-null values are used to calculate the norm.

Parameters

  a | N_array_3d *
  b | N_array_3d *
  type | the type of the norm -> N_MAXIMUM_NORM, N_EUKLID_NORM

Returns
  double the calculated norm

Definition at line 556 of file n_arrays_calc.c.

References b, G_debug(), G_fatal_error(), N_EUKLID_NORM, and N_MAXIMUM_NORM.

## N_print_array_2d()

void N_print_array_2d | ( | N_array_2d * | data | ) |

extern

Write info and content of the N_array_2d struct to stdout.

Offsets are ignored

Parameters

  data | N_array_2d *

Returns
  void

Definition at line 628 of file n_arrays.c.

References N_get_array_2d_c_value(), N_get_array_2d_d_value(), N_get_array_2d_f_value(), and N_print_array_2d_info().

## N_print_array_2d_info()

void N_print_array_2d_info | ( | N_array_2d * | data | ) |

extern

This function writes the data info of the array data to stdout.

Parameters

  data | N_array_2d *

Returns
  void

Definition at line 603 of file n_arrays.c.

Referenced by N_print_array_2d(), and N_print_gradient_field_2d_info().

## N_print_array_3d()

void N_print_array_3d | ( | N_array_3d * | data | ) |

extern

Write info and content of the array data to stdout.

Offsets are ignored

Parameters

  data | N_array_2d *

Returns
  void

Definition at line 1196 of file n_arrays.c.

References N_get_array_3d_d_value(), N_get_array_3d_f_value(), and N_print_array_3d_info().

## N_print_array_3d_info()

void N_print_array_3d_info | ( | N_array_3d * | data | ) |

extern

Write the info of the array to stdout.

Parameters

  data | N_array_3d *

Returns
  void

Definition at line 1170 of file n_arrays.c.

Referenced by N_print_array_3d(), and N_print_gradient_field_3d_info().

## N_print_gradient_field_2d_info()

void N_print_gradient_field_2d_info | ( | N_gradient_field_2d * | field | ) |

extern

Print gradient field information to stdout.

Parameters

  field | N_gradient_2d_field *

Returns
  void

Definition at line 961 of file n_gradient.c.

References N_gradient_field_2d::cols, N_gradient_field_2d::max, N_gradient_field_2d::mean, N_gradient_field_2d::min, N_print_array_2d_info(), N_gradient_field_2d::nonull, N_gradient_field_2d::rows, N_gradient_field_2d::sum, N_gradient_field_2d::x_array, and N_gradient_field_2d::y_array.

## N_print_gradient_field_3d_info()

void N_print_gradient_field_3d_info | ( | N_gradient_field_3d * | field | ) |

extern

Print gradient field information to stdout.

Parameters

  field | N_gradient_3d_field *

Returns
  void

Definition at line 1062 of file n_gradient.c.

References N_gradient_field_3d::cols, N_gradient_field_3d::depths, N_gradient_field_3d::max, N_gradient_field_3d::mean, N_gradient_field_3d::min, N_print_array_3d_info(), N_gradient_field_3d::nonull, N_gradient_field_3d::rows, N_gradient_field_3d::sum, N_gradient_field_3d::x_array, N_gradient_field_3d::y_array, and N_gradient_field_3d::z_array.

## N_print_les()

void N_print_les | ( | N_les * | les | ) |

extern

prints the linear equation system to stdout

Format: A*x = b

Example

    2 1 1 1 * 2 = 0.1
    1 2 0 0 * 3 = 0.2
    1 0 2 0 * 3 = 0.2
    1 0 0 2 * 2 = 0.1

Parameters

  les | N_les *

Returns
  void

Definition at line 257 of file n_les.c.

References N_les::A, N_les::Asp, N_les::b, N_les::cols, N_SPARSE_LES, N_les::rows, N_les::type, and N_les::x.

## N_put_array_2d_c_value()

void N_put_array_2d_c_value | ( | N_array_2d * | data,
|  | int | col,
|  | int | row,
|  | CELL | value )

extern

Writes a CELL value to the N_array_2d struct at position col, row.

Parameters

  data | N_array_2d *
  col | int
  row | int
  value | CELL

Returns
  void

Definition at line 516 of file n_arrays.c.

References N_put_array_2d_value().

Referenced by N_assemble_les_2d_param(), N_math_array_2d(), and N_read_rast_to_array_2d().

## N_put_array_2d_d_value()

void N_put_array_2d_d_value | ( | N_array_2d * | data,
|  | int | col,
|  | int | row,
|  | DCELL | value )

extern

Writes a DCELL value to the N_array_2d struct at position col, row.

Parameters

  data | N_array_2d *
  col | int
  row | int
  value | DCELL

Returns
  void

Definition at line 576 of file n_arrays.c.

References N_put_array_2d_value().

Referenced by N_calc_solute_transport_disptensor_2d(), N_calc_solute_transport_transmission_2d(), N_compute_gradient_field_2d(), N_compute_gradient_field_components_2d(), N_gwflow_2d_calc_water_budget(), N_math_array_2d(), and N_read_rast_to_array_2d().

## N_put_array_2d_f_value()

void N_put_array_2d_f_value | ( | N_array_2d * | data,
|  | int | col,
|  | int | row,
|  | FCELL | value )

extern

Writes a FCELL value to the N_array_2d struct at position col, row.

Parameters

  data | N_array_2d *
  col | int
  row | int
  value | FCELL

Returns
  void

Definition at line 546 of file n_arrays.c.

References N_put_array_2d_value().

Referenced by N_math_array_2d(), and N_read_rast_to_array_2d().

## N_put_array_2d_value()

void N_put_array_2d_value | ( | N_array_2d * | data,
|  | int | col,
|  | int | row,
|  | char * | value )

extern

Writes a value to the N_array_2d struct at position col, row.

The value will be automatically cast to the array type.

Parameters

  data | N_array_2d *
  col | int
  row | int
  value | char *

Returns
  void

Definition at line 412 of file n_arrays.c.

References G_debug(), and NULL.

Referenced by N_put_array_2d_c_value(), N_put_array_2d_d_value(), and N_put_array_2d_f_value().

## N_put_array_2d_value_null()

void N_put_array_2d_value_null | ( | N_array_2d * | data,
|  | int | col,
|  | int | row )

extern

Writes the null value to the N_array_2d struct at position col, row.

The null value will be automatically set to the array data type (CELL, FCELL or DCELL).

Parameters

  data | N_array_2d *
  col | int
  row | int

Returns
  void

Definition at line 459 of file n_arrays.c.

References G_debug(), and NULL.

Referenced by N_math_array_2d(), and N_read_rast_to_array_2d().

## N_put_array_3d_d_value()

void N_put_array_3d_d_value | ( | N_array_3d * | data,
|  | int | col,
|  | int | row,
|  | int | depth,
|  | double | value )

extern

Writes a double value to the N_array_3d struct at position col, row, depth.

Parameters

  data | N_array_3d *
  col | int
  row | int
  depth | int
  value | double

Returns
  void

Definition at line 1148 of file n_arrays.c.

References N_put_array_3d_value().

Referenced by N_assemble_les_3d_param(), N_calc_solute_transport_disptensor_3d(), N_compute_gradient_field_3d(), N_compute_gradient_field_components_3d(), N_gwflow_3d_calc_water_budget(), N_math_array_3d(), and N_read_rast3d_to_array_3d().

## N_put_array_3d_f_value()

void N_put_array_3d_f_value | ( | N_array_3d * | data,
|  | int | col,
|  | int | row,
|  | int | depth,
|  | float | value )

extern

This function writes a float value to the N_array_3d data at position col, row, depth.

Parameters

  data | N_array_3d *
  col | int
  row | int
  depth | int
  value | float

Returns
  void

Definition at line 1121 of file n_arrays.c.

References N_put_array_3d_value().

Referenced by N_math_array_3d(), and N_read_rast3d_to_array_3d().

## N_put_array_3d_value()

void N_put_array_3d_value | ( | N_array_3d * | data,
|  | int | col,
|  | int | row,
|  | int | depth,
|  | char * | value )

extern

This function writes a value to the N_array_3d data at position col, row, depth.

The value will be automatically cast to the array type.

Parameters

  data | N_array_3d *
  col | int
  row | int
  depth | int
  value | char *

Returns
  void

Definition at line 1010 of file n_arrays.c.

References G_debug(), and NULL.

Referenced by N_put_array_3d_d_value(), and N_put_array_3d_f_value().

## N_put_array_3d_value_null()

void N_put_array_3d_value_null | ( | N_array_3d * | data,
|  | int | col,
|  | int | row,
|  | int | depth )

extern

This function writes a null value to the N_array_3d data at position col, row, depth.

The null value will be automatically set to the array type.

Parameters

  data | N_array_3d *
  col | int
  row | int
  depth | int

Returns
  void

Definition at line 1060 of file n_arrays.c.

References G_debug(), and NULL.

Referenced by N_math_array_3d(), and N_read_rast3d_to_array_3d().

## N_read_rast3d_to_array_3d()

N_array_3d * N_read_rast3d_to_array_3d | ( | char * | name,
|  | N_array_3d * | array,
|  | int | mask )

extern

Read a volume map into a N_array_3d structure.

The volume map is opened in the current region settings. If no N_array_3d structure is provided (NULL pointer), a new structure will be allocated with the same data type as the volume map and the size of the current region. The array offset will be set to 0.

If a N_array_3d structure is provided, the values from the volume map are casted to the N_array_3d type. The array must have the same size as the current region.

The new created or the provided array is returned. If the reading of the volume map fails, Rast3d_fatal_error() will be invoked.

Parameters

  name | * char - the name of an existing volume map
  array | * N_array_3d - an existing array or NULL
  mask | int - 0 = false, 1 = true : if a mask is presenent, use it with the input volume map

Returns
  N_array_3d * - the existing or new allocated array

Definition at line 253 of file n_arrays_io.c.

References G_fatal_error(), G_find_raster3d(), G_message(), G_percent(), N_alloc_array_3d(), N_put_array_3d_d_value(), N_put_array_3d_f_value(), N_put_array_3d_value_null(), name, NULL, and x.

## N_read_rast_to_array_2d()

N_array_2d * N_read_rast_to_array_2d | ( | char * | name,
|  | N_array_2d * | array )

extern

Read a raster map into a N_array_2d structure.

The raster map will be opened in the current region settings. If no N_array_2d structure is provided (NULL pointer), a new structure will be allocated with the same data type as the raster map and the size of the current region. The array offset will be set to 0.
If a N_array_2d structure is provided, the values from the raster map are casted to the N_array_2d type. The array must have the same size as the current region.
The new created or the provided array are returned. If the reading of the raster map fails, G_fatal_error() will be invoked.

Parameters

  name | * char - the name of an existing raster map
  array | * N_array_2d - an existing array or NULL

Returns
  N_array_2d * - the existing or new allocated array

Definition at line 44 of file n_arrays_io.c.

References G_fatal_error(), G_free(), G_get_set_window(), G_incr_void_ptr(), G_message(), G_percent(), N_alloc_array_2d(), N_put_array_2d_c_value(), N_put_array_2d_d_value(), N_put_array_2d_f_value(), N_put_array_2d_value_null(), name, NULL, and x.

## N_set_les_callback_2d_func()

void N_set_les_callback_2d_func | ( | N_les_callback_2d * | data,
|  | N_data_star *(* | callback_func_2d )(void *, N_geom_data *, int, int) )

extern

Set the callback function which is called while assembling the les in 2d.

Parameters

  data | N_les_callback_2d *
  callback_func_2d | N_data_star *

Returns
  void

Definition at line 360 of file n_les_assemble.c.

## N_set_les_callback_3d_func()

void N_set_les_callback_3d_func | ( | N_les_callback_3d * | data,
|  | N_data_star *(* | callback_func_3d )(void *, N_geom_data *, int, int, int) )

extern

Set the callback function which is called while assembling the les in 3d.

Parameters

  data | N_les_callback_3d *
  callback_func_3d | N_data_star *

Returns
  void

Definition at line 341 of file n_les_assemble.c.

## N_write_array_2d_to_rast()

void N_write_array_2d_to_rast | ( | N_array_2d * | array,
|  | char * | name )

extern

Write a N_array_2d struct to a raster map.

A new raster map is created with the same type as the N_array_2d. The current region is used to open the raster map. The N_array_2d must have the same size as the current region. If the writing of the raster map fails, G_fatal_error() will be invoked.

Parameters

  array | N_array_2d *
  name | char * - the name of the raster map

Returns
  void

Definition at line 172 of file n_arrays_io.c.

References G_fatal_error(), G_free(), G_get_set_window(), G_message(), G_percent(), N_get_array_2d_c_value(), N_get_array_2d_d_value(), N_get_array_2d_f_value(), name, NULL, N_array_2d::type, and x.

## N_write_array_3d_to_rast3d()

void N_write_array_3d_to_rast3d | ( | N_array_3d * | array,
|  | char * | name,
|  | int | mask )

extern

Write a N_array_3d struct to a volume map.

A new volume map is created with the same type as the N_array_3d. The current region is used to open the volume map. The N_array_3d must have the same size as the current region. If the writing of the volume map fails, Rast3d_fatal_error() will be invoked.

Parameters

  array | N_array_3d *
  name | char * - the name of the volume map
  mask | int - 1 = use a 3d mask, 0 do not use a 3d mask

Returns
  void

Definition at line 381 of file n_arrays_io.c.

References G_fatal_error(), G_message(), G_percent(), N_get_array_3d_d_value(), N_get_array_3d_f_value(), name, NULL, and x.