create interp


The page defines the application programing interface specification for the interp operation.



The command line interface for the interp catagory of operations is:

usage: flashkit create interp BASENAME [--step INT] [<opt>...] [<flg>...]
Create an initial flow field (block) using interpolated simulation data.

arguments:  
BASENAME    Basename for flash simulation, will be guessed if not provided
            (e.g., INS_LidDr_Cavity for files INS_LidDr_Cavity_hdf5_plt_cnt_xxxx)

options:
-D, --ndim     INT   Number of simulation dimensions (i.e., 2 or 3); defaults to 2.
-X, --nxb      INT   Number of grid points per block in the i direction; defaults to 64.
-Y, --nyb      INT   Number of grid points per block in the j direction; defaults to 64.
-Z, --nzb      INT   Number of grid points per block in the k direction; defaults to 64.
-i, --iprocs   INT   Number of blocks in the i direction; defaults to 1.
-j, --jprocs   INT   Number of blocks in the j direction; defaults to 1.
-k, --kprocs   INT   Number of blocks in the k direction; defaults to 1.
-l, --fields   DICT  Key/value pairs for final fields (e.g., <velx=facex,...>); defaults are
                         {'velx': 'facex', 'vely': 'facey', 'velz': 'facez', 'temp': 'center'}.
-m, --fsource  DICT  Key/value pairs for source fields (e.g., <velx=(cc_u,center),...>); defaults to FIELDS.
-f, --step     INT   File number (e.g., <1,3,5,7,9>) of source timeseries output.
-g, --grid   STRING  Grid file(s) name follower; defaults to '_hdf5_grd_'.
-c, --plot   STRING  Plot/Checkpoint file(s) name follower; defaults to '_hdf5_plt_cnt_'.
-q, --force  STRING  Plot/Checkpoint file(s) substring to ignore; defaults to 'forced'.
-p, --path     PATH  Path to source files used in some initialization methods (e.g., python); defaults to cwd.
-d, --dest     PATH  Path to intial block hdf5 file; defaults to cwd.

flags:
-A, --auto           Force behavior to attempt guessing BASENAME and [--step INT].
-B, --find           Force behavior to attempt guessing [--step INT].
-F, --nofile         Do not write the calculated coordinates to file. 
-R, --result         Return the calculated fields by block on root. 
-I, --ignore         Ignore configuration file provided arguments, options, and flags.
-O, --options        Show the available options (i.e., defaults and config file format) and exit.
-h, --help           Show this message and exit.

notes:  If neither BASENAME nor -f is specified, the --path will be searched for FLASH simulation
        files and the last such file (in sorted order) identified will be used.
        This function reads grid data from an hdf5 file (i.e., must run <flashkit create grid> first).

Please consult the discussion on command line syntax for help in formating the above options (e.g., LIST or DICT).



The python interface for the interp operation is accessed with the following code:

from flashkit import flash
...
flash.create.interp(option=value, flag=True, ...)

The python interface specification for interp is as follows:

interp(**arguments: Any) None

Python application interface for using interpolation to create an initial block file.

This method creates an HDF5 file associated with the desired intial flow specification (by interpolating from another simulation output), suitable for input by the FLASH application at runtime.

Keyword Arguments
  • ndim (int) – Number of final simulation dimensions (i.e., 2 or 3).

  • nxb (int) – Number of final grid points per block in the i direction.

  • nyb (int) – Number of final grid points per block in the j direction.

  • nzb (int) – Number of final grid points per block in the k direction.

  • iprocs (int) – Number of final blocks in the i direction.

  • jprocs (int) – Number of final blocks in the j direction.

  • kprocs (int) – Number of final blocks in the k direction.

  • fields (dict) – Key/value pairs for final fields (e.g., {‘velx’: ‘facex’, …})

  • fsource (dict) – Key/value pairs for source fields (e.g., {‘velx’: (‘cc_u’, ‘center’), …}).

  • basename (str) – Basename for flash simulation, will be guessed if not provided (e.g., INS_LidDr_Cavity for files INS_LidDr_Cavity_hdf5_plt_cnt_xxxx)

  • step (int) – File number (e.g., <1,3,5,7,9>) of source timeseries output.

  • plot (str) – Plot/Checkpoint source file name follower.

  • grid (str) – Grid source file name follower.

  • force (str) – Plot/Checkpoint file(s) substring to ignore.

  • path (str) – Path to source timeseries hdf5 simulation output files.

  • dest (str) – Path to final grid and block hdf5 files.

  • auto (bool) – Force behavior to attempt guessing BASENAME and [–step INT].

  • find (bool) – Force behavior to attempt guessing [–step INT].

  • nofile (bool) – Do not write the calculated fields by block to file.

  • result (bool) – Return the calculated fields by block on root.

  • ignore (bool) – Ignore configuration file provided arguments, options, and flags.

Note

By default this function reads the grid data from the hdf5 file (i.e., must run create.grid() first); optionally you can provide the result from grid creation directly by using an optional keyword – coords: (ndarray, …).



The complete specification of library defaults values (as shown above) and mappings is as follows:

The following library defaults are provided for flashkit create interp:

Options          Default Values
-------          --------------
fields           {'velx': 'facex', 'vely': 'facey', 'velz': 'facez', 'temp': 'center'}
grid             _hdf5_grd_
force            forced
plot             _hdf5_plt_cnt_
iprocs           1
jprocs           1
kprocs           1
dest             --
path             --
nofile           False
result           False
ndim             2
nxb              64
nyb              64
nzb              64


The following outlines the general section options, which can be mapped
in the configuration file, that are provided for flashkit create interp:

Options          flash.toml Sections and Options
-------          -------------------------------
grid             [general.files]
                 grid = ...

force            [general.files]
                 forced = ...

plot             [general.files]
                 plot = ...

iprocs           [general.mesh]
                 iprocs = ...

jprocs           [general.mesh]
                 jprocs = ...

kprocs           [general.mesh]
                 kprocs = ...

dest             [general.paths]
                 working = ...

path             [general.paths]
                 working = ...

nofile           [general.pipes]
                 nofile = ...

result           [general.pipes]
                 result = ...

ndim             [general.space]
                 ndim = ...

nxb              [general.space]
                 nxb = ...

nyb              [general.space]
                 nyb = ...

nzb              [general.space]
                 nzb = ...

Please consult the tutorial discussion on configuration file formating for help in specifying the above options in a flash.toml file and what mapping general options are, as well as the full specification on FlashKit library options.