cape.pycart.cmd: 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.

See also:
  • cape.cmd

  • cape.bin

  • cape.pycart.bin

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

Outputs:
cmd: list[str]

Command split into a list of strings

Versions:
  • 2014-09-02 @ddalle: v1.0

  • 2023-08-21 @ddalle: v1.1; use isolate_subsection()

cape.pycart.cmdgen.cubes(opts=None, j=0, **kw)

Interface to Cart3D script cubes

Call:
>>> cmd = cubes(opts=opts, j=0, **kw)
Inputs:
j: {0} | int

Phase number

opts: Options | dict

Options interface, run control options instance, raw dict

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

Outputs:
cmd: list[str]

Command split into a list of strings

Versions:
  • 2014-06-30 @ddalle: v1.0

  • 2014-09-02 @ddalle: v2.0; new options paradigm

  • 2014-09-10 @ddalle: v3.0; two modules: cmd, bin

  • 2014-12-02 @ddalle: v3.1; add kwargs, add sf

  • 2023-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 if False)

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

Outputs:
cmdi: list[str]

Command split into a list of strings

Versions:
  • 2014-09-07 @ddalle: v1.0

  • 2023-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:
opts: Options | dict

Options interface

j: {0} | int

Phase number

mg_fc: int

Number of multigrid levels to prepare

Outputs:
cmd: list[str]

Command split into a list of strings

Versions:
  • 2014-09-02 @ddalle: v1.0

  • 2023-08-21 @ddalle: v1.1; use isolate_subsection()