#NEWLINE# def test_parab_FD_subbed_Pcomps( self ) : #NEWLINE# #INDENT# model = Problem ( impl = impl ) #NEWLINE# root = model . root = Group ( ) #NEWLINE# par = root . add ( 'par' , ParallelGroup ( ) ) #NEWLINE# par . add ( 's1' , MP_Point ( root = 2.0 ) ) #NEWLINE# par . add ( 's2' , MP_Point ( root = 3.0 ) ) #NEWLINE# root . add ( 'sumcomp' , ExecComp ( 'sum = x1+x2' ) ) #NEWLINE# root . connect ( 'par.s1.c.y' , 'sumcomp.x1' ) #NEWLINE# root . connect ( 'par.s2.c.y' , 'sumcomp.x2' ) #NEWLINE# driver = model . driver = pyOptSparseDriver ( ) #NEWLINE# driver . options [ 'optimizer' ] = OPTIMIZER #NEWLINE# driver . options [ 'print_results' ] = False #NEWLINE# driver . add_desvar ( 'par.s1.p.x' , lower = ( - 100 ) , upper = 100 ) #NEWLINE# driver . add_desvar ( 'par.s2.p.x' , lower = ( - 100 ) , upper = 100 ) #NEWLINE# driver . add_objective ( 'sumcomp.sum' ) #NEWLINE# root . fd_options [ 'force_fd' ] = True #NEWLINE# model . setup ( check = False ) #NEWLINE# model . run ( ) #NEWLINE# if ( ( not MPI ) or ( self . comm . rank == 0 ) ) : #NEWLINE# #INDENT# assert_rel_error ( self , driver [ 'par.s1.p.x' ] , 2.0 , 1e-06 ) #NEWLINE# #UNINDENT# if ( ( not MPI ) or ( self . comm . rank == 1 ) ) : #NEWLINE# #INDENT# assert_rel_error ( self , model [ 'par.s2.p.x' ] , 3.0 , 1e-06 )