cape.pyfun.rubberData
: FUN3D file rubber.data
¶
This module provides an interface to the fixed-name FUN3D file
rubber.data
that is used in FUN3D to provide inputs for
optimization and or adjoint-based mesh adaptation. It provides a
single class pyFun.rubberdatafile.RubberData
that interprets and
sets individual lines of this customized data file.
- class cape.pyfun.rubberdatafile.RubberData(fname=None)¶
Read the
rubber.data
file- Call:
>>> R = pyFun.rubberdatafile.RubberData(fname)
- Inputs:
- fname:
str
Rubber data file, default
rubber.data
- fname:
- Outputs:
- R:
pyFun.rubberdatafile.RubberData
Instance of the pyFun rubber data class
- R:
- Versions:
2016-04-22
@ddalle
: First version
- AddCoeff(k=1, m=None)¶
Add one or more components to a function definition
- AddFunction()¶
Append an empty section (with default CD definition)
- Call:
>>> R.AddFunction()
- Inputs:
- R:
pyFun.rubberdatafile.RubberData
Interface to FUN3D function definition file
- R:
- Versions:
2016-04-22
@ddalle
: First version
- GetCoeffComp(k, j=1)¶
Get the component for function k component j
- Call:
>>> comp = R.GetFunctionComp(k, j=1)
- Inputs:
- Outputs:
- comp:
int
Face ID;
0
for all components
- comp:
- Versions:
2016-04-22
@ddalle
: First version2016-04-27
@ddalle
: Added multiple components
- GetCoeffPower(k, j=1)¶
Get the target value for coefficient j of function k
- Call:
>>> p = R.GetCoeffPower(k, j=1)
- Inputs:
- Outputs:
- p: {
1.0
} |float
Function power
- p: {
- Versions:
2016-04-22
@ddalle
: First version2016-04-28
@ddalle
: Added multiple components
- GetCoeffTarget(k, j=1)¶
Get the target value for coefficient j of function k
- Call:
>>> t = R.GetCoeffTarget(k, j=1)
- Inputs:
- Outputs:
- t: {
0.0
} |float
Function target
- t: {
- Versions:
2016-04-22
@ddalle
: First version2016-04-28
@ddalle
: Added multiple components
- GetCoeffType(k, j=1)¶
Get the keyword for coefficient j of function k
- Call:
>>> name = R.GetCoeffType(k, j=1)
- Inputs:
- Outputs:
- name: {
cd
} |int
Function keyword
- name: {
- Versions:
2016-04-22
@ddalle
: First version2016-04-28
@ddalle
: Added multiple components
- GetCoeffWeight(k, j=1)¶
Get the component weight for coefficient j of function k
- Call:
>>> w = R.GetCoeffWeight(k, j=1)
- Inputs:
- Outputs:
- w: {
1.0
} |float
Function keyword
- w: {
- Versions:
2016-04-22
@ddalle
: First version2016-04-28
@ddalle
: Added multiple components
- GetFunctionType(k)¶
Get the type of function k
- Call:
>>> typ = R.GetFunctionType(k)
- Inputs:
- R:
pyFun.rubberdatafile.RubberData
Interface to FUN3D function definition file
- k:
int
Function number
- R:
- Outputs:
- typ:
1
|2
Function type index;
1
for function and2
for constraint
- typ:
- Versions:
2016-04-22
@ddalle
: First version
- GetNComp(k=1)¶
Get number of components for function k
- GetNFunction()¶
Get the number of output/objective/constraint functions
- Call:
>>> n = R.GetNFunction()
- Inputs:
- R:
pyFun.rubberdatafile.RubberData
Interface to FUN3D function definition file
- R:
- Outputs:
- n:
int
|None
Number of functions defined
- n:
- Versions:
2016-04-22
@ddalle
: First version
- GetNextLine(i, n=1)¶
Get index of the next non-comment line after a specified line number
- GetNextLineIndex(i, n=1)¶
Get index of the next non-comment line after a specified line number
- Call:
>>> j = R.GetNextLineIndex(i) >>> j = R.GetNextLineIndex(i, n=1)
- Inputs:
- Outputs:
- j:
int
|None
Index of next non-comment line; if
None
, no such line
- j:
- Versions:
2016-04-22
@ddalle
: First version
- SetCoeffComp(k, comp, j=1)¶
Set the component for function k
- Call:
>>> R.SetCoeffComp(k, comp)
- Inputs:
- Versions:
2016-04-22
@ddalle
: First version2016-04-27
@ddalle
: Added multiple components
- SetCoeffPower(k, p=1.0, j=1)¶
Set the exponent for function k
- Call:
>>> R.SetCoeffPower(k, p, j=1)
- Inputs:
- Versions:
2016-04-22
@ddalle
: First version2016-04-28
@ddalle
: Added multiple components
- SetCoeffTarget(k, t=0.0, j=1)¶
Set the weight for function k
- Call:
>>> R.SetCoeffTarget(k, t, j=1)
- Inputs:
- Versions:
2016-04-22
@ddalle
: First version2016-04-28
@ddalle
: Added multiple components
- SetCoeffType(k, name, j=1)¶
Set the keyword for function k
- Call:
>>> R.SetCoeffType(k, name, j=1)
- Inputs:
- Versions:
2016-04-22
@ddalle
: First version2016-04-28
@ddalle
: Added multiple components
- SetCoeffWeight(k, w=1.0, j=1)¶
Set the weight for function k
- Call:
>>> R.SetCoeffWeight(k, w, j=1)
- Inputs:
- Versions:
2016-04-22
@ddalle
: First version2016-04-28
@ddalle
: Added multiple components
- SetFunctionType(k, typ)¶
Set the type of function k
- Call:
>>> R.SetFunctionType(k, typ)
- Inputs:
- R:
pyFun.rubberdatafile.RubberData
Interface to FUN3D function definition file
- k:
int
Function number
- typ:
1
|2
Function type index;
1
for function and2
for constraint
- R:
- Versions:
2016-04-22
@ddalle
: First version
- SetNComp(k=1, m=1)¶
Set number of components for function k