cape.cfdx.triqfm: Module for reading patch loads from one case

This module provides classes for reading surface data from an existing .triq file in a CFD case’s main folder. It provides classes to read this data and then compute data products:

class cape.cfdx.triqfm.CaseTriqBase(comp: str, ftriq: str, cntl: CntlBase, i: int)

Bases: DataKit

cntl
get_configfile() → str

Find configuration file for .triq file

Call:
>>> fcfg = db.get_configfile()
Inputs:
db: CaseTriqFM

Interface to TriqFM data for one component of one case

Outputs:
fcfg: str

Name of XML/JSON/MIXSUR config file

Versions:
  • 2025-08-13 @ddalle: v1.0

read_triq() → Triq

Read the surface solution data from a .triq file

Call:
>>> triq = db.read_triq()
Inputs:
db: CaseTriqFM

Interface to TriqFM data for one component of one case

Outputs:
triq: cape.trifile.Triq

Triangulated surface data (also stored in db.triq)

Versions:
  • 2025-08-13 @ddalle: v1.0

  • 2025-10-22 @ddalle: v1.1; support ConfigJSON

triq
class cape.cfdx.triqfm.CaseTriqFM(comp: str, ftriq: str, cntl: CntlBase, i: int)

Bases: CaseTriqBase

Interface to post-processed patch loads from one case

Call:
>>> db = CaseTriqFM(comp, ftriq, cntl, i)
Inputs:
comp: str

Name of component

ftriq: str

Name of .triq annotated surface file to read

cntl: cape.cfdx.cntl.Cntl

Run matrix controller instance

i: int

Index of this case

apply_transformations(fm: dict)

Get the forces and moments on a patch

Call:
>>> db.apply_transformations(fm)
Inputs:
db: CaseTriqFM

Interface to TriqFM data for one component of one case

fm: dict[float]

Force & moment coefficients, transformed in-place

Versions:
  • 2017-03-28 @ddalle: v1.0

  • 2025-08-13 @ddalle: v2.0 (dex)

cntl
cols
comp
compmap
ftriq
get_conditions() → dict

Get the freestream conditions needed for forces

Call:
>>> xi = db.get_conditions()
Inputs:
db: CaseTriqFM

Interface to TriqFM data for one component of one case

Outputs:
xi: dict

Conditions, incl. Mach (mach), Reynolds number (Re)

Versions:
  • 2017-03-28 @ddalle: v1.0

  • 2025-08-13 @ddalle: v1.1 (dex)

get_patch_compid(patch: str | None) → str

Get the comp name/number in the tri-map for one patch

Call:
>>> compid = db.get_patch_compid(patch)
Inputs:
db: CaseTriqFM

Interface to TriqFM data for one component of one case

patch: str

Name of patch

Outputs:
compid: str | int

Name or number of component defining patch

Versions:
  • 2025-08-13 @ddalle: v1.0

get_patch_compids() → list

Get the list of component IDs mapped from the template tri

Call:
>>> compids = db.get_patch_compids()
Inputs:
db: CaseTriqFM

Interface to TriqFM data for one component of one case

Outputs:
compids: list[int]

List of component IDs that came from the mapping file

Versions:
  • 2017-03-30 @ddalle: v1.0

get_triq_forces()

Get the forces, moments, and other states on each patch

Call:
>>> db.get_triq_forces()
Inputs:
db: CaseTriqFM

Interface to TriqFM data for one component of one case

Versions:
  • 2017-03-28 @ddalle: v1.0 (TriqFMDataBook)

  • 2025-08-13 @ddalle: v2.0 (dex)

get_triq_forces_patch(patch: str | None) → dict

Get the forces and moments on a patch

Call:
>>> fm = db.get_triq_forces_patch(patch, **kw)
Inputs:
db: CaseTriqFM

Interface to TriqFM data for one component of one case

patch: str

Name of patch

Outputs:
fm: dict[float]

