cape.pycart.util: Utilities for pyCart

This module imports the generic utilities using

from cape.util import *

It also stores the absolute path to the folder containing the cape.pycart module as the variable pyCartFolder.

The module also provides several other methods for reading multiple files to determine the situational status of the Cart3D solution in the present working directory. These methods may be duplicated in cape.pycart.case.

See also:
cape.pycart.util.GetHistIter(fname='history.dat')

Get the most recent iteration number from a history.dat file

Call:
>>> n = GetHistIter(fname='history.dat')
Inputs:
fname: str

Name of file to read

Outputs:
n: float

Last iteration number

Versions:
  • 2014-11-24 @ddalle: v1.0 (cape.cfdx.util)

  • 2015-12-04 @ddalle: v1.0

cape.pycart.util.GetSteadyHistIter()

Get largest steady-state iteration number from history.dat

Call:
>>> n = GetSteadyHistIter()
Outputs:
n: int

Iteration number of last line w/o decimal (integer)

Versions:
  • 2015-12-02 @ddalle: v1.0

cape.pycart.util.GetTotalHistIter()

Get current iteration from history.dat corrected by restart

Call:
>>> n = GetUnsteadyHistIter()
Outputs:
n: float

Most recent iteration number, including partial iters

Versions:
  • 2015-12-02 @ddalle: v1.0

cape.pycart.util.GetUnsteadyHistIter()

Get largest time-accurate iteration number from history.dat

Call:
>>> n = GetUnsteadyHistIter()
Outputs:
n: float

Most recent iteration number, including partial iterations

Versions:
  • 2015-12-02 @ddalle: v1.0

cape.pycart.util.GetWorkingFolder()

Get the most recent working folder

Can be one of the following:

  • . (present directory)

  • adapt??

  • adapt??/FLOW

This function must be called from the top level of a case run directory.

Call:
>>> fdir = GetWorkingFolder()
Outputs:
fdir: str

Name of the most recently used working folder with a history file

Versions:
  • 2014-11-24 @ddalle: v1.0

  • 2023-06-06 @ddalle: v2.0; support adapt??/FLOW/