本文整理汇总了Python中DLLM.DLLMKernel.DLLMSolver.DLLMSolver.run_direct方法的典型用法代码示例。如果您正苦于以下问题:Python DLLMSolver.run_direct方法的具体用法?Python DLLMSolver.run_direct怎么用?Python DLLMSolver.run_direct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DLLM.DLLMKernel.DLLMSolver.DLLMSolver
的用法示例。
在下文中一共展示了DLLMSolver.run_direct方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_DLLM_valid_dpF_list_dpchi
# 需要导入模块: from DLLM.DLLMKernel.DLLMSolver import DLLMSolver [as 别名]
# 或者: from DLLM.DLLMKernel.DLLMSolver.DLLMSolver import run_direct [as 别名]
def test_DLLM_valid_dpF_list_dpchi(self):
OC,wing_param = self.__init_wing_param()
DLLM = DLLMSolver('test',wing_param,OC)
print ''
DLLM.run_direct()
iAoA=DLLM.get_iAoA()
x0=wing_param.get_dv_array()
def f2(x):
wing_param.update_from_x_list(x)
DLLM.set_wing_param(wing_param)
DLLM.comp_R(iAoA)
DLLM.set_direct_computed()
DLLM.run_post()
func=DLLM.get_F_list()
return func
def df2(x):
wing_param.update_from_x_list(x)
DLLM.set_wing_param(wing_param)
DLLM.comp_R(iAoA)
DLLM.set_direct_computed()
DLLM.run_post()
func_grad=DLLM.get_dpF_list_dpchi()
return func_grad
val_grad2=FDValidGrad(2,f2,df2,fd_step=1.e-8)
ok2,df_fd2,df2=val_grad2.compare(x0,treshold=1.e-6,split_out=True,return_all=True)
assert(ok2)
示例2: f
# 需要导入模块: from DLLM.DLLMKernel.DLLMSolver import DLLMSolver [as 别名]
# 或者: from DLLM.DLLMKernel.DLLMSolver.DLLMSolver import run_direct [as 别名]
def f(x):
wing_param.update_from_x_list(x)
DLLM = DLLMSolver('Simple',wing_param,OC)
DLLM.run_direct()
DLLM.run_post()
func=DLLM.get_F_list()
return func
示例3: test_DLLM_valid_dpF_list_dpAoA
# 需要导入模块: from DLLM.DLLMKernel.DLLMSolver import DLLMSolver [as 别名]
# 或者: from DLLM.DLLMKernel.DLLMSolver.DLLMSolver import run_direct [as 别名]
def test_DLLM_valid_dpF_list_dpAoA(self):
OC,wing_param = self.__init_wing_param()
DLLM = DLLMSolver('test',wing_param,OC)
print ''
DLLM.run_direct()
iAoA=DLLM.get_iAoA()
AoA0=OC.get_AoA_rad()
def f3(x):
OC.set_AoA_rad(x[0])
DLLM.comp_R(iAoA)
DLLM.set_direct_computed()
DLLM.run_post()
func=DLLM.get_F_list()
return func
def df3(x):
OC.set_AoA_rad(x[0])
DLLM.comp_R(iAoA)
DLLM.set_direct_computed()
DLLM.run_post()
func_grad=DLLM.get_dpF_list_dpAoA()
N=len(func_grad)
np_func_grad=zeros((N,1))
np_func_grad[:,0]=func_grad[:]
return np_func_grad
val_grad3=FDValidGrad(2,f3,df3,fd_step=1.e-8)
ok3,df_fd3,df3=val_grad3.compare([AoA0],treshold=1.e-6,split_out=True,return_all=True)
assert(ok3)
示例4: test_DLLM_valid_dpLoads_dpAoA
# 需要导入模块: from DLLM.DLLMKernel.DLLMSolver import DLLMSolver [as 别名]
# 或者: from DLLM.DLLMKernel.DLLMSolver.DLLMSolver import run_direct [as 别名]
def test_DLLM_valid_dpLoads_dpAoA(self):
OC,wing_param = self.__init_wing_param()
DLLM = DLLMSolver('test',wing_param,OC)
print ''
DLLM.run_direct()
iAoA0=DLLM.get_iAoA()
AoA0=OC.get_AoA_rad()
def f2(x):
OC.set_AoA_rad(x[0])
R=DLLM.comp_R(iAoA0)
Post=DLLM.get_DLLMPost()
func=Post.comp_Lift_distrib()
return func
def df2(x):
OC.set_AoA_rad(x[0])
R=DLLM.comp_R(iAoA0)
Post=DLLM.get_DLLMPost()
func_grad=Post.comp_dpLift_distrib_dpAoA()
N=len(func_grad)
np_func_grad=zeros((N,1))
np_func_grad[:,0]=func_grad[:]
return np_func_grad
val_grad2=FDValidGrad(2,f2,df2,fd_step=1.e-8)
ok2,df_fd2,df2=val_grad2.compare([AoA0],treshold=1.e-5,return_all=True)
assert(ok2)
示例5: df
# 需要导入模块: from DLLM.DLLMKernel.DLLMSolver import DLLMSolver [as 别名]
# 或者: from DLLM.DLLMKernel.DLLMSolver.DLLMSolver import run_direct [as 别名]
def df(x):
wing_param.update_from_x_list(x)
DLLM = DLLMSolver('Simple',wing_param,OC)
DLLM.run_direct()
DLLM.run_post()
DLLM.run_adjoint()
func_grad=numpy.array(DLLM.get_dF_list_dchi())
return func_grad
示例6: f
# 需要导入模块: from DLLM.DLLMKernel.DLLMSolver import DLLMSolver [as 别名]
# 或者: from DLLM.DLLMKernel.DLLMSolver.DLLMSolver import run_direct [as 别名]
def f(x):
wing_param.update_from_x_list(x)
DLLM = DLLMSolver('Meta',wing_param,OC)
DLLM.run_direct()
#DLLM.run_post(func_list=['Cl'])
DLLM.run_post()
func=DLLM.get_F_list()
return func
示例7: runDLLM
# 需要导入模块: from DLLM.DLLMKernel.DLLMSolver import DLLMSolver [as 别名]
# 或者: from DLLM.DLLMKernel.DLLMSolver.DLLMSolver import run_direct [as 别名]
def runDLLM(wing_param, OC):
DLLM = DLLMSolver('Wing',wing_param,OC)
DLLM.run_direct()
DLLM.run_post()
output = DLLM.get_F_list()
F_list_names = DLLM.get_F_list_names()
return output, F_list_names
示例8: test_DLLM_run_direct
# 需要导入模块: from DLLM.DLLMKernel.DLLMSolver import DLLMSolver [as 别名]
# 或者: from DLLM.DLLMKernel.DLLMSolver.DLLMSolver import run_direct [as 别名]
def test_DLLM_run_direct(self):
OC,wing_param = self.__init_wing_param()
DLLM = DLLMSolver('test',wing_param,OC)
try:
print ''
DLLM.run_direct()
ok=True
except:
ok=False
assert(ok)
示例9: test_DLLM_valid_dpLoads_distrib_dpAoA
# 需要导入模块: from DLLM.DLLMKernel.DLLMSolver import DLLMSolver [as 别名]
# 或者: from DLLM.DLLMKernel.DLLMSolver.DLLMSolver import run_direct [as 别名]
def test_DLLM_valid_dpLoads_distrib_dpAoA(self):
OC,wing_param = self.__init_wing_param()
DLLM = DLLMSolver('test',wing_param,OC)
print ''
DLLM.run_direct()
iAoA0=DLLM.get_iAoA()
AoA0=OC.get_AoA_rad()
Post=DLLM.get_DLLMPost()
def f1(x):
OC.set_AoA_rad(x[0])
R=DLLM.comp_R(iAoA0)
DLLM.run_post()
func=Post.Lift_distrib
return func
def df1(x):
OC.set_AoA_rad(x[0])
R=DLLM.comp_R(iAoA0)
DLLM.run_post()
func_grad=Post.dpLift_distrib_dpAoA
N=len(func_grad)
np_func_grad=np.zeros((N,1))
np_func_grad[:,0]=func_grad[:]
return np_func_grad
def f2(x):
OC.set_AoA_rad(x[0])
R=DLLM.comp_R(iAoA0)
DLLM.run_post()
func=Post.Drag_distrib
return func
def df2(x):
OC.set_AoA_rad(x[0])
R=DLLM.comp_R(iAoA0)
DLLM.run_post()
func_grad=Post.dpDrag_distrib_dpAoA
N=len(func_grad)
np_func_grad=np.zeros((N,1))
np_func_grad[:,0]=func_grad[:]
return np_func_grad
val_grad1=FDValidGrad(2,f1,df1,fd_step=1.e-8)
ok1,df_fd1,df1=val_grad1.compare([AoA0],treshold=1.e-6,return_all=True)
val_grad2=FDValidGrad(2,f2,df2,fd_step=1.e-8)
ok2,df_fd2,df2=val_grad2.compare([AoA0],treshold=1.e-6,return_all=True)
norm1, norm2 = self.print_valid_FD([AoA0],'dpLift_distrib_dpAoA',df1,df_fd1,'dpDrag_distrib_dpAoA',df2,df_fd2)
self.plot_valid_FD([AoA0],'dpLift_distrib_dpAoA',df1,df_fd1,'dpDrag_distrib_dpAoA',df2,df_fd2, norm1, norm2, 'Loads_distrib_dpAoA')
if (ok1==True) and (ok2==True):
ok = True
else :
ok = False
assert(ok)
示例10: test_DLLM_valid_dpLoads_distrib_dpchi
# 需要导入模块: from DLLM.DLLMKernel.DLLMSolver import DLLMSolver [as 别名]
# 或者: from DLLM.DLLMKernel.DLLMSolver.DLLMSolver import run_direct [as 别名]
def test_DLLM_valid_dpLoads_distrib_dpchi(self):
OC,wing_param = self.__init_wing_param()
DLLM = DLLMSolver('test',wing_param,OC)
print ''
DLLM.run_direct()
iAoA=DLLM.get_iAoA()
x0=wing_param.get_dv_array()
Post=DLLM.get_DLLMPost()
def f1(x):
wing_param.update_from_x_list(x)
DLLM.set_geom(wing_param)
DLLM.comp_R(iAoA)
Post.run()
func=Post.Lift_distrib
return func
def df1(x):
wing_param.update_from_x_list(x)
DLLM.set_geom(wing_param)
DLLM.comp_R(iAoA)
Post.run()
func_grad=Post.dpLift_distrib_dpchi
return func_grad
def f2(x):
wing_param.update_from_x_list(x)
DLLM.set_geom(wing_param)
DLLM.comp_R(iAoA)
Post.run()
func=Post.Drag_distrib
return func
def df2(x):
wing_param.update_from_x_list(x)
DLLM.set_geom(wing_param)
DLLM.comp_R(iAoA)
Post.run()
func_grad=Post.dpDrag_distrib_dpchi
return func_grad
val_grad1=FDValidGrad(2,f1,df1,fd_step=1.e-8)
ok1,df_fd1,df1=val_grad1.compare(x0,treshold=1.e-6,return_all=True)
val_grad2=FDValidGrad(2,f2,df2,fd_step=1.e-8)
ok2,df_fd2,df2=val_grad2.compare(x0,treshold=1.e-6,return_all=True)
norm1, norm2 = self.print_valid_FD(x0,'dpLift_distrib_dpchi',df1,df_fd1,'dpDrag_distrib_dpchi',df2,df_fd2)
self.plot_valid_FD(x0,'dpLift_distrib_dpchi',df1,df_fd1,'dpDrag_distrib_dpchi',df2,df_fd2, norm1, norm2, 'Loads_distrib_dpchi')
if (ok1==True) and (ok2==True):
ok = True
else :
ok = False
assert(ok)
示例11: test_DLLM_valid_dpR_dpiAoA
# 需要导入模块: from DLLM.DLLMKernel.DLLMSolver import DLLMSolver [as 别名]
# 或者: from DLLM.DLLMKernel.DLLMSolver.DLLMSolver import run_direct [as 别名]
def test_DLLM_valid_dpR_dpiAoA(self):
OC,wing_param = self.__init_wing_param()
DLLM = DLLMSolver('test',wing_param,OC)
print ''
DLLM.run_direct()
iAoA0=DLLM.get_iAoA()
def f1(x):
func=DLLM.comp_R(x)
return func
def df1(x):
func_grad=DLLM.comp_dpR_dpiAoA(x)
return func_grad
val_grad1=FDValidGrad(2,f1,df1,fd_step=1.e-8)
ok1,df_fd1,df1=val_grad1.compare(iAoA0,treshold=1.e-6,return_all=True)
assert(ok1)
示例12: test_DLLM_valid_dpR_dpthetaY
# 需要导入模块: from DLLM.DLLMKernel.DLLMSolver import DLLMSolver [as 别名]
# 或者: from DLLM.DLLMKernel.DLLMSolver.DLLMSolver import run_direct [as 别名]
def test_DLLM_valid_dpR_dpthetaY(self):
OC,wing_param = self.__init_wing_param()
DLLM = DLLMSolver('test',wing_param,OC)
print ''
DLLM.run_direct()
iAoA=DLLM.get_iAoA()
thetaY0=wing_param.get_thetaY()
def f3(x):
wing_param.set_thetaY(x)
func=DLLM.comp_R(iAoA)
return func
def df3(x):
wing_param.set_thetaY(x)
func_grad=DLLM.comp_dpR_dpthetaY()
return func_grad
val_grad3=FDValidGrad(2,f3,df3,fd_step=1.e-8)
ok3,df_fd3,df3=val_grad3.compare(thetaY0,treshold=1.e-6,return_all=True)
assert(ok3)
示例13: test_DLLM_valid_dpR_dpAoA
# 需要导入模块: from DLLM.DLLMKernel.DLLMSolver import DLLMSolver [as 别名]
# 或者: from DLLM.DLLMKernel.DLLMSolver.DLLMSolver import run_direct [as 别名]
def test_DLLM_valid_dpR_dpAoA(self):
OC,wing_param = self.__init_wing_param()
DLLM = DLLMSolver('test',wing_param,OC)
print ''
DLLM.run_direct()
iAoA = DLLM.get_iAoA()
AoA0=OC.get_AoA_rad()
def f4(x):
OC.set_AoA_rad(x[0])
func=DLLM.comp_R(iAoA)
return func
def df4(x):
OC.set_AoA_rad(x[0])
func_grad=DLLM.comp_dpR_dpAoA()
N=len(func_grad)
np_func_grad=zeros((N,1))
np_func_grad[:,0]=func_grad[:]
return np_func_grad
val_grad4=FDValidGrad(2,f4,df4,fd_step=1.e-8)
ok4,df_fd4,df4=val_grad4.compare([AoA0],treshold=1.e-6,return_all=True)
assert(ok4)
示例14: DLLMSolver
# 需要导入模块: from DLLM.DLLMKernel.DLLMSolver import DLLMSolver [as 别名]
# 或者: from DLLM.DLLMKernel.DLLMSolver.DLLMSolver import run_direct [as 别名]
import numpy
OC=OperatingCondition('cond1')
OC.set_Mach(0.8)
OC.set_AoA(3.5)
OC.set_altitude(10000.)
OC.set_T0_deg(15.)
OC.set_P0(101325.)
OC.set_humidity(0.)
OC.compute_atmosphere()
wing_param=Wing_Broken('broken_wing',n_sect=20)
wing_param.import_BC_from_file('input_parameters.par')
wing_param.build_linear_airfoil(OC, AoA0=0.0, set_as_ref=True)
wing_param.build_airfoils_from_ref()
wing_param.update()
wing_param.plot()
print wing_param
x0=wing_param.get_dv_array()
DLLM = DLLMSolver('Simple',wing_param,OC)
DLLM.run_direct()
DLLM.run_post()
Post=DLLM.get_DLLMPost()
print Post.dpLift_distrib_dpiAoA