#NEWLINE# def test_simple_matvec_subbed_like_multipoint( self ) : #NEWLINE# #INDENT# group = Group ( ) #NEWLINE# group . add ( 'mycomp' , SimpleCompDerivMatVec ( ) , promotes = [ 'x' , 'y' ] ) #NEWLINE# prob = Problem ( impl = impl ) #NEWLINE# prob . root = Group ( ) #NEWLINE# prob . root . add ( 'sub' , group , promotes = [ '*' ] ) #NEWLINE# prob . root . sub . add ( 'x_param' , IndepVarComp ( 'x' , 1.0 ) , promotes = [ '*' ] ) #NEWLINE# prob . root . ln_solver = PetscKSP ( ) #NEWLINE# prob . setup ( check = False ) #NEWLINE# prob . run ( ) #NEWLINE# J = prob . calc_gradient ( [ 'x' ] , [ 'y' ] , mode = 'fwd' , return_format = 'dict' ) #NEWLINE# assert_rel_error ( self , J [ 'y' ] [ 'x' ] [ 0 ] [ 0 ] , 2.0 , 1e-06 ) #NEWLINE# J = prob . calc_gradient ( [ 'x' ] , [ 'y' ] , mode = 'rev' , return_format = 'dict' ) #NEWLINE# assert_rel_error ( self , J [ 'y' ] [ 'x' ] [ 0 ] [ 0 ] , 2.0 , 1e-06 ) #NEWLINE# J = prob . calc_gradient ( [ 'x' ] , [ 'y' ] , mode = 'fd' , return_format = 'dict' ) #NEWLINE# assert_rel_error ( self , prob [ 'y' ] [ 'x' ] [ 0 ] [ 0 ] , 2.0 , 1e-06 ) #NEWLINE# J = prob . calc_gradient ( [ 'x' ] , [ 'y' ] , mode = 'fd' , return_format = 'array' ) #NEWLINE# assert_rel_error ( self , J [ 0 ] [ 0 ] , 2.0 , 1e-06 )