cape.pycart.report: Automated report interface

The pyCart module for generating automated results reports using PDFLaTeX provides a single class pyCart.report.Report, which is based off the CAPE version cape.cfdx.report.Report. The cape.cfdx.report.Report class is a sort of dual-purpose object that contains a file interface using cape.texfile.Tex combined with a capability to create figures for each case or sweep of cases mostly based on cape.cfdx.databook.

An automated report is a multi-page PDF generated using PDFLaTeX. Usually, each CFD case has one or more pages dedicated to results for that casecntl. The user defines a list of figures, each with its own list of subfigures, and these are generated for each case in the run matrix (subject to any command-line constraints the user may specify). Types of subfigures include

  • Table of the values of the input variables for this case

  • Table of force and moment values and statistics

  • Iterative histories of forces or moments

  • Iterative histories of residuals

  • Images using a Tecplot layout

  • Many more

In addition, the user may also define “sweeps,” which analyze groups of cases defined by user-specified constraints. For example, a sweep may be used to plot results as a function of Mach number for sets of cases having matching angle of attack and sideslip angle. When using a sweep, the report contains one or more pages for each sweep (rather than one or more pages for each case).

Reports are usually created using system commands of the following format.

The class has an immense number of methods, which can be somewhat grouped into bookkeeping methods and plotting methods. The main user-facing methods are cape.cfdx.report.Report.UpdateCases() and cape.cfdx.report.Report.UpdateSweep(). Each type of subfigure has its own method, for example cape.cfdx.report.Report.SubfigPlotCoeff() for "PlotCoeff" or cape.cfdx.report.Report.SubfigPlotL2() for "PlotL2".

See also:
cape.pycart.report.ImportLineLoad()

Import cape.pycart.lineload if not loaded

Call:
>>> pyCart.report.ImportLineLoad()
Versions:
  • 2016-06-10 @ddalle: First version

cape.pycart.report.ImportPointSensor()

Import cape.pycart.pointSensor if not loaded

Call:
>>> pyCart.report.ImportPointSensor()
Versions:
  • 2014-12-27 @ddalle: First version

class cape.pycart.report.Report(cntl: CntlBase, rep: str)

Interface for automated report generation

Call:
>>> R = pyCart.report.Report(cart3d, rep)
Inputs:
cart3d: cape.pycart.cntl.Cntl

Master Cart3D settings interface

rep: str

Name of report to update

Outputs:
R: pyCart.report.Report

Automated report interface

Versions:
  • 2015-03-07 @ddalle: Started

  • 2015-03-10 @ddalle: First version

GetStateSymbol(coeff, fs)

Get a TeX symbol for a coefficient and statistical field

Call:
>>> sym = R.GetStateSymbol(coeff, fs)
Inputs:
R: pyCart.report.Report

Automated report instance

coeff: Cp | dp | rho | M | T | p

Name of coefficient

fs: mu | std | err | min | max | u

Statistical quantity

Outputs:
sym: str

TeX symbol (including $ chars) for this field

Versions:
  • 2015-12-18 @ddalle: First version

LinkVizFiles(sfig=None, i=None)

Create links to appropriate visualization files

Specifically, Components.i.plt and cutPlanes.plt or Components.i.dat and cutPlanes.dat are created.

Call:
>>> R.LinkVizFiles(sfig, i)
Inputs:
R: pyCart.report.Report

Automated report interface

sfig: str

Name of the subfigure

i: int

Case index

See Also:

pyCart.casecntl.LinkPLT()

Versions:
  • 2016-02-06 @ddalle: First version

ReadLineLoad(comp, i, targ=None, update=False)

Read line load for a case

Call:
>>> LL = R.ReadLineLoad(comp, i, targ=None, update=False)
Inputs:
R: pyCart.report.Report

Automated report interface

comp: str

Name of line load component

i: int

Case number

targ: {None} | str

Name of target data book to read, if not None

update: True | {False}

Whether or not to attempt an update if case not in data book

Outputs:
LL: pyCart.lineload.CaseLL

Individual case line load interface

Versions:
  • 2016-06-10 @ddalle: First version

ReadPointSensor()

Read iterative history for a case

Call:
>>> P = R.ReadPointSensor()
Inputs:
R: pyCart.report.Report

Automated report interface

Outputs:
P: pyCart.pointsensor.CasePointSensor

Iterative history of point sensors

Versions:
  • 2015-12-07 @ddalle: First version

ReadTecscript(fsrc)

Read a Tecplot script interface

Call:
>>> R.ReadTecscript(fsrc)
Inputs:
R: pyCart.report.Report

Automated report interface

fscr: str

Name of file to read

Versions:
  • 2016-10-25 @ddalle: First version

SubfigPlotPoint(sfig, i, q)

Plot iterative history of a point sensor state

Call:
>>> lines = R.SubfigPlotPoint(sfig, i, q)
Inputs:
R: pyCart.report.Report

Automated report interface

sfig: str

Name of sfigure to update

i: int

Case index

q: True | False

Whether or not to redraw images

Versions:
  • 2015-12-07 @ddalle: First version

SubfigPointSensorTable(sfig, i, q)

Create lines for a “PointSensorTable” subfigure

Call:
>>> lines = R.SubfigPointTable(sfig, i, q)
Inputs:
R: pyCart.report.Report

Automated report interface

sfig: str

Name of subfigure to update

i: int

Case index

q: True | False

Whether or not to redraw images

Versions:
  • 2015-12-07 @ddalle: First version

SubfigSweepPointHist(sfig, fswp, I, q)

Plot a histogram of a point sensor coefficient over several cases

Call:
>>> R.SubfigSweepCoeff(sfig, fswp, I)
Inputs:
R: cape.cfdx.report.Report

Automated report interface

sfig: str

Name of sfigure to update

fswp: str

Name of sweep

I: numpy.ndarray[int]

List of indices in the sweep

q: True | False

Whether or not to redraw images

Versions:
  • 2016-01-16 @ddalle: First version