AdH Kraken 0.0.0
Next generation Adaptive Hydraulics
Loading...
Searching...
No Matches
sdvar.h
1#ifndef H_SDVAR_
2#define H_SDVAR_
3
4//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/
5//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/
6
7typedef struct {
8 int n; // the number of active dependent variables
9 int var[N_DVARS]; // position in array form
10 bool print_flag[N_DVARS]; // true if the variable is output
12
13//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/
14//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/
15typedef struct {
16
17 // node-based variables
18 int n_dvar; // number of active dependent variables
19 int nnode_dvar; // number of active nodes
20 SDVAR_POSITION sdvar_pos_node; // variable positions in matrix
21 double **nodal_dvar; // [n_dvar][nnode_dvar]
22
23 // element-based surface water variables
24 int n_dvar_elem_dbl;
25 int n_dvar_elem_int;
26 int nelem_dvar;//number of active elements
27 SDVAR_POSITION sdvar_pos_elem_dbl;
28 SDVAR_POSITION sdvar_pos_elem_int;
29 double **elem_dvar;//[n_dvar_elem_dbl][nelem_dvar]
30 int **elem_flags;//[n_dvar_elem_int][nelem_dvar]
31
32 //maps
33 int *dvar_node_map; //[nnode] array goes NodeID->index within nodal_dvar
34 int *dvar_active; //n_dvar array that has the NodeID, convenient for printing out stuff
35 int *dvar_elem_map; //nelem array takes elem # -> index within elem_var
36
37} SDVAR;
38
39//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/
40//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/
41
43void sdvar_position_printScreen(SDVAR_POSITION *dp);
44void sdvar_alloc_init(SDVAR *sdvar, int nnode, int n_dvar, int n_dvar_elem_dbl, int n_dvar_elem_int, int nnode_dvar, int nelem_dvar);
45#endif
46
void sdvar_position_init(SDVAR_POSITION *dp)
Initializes a SDVAR instance.
Definition: sdvar.c:24
void sdvar_alloc_init(SDVAR *sdvar, int nnode, int n_dvar, int n_dvar_elem_dbl, int n_dvar_elem_int, int nnode_dvar, int nelem_dvar)
Allocates and initializes a SDVAR dependent variable structure.
Definition: sdvar.c:61
Definition: sdvar.h:7
Definition: sdvar.h:15