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:
CaseTriqFM: patch load forces & momentsCaseTriqPoint: interpolate pressure at several points
- class cape.cfdx.triqfm.CaseTriqBase(comp: str, ftriq: str, cntl: CntlBase, i: int)¶
Bases:
DataKit- cntl¶
- get_configfile() str¶
Find configuration file for
.triqfile- Call:
>>> fcfg = db.get_configfile()
- Inputs:
- db:
CaseTriqFM Interface to TriqFM data for one component of one case
- db:
- Outputs:
- fcfg:
str Name of XML/JSON/MIXSUR config file
- fcfg:
- Versions:
2025-08-13
@ddalle: v1.0
- read_triq() Triq¶
Read the surface solution data from a
.triqfile- Call:
>>> triq = db.read_triq()
- Inputs:
- db:
CaseTriqFM Interface to TriqFM data for one component of one case
- db:
- Outputs:
- triq:
cape.trifile.Triq Triangulated surface data (also stored in db.triq)
- triq:
- Versions:
2025-08-13
@ddalle: v1.02025-10-22
@ddalle: v1.1; support ConfigJSON
- triq¶
- class cape.cfdx.triqfm.CaseTriqFM(comp: str, ftriq: str, cntl: CntlBase, i: int)¶
Bases:
CaseTriqBaseInterface 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
.triqannotated surface file to read- cntl:
cape.cfdx.cntl.Cntl Run matrix controller instance
- i:
int Index of this case
- comp:
- 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
- db:
- Versions:
2017-03-28
@ddalle: v1.02025-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
- db:
- Outputs:
- xi:
dict Conditions, incl. Mach (mach), Reynolds number (Re)
- xi:
- Versions:
2017-03-28
@ddalle: v1.02025-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
- db:
- Outputs:
- 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
- db:
- Outputs:
- 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
- db:
- 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
- db:
- Outputs:
- Versions:
2017-03-28
@ddalle: v1.02025-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
- db:
- Attributes:
- DBF.compmap:
dict Map of component numbers altered during the mapping
- DBF.compmap:
- 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
- db:
- Outputs:
- triq:
cape.trifile.Triq Triangulated surface data (also stored in db.triq)
- 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
- db:
- Outputs:
- triq:
cape.trifile.Triq Interface to annotated surface triangulation
- triq:
- 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
- db:
- 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
- db:
- Outputs:
- plt:
cape.pltfile.Plt Binary Tecplot interface
- plt:
- 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
- db:
- 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:
CaseTriqBaseInterface to post-processed interpolated surface pressure points
- Call:
>>> db = CaseTriqPoint(comp, ftriq, cntl, i)
- Inputs:
- comp:
str Name of component
- ftriq:
str Name of
.triqannotated surface file to read- cntl:
cape.cfdx.cntl.Cntl Run matrix controller instance
- i:
int Index of this case
- comp:
- 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
- db:
- 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¶