Dictionary of force & moment coefficients

Versions:
  • 2017-03-28 @ddalle: v1.0

  • 2025-08-13 @ddalle: v2.0 (dex)

i
map_tri_compid()

Perform any component ID mapping if necessary

Call:
>>> triq = db.map_tri_compid()
Inputs:
db: CaseTriqFM

Interface to TriqFM data for one component of one case

Attributes:
DBF.compmap: dict

Map of component numbers altered during the mapping

Versions:
  • 2017-03-28 @ddalle: v1.0

patches
read_tri_map() → Tri

Read the surface triangulation mapping file

This file defines the patches for the TriqFM output.

Call:
>>> triq = db.read_triq()
Inputs:
db: CaseTriqFM

Interface to TriqFM data for one component of one case

Outputs:
triq: cape.trifile.Triq

Triangulated surface data (also stored in db.triq)

Versions:
  • 2025-08-13 @ddalle: v1.0

select_triq() → Triq

Select the components of triq that are mapped patches

Call:
>>> triq = db.select_triq()
Inputs:
db: CaseTriqFM

Interface to TriqFM data for one component of one case

Outputs:
triq: cape.trifile.Triq

Interface to annotated surface triangulation

Versions:
  • 2017-03-30 @ddalle: v1.0

transform_fm(fm: dict, topts: dict)

Apply transformations to one patch load

Available transformations and their parameters are listed below.

  • “Euler321”: “psi”, “theta”, “phi”

  • “ScaleCoeffs”: “CA”, “CY”, “CN”

Call:
>>> db.transform_fm(fm, topts)
Inputs:
db: CaseTriqFM

Interface to TriqFM data for one component of one case

fm: dict[float]

Force & moment coefficients, transformed in-place

topts: dict

Dictionary of options for the transformation

x: cape.runmatrix.RunMatrix

The run matrix used for this analysis

Versions:
  • 2014-12-22 @ddalle: v1.0 (TriqFMDataBook)

  • 2025-08-13 @ddalle: v2.0 (dex)

tri
triq
triq2plt(triq: Triq, **kw) → Plt

Convert an annotated tri (TRIQ) interface to Tecplot (PLT)

Call:
>>> plt = DBF.Triq2Plt(triq, **kw)
Inputs:
db: CaseTriqFM

Interface to TriqFM data for one component of one case

triq: cape.trifile.Triq

Interface to annotated surface triangulation

Outputs:
plt: cape.pltfile.Plt

Binary Tecplot interface

Versions:
  • 2017-03-30 @ddalle: v1.0

write_triq(**kw)

Write mapped solution as TRIQ or Tecplot file with zones

Call:
>>> db.write_triq(**kw)
Inputs:
db: CaseTriqFM

Interface to TriqFM data for one component of one case

Versions:
  • 2017-03-30 @ddalle: v1.0 (TriqFMDataBook)

  • 2025-08-13 @ddalle: v2.0 (dex)

class cape.cfdx.triqfm.CaseTriqPoint(comp: str, ftriq: str, cntl: CntlBase, i: int)

Bases: CaseTriqBase

Interface to post-processed interpolated surface pressure points

Call:
>>> db = CaseTriqPoint(comp, ftriq, cntl, i)
Inputs:
comp: str

Name of component

ftriq: str

Name of .triq annotated surface file to read

cntl: cape.cfdx.cntl.Cntl

Run matrix controller instance

i: int

Index of this case

cntl
cols
comp
ftriq
i
interp_pt(pt: str)

Interpolate a single surface point

Call:
>>> db.interp_pt(pt)
Inputs:
db: CaseTriqPoint

Single-case surface point interp class

Versions:
  • 2025-08-30 @ddalle: v1.0

interp_pts()

Interpolate surface points

Call:
>>> db.interp_pts()
Versions:
  • 2025-08-30 @ddalle: v1.0

pts
triq