GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71769
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
N_pde.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * MODULE: Grass PDE Numerical Library
5 * AUTHOR(S): Soeren Gebbert, Berlin (GER) Dec 2006
6 * soerengebbert <at> gmx <dot> de
7 *
8 * PURPOSE: This file contains definitions of variables and data types
9 *
10 * COPYRIGHT: (C) 2000 by the GRASS Development Team
11 *
12 * This program is free software under the GNU General Public
13 * License (>=v2). Read the file COPYING that comes with GRASS
14 * for details.
15 *
16 *****************************************************************************/
17 
18 #include <grass/gis.h>
19 #include <grass/raster3d.h>
20 #include <grass/glocale.h>
21 #include <grass/gmath.h>
22 
23 #ifndef _N_PDE_H_
24 #define _N_PDE_H_
25 
26 #define N_NORMAL_LES 0
27 #define N_SPARSE_LES 1
28 /*!
29  * Boundary conditions for cells
30  */
31 #define N_CELL_INACTIVE 0
32 #define N_CELL_ACTIVE 1
33 #define N_CELL_DIRICHLET 2
34 #define N_CELL_TRANSMISSION 3
35 /*!
36  * \brief the maximum number of available cell states (eg: boundary condition, inactiven active)
37  * */
38 #define N_MAX_CELL_STATE 20
39 
40 #define N_5_POINT_STAR 0
41 #define N_7_POINT_STAR 1
42 #define N_9_POINT_STAR 2
43 #define N_27_POINT_STAR 3
44 
45 #define N_MAXIMUM_NORM 0
46 #define N_EUKLID_NORM 1
47 
48 #define N_ARRAY_SUM 0 /* summ two arrays */
49 #define N_ARRAY_DIF 1 /* calc the difference between two arrays */
50 #define N_ARRAY_MUL 2 /* multiply two arrays */
51 #define N_ARRAY_DIV 3 /* array division, if div with 0 the NULL value is set */
52 
53 #define N_UPWIND_FULL 0 /*full upwinding stabilization */
54 #define N_UPWIND_EXP 1 /*exponential upwinding stabilization */
55 #define N_UPWIND_WEIGHT 2 /*weighted upwinding stabilization */
56 
57 
58 
59 /* *************************************************************** */
60 /* *************** LINEARE EQUATION SYSTEM PART ****************** */
61 /* *************************************************************** */
62 
63 /*!
64  * \brief The linear equation system (les) structure
65  *
66  * This structure manages the Ax = b system.
67  * It manages regular quadratic matrices or
68  * sparse matrices. The vector b and x are normal one dimensional
69  * memory structures of type double. Also the number of rows
70  * and the matrix type are stored in this structure.
71  * */
72 typedef struct
73 {
74  double *x; /*the value vector */
75  double *b; /*the right side of Ax = b */
76  double **A; /*the normal quadratic matrix */
77  G_math_spvector **Asp; /*the sparse matrix */
78  int rows; /*number of rows */
79  int cols; /*number of cols */
80  int quad; /*is the matrix quadratic (1-quadratic, 0 not) */
81  int type; /*the type of the les, normal == 0, sparse == 1 */
82 } N_les;
83 
84 extern N_les *N_alloc_les_param(int cols, int rows, int type, int param);
85 extern N_les *N_alloc_les(int rows, int type);
86 extern N_les *N_alloc_les_A(int rows, int type);
87 extern N_les *N_alloc_les_Ax(int rows, int type);
88 extern N_les *N_alloc_les_Ax_b(int rows, int type);
89 extern N_les *N_alloc_nquad_les(int cols, int rows, int type);
90 extern N_les *N_alloc_nquad_les_A(int cols, int rows, int type);
91 extern N_les *N_alloc_nquad_les_Ax(int cols, int rows, int type);
92 extern N_les *N_alloc_nquad_les_Ax_b(int cols, int rows, int type);
93 extern void N_print_les(N_les * les);
94 extern void N_free_les(N_les * les);
95 
96 /* *************************************************************** */
97 /* *************** GEOMETRY INFORMATION ************************** */
98 /* *************************************************************** */
99 
100 /*!
101  * \brief Geometric information about the structured grid
102  * */
103 typedef struct
104 {
105  int planimetric; /*If the projection is not planimetric (0), the array calculation is different for each row */
106  double *area; /* the vector of area values for non-planimetric projection for each row */
107  int dim; /* 2 or 3 */
108 
109  double dx;
110  double dy;
111  double dz;
112 
113  double Az;
114 
115  int depths;
116  int rows;
117  int cols;
118 
119 } N_geom_data;
120 
121 extern N_geom_data *N_alloc_geom_data(void);
122 extern void N_free_geom_data(N_geom_data * geodata);
123 extern N_geom_data *N_init_geom_data_3d(RASTER3D_Region * region3d, N_geom_data * geodata);
124 extern N_geom_data *N_init_geom_data_2d(struct Cell_head *region, N_geom_data * geodata);
125 extern double N_get_geom_data_area_of_cell(N_geom_data * geom, int row);
126 
127 /* *************************************************************** */
128 /* *************** READING RASTER AND VOLUME DATA **************** */
129 /* *************************************************************** */
130 
131 typedef struct
132 {
133  int type; /* which raster type CELL_TYPE, FCELL_TYPE, DCELL_TYPE */
134  int rows, cols;
135  int rows_intern, cols_intern;
136  int offset; /*number of cols/rows offset at each boundary */
137  CELL *cell_array; /*The data is stored in an one dimensional array internally */
138  FCELL *fcell_array; /*The data is stored in an one dimensional array internally */
139  DCELL *dcell_array; /*The data is stored in an one dimensional array internally */
140 } N_array_2d;
141 
142 extern N_array_2d *N_alloc_array_2d(int cols, int rows, int offset, int type);
143 extern void N_free_array_2d(N_array_2d * data_array);
144 extern int N_get_array_2d_type(N_array_2d * array2d);
145 extern void N_get_array_2d_value(N_array_2d * array2d, int col, int row, void *value);
146 extern CELL N_get_array_2d_c_value(N_array_2d * array2d, int col, int row);
147 extern FCELL N_get_array_2d_f_value(N_array_2d * array2d, int col, int row);
148 extern DCELL N_get_array_2d_d_value(N_array_2d * array2d, int col, int row);
149 extern void N_put_array_2d_value(N_array_2d * array2d, int col, int row, char *value);
150 extern void N_put_array_2d_c_value(N_array_2d * array2d, int col, int row, CELL value);
151 extern void N_put_array_2d_f_value(N_array_2d * array2d, int col, int row, FCELL value);
152 extern void N_put_array_2d_d_value(N_array_2d * array2d, int col, int row, DCELL value);
153 extern int N_is_array_2d_value_null(N_array_2d * array2d, int col, int row);
154 extern void N_put_array_2d_value_null(N_array_2d * array2d, int col, int row);
155 extern void N_print_array_2d(N_array_2d * data);
156 extern void N_print_array_2d_info(N_array_2d * data);
157 extern void N_copy_array_2d(N_array_2d * source, N_array_2d * target);
158 extern double N_norm_array_2d(N_array_2d * array1, N_array_2d * array2, int type);
159 extern N_array_2d *N_math_array_2d(N_array_2d * array1, N_array_2d * array2, N_array_2d * result, int type);
161 extern N_array_2d *N_read_rast_to_array_2d(char *name, N_array_2d * array);
162 extern void N_write_array_2d_to_rast(N_array_2d * array, char *name);
163 extern void N_calc_array_2d_stats(N_array_2d * a, double *min, double *max, double *sum, int *nonzero, int withoffset);
164 
165 typedef struct
166 {
167  int type; /* which raster type FCELL_TYPE, DCELL_TYPE */
168  int rows, cols, depths;
169  int rows_intern, cols_intern, depths_intern;
170  int offset; /*number of cols/rows/depths offset at each boundary */
171  float *fcell_array; /*The data is stored in an one dimensional array internally */
172  double *dcell_array; /*The data is stored in an one dimensional array internally */
173 } N_array_3d;
174 
175 extern N_array_3d *N_alloc_array_3d(int cols, int rows, int depths, int offset, int type);
176 extern void N_free_array_3d(N_array_3d * data_array);
177 extern int N_get_array_3d_type(N_array_3d * array3d);
178 extern void N_get_array_3d_value(N_array_3d * array3d, int col, int row, int depth, void *value);
179 extern float N_get_array_3d_f_value(N_array_3d * array3d, int col, int row, int depth);
180 extern double N_get_array_3d_d_value(N_array_3d * array3d, int col, int row, int depth);
181 extern void N_put_array_3d_value(N_array_3d * array3d, int col, int row, int depth, char *value);
182 extern void N_put_array_3d_f_value(N_array_3d * array3d, int col, int row, int depth, float value);
183 extern void N_put_array_3d_d_value(N_array_3d * array3d, int col, int row, int depth, double value);
184 extern int N_is_array_3d_value_null(N_array_3d * array3d, int col, int row, int depth);
185 extern void N_put_array_3d_value_null(N_array_3d * array3d, int col, int row, int depth);
186 extern void N_print_array_3d(N_array_3d * data);
187 extern void N_print_array_3d_info(N_array_3d * data);
188 extern void N_copy_array_3d(N_array_3d * source, N_array_3d * target);
189 extern double N_norm_array_3d(N_array_3d * array1, N_array_3d * array2, int type);
190 extern N_array_3d *N_math_array_3d(N_array_3d * array1, N_array_3d * array2, N_array_3d * result, int type);
192 extern N_array_3d *N_read_rast3d_to_array_3d(char *name, N_array_3d * array, int mask);
193 extern void N_write_array_3d_to_rast3d(N_array_3d * array, char *name, int mask);
194 extern void N_calc_array_3d_stats(N_array_3d * a, double *min, double *max, double *sum, int *nonzero, int withoffset);
195 
196 /* *************************************************************** */
197 /* *************** MATRIX ASSEMBLING METHODS ********************* */
198 /* *************************************************************** */
199 /*!
200  * \brief Matrix entries for a mass balance 5/7/9 star system
201  *
202  * Matrix entries for the mass balance of a 5 star system
203  *
204  * The entries are center, east, west, north, south and the
205  * right side vector b of Ax = b. This system is typically used in 2d.
206 
207  \verbatim
208  N
209  |
210  W-- C --E
211  |
212  S
213  \endverbatim
214 
215  * Matrix entries for the mass balance of a 7 star system
216  *
217  * The entries are center, east, west, north, south, top, bottom and the
218  * right side vector b of Ax = b. This system is typically used in 3d.
219 
220  \verbatim
221  T N
222  |/
223  W-- C --E
224  /|
225  S B
226  \endverbatim
227 
228  * Matrix entries for the mass balance of a 9 star system
229  *
230  * The entries are center, east, west, north, south, north-east, south-east,
231  * north-wast, south-west and the
232  * right side vector b of Ax = b. This system is typically used in 2d.
233 
234  \verbatim
235  NW N NE
236  \ | /
237  W-- C --E
238  / | \
239  SW S SE
240  \endverbatim
241 
242  * Matrix entries for the mass balance of a 27 star system
243  *
244  * The entries are center, east, west, north, south, north-east, south-east,
245  * north-wast, south-west, same for top and bottom and the
246  * right side vector b of Ax = b. This system is typically used in 2d.
247 
248  \verbatim
249  top:
250  NW_T N_Z NE_T
251  \ | /
252  W_T-- T --E_T
253  / | \
254  SW_T S_T SE_T
255 
256  center:
257  NW N NE
258  \ | /
259  W-- C --E
260  / | \
261  SW S SE
262 
263  bottom:
264  NW_B N_B NE_B
265  \ | /
266  W_B-- B --E_B
267  / | \
268  SW_B S_B SE_B
269  \endverbatim
270 
271  */
272 typedef struct
273 {
274  int type;
275  int count;
276  double C, W, E, N, S, NE, NW, SE, SW, V;
277  /*top part */
278  double T, W_T, E_T, N_T, S_T, NE_T, NW_T, SE_T, SW_T;
279  /*bottom part */
280  double B, W_B, E_B, N_B, S_B, NE_B, NW_B, SE_B, SW_B;
281 } N_data_star;
282 
283 /*!
284  * \brief callback structure for 3d matrix assembling
285  * */
286 typedef struct
287 {
288  N_data_star *(*callback) ();
290 
291 /*!
292  * \brief callback structure for 2d matrix assembling
293  * */
294 typedef struct
295 {
296  N_data_star *(*callback) ();
298 
299 
300 extern void N_set_les_callback_3d_func(N_les_callback_3d * data, N_data_star * (*callback_func_3d) ());
301 extern void N_set_les_callback_2d_func(N_les_callback_2d * data, N_data_star * (*callback_func_2d) ());
304 extern N_data_star *N_alloc_5star(void);
305 extern N_data_star *N_alloc_7star(void);
306 extern N_data_star *N_alloc_9star(void);
307 extern N_data_star *N_alloc_27star(void);
308 extern N_data_star *N_create_5star(double C, double W, double E, double N,
309  double S, double V);
310 extern N_data_star *N_create_7star(double C, double W, double E, double N,
311  double S, double T, double B, double V);
312 extern N_data_star *N_create_9star(double C, double W, double E, double N,
313  double S, double NW, double SW, double NE,
314  double SE, double V);
315 extern N_data_star *N_create_27star(double C, double W, double E, double N,
316  double S, double NW, double SW, double NE,
317  double SE, double T, double W_T,
318  double E_T, double N_T, double S_T,
319  double NW_T, double SW_T, double NE_T,
320  double SE_T, double B, double W_B,
321  double E_B, double N_B, double S_B,
322  double NW_B, double SW_B, double NE_B,
323  double SE_B, double V);
324 extern N_data_star *N_callback_template_3d(void *data, N_geom_data * geom, int col, int row, int depth);
325 extern N_data_star *N_callback_template_2d(void *data, N_geom_data * geom, int col, int row);
326 extern 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);
327 extern 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);
328 extern 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);
329 extern 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);
330 extern 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);
331 extern 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);
332 extern 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);
333 extern 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);
334 extern int N_les_pivot_create(N_les * les);
335 int N_les_integrate_dirichlet_2d(N_les * les, N_geom_data * geom, N_array_2d * status, N_array_2d * start_val);
336 int N_les_integrate_dirichlet_3d(N_les * les, N_geom_data * geom, N_array_3d * status, N_array_3d * start_val);
337 
338 /* *************************************************************** */
339 /* *************** GPDE STANDARD OPTIONS ************************* */
340 /* *************************************************************** */
341 
342 /*! \brief Standard options of the gpde library
343  * */
344 typedef enum
345 {
346  N_OPT_SOLVER_SYMM, /*! solver for symmetric, positive definite linear equation systems */
347  N_OPT_SOLVER_UNSYMM, /*! solver for unsymmetric linear equation systems */
348  N_OPT_MAX_ITERATIONS, /*! Maximum number of iteration used to solver the linear equation system */
349  N_OPT_ITERATION_ERROR, /*! Error break criteria for the iterative solver (jacobi, sor, cg or bicgstab) */
350  N_OPT_SOR_VALUE, /*! The relaxation parameter used by the jacobi and sor solver for speedup or stabilizing */
351  N_OPT_CALC_TIME /*! The calculation time in seconds */
352 } N_STD_OPT;
353 
354 extern struct Option *N_define_standard_option(int opt);
355 
356 /* *************************************************************** */
357 /* *************** GPDE MATHEMATICAL TOOLS *********************** */
358 /* *************************************************************** */
359 
360 extern double N_calc_arith_mean(double a, double b);
361 extern double N_calc_arith_mean_n(double *a, int size);
362 extern double N_calc_geom_mean(double a, double b);
363 extern double N_calc_geom_mean_n(double *a, int size);
364 extern double N_calc_harmonic_mean(double a, double b);
365 extern double N_calc_harmonic_mean_n(double *a, int size);
366 extern double N_calc_quad_mean(double a, double b);
367 extern double N_calc_quad_mean_n(double *a, int size);
368 
369 /* *************************************************************** */
370 /* *************** UPWIND STABILIZATION ALGORITHMS *************** */
371 /* *************************************************************** */
372 
373 extern double N_full_upwinding(double sprod, double distance, double D);
374 extern double N_exp_upwinding(double sprod, double distance, double D);
375 
376 
377 /* *************************************************************** */
378 /* *************** METHODS FOR GRADIENT CALCULATION ************** */
379 /* *************************************************************** */
380 /*!
381  \verbatim
382 
383  ______________
384  | | | |
385  | | | |
386  |----|-NC-|----|
387  | | | |
388  | WC EC |
389  | | | |
390  |----|-SC-|----|
391  | | | |
392  |____|____|____|
393 
394 
395  | /
396  TC NC
397  |/
398  --WC-----EC--
399  /|
400  SC BC
401  / |
402 
403  \endverbatim
404 
405  */
406 
407 /*! \brief Gradient between the cells in X and Y direction */
408 typedef struct
409 {
410 
411  double NC, SC, WC, EC;
412 
413 } N_gradient_2d;
414 
415 /*! \brief Gradient between the cells in X, Y and Z direction */
416 typedef struct
417 {
418 
419  double NC, SC, WC, EC, TC, BC;
420 
421 } N_gradient_3d;
422 
423 
424 /*!
425  \verbatim
426 
427  Gradient in X direction between the cell neighbours
428  ____ ____ ____
429  | | | |
430  | NWN NEN |
431  |____|____|____|
432  | | | |
433  | WN EN |
434  |____|____|____|
435  | | | |
436  | SWS SES |
437  |____|____|____|
438 
439  Gradient in Y direction between the cell neighbours
440  ______________
441  | | | |
442  | | | |
443  |NWW-|-NC-|-NEE|
444  | | | |
445  | | | |
446  |SWW-|-SC-|-SEE|
447  | | | |
448  |____|____|____|
449 
450  Gradient in Z direction between the cell neighbours
451  /______________/
452  /| | | |
453  | NWZ| NZ | NEZ|
454  |____|____|____|
455  /| | | |
456  | WZ | CZ | EZ |
457  |____|____|____|
458  /| | | |
459  | SWZ| SZ | SEZ|
460  |____|____|____|
461  /____/____/____/
462 
463 
464  \endverbatim
465  */
466 
467 /*! \brief Gradient between the cell neighbours in X direction */
468 typedef struct
469 {
470 
471  double NWN, NEN, WC, EC, SWS, SES;
472 
474 
475 /*! \brief Gradient between the cell neighbours in Y direction */
476 typedef struct
477 {
478 
479  double NWW, NEE, NC, SC, SWW, SEE;
480 
482 
483 /*! \brief Gradient between the cell neighbours in Z direction */
484 typedef struct
485 {
486 
487  double NWZ, NZ, NEZ, WZ, CZ, EZ, SWZ, SZ, SEZ;
488 
490 
491 /*! \brief Gradient between the cell neighbours in X and Y direction */
492 typedef struct
493 {
494 
497 
499 
500 
501 /*! \brief Gradient between the cell neighbours in X, Y and Z direction */
502 typedef struct
503 {
504 
505  N_gradient_neighbours_x *xt; /*top values */
506  N_gradient_neighbours_x *xc; /*center values */
507  N_gradient_neighbours_x *xb; /*bottom values */
508 
509  N_gradient_neighbours_y *yt; /*top values */
510  N_gradient_neighbours_y *yc; /*center values */
511  N_gradient_neighbours_y *yb; /*bottom values */
512 
513  N_gradient_neighbours_z *zt; /*top-center values */
514  N_gradient_neighbours_z *zb; /*bottom-center values */
515 
517 
518 
519 /*! Two dimensional gradient field */
520 typedef struct
521 {
522 
525  int cols, rows;
526  double min, max, mean, sum;
527  int nonull;
528 
530 
531 /*! Three dimensional gradient field */
532 typedef struct
533 {
534 
538  int cols, rows, depths;
539  double min, max, mean, sum;
540  int nonull;
541 
543 
544 
545 extern N_gradient_2d *N_alloc_gradient_2d(void);
546 extern void N_free_gradient_2d(N_gradient_2d * grad);
547 extern N_gradient_2d *N_create_gradient_2d(double NC, double SC, double WC, double EC);
548 extern int N_copy_gradient_2d(N_gradient_2d * source, N_gradient_2d * target);
549 extern N_gradient_2d *N_get_gradient_2d(N_gradient_field_2d * field, N_gradient_2d * gradient, int col, int row);
550 extern N_gradient_3d *N_alloc_gradient_3d(void);
551 extern void N_free_gradient_3d(N_gradient_3d * grad);
552 extern N_gradient_3d *N_create_gradient_3d(double NC, double SC, double WC, double EC, double TC, double BC);
553 extern int N_copy_gradient_3d(N_gradient_3d * source, N_gradient_3d * target);
554 extern N_gradient_3d *N_get_gradient_3d(N_gradient_field_3d * field, N_gradient_3d * gradient, int col, int row, int depth);
558  double NEN,
559  double WC,
560  double EC,
561  double SWS,
562  double SES);
567  double NEE,
568  double NC,
569  double SC,
570  double SWW,
571  double SEE);
576  double NZ,
577  double NEZ,
578  double WZ,
579  double CZ,
580  double EZ,
581  double SWZ,
582  double SZ,
583  double SEZ);
604 extern N_gradient_field_2d *N_alloc_gradient_field_2d(int cols, int rows);
605 extern void N_free_gradient_field_2d(N_gradient_field_2d * field);
608  N_array_2d * weight_x,
609  N_array_2d * weight_y,
610  N_geom_data * geom,
612  gradfield);
616 extern N_gradient_field_3d *N_alloc_gradient_field_3d(int cols, int rows, int depths);
617 extern void N_free_gradient_field_3d(N_gradient_field_3d * field);
620  N_array_3d * weight_x,
621  N_array_3d * weight_y,
622  N_array_3d * weight_z,
623  N_geom_data * geom,
625  gradfield);
626 extern 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);
627 
628 #endif
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]...
Definition: n_gradient.c:115
N_gradient_neighbours_x * xt
Definition: N_pde.h:505
N_gradient_neighbours_z * zt
Definition: N_pde.h:513
void N_put_array_2d_value_null(N_array_2d *data, int col, int row)
Writes the null value to the N_array_2d struct at position col, row.
Definition: n_arrays.c:458
N_gradient_3d * N_alloc_gradient_3d(void)
Allocate a N_gradient_3d structure.
Definition: n_gradient.c:151
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...
Definition: n_les.c:83
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
Matrix entries for a mass balance 5/7/9 star system.
Definition: N_pde.h:272
Gradient between the cell neighbours in X and Y direction.
Definition: N_pde.h:492
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.
Definition: n_les.c:145
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)
Assemble a linear equation system (les) based on 2d location data (raster) and active and dirichlet c...
int N_get_array_2d_type(N_array_2d *array)
Return the data type of the N_array_2d struct.
Definition: n_arrays.c:164
int rows
Definition: N_pde.h:134
double N_calc_harmonic_mean_n(double *a, int size)
Calculate the harmonical mean of the values in vector a of size n.
Definition: n_tools.c:140
Gradient between the cell neighbours in Z direction.
Definition: N_pde.h:484
void N_calc_array_2d_stats(N_array_2d *a, double *min, double *max, double *sum, int *nonull, int withoffset)
Calculate basic statistics of the N_array_2d struct.
The row vector of the sparse matrix.
Definition: gmath.h:54
int quad
Definition: N_pde.h:80
N_gradient_neighbours_z * N_alloc_gradient_neighbours_z(void)
Allocate a N_gradient_neighbours_z structure.
Definition: n_gradient.c:481
double N_calc_geom_mean(double a, double b)
Calculate the geometrical mean of values a and b.
Definition: n_tools.c:76
N_gradient_neighbours_x * N_alloc_gradient_neighbours_x(void)
Allocate a N_gradient_neighbours_x structure.
Definition: n_gradient.c:290
2D/3D raster map header (used also for region)
Definition: gis.h:390
void N_print_gradient_field_2d_info(N_gradient_field_2d *field)
Print gradient field information to stdout.
Definition: n_gradient.c:986
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.
Definition: n_arrays_io.c:47
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)
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.
int dim
Definition: N_pde.h:107
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.
Definition: n_arrays.c:990
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.
Definition: n_arrays.c:726
#define min(x, y)
Definition: draw2.c:31
Gradient between the cells in X and Y direction.
Definition: N_pde.h:408
void N_put_array_3d_f_value(N_array_3d *data, 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.
Definition: n_arrays.c:1148
double DCELL
Definition: gis.h:581
N_gradient_neighbours_y * y
Definition: N_pde.h:496
N_array_2d * N_alloc_array_2d(int cols, int rows, int offset, int type)
Allocate memory for a N_array_2d data structure.
Definition: n_arrays.c:72
N_gradient_field_3d * N_alloc_gradient_field_3d(int cols, int rows, int depths)
Allocate a N_gradient_field_3d.
Definition: n_gradient.c:1018
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.
Definition: n_gradient.c:966
double N_calc_geom_mean_n(double *a, int size)
Calculate the geometrical mean of the values in vector a of size n.
Definition: n_tools.c:96
N_les_callback_3d * N_alloc_les_callback_3d(void)
Allocate the structure holding the callback function.
N_STD_OPT
Standard options of the gpde library.
Definition: N_pde.h:344
N_data_star * N_alloc_5star(void)
allocate a 5 point star data 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.
Definition: n_gradient.c:329
#define NE
Definition: dataquad.h:30
#define N
Definition: e_intersect.c:923
void N_free_gradient_neighbours_2d(N_gradient_neighbours_2d *grad)
Free&#39;s a N_gradient_neighbours_2d structure.
Definition: n_gradient.c:608
int N_copy_gradient_neighbours_3d(N_gradient_neighbours_3d *source, N_gradient_neighbours_3d *target)
copy a N_gradient_neighbours_3d structure
Definition: n_gradient.c:875
int N_copy_gradient_neighbours_y(N_gradient_neighbours_y *source, N_gradient_neighbours_y *target)
copy a N_gradient_neighbours_y structure
Definition: n_gradient.c:455
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)
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)
Assemble a linear equation system (les) based on 2d location data (raster) and active cells...
void N_free_gradient_neighbours_y(N_gradient_neighbours_y *grad)
Free&#39;s a N_gradient_neighbours_y structure.
Definition: n_gradient.c:403
N_gradient_2d * N_alloc_gradient_2d(void)
Allocate a N_gradient_2d structure.
Definition: n_gradient.c:27
N_gradient_neighbours_2d * N_alloc_gradient_neighbours_2d(void)
Allocate a N_gradient_neighbours_2d structure.
Definition: n_gradient.c:587
void N_put_array_2d_value(N_array_2d *data, int col, int row, char *value)
Writes a value to the N_array_2d struct at position col, row.
Definition: n_arrays.c:411
double WC
Definition: N_pde.h:419
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.
Definition: n_les.c:100
int N_convert_array_3d_null_to_zero(N_array_3d *a)
Convert all null values to zero values.
double N_calc_quad_mean(double a, double b)
Calculate the quadratic mean of values a and b.
Definition: n_tools.c:169
#define NW
Definition: dataquad.h:29
double * x
Definition: N_pde.h:74
void N_put_array_2d_c_value(N_array_2d *data, int col, int row, CELL value)
Writes a CELL value to the N_array_2d struct at position col, row.
Definition: n_arrays.c:524
callback structure for 2d matrix assembling
Definition: N_pde.h:294
int depths
Definition: N_pde.h:115
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.
void N_print_array_3d_info(N_array_3d *data)
Write the info of the array to stdout.
Definition: n_arrays.c:1197
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.
Definition: n_gradient.c:825
FCELL N_get_array_2d_f_value(N_array_2d *data, int col, int row)
Returns the value of type FCELL at position col, row.
Definition: n_arrays.c:346
#define x
#define max(x, y)
Definition: draw2.c:32
float N_get_array_3d_f_value(N_array_3d *data, int col, int row, int depth)
This function returns the value of type float at position col, row, depth.
Definition: n_arrays.c:961
N_array_3d * y_array
Definition: N_pde.h:536
void N_put_array_2d_f_value(N_array_2d *data, int col, int row, FCELL value)
Writes a FCELL value to the N_array_2d struct at position col, row.
Definition: n_arrays.c:554
void N_print_array_2d(N_array_2d *data)
Write info and content of the N_array_2d struct to stdout.
Definition: n_arrays.c:637
int offset
Definition: N_pde.h:170
int N_les_pivot_create(N_les *les)
int count
Definition: N_pde.h:275
void N_free_gradient_field_3d(N_gradient_field_3d *field)
Free&#39;s a N_gradient_neighbours_3d structure.
Definition: n_gradient.c:1045
void N_free_gradient_3d(N_gradient_3d *grad)
Free&#39;s a N_gradient_3d structure.
Definition: n_gradient.c:166
double dy
Definition: N_pde.h:110
N_gradient_neighbours_z * zb
Definition: N_pde.h:514
int offset
Definition: N_pde.h:136
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.
Definition: n_gradient.c:1069
#define W
Definition: ogsf.h:140
void N_put_array_3d_value_null(N_array_3d *data, int col, int row, int depth)
This function writes a null value to the N_array_3d data at position col, row, depth.
Definition: n_arrays.c:1076
int N_convert_array_2d_null_to_zero(N_array_2d *a)
Convert all null values to zero values.
double W_B
Definition: N_pde.h:280
CELL * cell_array
Definition: N_pde.h:137
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.
Definition: n_arrays_calc.c:45
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)
Assemble a linear equation system (les) based on 2d location data (raster)
#define SW
Definition: dataquad.h:31
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.
Definition: n_geom.c:114
int type
Definition: gis.h:512
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)
Assemble a linear equation system (les) based on 3d location data (g3d) active and dirichlet cells...
#define D
Definition: gis/intersect.c:74
void N_free_les(N_les *les)
Release the memory of the linear equation system.
Definition: n_les.c:304
Geometric information about the structured grid.
Definition: N_pde.h:103
N_array_2d * N_math_array_2d(N_array_2d *a, N_array_2d *b, N_array_2d *result, int type)
Perform calculations with two input arrays, the result is written to a third array.
N_array_2d * y_array
Definition: N_pde.h:524
double dz
Definition: N_pde.h:111
void N_calc_gradient_field_2d_stats(N_gradient_field_2d *field)
Calculate basic statistics of a gradient field.
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)
Assemble a linear equation system (les) based on 3d location data (g3d) active cells.
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...
Definition: n_les.c:115
void N_print_gradient_field_3d_info(N_gradient_field_3d *field)
Print gradient field information to stdout.
Definition: n_gradient.c:1090
N_gradient_neighbours_3d * N_alloc_gradient_neighbours_3d(void)
Allocate a N_gradient_neighbours_3d structure.
Definition: n_gradient.c:769
int rows
Definition: N_pde.h:116
void N_print_array_3d(N_array_3d *data)
Write info and content of the array data to stdout.
Definition: n_arrays.c:1223
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.
Definition: n_gradient.c:522
N_gradient_neighbours_x * xb
Definition: N_pde.h:507
void N_free_array_2d(N_array_2d *data)
Release the memory of a N_array_2d structure.
Definition: n_arrays.c:130
int N_copy_gradient_neighbours_z(N_gradient_neighbours_z *source, N_gradient_neighbours_z *target)
copy a N_gradient_neighbours_z structure
Definition: n_gradient.c:557
double ** A
Definition: N_pde.h:76
double b
Definition: r_raster.c:39
void N_get_array_2d_value(N_array_2d *data, int col, int row, void *value)
Write the value of the N_array_2d struct at position col, row to value.
Definition: n_arrays.c:181
N_gradient_neighbours_y * yb
Definition: N_pde.h:511
void N_print_les(N_les *les)
prints the linear equation system to stdout
Definition: n_les.c:252
N_data_star * N_alloc_9star(void)
allocate a 9 point star data structure
N_les_callback_2d * N_alloc_les_callback_2d(void)
Allocate the structure holding the callback function.
int N_copy_gradient_3d(N_gradient_3d *source, N_gradient_3d *target)
copy a N_gradient_3d structure
Definition: n_gradient.c:214
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)...
Gradient between the cell neighbours in X, Y and Z direction.
Definition: N_pde.h:502
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...
Definition: n_les.c:51
N_array_3d * z_array
Definition: N_pde.h:537
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
Gradient between the cell neighbours in X direction.
Definition: N_pde.h:468
double W_T
Definition: N_pde.h:278
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.
Definition: n_gradient.c:424
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...
Definition: n_les.c:67
void N_put_array_3d_d_value(N_array_3d *data, int col, int row, int depth, double value)
Writes a double value to the N_array_3d struct at position col, row, depth.
Definition: n_arrays.c:1175
double N_calc_quad_mean_n(double *a, int size)
Calculate the quadratic mean of the values in vector a of size n.
Definition: n_tools.c:189
double N_exp_upwinding(double sprod, double distance, double D)
exponential upwinding stabilization algorithm
Definition: n_upwind.c:63
N_gradient_neighbours_y * yt
Definition: N_pde.h:509
FCELL * fcell_array
Definition: N_pde.h:138
int N_get_array_3d_type(N_array_3d *array)
Return the data type of the N_array_3d.
Definition: n_arrays.c:809
N_data_star * N_alloc_7star(void)
allocate a 7 point star data structure
void N_free_gradient_neighbours_3d(N_gradient_neighbours_3d *grad)
Free&#39;s a N_gradient_neighbours_3d structure.
Definition: n_gradient.c:796
double Az
Definition: N_pde.h:113
G_math_spvector ** Asp
Definition: N_pde.h:77
void N_set_les_callback_2d_func(N_les_callback_2d *data, N_data_star *(*callback_func_2d)())
Set the callback function which is called while assembling the les in 2d.
void N_print_array_2d_info(N_array_2d *data)
This function writes the data info of the array data to stdout.
Definition: n_arrays.c:611
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_alloc_27star(void)
allocate a 27 point star data structure
void N_free_gradient_neighbours_x(N_gradient_neighbours_x *grad)
Free&#39;s a N_gradient_neighbours_x structure.
Definition: n_gradient.c:307
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.
Definition: n_arrays_io.c:253
DCELL * dcell_array
Definition: N_pde.h:139
N_les * N_alloc_les_param(int cols, int rows, int type, int parts)
Allocate memory for a quadratic or not quadratic linear equation system.
Definition: n_les.c:178
int N_is_array_2d_value_null(N_array_2d *data, int col, int row)
Returns 1 if the value of N_array_2d struct at position col, row is of type null, otherwise 0...
Definition: n_arrays.c:231
int N_copy_gradient_neighbours_x(N_gradient_neighbours_x *source, N_gradient_neighbours_x *target)
copy a N_gradient_neighbours_x structure
Definition: n_gradient.c:360
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...
Definition: n_les.c:35
double N_norm_array_3d(N_array_3d *a, N_array_3d *b, int type)
Calculate the norm of the two input arrays.
N_les * N_alloc_les_A(int rows, int type)
Allocate memory for a quadratic linear equation system which includes the Matrix A.
Definition: n_les.c:130
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)
Assemble a linear equation system (les) based on 3d location data (g3d) active cells.
int cols
Definition: N_pde.h:117
Gradient between the cells in X, Y and Z direction.
Definition: N_pde.h:416
int type
Definition: N_pde.h:274
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.
Definition: n_geom.c:192
#define SE
Definition: dataquad.h:32
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.
Definition: n_gradient.c:630
double N_calc_arith_mean(double a, double b)
Calculate the arithmetic mean of values a and b.
Definition: n_tools.c:33
double N_norm_array_2d(N_array_2d *a, N_array_2d *b, int type)
Calculate the norm of the two input arrays.
N_gradient_neighbours_y * N_alloc_gradient_neighbours_y(void)
Allocate a N_gradient_neighbours_y structure.
Definition: n_gradient.c:386
float * fcell_array
Definition: N_pde.h:171
float FCELL
Definition: gis.h:582
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...
Definition: n_gradient.c:702
void N_calc_gradient_field_3d_stats(N_gradient_field_3d *field)
Calculate basic statistics of a gradient field.
int planimetric
Definition: N_pde.h:105
N_geom_data * N_alloc_geom_data(void)
Allocate the pde geometry data structure and return a pointer to the new allocated structure...
Definition: n_geom.c:30
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.
Definition: n_arrays_io.c:385
double * dcell_array
Definition: N_pde.h:172
int type
Definition: N_pde.h:133
N_gradient_field_2d * N_alloc_gradient_field_2d(int cols, int rows)
Allocate a N_gradient_field_2d.
Definition: n_gradient.c:920
void N_free_gradient_neighbours_z(N_gradient_neighbours_z *grad)
Free&#39;s a N_gradient_neighbours_z structure.
Definition: n_gradient.c:498
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 pr...
int cols
Definition: N_pde.h:79
CELL N_get_array_2d_c_value(N_array_2d *data, int col, int row)
Returns the value of type CELL at position col, row.
Definition: n_arrays.c:314
void N_free_geom_data(N_geom_data *geom)
Release memory of a pde geometry data structure.
Definition: n_geom.c:50
void N_free_gradient_2d(N_gradient_2d *grad)
Free&#39;s a N_gradient_2d structure.
Definition: n_gradient.c:42
int CELL
Definition: gis.h:580
double * area
Definition: N_pde.h:106
N_array_3d * x_array
Definition: N_pde.h:535
void N_set_les_callback_3d_func(N_les_callback_3d *data, N_data_star *(*callback_func_3d)())
Set the callback function which is called while assembling the les in 3d.
void N_put_array_2d_d_value(N_array_2d *data, int col, int row, DCELL value)
Writes a DCELL value to the N_array_2d struct at position col, row.
Definition: n_arrays.c:584
double WC
Definition: N_pde.h:411
void N_write_array_2d_to_rast(N_array_2d *array, char *name)
Write a N_array_2d struct to a raster map.
Definition: n_arrays_io.c:173
struct Option * N_define_standard_option(int opt)
Create standardised Option structure related to the gpde library.
Structure that stores option information.
Definition: gis.h:509
N_gradient_neighbours_x * xc
Definition: N_pde.h:506
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_calc_array_3d_stats(N_array_3d *a, double *min, double *max, double *sum, int *nonull, int withoffset)
Calculate basic statistics of the N_array_3d struct.
double * b
Definition: N_pde.h:75
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)
Assemble a linear equation system (les) based on 2d location data (raster) and active 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 *call, int cell_type)
Assemble a linear equation system (les) based on 3d location data (g3d)
void N_put_array_3d_value(N_array_3d *data, int col, int row, int depth, char *value)
This function writes a value to the N_array_3d data at position col, row, depth.
Definition: n_arrays.c:1021
int N_copy_gradient_neighbours_2d(N_gradient_neighbours_2d *source, N_gradient_neighbours_2d *target)
copy a N_gradient_neighbours_2d structure
Definition: n_gradient.c:663
N_gradient_neighbours_y * yc
Definition: N_pde.h:510
double N_calc_harmonic_mean(double a, double b)
Calculate the harmonical mean of values a and b.
Definition: n_tools.c:119
callback structure for 3d matrix assembling
Definition: N_pde.h:286
N_array_3d * N_math_array_3d(N_array_3d *a, N_array_3d *b, N_array_3d *result, int type)
Perform calculations with two input arrays, the result is written to a third array.
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.
Definition: n_arrays.c:378
Gradient between the cell neighbours in Y direction.
Definition: N_pde.h:476
float mean(IClass_statistics *statistics, int band)
Helper function for computing mean.
double W
Definition: N_pde.h:276
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 ...
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.
Definition: n_geom.c:73
const char * name
Definition: named_colr.c:7
double dx
Definition: N_pde.h:109
int rows
Definition: N_pde.h:78
N_gradient_neighbours_x * x
Definition: N_pde.h:495
void N_free_array_3d(N_array_3d *data)
Release the memory of a N_array_3d.
Definition: n_arrays.c:780
int N_copy_gradient_2d(N_gradient_2d *source, N_gradient_2d *target)
copy a N_gradient_2d structure
Definition: n_gradient.c:85
N_gradient_2d * N_create_gradient_2d(double NC, double SC, double WC, double EC)
allocate and initialize a N_gradient_2d structure
Definition: n_gradient.c:60
void N_free_gradient_field_2d(N_gradient_field_2d *field)
Free&#39;s a N_gradient_neighbours_2d structure.
Definition: n_gradient.c:944
int type
Definition: N_pde.h:167
int rows_intern
Definition: N_pde.h:169
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_callback_template_3d(void *data, N_geom_data *geom, int col, int row, int depth)
A callback template creates a 7 point star structure.
The linear equation system (les) structure.
Definition: N_pde.h:72
N_array_2d * x_array
Definition: N_pde.h:523
int rows
Definition: N_pde.h:168
int type
Definition: N_pde.h:81
double N_full_upwinding(double sprod, double distance, double D)
full upwinding stabilization algorithm
Definition: n_upwind.c:33
int rows_intern
Definition: N_pde.h:135
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...
Definition: n_gradient.c:248
int N_is_array_3d_value_null(N_array_3d *data, 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...
Definition: n_arrays.c:881
void N_get_array_3d_value(N_array_3d *data, 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...
Definition: n_arrays.c:829
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
Definition: n_gradient.c:187
double N_calc_arith_mean_n(double *a, int size)
Calculate the arithmetic mean of the values in vector a of size n.
Definition: n_tools.c:53