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.rubberData.RubberData that interprets and
sets individual lines of this customized data file.
- See also:
- class cape.pyfun.rubberData.RubberData(fname=None)¶
Read the
rubber.datafile- Call:
>>> R = pyFun.rubberData.RubberData(fname)
- Inputs:
- fname:
str Rubber data file, default
rubber.data
- fname:
- Outputs:
- R:
pyFun.rubberData.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
- Call:
>>> R.AddCoeff(k) >>> R.AddCoeff(k, m)
- Inputs:
- R:
pyFun.rubberData.RubberData Interface to FUN3D function definition file
- k:
int Composite function number (almost always
1)- m: {
None} |int Number of components; if
None, add one more component
- R:
- Versions:
2016-04-27
@ddalle: First version
- AddFunction()¶
Append an empty section (with default CD definition)
- Call:
>>> R.AddFunction()
- Inputs:
- R:
pyFun.rubberData.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:
- R:
pyFun.rubberData.RubberData Interface to FUN3D function definition file
- k:
int Function number (1-based)
- j:
int Component number (1-based)
- R:
- Outputs:
- comp:
int Face ID;
0for 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:
- R:
pyFun.rubberData.RubberData Interface to FUN3D function definition file
- k:
int Function number (1-based)
- j:
int Component number (1-based)
- R:
- 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:
- R:
pyFun.rubberData.RubberData Interface to FUN3D function definition file
- k:
int Function number (1-based)
- j:
int Component number (1-based)
- R:
- 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:
- R:
pyFun.rubberData.RubberData Interface to FUN3D function definition file
- k:
int Function number (1-based)
- j:
int Component number (1-based)
- R:
- 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:
- R:
pyFun.rubberData.RubberData Interface to FUN3D function definition file
- k:
int Function number (1-based)
- j:
int Component number (1-based)
- R:
- 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.rubberData.RubberData Interface to FUN3D function definition file
- k:
int Function number
- R:
- Outputs:
- typ:
1|2 Function type index;
1for function and2for constraint
- typ:
- Versions:
2016-04-22
@ddalle: First version
- GetNComp(k=1)¶
Get number of components for function k
- Call:
>>> m = R.GetNComp(k)
- Inputs:
- R:
pyFun.rubberData.RubberData Interface to FUN3D function definition file
- k:
int Composite function number (almost always
1)
- R:
- Outputs:
- m:
int Number of components for function k
- m:
- Versions:
2016-04-27
@ddalle: First version
- GetNFunction()¶
Get the number of output/objective/constraint functions
- Call:
>>> n = R.GetNFunction()
- Inputs:
- R:
pyFun.rubberData.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
- Call:
>>> line = R.GetNextLine(i)
- Inputs:
- R:
pyFun.rubberData.RubberData Interface to FUN3D function definition file
- i:
int Line number
- n:
int Number of lines to read
- R:
- Outputs:
- line:
str Contents of next non-comment line, may be empty
- line:
- Versions:
2016-04-22
@ddalle: First version
- 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:
- R:
pyFun.rubberData.RubberData Interface to FUN3D function definition file
- i:
int Line number
- n:
int Number of lines to read
- R:
- 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:
- R:
pyFun.rubberData.RubberData Interface to FUN3D function definition file
- k:
int Function number (0-based)
- comp:
int Face ID;
0for all components- j:
int Component number (1-based)
- R:
- 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:
- R:
pyFun.rubberData.RubberData Interface to FUN3D function definition file
- k:
int Function number (0-based)
- p: {
1.0} |float Function exponent:
w*(v-t)**p- j:
int Component number (1-based)
- R:
- 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:
- R:
pyFun.rubberData.RubberData Interface to FUN3D function definition file
- k:
int Function number (0-based)
- t: {
0.0} |float Function target
- j:
int Component number (1-based)
- R:
- 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:
- R:
pyFun.rubberData.RubberData Interface to FUN3D function definition file
- k:
int Function number (1-based)
- name: {
cd} |int Function keyword
- j:
int Component number (1-based)
- R:
- 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:
- R:
pyFun.rubberData.RubberData Interface to FUN3D function definition file
- k:
int Function number (0-based)
- w: {
1.0} |float Function weight
- j:
int Component number (1-based)
- R:
- 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.rubberData.RubberData Interface to FUN3D function definition file
- k:
int Function number
- typ:
1|2 Function type index;
1for function and2for constraint
- R:
- Versions:
2016-04-22
@ddalle: First version
- SetNComp(k=1, m=1)¶
Set number of components for function k
- Call:
>>> R.SetNComp(k, m=1)
- Inputs:
- R:
pyFun.rubberData.RubberData Interface to FUN3D function definition file
- k:
int Composite function number (almost always
1)- m:
int Number of components for function k
- R:
- Versions:
2016-04-27
@ddalle: First version
- SetNFunction(n)¶
Set the number of output/objective/constraint functions
- Call:
>>> R.SetNFunction(n)
- Inputs:
- R:
pyFun.rubberData.RubberData Interface to FUN3D function definition file
- n:
int|None Number of functions defined
- R:
- Versions:
2016-04-22
@ddalle: First version