本文整理匯總了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)
#.........這裏部分代碼省略.........