18#include <grass/N_pde.h>
63 G_debug(5,
"N_create_gradient_2d: create N_gradient_2d");
85 G_debug(5,
"N_copy_gradient_2d: copy N_gradient_2d");
117 double NC = 0, SC = 0, WC = 0, EC = 0;
126 5,
"N_get_gradient_2d: calculate N_gradient_2d NC %g SC %g WC %g EC %g",
185 double TC,
double BC)
189 G_debug(5,
"N_create_gradient_3d: create N_gradient_3d");
213 G_debug(5,
"N_copy_gradient_3d: copy N_gradient_3d");
250 double NC, SC, WC, EC, TC, BC;
261 "N_get_gradient_3d: calculate N_gradient_3d NC %g SC %g WC %g EC "
263 NC, SC, WC, EC, TC, BC);
327 double WC,
double EC,
328 double SWS,
double SES)
333 "N_create_gradient_neighbours_x: create N_gradient_neighbours_x");
358 G_debug(6,
"N_copy_gradient_neighbours_x: copy N_gradient_neighbours_x");
419 double NC,
double SC,
420 double SWW,
double SEE)
425 "N_create_gradient_neighbours_y: create N_gradient_neighbours_y");
450 G_debug(6,
"N_copy_gradient_neighbours_y: copy N_gradient_neighbours_y");
514 double NEZ,
double WZ,
515 double CZ,
double EZ,
516 double SWZ,
double SZ,
522 "N_create_gradient_neighbours_z: create N_gradient_neighbours_z");
550 G_debug(6,
"N_copy_gradient_neighbours_z: copy N_gradient_neighbours_z");
625 "N_create_gradient_neighbours_2d: create N_gradient_neighbours_2d");
655 G_debug(5,
"N_copy_gradient_neighbours_2d: copy N_gradient_neighbours_2d");
693 double NWN, NEN, WC, EC, SWS, SES;
694 double NWW, NEE, NC, SC, SWW, SEE;
717 "N_get_gradient_neighbours_2d: calculate N_gradient_neighbours_x "
718 "NWN %g NEN %g WC %g EC %g SWS %g SES %g",
719 NWN, NEN, WC, EC, SWS, SES);
722 "N_get_gradient_neighbours_2d: calculate N_gradient_neighbours_y "
723 "NWW %g NEE %g NC %g SC %g SWW %g SEE %g",
724 NWW, NEE, NC, SC, SWW, SEE);
816 "N_create_gradient_neighbours_3d: create N_gradient_neighbours_3d");
857 G_debug(5,
"N_copy_gradient_neighbours_3d: copy N_gradient_neighbours_3d");
901 "N_alloc_gradient_field_2d: allocate a N_gradient_field_2d struct");
944 G_debug(3,
"N_copy_gradient_field_2d: copy N_gradient_field_2d");
998 "N_alloc_gradient_field_3d: allocate a N_gradient_field_3d struct");
1044 G_debug(3,
"N_copy_gradient_field_3d: copy N_gradient_field_3d");
void G_free(void *)
Free allocated memory.
int G_debug(int, const char *,...) __attribute__((format(printf
void N_print_array_3d_info(N_array_3d *data)
Write the info of the array to stdout.
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)
Release the memory of a N_array_3d.
DCELL N_get_array_2d_d_value(N_array_2d *data, int col, int row)
Returns the value of type DCELL at position col, row.
void N_print_array_2d_info(N_array_2d *data)
This function writes the data info of the array data to stdout.
void N_free_array_2d(N_array_2d *data)
Release the memory of a N_array_2d structure.
N_array_2d * N_alloc_array_2d(int cols, int rows, int offset, int type)
Allocate memory for a N_array_2d data structure.
double N_get_array_3d_d_value(N_array_3d *data, int col, int row, int depth)
This function returns the value of type float at position col, row, depth.
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.
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.
N_gradient_3d * N_alloc_gradient_3d(void)
Allocate 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
N_gradient_2d * N_alloc_gradient_2d(void)
Allocate a N_gradient_2d structure.
N_gradient_neighbours_y * N_alloc_gradient_neighbours_y(void)
Allocate a N_gradient_neighbours_y structure.
int N_copy_gradient_neighbours_2d(N_gradient_neighbours_2d *source, N_gradient_neighbours_2d *target)
copy a N_gradient_neighbours_2d structure
int N_copy_gradient_3d(N_gradient_3d *source, N_gradient_3d *target)
copy a N_gradient_3d structure
N_gradient_neighbours_z * N_alloc_gradient_neighbours_z(void)
Allocate 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.
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.
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_field_2d * N_alloc_gradient_field_2d(int cols, int rows)
Allocate a N_gradient_field_2d.
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.
void N_free_gradient_neighbours_2d(N_gradient_neighbours_2d *grad)
Free's a N_gradient_neighbours_2d structure.
void N_print_gradient_field_2d_info(N_gradient_field_2d *field)
Print gradient field information to stdout.
N_gradient_neighbours_x * N_alloc_gradient_neighbours_x(void)
Allocate a N_gradient_neighbours_x structure.
void N_print_gradient_field_3d_info(N_gradient_field_3d *field)
Print gradient field information to stdout.
void N_free_gradient_neighbours_z(N_gradient_neighbours_z *grad)
Free's a N_gradient_neighbours_z 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...
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_field_3d * N_alloc_gradient_field_3d(int cols, int rows, int depths)
Allocate a N_gradient_field_3d.
int N_copy_gradient_neighbours_3d(N_gradient_neighbours_3d *source, N_gradient_neighbours_3d *target)
copy a N_gradient_neighbours_3d structure
N_gradient_neighbours_2d * N_alloc_gradient_neighbours_2d(void)
Allocate a N_gradient_neighbours_2d 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.
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.
N_gradient_neighbours_3d * N_alloc_gradient_neighbours_3d(void)
Allocate a N_gradient_neighbours_3d 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.
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_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][co...
void N_free_gradient_2d(N_gradient_2d *grad)
Free's a N_gradient_2d structure.
int N_copy_gradient_neighbours_y(N_gradient_neighbours_y *source, N_gradient_neighbours_y *target)
copy a N_gradient_neighbours_y structure
int N_copy_gradient_2d(N_gradient_2d *source, N_gradient_2d *target)
copy a N_gradient_2d structure
void N_free_gradient_3d(N_gradient_3d *grad)
Free's a N_gradient_3d structure.
void N_free_gradient_neighbours_y(N_gradient_neighbours_y *grad)
Free's a N_gradient_neighbours_y structure.
void N_free_gradient_field_2d(N_gradient_field_2d *field)
Free's a N_gradient_neighbours_2d structure.
void N_free_gradient_neighbours_x(N_gradient_neighbours_x *grad)
Free's a N_gradient_neighbours_x 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_field_2d(N_gradient_field_2d *source, N_gradient_field_2d *target)
Copy N_gradient_field_2d structure from source to target.
void N_free_gradient_neighbours_3d(N_gradient_neighbours_3d *grad)
Free's a N_gradient_neighbours_3d structure.
Gradient between the cells in X and Y direction.
Gradient between the cells in X, Y and Z direction.
Gradient between the cell neighbours in X and Y direction.
N_gradient_neighbours_y * y
N_gradient_neighbours_x * x
Gradient between the cell neighbours in X, Y and Z direction.
N_gradient_neighbours_y * yb
N_gradient_neighbours_z * zb
N_gradient_neighbours_y * yt
N_gradient_neighbours_z * zt
N_gradient_neighbours_y * yc
N_gradient_neighbours_x * xb
N_gradient_neighbours_x * xt
N_gradient_neighbours_x * xc
Gradient between the cell neighbours in X direction.
Gradient between the cell neighbours in Y direction.
Gradient between the cell neighbours in Z direction.