#NEWLINE# def test_driver_param_indices_force_fd_shift( self ) : #NEWLINE# #INDENT# ' Test driver param indices with shifted indices and force_fd=True\n        ' #NEWLINE# prob = Problem ( ) #NEWLINE# prob . root = SellarStateConnection ( ) #NEWLINE# prob . root . fd_options [ 'force_fd' ] = True #NEWLINE# prob . driver . add_desvar ( 'z' , lower = np . array ( [ ( - 10.0 ) , ( - 10.0 ) ] ) , upper = np . array ( [ 10.0 , 10.0 ] ) , indices = [ 1 ] ) #NEWLINE# prob . driver . add_desvar ( 'x' , lower = 0.0 , upper = 10.0 ) #NEWLINE# prob . driver . add_objective ( 'obj' ) #NEWLINE# prob . driver . add_constraint ( 'con1' , upper = 0.0 ) #NEWLINE# prob . driver . add_constraint ( 'con2' , upper = 0.0 ) #NEWLINE# prob . setup ( check = False ) #NEWLINE# prob [ 'z' ] [ 1 ] = 0.0 #NEWLINE# prob . run ( ) #NEWLINE# J = prob . calc_gradient ( [ 'x' , 'z' ] , [ 'obj' ] , mode = 'fd' , return_format = 'array' ) #NEWLINE# assert_rel_error ( J , J [ 0 ] [ 1 ] , 1.78402 , 0.001 )