cape.pycart.cmdgen
: Create commands for Cart3D executables¶
This module creates system commands as lists of strings for executables
or scripts for Cart3D. It is closely tied to cape.pycart.bin
,
which actually runs the executables.
Commands are created in the form of a list of strings. This is the
format used in the built-in module subprocess
and also with
cape.bin.calli()
. As a very simple example, the system command
"ls -lh"
becomes the list ["ls", "-lh"]
.
Calls to the main Cart3D flow solver via flowCart
or
mpix_flowCart
include a great deal of command-line options. This
module simplifies the creation of this command by determining those
inputs from a cape.pycart.options.Options
or
cape.pycart.options.runctlopts.RunControlOpts
instance.
- cape.pycart.cmdgen.autoInputs(opts=None, j=0, **kw)¶
Interface to Cart3D executable
autoInputs
- Call:
>>> cmd = autoInputs(opts=opts, j=0, **kw)
- Inputs:
- opts:
Options
|dict
Options interface
- j: {
0
} |int
Phase number
- r:
int
Mesh radius
- ftri:
str
Name of surface triangulation file
- maxR:
int
Number of refinements to make
- halfBody:
True
| {False
} Create a half-body mesh that starts at
0
for one axis
symmX
- opts:
- Outputs:
- Versions:
2014-09-02
@ddalle
: v1.02023-08-21
@ddalle
: v1.1; use isolate_subsection()2024-03-05
@ddalle
: v1.2; add -halfBody
- cape.pycart.cmdgen.cubes(opts=None, j=0, **kw)¶
Interface to Cart3D script
cubes
- Call:
>>> cmd = cubes(opts=opts, j=0, **kw)
- Inputs:
- Outputs:
- Versions:
2014-06-30
@ddalle
: v1.02014-09-02
@ddalle
: v2.0; new options paradigm2014-09-10
@ddalle
: v3.0; two modules:cmd
,bin
2014-12-02
@ddalle
: v3.1; add kwargs, add sf2023-08-21
@ddalle
: v4.0; elim cntl arg, use isolate_()
- cape.pycart.cmdgen.flowCart(opts=None, j=0, **kw)¶
Interface to Cart3D executable
flowCart
- Call:
>>> cmdi = flowCart(opts=None, i=0, **kw)
- Inputs:
- opts:
Options
|dict
Options interface
- j: {
0
} |int
Phase number
- n:
int
Iteration number from which to start (affects
-N
setting)- clic:
bool
Whether or not to create
Components.i.triq
file- mpi_fc:
bool
Whether or not to use MPI version
- it_fc:
int
Number of iterations to run
flowCart
- mg_fc:
int
Number of multigrid levels to use
- it_avg:
int
Iterations between averaging break; overrides it_fc
- it_start:
int
Startup iterations before starting averaging
- fmg:
bool
Whether to use full multigrid (adds
-no_fmg
flag ifFalse
)- pmg:
bool
Whether or not to use poly multigrid
- cfl:
float
Nominal CFL number
- cflmin:
float
Minimum CFL number allowed for problem cells or iterations
- tm:
bool
Whether or not to use second-order cut cells
- buffLim:
bool
Whether or not to use buffer limiting to smear shocks
- binaryIO:
bool
Whether or not to use binary format for input/output files
- limiter:
int
Limiter index
- y_is_spanwise:
bool
Whether or not to consider angle of attack in z direction
- nProc:
int
Number of threads to use for
flowCart
operation- buffLim:
bool
Whether or not to use buffer limits for strong off-body shocks
- opts:
- Outputs:
- Versions:
2014-09-07
@ddalle
: v1.02023-08-21
@ddalle
: v1.1; use isolate_subsection()
- cape.pycart.cmdgen.mgPrep(opts=None, j=0, **kw)¶
Interface to Cart3D executable
mgPrep
- Call:
>>> cmd = mgPrep(opts=None, j=0, **kw)
- Inputs:
- Outputs:
- Versions:
2014-09-02
@ddalle
: v1.02023-08-21
@ddalle
: v1.1; use isolate_subsection()