本文整理汇总了Python中DLLM.DLLMGeom.wing_param.Wing_param.set_AoA_id方法的典型用法代码示例。如果您正苦于以下问题:Python Wing_param.set_AoA_id方法的具体用法?Python Wing_param.set_AoA_id怎么用?Python Wing_param.set_AoA_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DLLM.DLLMGeom.wing_param.Wing_param
的用法示例。
在下文中一共展示了Wing_param.set_AoA_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DLLMWrapper
# 需要导入模块: from DLLM.DLLMGeom.wing_param import Wing_param [as 别名]
# 或者: from DLLM.DLLMGeom.wing_param.Wing_param import set_AoA_id [as 别名]
class DLLMWrapper():
ERROR_MSG = 'ERROR in DLLMWrapper.'
WARNING_MSG = 'WARNING in DLLMWrapper.'
POS_SOLVER = ['Solver','TargetCl','TargetLift']
POS_FMT = ['list','numpy']
def __init__(self, tag):
"""
Wrapper for the DLLM solver
"""
self.__tag = tag
self.__OC = None # Operating condition
self.__wing_param = None # Wing_param class
self.__DLLM_solver = None # DLLM Solver class
self.__config_dict = None
self.__out_format = 'list'
self.__grad_format = 'list'
self.__AoA_id = 'AoA'
self.__F_list = None
self.__F_list_grad = None
#-- Accessors
def get_OC(self):
return self.__OC
def get_wing_param(self):
return self.__wing_param
def get_DLLM_solver(self):
return self.__DLLM_solver
def get_tags_x0_and_bounds(self):
tags=self.__wing_param.get_dv_id_list()
x0=self.__wing_param.get_dv_array()
bounds=self.__wing_param.get_bounds_array()
return tags,x0,bounds
def get_x0_and_bounds(self):
x0=self.__wing_param.get_dv_array()
bounds=self.__wing_param.get_bounds_array()
return x0,bounds
def get_x0(self):
return self.get_x()
def get_x(self):
x=self.__wing_param.get_dv_array()
return x
def get_F_list_names(self):
return self.__DLLM_solver.get_F_list_names()
def get_F_list(self):
return self.__F_list
def get_F_list_grad(self):
return self.__F_list_grad
def get_F_list_and_grad(self):
return self.__F_list, self.__F_list_grad
#-- Setters
def set_AoA_id(self, AoA_id):
self.__AoA_id = AoA_id
def set_out_format(self, format):
WARNING_MSG=self.WARNING_MSG+'set_out_format: '
if format not in self.POS_FMT:
print WARNING_MSG+'format = '+str(format)+' not in '+str(self.POS_FMT)+'. Set to default out format = list'
format='list'
self.__out_format = format
def set_grad_format(self, format):
WARNING_MSG=self.WARNING_MSG+'set_grad_format: '
if format not in self.POS_FMT:
print WARNING_MSG+'format = '+str(format)+' not in '+str(self.POS_FMT)+'. Set to default grad format = list'
format='list'
self.__grad_format = format
#-- Public methods
def configure(self, config_dict):
self.__config_dict = config_dict
self.__config_OC()
self.__config_param()
self.__config_DLLM()
def run(self, x):
self.__wing_param.update_from_x_list(x)
self.__DLLM_solver.set_wing_param(self.__wing_param)
F_list=self.analysis()
return F_list
def run_grad(self, x):
self.__wing_param.update_from_x_list(x)
self.__DLLM_solver.set_wing_param(self.__wing_param)
#.........这里部分代码省略.........