cape.pyover.case
: OVERFLOW case control module¶
This module contains the important function run_overflow()
, which
actually runs overrunmpi
or whichever executable is specified by the
user, along with the utilities that support it.
It also contains OVERFLOW-specific versions of some of the generic
methods from cape.cfdx.case
. For instance the function
GetCurrentIter()
determines how many OVERFLOW iterations have been
run in the current folder, which is obviously a solver-specific task. It
also contains the function LinkQ()
and LinkX()
which creates
links to fixed file names from the most recent output created by
OVERFLOW, which is useful for creating simpler Tecplot layouts, for
example.
All of the functions from cape.case
are imported here. Thus they
are available unless specifically overwritten by specific
cape.pyover
versions.
- class cape.pyover.casecntl.CaseRunner(fdir: str | None = None)¶
- finalize_files(j: int)¶
Clean up files after running one cycle of phase j
- Call:
>>> runner.finalize_files(j)
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- j:
int
Phase number
- runner:
- Versions:
2016-04-14
@ddalle
: v1.0 (FinalizeFiles
)
- find_surf_source() MeshFileMeta ¶
Find latest available files with surface data
- Call:
>>> typ, x, q = runner.find_surf_source()
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- runner:
- Outputs:
- Versions:
2025-08-16
@ddalle
: v1.0
- genr8_resid_args() tuple ¶
Get list of args to
CaseResid
- Call:
>>> args = runner.genr8_resid_args()
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- runner:
- Outputs:
- Versions:
2025-09-16
@ddalle
: v1.0
- get_dex_args_pre_fm() tuple ¶
Get list of args prior to component name in
CaseFM
- Call:
>>> args = runner.get_dex_args_pre_fm()
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- runner:
- Outputs:
- Versions:
2025-08-08
@ddalle
: v1.0
- get_dex_iter_lineload(comp: str) int ¶
Get number of iterations for
"LineLoad"
comp- Call:
>>> n = runner.get_dex_iter_lineload()
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- comp:
str
Name of DataBook component
- runner:
- Outputs:
- n:
int
Iteration count
- n:
- Versions:
2025-08-12
@ddalle
: v1.0
- get_dex_iter_triqfm(comp: str) int ¶
Get number of iterations for
"TriqFM"
comp- Call:
>>> n = runner.get_dex_iter_triqfm()
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- comp:
str
Name of DataBook component
- runner:
- Outputs:
- n:
int
Iteration count
- n:
- Versions:
2025-08-13
@ddalle
: v1.0
- get_dex_nstats_lineload(comp: str) int ¶
Get window size for a
"LineLoad"
DataBook component- Call:
>>> n = db.get_dex_nstats_lineload(comp)
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- comp:
str
Name of DataBook component
- runner:
- Outputs:
- n:
int
Iterations/timesteps included in averaging window
- n:
- Versions:
2025-08-12
@ddalle
: v1.0
- get_grid_regex() str ¶
Return regular expression for volume grid files
- Call:
>>> pat = runner.get_grid_regex()
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- runner:
- Outputs:
- pat:
str
Regular expression search pattern
- pat:
- Versions:
2025-08-16
@ddalle
: v1.0
- get_prefix(j=None)¶
Read OVERFLOW file prefix
- Call:
>>> rname = runner.get_prefix(j=None)
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- j: {
None
} |int
Phase number
- runner:
- Outputs:
- rname:
str
Project prefix
- rname:
- Versions:
2016-02-01
@ddalle
: v1.0 (GetPrefix
)2023-07-08
@ddalle
: v1.1; instance method
- get_stop_iter()¶
Get iteration at which to stop by reading
STOP
fileIf the file exists but is empty, returns
0
; if file does not exist, returnsNone
; and otherwise reads the iteration- Call:
>>> qstop, nstop = runner.get_stop_iter()
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- runner:
- Outputs:
- nstop:
int
|None
Iteration at which to stop, if any
- nstop:
- Versions:
2017-03-07
@ddalle
: v1.0 (GetStopIter
)2023-07-08
@ddalle
: v1.1; instance method
- get_surf_regex()¶
Get regular expression that all surface output files match
- Call:
>>> regex = runner.get_surf_regex()
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- runner:
- Outputs:
- regex:
str
Regular expression that all surface sol’n files match
- regex:
- Versions:
2025-01-24
@ddalle
: v1.0
- get_surfgrid_regex()¶
Return regular expression for surface grid files
- Call:
>>> pat = runner.get_surfgrid_regex()
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- runner:
- Outputs:
- pat:
str
Regular expression search pattern
- pat:
- Versions:
2025-08-16
@ddalle
: v1.0
- get_vol_regex() str ¶
Get regular expression that all volume output files match
- Call:
>>> regex = runner.get_vol_regex()
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- runner:
- Outputs:
- regex:
str
Regular expression that all surface sol’n files match
- regex:
- Versions:
2025-08-13
@ddalle
: v1.0
- getx_history_iter()¶
Get the most recent iteration number for a history file
This function uses the last line from the file
run.resid
- Call:
>>> n = runner.getx_history_iter()
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- runner:
- Outputs:
- Versions:
2016-02-01
@ddalle
: v1.0 (GetHistoryIter
)2023-07-08
@ddalle
: v1.1; instance method
- getx_iter()¶
Get the most recent iteration number for OVERFLOW case
- Call:
>>> n = runner.getx_iter()
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- runner:
- Outputs:
- n:
int
|None
Last iteration number
- n:
- Versions:
2015-10-19
@ddalle
: v1.0 (GetCurrentIter
)2023-07-08
@ddalle
: v1.1; instance method
- getx_out_iter()¶
Get the most recent iteration number for a running file
This function uses the last line from the file
resid.out
- Call:
>>> n = runner.getx_out_iter()
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- runner:
- Outputs:
- n:
int
|None
Most recent iteration number
- n:
- Versions:
2016-02-02
@ddalle
: v1.0 (GetOutIter
)2023-07-08
@ddalle
: v1.1; instance method
- getx_phase(n: int)¶
Get the appropriate input number based on results available
- Call:
>>> j = runner.getx_phase(n)
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- n:
int
Iteration number
- runner:
- Outputs:
- j:
int
Most appropriate phase number for a restart
- j:
- Versions:
2014-10-02
@ddalle
: v1.0 (cape.pycart.case
)2015-12-29
@ddalle
: v1.0 (cape.pyfun.case
)2016-02-03
@ddalle
: v1.0 (GetPhaseNumber
)2017-01-13
@ddalle
: v1.1; no fullrun.%02.*
seq2023-07-09
@ddalle
: v1.2; rename, instance method
- getx_restart_iter()¶
Get total iteration number of most recent flow file
- Call:
>>> n = runner.getx_restart_iter()
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- runner:
- Outputs:
- n:
int
Index of most recent check file
- n:
- Versions:
2015-10-19
@ddalle
: v1.0
- getx_running_iter()¶
Get the most recent iteration number for a running file
This function uses the last line from the file
resid.tmp
- Call:
>>> n = runner.getx_running_iter()
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- runner:
- Outputs:
- n:
int
|None
Most recent iteration number
- n:
- Versions:
2016-02-01
@ddalle
: v1.0 (GetRunningIter
)2023-07-08
@ddalle
: v1.2; instance method
- infer_tavg_nstats(n: int | None = None, fname: int | None = None) int ¶
Infer num of iters averaged for output at iteration n
- Call:
>>> nstats = runner.infer_tavg_nstats(n)
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- n:
int
Iteration number
- runner:
- Outputs:
- nstats:
int
Number of iterations averaged in viz file
- nstats:
- Versions:
2025-08-10
@ddalle
: v1.0
- init_post()¶
Custom initialization for
pyover
- Call:
>>> runner.init_post()
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- runner:
- Versions:
2023-07-08
@ddalle
: v1.0
- prep_qvol(subdir: str = 'lineload')¶
Prepare
q.vol
in subdir as link to bestq
vol file- Call:
>>> runner.prep_qvol(subdir="lineload")
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- runner:
- Versions:
2025-08-15
@ddalle
: v1.0
- prepare_triq(subdir: str = 'lineload')¶
Prep
q
andx
files to creategrid.i.triq
This will first identify the most recent source files in the working directory and also run
splitmq
andsplitmx
if so prescribed.- Call:
>>> triqstats = runner.prepare_triq(subdir="lineload")
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- subdir: {
"lineload"
} |str
Name folder to create
grid.i.triq
within
- runner:
- Outputs:
- triqstats:
collections.namedtuple
FileStatus
of.triq
file- triqstats.fname:
"grid.i.triq"
Name of
.triq
file (created or found)- triqstats.n:
int
Iteration number for fname
- triqstats:
- Versions:
2025-08-19
@ddalle
: v1.0
- read_namelist(j=None)¶
Read case namelist file
- Call:
>>> nml = runner.read_namelist(j=None)
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- i: {
None
} | nonnegativeint
Phase number (0-based)
- runner:
- Outputs:
- nml:
OverNamelist
Namelist interface
- nml:
- Versions:
2015-12-29
@ddalle
: v1.0 (cape.pyfun.case
)2015-02-02
@ddalle
: v1.0 (GetNamelist
)2016-12-12
@ddalle
: v1.1; i kwarg2023-07-09
@ddalle
: v1l.1; rename, instance method
- run_phase(j: int)¶
Run one phase using appropriate commands
- Call:
>>> runner.run_phase(j)
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- j:
int
Phase number
- runner:
- Versions:
2023-06-05
@ddalle
: v1.0; fromrun_overflow
2023-07-08
@ddalle
; v1.1; instance method
- splitmq(fsplitmq: str = 'splitmq.i')¶
Run
splitmq
to extract surface and second-layer sol data- Call:
>>> runner.splitmq(fsplitmq="splitmq.i")
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- fsplitmq: {
"splitmq.i"
} |str
Name of input file
- runner:
- Versions:
2025-08-18
@ddalle
: v1.0
- splitmx(fsplitmx: str)¶
Run
splitmx
to extract surface and second-layer grid- Call:
>>> runner.splitmx(fsplitmx="splitmx.i")
- Inputs:
- runner:
CaseRunner
Controller to run one case of solver
- fsplitmx: {
"splitmx.i"
} |str
Name of input file
- runner:
- Versions:
2025-08-18
@ddalle
: v1.0
- write_stop_iter(n=0)¶
Create a
STOP
file and optionally set the stop iteration- Call:
>>> runner.write_stop_iter(n)
- Inputs:
- n:
None
| {0
} | positiveint
Iteration at which to stop; empty file if
0
orNone
- n:
- Versions:
2017-03-07
@ddalle
: v1.0 (WriteStopIter
)2023-06-05
@ddalle
: v2.0; use context manager2023-07-08
@ddalle
: v2.1; rename, instance method
- cape.pyover.casecntl.EditSplitmqI(fin, fout, qin, qout)¶
Edit the I/O file names in a
splitmq
/splitmx
input file
- cape.pyover.casecntl.GetLatest(glb)¶
Get the most recent file matching a glob or list of globs
- cape.pyover.casecntl.GetQ()¶
Find most recent
q.*
file, withq.avg
taking precedence- Call:
>>> fq = GetQ()
- Outputs:
- fq:
None
|str
Name of most recent averaged
q
file or newestq
file
- fq:
- Versions:
2016-12-29
@ddalle
: v1.0
- cape.pyover.casecntl.GetQFile(fqi='q.pyover.p3d')¶
Get most recent OVERFLOW
q
file and its associated iterationsAveraged solution files, such as
q.avg
take precedence.- Call:
>>> fq, n, i0, i1 = GetQFile(fqi="q.pyover.p3d")
- Inputs:
- fqi: {q.pyover.p3d} | q.pyover.avg | q.pyover.vol |
str
Target Overflow solution file after linking most recent files
- fqi: {q.pyover.p3d} | q.pyover.avg | q.pyover.vol |
- Outputs:
- Versions:
2016-12-30
@ddalle
: v1.02017-03-28
@ddalle
: v1.1; from`lineload` to ``case
- cape.pyover.casecntl.GetX()¶
Get the most recent
x.*
file- Call:
>>> fx = GetX()
- Outputs:
- fx:
None
|str
Name of most recent
x.save
or similar file
- fx:
- Versions:
2016-12-29
@ddalle
: v1.0
- cape.pyover.casecntl.LinkLatest(fsrc, fname)¶
Create a symbolic link, but clean up existing links
This prevents odd behavior when using
os.symlink()
when the link already exists. It performs no action (rather than raising an error) when the source file does not exist or isNone
. Finally, if fname is already a full file, no action is taken.
- cape.pyover.casecntl.LinkQ()¶
Link the most recent
q.*
file to a fixed file name- Call:
>>> LinkQ()
- Versions:
2016-09-06
@ddalle
: v1.02016-12-29
@ddalle
: Moved file search toGetQ()
- cape.pyover.casecntl.LinkX()¶
Link the most recent
x.*
file to a fixed file name- Call:
>>> LinkX()
- Versions:
2016-09-06
@ddalle
: v1.0
- class cape.pyover.casecntl.MeshFileMeta(typ, x, q)¶
Class for solution mesh + data file names
- q¶
Alias for field number 2
- typ¶
Alias for field number 0
- x¶
Alias for field number 1
- cape.pyover.casecntl.checkqavg(fname)¶
Check the number of iterations in a
q.avg
fileThis function works by attempting to read a Fortran record at the very end of the file with exactly one (single-precision) integer. The function tries both little- and big-endian interpretations. If both methods fail, it returns
1
to indicate that theq
file is a single-iteration solution.
- cape.pyover.casecntl.checkqt(fname)¶
Check the iteration number or time in a
q
file
- cape.pyover.casecntl.run_overflow()¶
Setup and run the appropriate OVERFLOW command
- Call:
>>> run_overflow()
- Versions:
2016-02-02
@ddalle
: v1.02021-10-08
@ddalle
: v1.12023-07-08
@ddalle
: v2.0; use CaseRunner