The tGrid Structure
A grid in bamps
refers to a single cell.
It contains both the local solution stored in tArrays, as well as some metadata about its refinement status.
Information pertaining to the grid boundaries are encapsulated in the up to six tBoundary structures.
Members
Metadata
- tHypergrid* hypergrid
-
A pointer to the hypergrid.
- tPatch* patch
-
A pointer to the patch this grid is in.
- int npatch
-
The index of the patch this grid is in.
- int hlevel
-
h-refinement level of this grid. Lowest level is 0.
- int hlflag
-
target h-refinement level as determined by refinement indicator. This data comes from the corresponding tNode of this grid, but is also stored here so it gets transferred properly when grids are exchanged during load balancing.
- int ne_hlflag[6][4]
-
hlflag entries of all possible neighbours of this grid. First index addresses directions, second index addresses neighbours in that direction.
- int* i8s
-
This array of ints contains the h-refinement history of this grid. It contains the child indices of its ancestors, running from 0 to 7 for each level, up to the current level. These numbers are used during coarsening to determine groups of sibling grids. This array is dynamically allocated since the number of h-levels is not known at compile time.
- int plevel
-
The current p-refinement level of this grid
The number representing a p-refinement level does is not identical with the polynomial order of grids on that level. It is simply an index. - tBoundary** boundaries
-
Array of (pointers to) the tBoundary structures belonging to this grid.
- struct tGrid ** neighbors
-
Deprecated.
- int nneighbours
-
Deprecated.
Number of neighbours can be determined by querying the tBoundaries for neighbour grid indices, and counting entries that are not -1. - int ngrid
-
MPI-local index of this grid in the local gridstack.
- int ngrid_global
-
MPI-global index of this grid. This serves as a unique identifier of a grid.
- int filter[3]
-
? Flags determining whether this grid should be filtered in different directions ?
- int troubled
-
Flag showing whether this grid is
"troubled"
as determined by the troubled cell indicator. - int evolve_step
-
Which evolve step the grid is currently at.
- double time
-
What time this grid has been evolve up to.
- double dt
-
Local timestep used to evolve this grid.
- double tstart
-
Initial time of this grid.
- int* output_indices[OTYPENUM]
-
Indices for every type of output.
- int n_output_indices[OTYPENUM]
-
Number of indices for every type of output.
- int nx, ny, nz
-
Number of grid points in x, y, and z direction.
- int nnn
-
Total number of grid points on this grid.
- int nnnv
-
Total number of grid points on the grid, multiplied by the number of variables stored at each point.
- tGridOrientation orientation
-
Orientation of the patch.
- tGridType type
-
Type of this grid.
- int rank
-
MPI rank of this grid.
- int nv
-
Number of variables.
- int nvflux
-
Number of fluxes.
- int nvini
-
Number of initial data variables.
- int nana
-
Number of analysis variables.
- double xmin, xmax, ymin, ymax, zmin, zmax
-
Extent of the grid. Actually related to (u,v,w) coordinates and not (x,y,z).
- double hmin, h1min, h2min, h3min
-
minimal grid spacing in different directions.
Grid Variables
- tArray* adm
-
Pointer to ADM data.
- tArray* ini
-
Pointer to parts of the initial data, used for H phase-in.
- tArray* u
-
Pointer to the evolved data.
- tArray* ustat
-
Pointer to static fields, of which we don’t take derivatives.
- tArray* ru
-
Pointer to computed right hand sides.
- tArray* flux
-
Pointer to computed fluxes (DG).
- tArray* u_prev
-
Deprecated.
- tArray* r
-
Pointer to rhs for time integrators.
- tArray* v, w
-
Pointers to additional storage for Runge-Kutta scheme.
- tArray* ana
-
Pointer to analysis variables (variables not evolved, but derived from th variables in u after each time step).
- tArray* ddd
-
Pointer to derivatives.
- tArray* tmp
-
Pointer to temporary storage.
- tArray** ini_sub, u_sub, ustat_sub, ru_sub, flux_sub, u_prev_sub, r_sub, v_sub, w_sub, ana_sub, ddd_sub
-
Pointers to sub-arrays for individual modules.
- tArray* metric_interface
-
Metric interface. Contains gab and Γabc.
- tArray* matter_interface
-
Matter interface. Contains energy-momentum tensor Tab.
- tArray* df_interface
-
Dual Foliation interface. Contains inverse Jacobian.
- tArray** averages
-
Grid averages of variables, needed for limiters.
- tArray*** sub_averages
-
Sub-averages of variables across the up to 8 octants of the grid.
- int* u_odd_flags_x, u_odd_flags_y, u_odd_flags_z
-
Pointers to the odd flags for physical fields for this grid.
Grid collocation, coordinates, operators
- tArray* ucoord, vcoord, wcoord
-
3d arrays of (u,v,w) coordinates.
- tArray* xcart, ycart, zcart, rcart
-
3d arrays of Cartesian coordinates.
- tArray* J
-
Jacobians (actually the inverse Jacobian!).
- tArray* detJ
-
Determinant of the Jacobian. Needed for volume form.
- tArray* JdetJ
-
Needed for DG to fulfill metric identities.
- tArray* uvw_1d[3]
-
1d arrays of (u,v,w) coordinates.
- tArray* interpolations_weights[3]
-
Interpolation weights for each direction.
- tArray* integration weights[3]
-
Spectral integration weights for each direction.
- tArray* Dx1d, Dy1d. Dz1d
-
1d derivative matrices.
- tArray* amr_c2f[3][2]
-
1d coarse to fine interpolation matrices. First index addresses direction, second index addresses
"left"
or"right"
half target grid. - tArray* amr_f2c[3][2]
-
1d fine to coarse interpolation matrices. Indices as above.
- tArray* DGxMinv, DGyMinv, DGzMinv
-
1d DG mass matrices (inverse).
- tArray* DGxMinvS, DGyMinvS, DGzMinvS
-
1d DG matrices (mass_inv . stiffness).
- tArray* A1d[3]
-
Analysis matrices.
- tArray* S1d[3]
-
Synthesis matrices.
- tArray* F1d[3]
-
Filter matrices.
- tArray* m2v_modal
-
WENO matrices
- tArray* ideal_weights[3]
-
?
- tArray* smoothness_beta
-
?
- int symmetric[3]
-
Deprecated.