cape.pyover.options: OVERFLOW and pyOver Settings

This module provides tools to read, access, modify, and write settings for cape.pyover. The class is based off of the built-int dict class.

In addition, this module controls default values of each pyOver parameter in a two-step process. The precedence used to determine what the value of a given parameter should be is below.

  1. Values directly specified in the input file, pyOver.json

  2. Values specified in the default control file, $PYOVER/settings/pyOver.default.json

  3. Hard-coded defaults from this module

class cape.pyover.options.Options(fname=None, **kw)

Options structure, subclass of dict

Call:
>>> opts = Options(fname=None, **kw)
Inputs:
fname: str

File to be read as a JSON file with comments

kw: dict

Dictionary to be transformed into pyCart.options.Options

Versions:
  • 2014-07-28 @ddalle: First version

get_ALL(i=None)

Return the ALL namelist of settings applied to all grids

Call:
>>> d = opts.get_ALL(i=None)
Inputs:
opts: pyOver.options.Options

Options interface

i: int or None

Phase number

Outputs:
d: pyOver.options.odict

ALL namelist

Versions:
  • 2016-02-01 @ddalle: First version

get_ConfigDir(config=None)

Get configuration directory containing mesh files

Call:
>>> fdir = opts.get_ConfigDir()
>>> fdir = opts.get_ConfigDir(config)
Inputs:
opts: pyOver.options.Options

Options interface

config: str

Name of configuration to use (optional)

Outputs:
fdir: str

Configuration directory

Versions:
  • 2016-02-02 @ddalle: First version

get_DataBook_QIn(comp)

Get the input q file for a databook component

Call:
>>> fq = opts.get_DataBook_QIn(comp)
Inputs:
opts: pyOver.options.Options

Options interface

comp: str

Name of line load data book component

Outputs:
fq: {"q.pyover.p3d"} | str

Name of input Overflow solution file

Versions:
  • 2017-01-10 @ddalle: First version

get_DataBook_QOut(comp)

Get the preprocessed q file for a databook component

Call:
>>> fq = opts.get_DataBook_QOut(comp)
Inputs:
opts: pyOver.options.Options

Options interface

comp: str

Name of line load data book component

Outputs:
fq: {None} | "q.pyover.srf" | str

Name of output Overflow solution file

Versions:
  • 2017-01-10 @ddalle: First version

get_DataBook_QSurf(comp)

Get the preprocessed q.srf file name for a databook component

Call:
>>> fq = opts.get_DataBook_QSurf(comp)
Inputs:
opts: pyOver.options.Options

Options interface

comp: str

Name of line load data book component

Outputs:
fq: None | {"q.pyover.srf"} | str

Name of output Overflow surface solution file

Versions:
  • 2017-01-10 @ddalle: First version

get_DataBook_XIn(comp)

Get the input x file for a databook component

Call:
>>> fx = opts.get_DataBook_XIn(comp)
Inputs:
opts: pyOver.options.Options

Options interface

comp: str

Name of line load data book component

Outputs:
fx: {"x.pyover.p3d"} | str

Name of input Overflow grid file

Versions:
  • 2017-01-10 @ddalle: First version

get_DataBook_XOut(comp)

Get the input x file for a databook component

Call:
>>> fx = opts.get_DataBook_XOut(comp)
Inputs:
opts: pyOver.options.Options

Options interface

comp: str

Name of line load data book component

Outputs:
fx: {None} | "x.pyover.srf" | str

Name of output Overflow grid file

Versions:
  • 2017-01-10 @ddalle: First version

get_DataBook_XSurf(comp)

Get the input x.srf file for a databook component

Call:
>>> fx = opts.get_DataBook_XSurf(comp)
Inputs:
opts: pyOver.options.Options

Options interface

comp: str

Name of line load data book component

Outputs:
fx: None | {"x.pyover.srf"} | str

Name of output Overflow grid file

Versions:
  • 2017-01-10 @ddalle: First version

get_DataBook_fomo(comp)

Get path to mixsur output files

If each of the following files is found, there is no need to run mixsur, and files are linked instead.

  • grid.i.tri

  • grid.bnd

  • grid.ib

  • grid.ibi

  • grid.map

  • grid.nsf

  • grid.ptv

  • mixsur.fmp

Call:
>>> fdir = opts.get_DataBook_fomo(comp)
Inputs:
opts: pyOver.options.Options

Options interface

comp: str

