cape.pycart.archivist: Archiving actions specific to Cart3D

This module provides customizations of the generic cape.cfdx.archivist.CaseArchivist that assist in reducing the file count while running Cart3D, especially in adaptive mode.

class cape.pycart.archivist.CaseArchivist(opts: ArchiveOpts, where: str | None = None, casename: str | None = None)

Bases: CaseArchivist

Custom case archiving class for Cart3D

Call:
>>> a = CaseArchivist(opts, where=None, casename=None)
Inputs:
opts: ArchiveOpts

Case archiving options

where: {None} | str

Root of CFD case folder (default: CWD)

casename: {None} | str

Name of CFD case folder (default: last two levels of CWD)

archivedir
casename
clean_checkfiles(istart: int = 0, test: bool = False)

Clear check files that were created since iteration istart

Call:
>>> a.clean_checkfiles(istart=0)
Inputs:
a: CaseArchivist

Archive controller for one case

istart: int

Do not delete check files prior to iteration istart

test: True | {False}

If True, log which files would be deleted, but don’t actually delete, copy, or tar anything

Versions:
  • 2016-03-04 @ddalle: v1.0 (cape.pycart.manage)

  • 2024-09-24 @ddalle: v2.0; CaseArchivist

logger
opts
root_dir
tar_adapt(test: bool = False)

Tar adaptXX folders except most recent

No action will be taken if the TarAdapt setting is False.

For example, if there are 3 adaptations in the current folder, the following substitutions will be made.

  • adapt00/ –> adapt00.tar

  • adapt01/ –> adapt01.tar

  • adapt02/ –> adapt02.tar

  • adapt03/

The most recent adaptation is left untouched, and the old folders are deleted.

Call:
>>> a.tar_adapt(test=False)
Inputs:
a: CaseArchivist

Archive controller for one case

test: True | {False}

If True, log which files would be deleted, but don’t actually delete, copy, or tar anything

Versions:
  • 2014-11-12 @ddalle: v1.0 (cape.pycart.manage)

  • 2015-01-10 @ddalle: v1.1; format as an option

  • 2015-12-02 @ddalle: v1.2; Options

  • 2024-06-24 @ddalle: v1.3; never tar adapt00

  • 2024-09-24 @ddalle: v2.0; CaseArchivist

tar_viz(test: bool = False)

Move visualization surface and cut plane files to tar balls

This reduces file count by tarring Components.i.*.plt and cutPlanes.*.plt.

Call:
>>> a.tar_viz(test=False)
Inputs:
a: CaseArchivist

Archive controller for one case

test: True | {False}

If True, log which files would be deleted, but don’t actually delete, copy, or tar anything

Versions:
  • 2014-12-18 @ddalle: v1.0 (cape.pycart.manage)

  • 2015-01-10 @ddalle: v1.1; add format option

  • 2024-09-24 @ddalle: v2.0; CaseArchivist