next up previous [pdf]

Next: Field allocation Up: Structures and Interfaces Previous: Structures and Interfaces

Fields

The top level data structure characterizing an application implemented in IWAVE is a list of field keywords and other attributes. Each field gets a keyword, acting as a mnemonic index for internal and external reference. Fields are dynamic or static, and may be primal or dual in each coordinate axis: ``dual'' here refers to the grid, so dual fields represent values assigned to edges, faces, or volumes, rather than grid vertices (nodes). IWAVE encodes these boolean attributes as 0's or 1's. Finally, a bit of information about the scheme intrudes: each dynamic field is updated in one of the (sub)steps of a (possibly) multistep method, and for that substep, and that substep only, needs ghost cell data exchanged.

The FIELD struct containing this information is organized in the order

For instance, a $ (z,x)$ stress component field for a staggered grid elastic finite difference method is a dynamic fielld, representing a grid sampled centered in the $ (z,x)$ faces of the grid cells, and updated in second substep of each time step Moczo et al. (2006). The FIELD struct
{"szx", 1, 1, {1, 1, 0}}
captures this information (here coordinate order is $ (z,x,y)$ ).. Note that the only arbitrary choice here is the keyword string. The choice of keyword for each field must be consistent throughout the code.

The distinction between static and dynamic fields is more than a convenience. Static fields, representing the coefficients of the model differential equations, must exist in the simulation environment prior to simulation, in some form of persistent store. Simulation input and output fields, defined below, must also exist as persistent store prior to simulation. The current implementation of IWAVE presumes that ``persistent store'' is a synonym for ``disk file'', however the logic is simply that the data for these fields should exist outside of the simulation scope. Future versions of IWAVE may accommodate distributed data as persistent store, for instance. Dynamic fields exist only within the scope of the simulation: IWAVE creates and destroys them in the course of a run.

By convention, the first field listed in the application FIELD array is the source of the primary simulation grid, to which all other grids are referenced. Since this information will need to enter the compuation via i/o, this first field should be static (i.e. a coefficient), which will exist in the simulation environment prior to execution of the application.

The static array iwave_fields data member of the IWaveInfo class lists the static and dynamic fields of an IWAVE application and their top-level attributes using the FIELD struct explained above. Being static, iwave_fields must be initialized once, and only once, somewhere in global namespace. That is, the application author must supply a definition

iwave_fields = { ... };
somewhere - the preferred location for this definition is in the model definition header file containing the other required definition to be reviewed below. This model definition file should be included only in main program source files, as its static declarations must appear only once in program text.


next up previous [pdf]

Next: Field allocation Up: Structures and Interfaces Previous: Structures and Interfaces

2015-04-20