Name of line load data book component

Outputs:
fdir: {None} | str

Path to mixsur output files

Versions:
  • 2017-01-11 @ddalle: First version

get_DataBook_mixsur(comp)

Get the mixsur or overint input file for a databook component

Call:
>>> fname = opts.get_DataBook_mixsur(comp)
Inputs:
opts: pyOver.options.Options

Options interface

comp: str

Name of line load data book component

Outputs:
fname: str

Name of mixsur input file template

Versions:
  • 2016-12-29 @ddalle: First version

get_DataBook_splitmq(comp)

Get the splitmq input file for a databook component

Call:
>>> fname = opts.get_DataBook_splitmq(comp)
Inputs:
opts: pyOver.options.Options

Options interface

comp: str

Name of line load data book component

Outputs:
fname: str

Name of splitmq input file template

Versions:
  • 2016-12-29 @ddalle: First version

get_DataBook_usurp(comp)

Get the mixsur input file for use with usurp

Call:
>>> fname = opts.get_DataBook_usurp(comp)
Inputs:
opts: pyOver.options.Options

Options interface

comp: str

Name of line load data book component

Outputs:
fname: str

Name of mixsur input file template

Versions:
  • 2017-04-06 @ddalle: First version

get_FLOINP(i=None)

Return the FLOINP namelist

Call:
>>> d = opts.get_raw_grid(i=None)
Inputs:
opts: pyFun.options.Options

Options interface

i: int or None

Run sequence index

Outputs:
d: pyOver.options.odict

Flow inputs namelist

Versions:
  • 2016-02-01 @ddalle: First version

get_GLOBAL(i=None)

Return the GLOBAL namelist

Call:
>>> d = opts.get_GLOBAL(i=None)
Inputs:
opts: pyOver.options.Options

Options interface

i: int or None

Run sequence index

Outputs:
d: pyOver.options.odict

GLOBAL namelist

Versions:
  • 2016-02-01 @ddalle: First version

get_GridByName(grdnam, i=None)

Return a dictionary of options for a specific grid

Call:
>>> d = opts.get_GridByName(grdnam, i=None)
Inputs:
opts: :class;`pyOver.options.Options`

Options interface

grdnam: str | int

Name or number of grid to alter

i: int or None

Phase number

Outputs:
d: pyOver.options.odict

Dictionary of options for grid gridnam

Versions:
  • 2016-02-01 @ddalle: First version

get_GridKey(grdnam, sec, key, i=None)

Select a grid option

If the option is not found for grid gridnam, default to the value in the "ALL" section

Call:
>>> val = opts.get_GridKey(grdnam, sec, key, i=None)
Inputs:
opts: pyOver.options.Options

Options interface

sec: str

Section name

key: str

Variable name

i: int or None

Phase number

Versions:
  • 2016-02-01 @ddalle: First version

get_GroupMesh()

Determine whether or not groups have common meshes

Call:
>>> qGM = opts.get_GroupMesh()
Inputs:
opts pyCart.options.Options

Options interface

Outputs:
qGM: bool

True all cases in a group use the same (starting) mesh

Versions:
  • 2014-10-06 @ddalle: First version

get_MeshCopyFiles(config=None)

Return the names of mesh files to copy

Call:
>>> fmsh = opts.get_MeshCopyFiles()
Inputs:
opts: pyOver.options.Options

Options interface

config: str

Name of configuration to use (optional)

Outputs:
fmsh: list[str]

List of mesh file names to be copied to each case folder

Versions:
  • 2016-02-01 @ddalle: First version

get_MeshFiles(config=None)

Return the original mesh file names

Call:
>>> fname = opts.get_MeshFiles(i=None)
Inputs:
opts: pyOver.options.Options

Options interface

config: str

Name of configuration to use (optional)

Outputs:
fname: str | list[str]

Mesh file name or list of files

Versions:
  • 2015-12-29 @ddalle: First version

get_MeshLinkFiles(config=None)

Return the names of mesh files to link

Call:
>>> fmsh = opts.get_MeshLinkFiles()
Inputs:
opts: pyOver.options.Options

Options interface

config: str

Name of configuration to use (optional)

Outputs:
fmsh: list[str]

List of mesh file names to be copied to each case folder

Versions:
  • 2016-02-01 @ddalle: First version

get_MeshType(config=None)

Get configuration directory containing mesh files

