|
SU2
|
Public Member Functions | |
| def | __init__ (self, args, kwarg) |
| def | read (self, filename) |
| def | write (self, filename='') |
| def | dump (self, filename='') |
| def | __getattr__ (self, k) |
| def | __getitem__ (self, k) |
| def | unpack_dvs (self, dv_new, dv_old=None) |
| def | __eq__ (self, konfig) |
| def | __ne__ (self, konfig) |
| def | local_files (self) |
| def | diff (self, konfig) |
| def | dist (self, konfig, keys_check='ALL') |
| def | __repr__ (self) |
| def | __str__ (self) |
config = SU2.io.Config(filename="")
Starts a config class, an extension of
ordered_bunch()
use 1: initialize by reading config file
config = SU2.io.Config('filename')
use 2: initialize from dictionary or bunch
config = SU2.io.Config(param_dict)
use 3: initialize empty
config = SU2.io.Config()
Parameters can be accessed by item or attribute
ie: config['MESH_FILENAME'] or config.MESH_FILENAME
Methods:
read() - read from a config file
write() - write to a config file (requires existing file)
dump() - dump a raw config file
unpack_dvs() - unpack a design vector
diff() - returns the difference from another config
dist() - computes the distance from another config
| def SU2.io.config.Config.diff | ( | self, | |
| konfig | |||
| ) |
compares self to another config
Inputs:
konfig - a second config
Outputs:
config_diff - a config containing only the differing
keys, each with values of a list of the different
config values.
for example:
config_diff.MATH_PROBLEM = ['DIRECT','CONTINUOUS_ADJOINT']
| def SU2.io.config.Config.dist | ( | self, | |
| konfig, | |||
keys_check = 'ALL' |
|||
| ) |
calculates a distance to another config
Inputs:
konfig - a second config
keys_check - optional, a list of keys to check
Outputs:
distance - a float
Currently only works for DV_VALUE_NEW and DV_VALUE_OLD
Returns a large value otherwise
| def SU2.io.config.Config.dump | ( | self, | |
filename = '' |
|||
| ) |
dumps all items in the config bunch, without comments
| def SU2.io.config.Config.local_files | ( | self | ) |
removes path prefix from all *_FILENAME params
| def SU2.io.config.Config.read | ( | self, | |
| filename | |||
| ) |
reads from a config file
| def SU2.io.config.Config.unpack_dvs | ( | self, | |
| dv_new, | |||
dv_old = None |
|||
| ) |
updates config with design variable vectors
will scale according to each DEFINITION_DV scale parameter
Modifies:
DV_KIND
DV_MARKER
DV_PARAM
DV_VALUE_OLD
DV_VALUE_NEW
Inputs:
dv_new - list or array of new dv values
dv_old - optional, list or array of old dv values, defaults to zeros
| def SU2.io.config.Config.write | ( | self, | |
filename = '' |
|||
| ) |
updates an existing config file
1.8.12