This is a module built off of the cape.filecntl module customized for
manipulating aero.csh files. Such files are actually C shell scripts
copied into each run directory that operate adaptive runs of Cart3D. The
primary action of the AeroCsh is to set the values of
several variables within the script.
Because this is a C shell script, the pyCart.aerocshfile.AeroCsh.Write()
method creates an executable script.
Parameters that are set in the header section of aero.csh include
inputs to cubes, mgPrep, flowCart, and adjointCart. This is in
addition to the overall mesh adaptation parameters set in
cape.pycart.options.runControl.Adaptation.
- See Also:
-
-
class cape.pycart.aerocshfile.AeroCsh(fname='aero.csh')
File control class for aero.csh files
This class is derived from cape.filecntl.filecntl.FileCntl.
- Call:
>>> AC = AeroCsh()
>>> AC = AeroCsh(fname="aero.csh")
- Inputs:
- fname:
str Name of CNTL file to read, defaults to 'aero.csh'
-
GetVar(name)
Get generic aero.csh variable value
- Call:
>>> val = AC.GetVar(name)
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- name:
str Name of variable as identified in ‘aero.csh’
- Outputs:
- val:
str Text of value from file
- Versions:
-
-
Prepare(opts, j=0)
Prepare all the key parameters of an aero.csh file
- Call:
-
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- opts:
pyCart.options.Options Options interface
- j:
int Run sequence index
- Versions:
-
-
SetABuffer(buf)
Set the number of buffer layers when refining a cell
- Call:
-
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- buf:
int Number of buffer layers
- Versions:
-
-
SetAPC(apc)
Set the list of mesh growth factors
- Call:
-
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- apc: array_like
Vector of 'p' and 'a'
- Versions:
-
-
SetAdjFirstOrder(adj)
Set flag to run adjointCart first-order
- Call:
>>> AC.SetAdjFirstOrder(adj)
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- adj:
bool Whether or not to run adjointCart first-order
- Versions:
-
-
SetAdjointCartMG(mg_ad)
Set the number of multigrid levels for adjointCart
- Call:
>>> AC.SetAdjointCartMG(mg_ad)
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- mg_ad:
int Number of adjointCart multigrid levels
- Versions:
-
-
SetBinaryIO(binaryIO)
Set whether or not to write binary Tecplot files
- Call:
>>> AC.SetBinaryIO(binaryIO)
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- binaryIO:
bool Whether or not to write binary Tecplot files
- Versions:
-
-
SetBuffLim(buffLim)
Turn on or off buffer limiting to smear shocks
- Call:
>>> AC.SetBuffLim(buffLim)
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- buffLim:
bool Whether or not to use the -buffLim flag
- Versions:
-
-
SetCFL(cfl)
Set the CFL number
- Call:
-
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- cfl:
float CFL number
- Versions:
-
-
SetCFLMin(cflmin)
Set the minimum CFL number, which aero.csh uses as backup
- Call:
-
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- cfl:
float CFL number
- Versions:
-
-
SetCubesA(a)
Set the angle criterion for cubes
- Call:
-
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- a:
float Angle criterion for cubes
- Versions:
-
-
SetCubesB(b)
Set number of buffer layers for cubes
- Call:
-
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- b:
int Number of buffer layers for cubes
- Versions:
-
-
SetErrorTolerance(etol)
Set error tolerance in aero.csh file
- Call:
>>> AC.SetErrorTolerance(etol)
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- etol:
float Number to set the function error tolerance to
- Versions:
-
-
SetFMG(fmg)
Turn on or off -no_fmg flag
- Call:
-
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- fmg:
bool Whether or not to use full multigrid
- Versions:
-
-
SetFinalMeshXRef(xref)
Set the number of additional adaptations on final error map
- Call:
>>> AC.SetFinalMeshXRef(xref)
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- xref:
int Number of additional adaptations
- Versions:
-
-
SetFlowCartMG(mg_fc)
Set the number of multigrid levels for flowCart
- Call:
>>> AC.SetFlowCartMG(mg_fc)
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- mg_fc:
int Number of flowCart multigrid levels
- Versions:
-
-
SetLimiter(limiter)
Set the limiter for flowCart
- Call:
>>> AC.SetLimiter(limiter)
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- limiter:
int Limiter, 2 or 5
- Versions:
-
-
SetMaxR(maxR)
Set the maximum number of refinements for cubes
- Call:
-
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- maxR:
int Maximum number of refinements for cubes
- Versions:
-
-
SetMaxnCells(max_nCells)
Set the maximum number of cells for the mesh
- Call:
>>> AC.SetMaxnCells(max_nCells)
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- max_nCells:
int Maximum number of cells allowed in mesh
- Versions:
-
-
SetMeshGrowth(mesh_growth)
Set the list of mesh growth factors
- Call:
>>> AC.SetMeshGrowth(mesh_growth)
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- mesh_growth: array_like
Vector of mesh growth parameters
- Versions:
-
-
SetPMG(pmg)
Turn on or off -pmg flag
- Call:
-
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- pmg:
bool Whether or not to use poly multigrid
- Versions:
-
-
SetPreSpec(pre=True)
Turn on or off preSpec.c3d.cntl
- Call:
>>> AC.SetPreSpec(pre=True)
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- pre:
bool Whether or not to use prespecified regions
- Versions:
-
-
SetTM(tm)
Turn on or off option to use first-order cut cells
- Call:
-
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- tm:
bool or int Use first-order cut cells (tm=0) or not (tm=1)
- Versions:
-
-
SetVar(name, val, f=False)
Set generic aero.csh variable value
- Call:
-
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- name:
str Name of variable as identified in ‘aero.csh’
- val: any, converted using
str() Value to which variable is set in final script
- Versions:
-
-
SetYIsSpanwise(y_is_spanwise)
Turn on or off y_is_spanwise flag
- Call:
>>> AC.SetYIsSpanwise(y_is_spanwise)
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- y_is_spanwise:
bool Whether or not to use y-axis as spanwise axis
- Versions:
-
-
SetnAdapt(n_adapt_cycles)
Set the number of adaptation cycles
- Call:
>>> AC.SetnAdapt(n_adapt_cycles)
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- n_adapt_cycles:
int Number of adaptation cycles
- Versions:
-
-
SetnIter(it_fc)
Set the initial number of flowCart iterations
- Call:
-
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- it_fc:
int Number of flowCart iters on initial mesh
- Versions:
-
-
SetnIterAdjoint(it_ad)
Set the number of adjointCart iterations
- Call:
-
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- it_ad:
int Number of adjointCart iters
- Versions:
-
-
SetnIterList(ws_it)
Set the number of flowCart iterations on new mesh
- Call:
>>> AC.SetnIterList(ws_it)
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- ws_it:
int Number of flowCart iters on subsequent meshes
- Effects:
Writes a line of the form 'set ws_it = ( 50 50 50 )'
- Versions:
-
-
SetnMultiGrid(mg_fc)
Set the number of multigrid levels for both solvers
- Call:
>>> AC.SetnMultiGrid(mg_fc)
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- mg_fc:
int Number of multigrid levels, applied to flowCart and adjointCart
- Versions:
-
-
SetnRefinements(maxR)
Set number of refinements for ‘cubes’ in ‘aero.csh’ file
- Call:
>>> AC.SetnRefinements(maxR)
- Inputs:
- AC:
AeroCsh Instance of the aero.csh manipulation class
- maxR:
int Maximum number of refinements for cubes
- Versions:
-
-
Write(fname=None)
Write FC.lines to text file
- Call:
>>> AC.Write()
>>> AC.Write(fname)
- Inputs:
- AC:
AeroCsh File control instance, defaults to FC.fname
- fname:
str Name of file to write to
- Versions:
-