Call:
>>> ftyp = opts.get_ConfigDir()
>>> ftyp = opts.get_ConfigDir(config)
Inputs:
opts: pyOver.options.Options

Options interface

config: str

Name of configuration to use (optional)

Outputs:

ftyp: str | {dcf} | peg5

Versions:
  • 2016-02-02 @ddalle: First version

get_OverNamelist(j=None)

Return the name of the master over.namelist file

Call:
>>> fname = opts.get_OverNamelist()
Inputs:
opts: pyOver.options.Options

Options interface

Outputs:
fname: str

Name of OVERFLOW namelist template file

Versions:
  • 2016-02-01 @ddalle: First version

get_Prefix(j=None)

Get the project rootname, or file prefix

Call:
>>> fpre = opts.get_Prefix()
Inputs:
opts: pyOver.options.Options

Options interface

Outputs:
fpre: str

Name of OVERFLOW prefix

Versions:
  • 2016-02-01 @ddalle: First version

get_grid_var(grdnam, sec, key, i=None)

Select a namelist key from a specified section

Roughly, this returns opts[sec][key].

Call:
>>> val = opts.get_grid_var0(sec, key, i=None)
Inputs:
opts: pyOver.options.Options

Options interface

sec: str

Section name

key: str

Variable name

i: int or None

Phase number

Outputs:
val: int | float | str | list

Value from JSON options

Versions:
  • 2016-02-01 @ddalle: First version

get_namelist_var(sec, key, i=None)

Select a namelist key from a specified section

Roughly, this returns opts[sec][key].

Call:
>>> val = opts.get_namelist_var(sec, key, i=None)
Inputs:
opts: pyOver.options.Options

Options interface

sec: str

Section name

key: str

Variable name

i: int or None

Phase number

Outputs:
val: int | float | str | list

Value from JSON options

Versions:
  • 2015-10-19 @ddalle: First version

  • 2016-02-01 @ddalle: Copied from pyFun

get_overrun_args(j=None)

Get extra arguments to overrun_cmd

Call:
>>> fargs = opts.get_overrun_args(i)
Inputs:
opts: pyOver.options.Options

Options interface

i: int | None

Phase number

Outputs:
fargs: str

Extra command-line arguments/flags

Versions:
  • 2016-02-02 @ddalle: First version

get_overrun_aux(j=None)

Get auxiliary command-line inputs to overrun

Call:
>>> aux = opts.get_overrun_aux(i=None)
Inputs:
opts: pyOver.options.Options

Options interface

i: int

Phase number

Outputs:
aux: str

String to be given with -aux flag

Versions:
  • 2016-02-01 @ddalle: First version

get_overrun_cmd(j=None)

Get the name of the OVERFLOW binary to run

Call:
>>> fcmd = opts.get_overrun_cmd(i)
Inputs:
opts: pyOver.options.Options

Options interface

i: int | None

Phase number

Outputs:
fcmd: str

Name of the command-line function to use

Versions:
  • 2016-02-01 @ddalle: First version

get_overrun_kw(j=None)

Get other inputs to overrun

Call:
>>> kw = opts.get_overrun_kw(i=None)
Inputs:
opts: pyOver.options.Options

Options interface

i: int

Phase number

Outputs:
kw: dict

Dictionary of additional arguments to overrun

Versions:
  • 2016-02-01 @ddalle: First version

get_overrun_nthreads(j=None)

Get number of OpenMP threads for overrunmpi

Call:
>>> nt = opts.get_overrun_nthreads(i=None)
Inputs:
opts: pyOver.options.Options

Options interface

i: int | None

Phase number

Outputs:
nt: {None} | int > 0

Number of OpenMP threads

Versions:
  • 2017-04-27 @ddalle: First version

select_namelist(i=None)

Reduce namelist options to a single instance (i.e. sample lists)

Call:
>>> d = opts.select_namelist(i)
Inputs:
opts: pyOver.options.Options

Options interface

i: int or None

Phase number

Outputs:
d: pyOver.options.odict

Project namelist

Versions:
  • 2015-10-18 @ddalle: First version

  • 2016-02-01 @ddalle: Copied from pyFun

set_GroupMesh(qGM=False)

Specify that groups do or do not use common meshes

Call:
>>> opts.get_GroupMesh(qGM)
Inputs:
opts pyCart.options.Options

Options interface

qGM: bool

True all cases in a group use the same (starting) mesh

Versions:
  • 2014-10-06 @ddalle: First version