当前位置: 首页>>代码示例>>Python>>正文


Python DLLMSolver.get_DLLMPost方法代码示例

本文整理汇总了Python中DLLM.DLLMKernel.DLLMSolver.DLLMSolver.get_DLLMPost方法的典型用法代码示例。如果您正苦于以下问题:Python DLLMSolver.get_DLLMPost方法的具体用法?Python DLLMSolver.get_DLLMPost怎么用?Python DLLMSolver.get_DLLMPost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DLLM.DLLMKernel.DLLMSolver.DLLMSolver的用法示例。


在下文中一共展示了DLLMSolver.get_DLLMPost方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_DLLM_valid_dpLoads_distrib_dpAoA

# 需要导入模块: from DLLM.DLLMKernel.DLLMSolver import DLLMSolver [as 别名]
# 或者: from DLLM.DLLMKernel.DLLMSolver.DLLMSolver import get_DLLMPost [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)
开发者ID:matthieu-meaux,项目名称:DLLM,代码行数:56,代码来源:test_DLLM_simple_Loads.py

示例2: test_DLLM_valid_dpLoads_distrib_dpchi

# 需要导入模块: from DLLM.DLLMKernel.DLLMSolver import DLLMSolver [as 别名]
# 或者: from DLLM.DLLMKernel.DLLMSolver.DLLMSolver import get_DLLMPost [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)
开发者ID:matthieu-meaux,项目名称:DLLM,代码行数:54,代码来源:test_DLLM_simple_Loads.py

示例3: DLLMSolver

# 需要导入模块: from DLLM.DLLMKernel.DLLMSolver import DLLMSolver [as 别名]
# 或者: from DLLM.DLLMKernel.DLLMSolver.DLLMSolver import get_DLLMPost [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

开发者ID:matthieu-meaux,项目名称:DLLM,代码行数:31,代码来源:run_direct.py


注:本文中的DLLM.DLLMKernel.DLLMSolver.DLLMSolver.get_DLLMPost方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。