cape.pycart.cmd
: Create commands for Cart3D executables¶
This module creates system commands as lists of strings for executable binaries
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
pyCart.options.Options
or
pyCart.options.runControl.RunControl
object.
- See also:
cape.cmd
cape.bin
- cape.pycart.cmd.autoInputs(cart3d=None, opts=None, ftri='Components.i.tri', j=0, **kw)¶
Interface to Cart3D script
autoInputs
- Call:
>>> cmd = pyCart.cmd.autoInputs(cart3d, j=0) >>> cmd = pyCart.cmd.autoInputs(opts=opts, j=0) >>> cmd = pyCart.cmd.autoInputs(opts=rc, j=0) >>> cmd = pyCart.cmd.autoInputs(ftri='Components.i.tri', **kw)
- Inputs:
- cart3d:
cape.pycart.cntl.Cntl
Global pyCart settings instance
- j: {
0
} |int
Phase number
- opts:
pyCart.options.Options
Options interface
- rc:
pyCart.options.runControl.RunControl
Options interface
- r:
int
Mesh radius
- ftri:
str
Name of surface triangulation file
- maxR:
int
Number of refinements to make
- cart3d:
- Outputs:
- cmd:
list
[str
] Command split into a list of strings
- cmd:
- Versions:
2014-09-02
@ddalle
: First version
- cape.pycart.cmd.cubes(cart3d=None, opts=None, j=0, **kw)¶
Interface to Cart3D script cubes
- Call:
>>> cmd = pyCart.cmd.cubes(cart3d, j=0) >>> cmd = pyCart.cmd.cubes(opts=opts, j=0) >>> cmd = pyCart.cmd.cubes(opts=rc, j=0) >>> cmd = pyCart.cmd.cubes(maxR=11, reorder=True, **kwargs)
- Inputs:
- cart3d:
cape.pycart.cntl.Cntl
Global pyCart settings instance
- j: {
0
} |int
Phase number
- opts:
pyCart.options.Options
Options interface
- rc:
pyCart.options.runControl.RunControl
Options interface
- maxR:
int
Number of refinements to make
- reorder:
bool
Whether or not to reorder mesh
- a:
int
cubes angle criterion
- b:
int
Number of buffer layers
- sf:
int
Number of extra refinements around sharp edges
- cart3d:
- Outputs:
- cmd:
list
[str
] Command split into a list of strings
- cmd:
- Versions:
2014-06-30
@ddalle
: First version2014-09-02
@ddalle
: Rewritten with new options paradigm2014-09-10
@ddalle
: Split into cmd and bin2014-12-02
@ddalle
: Moved to keyword arguments and added sf
- cape.pycart.cmd.flowCart(cart3d=None, fc=None, i=0, **kwargs)¶
Interface to Cart3D binary
flowCart
- Call:
>>> cmdi = pyCart.cmd.flowCart(cart3d, i=0) >>> cmdi = pyCart.cmd.flowCart(fc=None, i=0) >>> cmdi = pyCart.cmd.flowCart(**kwargs)
- Inputs:
- cart3d:
cape.pycart.cntl.Cntl
Global pyCart settings instance
- fc:
pyCart.options.flowCart.flowCart
Direct reference to
cart3d.opts['flowCart']
- i:
int
Run index (restart if i is greater than 0)
- 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
- cart3d:
- Outputs:
- cmdi:
list
[str
] Command split into a list of strings
- cmdi:
- Versions:
2014-09-07
@ddalle
: First version
- cape.pycart.cmd.mgPrep(cart3d=None, opts=None, j=0, **kw)¶
Interface to Cart3D script mgPrep
- Call:
>>> cmd = pyCart.cmd.mgPrep(cart3d, j=0) >>> cmd = pyCart.cmd.mgPrep(opts=opts, j=0) >>> cmd = pyCart.cmd.mgPrep(opts=rc, j=0) >>> cmd = pyCart.cmd.mgPrep(**kw)
- Inputs:
- cart3d:
cape.pycart.cntl.Cntl
Global pyCart settings instance
- j: {
0
} |int
Phase number
- opts:
pyCart.options.Options
Options interface
- rc:
pyCart.options.runControl.RunControl
Options interface
- mg_fc:
int
Number of multigrid levels to prepare
- cart3d:
- Outputs:
- cmd:
list
[str
] Command split into a list of strings
- cmd:
- Versions:
2014-09-02
@ddalle
: First version