20 #include "grass/N_pde.h"
77 struct Cell_head region2d;
83 "N_init_geom_data_3d: initializing the geometry structure");
89 geom->
depths = region3d->depths;
120 struct Cell_head backup;
133 "N_init_geom_data_2d: initializing the geometry structure");
150 geom->
rows = region->rows;
151 geom->
cols = region->cols;
152 geom->
dx = region->ew_res * meters;
153 geom->
dy = region->ns_res * meters;
154 geom->
Az = geom->
dy * geom->
dx;
163 "N_init_geom_data_2d: calculating the areas for non parametric projection");
168 geom->
area = G_calloc(geom->
rows,
sizeof(
double));
170 geom->
area = G_calloc(geom->
rows,
sizeof(
double));
174 for (i = 0; i < geom->
rows; i++) {
202 G_debug(6,
"N_get_geom_data_area_of_cell: %g", geom->
Az);
206 G_debug(6,
"N_get_geom_data_area_of_cell: %g", geom->
area[row]);
207 return geom->
area[row];
void G_free(void *buf)
Free allocated memory.
int G_get_set_window(struct Cell_head *window)
Get the current working window.
int G_set_window(struct Cell_head *window)
Establishes 'window' as the current working window.
void G3d_regionToCellHead(G3D_Region *region3d, struct Cell_head *region2d)
Returns in region2d the 2d portion of region3d.
double G_area_of_cell_at_row(int row)
Cell area in specified row.
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.
Geometric information about the structured grid.
int G_begin_cell_area_calculations(void)
Begin cell area calculations.
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_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 *geom)
Release memory of a pde geometry data structure.
int G_debug(int level, const char *msg,...)
Print debugging message.
double G_database_units_to_meters_factor(void)
conversion to meters
N_geom_data * N_init_geom_data_3d(G3D_Region *region3d, N_geom_data *geodata)
Initiate a pde geometry data structure with a 3d region.