cape.cfdx.options.Config: CFD surface heirarchy configuration

This module interfaces options for geometric configurations. It defines quantities such as reference area, moment reference points, and other points to track. This section is not used to define the mesh or its properties. Instead, it is used to set extra properties for certain aspects of the geometry, for example association names with surfaces or points in the mesh.

For some solvers, this also affects what information is requested for the CFD solver to write during operation.

The Config.get_ConfigFile() typically points to an external file that associates names with each numbered surface.

Another aspect is to define "Points" by name. This allows the moment reference point for a configuration and not have to repeat the coordinates over and over again. Furthermore, named points can be transformed by other functions automatically. For example, a moment reference point can be translated and rotated along with a component, or a set of four points defining a right-handed coordinate system can be kept attached to a certain component.

class cape.cfdx.options.Config.Config(fname=None, **kw)

Dictionary-based interface for surface configuration

It is primarily used for naming surface components, grouping them, defining moment reference points, defining other points, and requesting components of interest.

Call:
>>> opts = Config(**kw)
Inputs:
kw: dict

Dictionary of configuration

Outputs:
opts: cape.options.Config.Config

Surface configuration options interface

Versions:
  • 2014-09-29 @ddalle: First version

expand_Point(x)

Expand points that are specified by name instead of value

Call:
>>> x = opts.expand_Point(x)
>>> x = opts.expand_Point(s)
>>> X = opts.expand_Point(d)
Inputs:
opts: cape.options.Options

Options interface

x: list[float]

Point

s: str

Point name

d: dict

Dictionary of points and point names

Outputs:
x: [float, float, float]

Point

X: dict

Dictionary of points

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

get_ConfigComponents(i=None)

Get configuration components

Call:
>>> comps = opts.get_ConfigComponents()
>>> comp = opts.get_ConfigComponents(i)
Inputs:
opts: cape.options.Options

Options interface

i: int

List index

Outputs:
comps: list[str]

List of components

comp: str

Single component

Versions:
  • 2015-10-20 @ddalle: First version

get_ConfigFile()

Return the configuration file name

Call:
>>> fname = opts.get_ConfigFile()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
fname: str

Configuration file name, usually 'Config.xml'

Versions:
  • 2014-09-29 @ddalle: First version

get_Point(name=None)

Return the coordinates of a point by name

If the input is a point, it is simply returned

Call:
>>> x = opts.get_Point(name=None)
>>> x = opts.get_Point(x)
Inputs:
opts: cape.options.Options

Options interface

name: str

Point name

Outputs:
x: [float, float, float]

Coordinates of that point

Versions:
  • 2015-09-11 @ddalle: First version

get_RefArea(comp=None)

Return the global reference area or reference area of a component

The component index can only be used if the ‘RefArea’ option is defined as a list. Similarly, the component name can only be used if the ‘RefArea’ option is a dict.

Call:
>>> A = opts.get_RefArea()
>>> A = opts.get_RefArea(comp=None)
Inputs:
opts: cape.options.Options

Options interface

comp: str or int

Name of component or component index

Outputs:
A: float

Global reference area or reference area for a component.

Versions:
  • 2014-09-29 @ddalle: First version

get_RefLength(comp=None)

Return the global reference length or that of a component

The component index can only be used if the ‘RefLength’ option is defined as a list. Similarly, the component name can only be used if the ‘RefLength’ option is a dict.

Call:
>>> L = opts.get_RefLength()
>>> L = opts.get_RefLength(comp=None)
Inputs:
opts: cape.options.Options

Options interface

comp: str or int

Name of component or component index

Outputs:
L: float

Global reference length or reference length for a component

Versions:
  • 2014-09-29 @ddalle: First version

get_RefPoint(comp=None)

Return the global moment reference point or that of a component

The component index can only be used if the ‘RefPoint’ option is defined as a list. Similarly, the component name can only be used if the ‘RefPoint’ option is a dict.

Call:
>>> x = opts.get_RefPoint()
>>> x = opts.get_RefPoint(comp=None)
Inputs:
opts: cape.options.Options

Options interface

comp: str or int

Name of component or component index

Outputs:
x: [float, float, float]

Global moment reference point or that for a component

Versions:
  • 2014-09-29 @ddalle: First version

get_RefSpan(comp=None)

Return the global reference span or that of a component

The component index can only be used if the ‘RefLength’ option is defined as a list. Similarly, the component name can only be used if the ‘RefLength’ option is a dict.

Call:
>>> b = opts.get_RefSpan()
>>> b = opts.get_RefSpan(comp=None)
Inputs:
opts: cape.options.Options

Options interface

comp: str or int

Name of component or component index

Outputs:
b: float

Global reference length or reference length for a component

Versions:
reset_Points()

Reset all points to original locations

Call:
>>> opts.reset_Points()
Inptus:
opts: cape.options.Options

Options interface

Versions:
  • 2016-04-18 @ddalle: First version

set_ConfigComponents(comps, i=None)

Set configuration components

Call:
>>> opts.set_ConfigComponents(comps)
>>> opts.set_ConfigComponents(comp, i)
Inputs:
opts: cape.options.Options

Options interface

i: int

List index

comps: list[str]

List of components

comp: str

Single component

Versions:
  • 2015-10-20 @ddalle: First version

set_ConfigFile(fname)

Set the configuration file name

Call:
>>> opts.set_ConfigFile(fname)
Inputs:
opts: cape.options.Options

Options interface

fname: str

Configuration file name, usually 'Config.xml'

Versions:
  • 2014-09-29 @ddalle: First version

set_Point(x, name=None)

Set or alter the coordinates of a point by name

Call:
>>> opts.set_Point(x, name)
Inputs:
opts: cape.options.Options

Options interface

x: [float, float, float]

Coordinates of that point

name: str

Point name

Versions:
  • 2015-09-11 @ddalle: First version

set_RefArea(A, comp=None)

Set the global reference area or reference area of a component

Call:
>>> opts.set_RefArea(A)
>>> opts.set_RefArea(A, comp=None)
Inputs:
opts: cape.options.Options

Options interface

A: float

Global reference area or reference area for a component.

comp: str or int

Name of component or component index

Versions:
  • 2014-09-29 @ddalle: First version

set_RefLength(L, comp=None)

Set the global reference length or that of a component

Call:
>>> opts.set_RefLength(L)
>>> opts.set_RefLength(L, comp=None)
Inputs:
opts: cape.options.Options

Options interface

L: float

Global reference length or reference length for a component

comp: str or int

Name of component or component index

Versions:
  • 2014-09-29 @ddalle: First version

set_RefPoint(x, comp=None)

Set the global moment reference point or that of a component

Call:
>>> opts.set_RefPoint(x)
>>> opts.set_RefPoint(x, comp=None)
Inputs:
opts: cape.options.Options

Options interface

x: [float, float, float]

Global moment reference point or that for a component

comp: str or int

Name of component or component index

Versions:
  • 2014-09-29 @ddalle: First version

set_RefSpan(b, comp=None)

Set the global reference span or that of a component

Call:
>>> opts.set_RefSpan(b)
>>> opts.set_RefSpan(b, comp=None)
Inputs:
opts: cape.options.Options

Options interface

b: float

Global reference span or reference length for a component

comp: str or int

Name of component or component index

Versions: