from __future__ import absolute_import
__author__ = 'marafi'


def SolutionAlgorithim(OData, Dt, Tol, Steps):
    #Insert within the While loop, make sure parameter "ok" is defined
    import OpenSeesAPI
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Lower Dt: %f and Tol: %f ... "'%(Dt,Tol)))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Newton Line Search ... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.EnergyIncr(Tol,1000,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch(Tolerance=0.8))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze %d %f ]'%(Steps,Dt)))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Newton with Initial Tangent ... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.NormDispIncr(Tol,1000,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.Newton(Initial=True))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze %d %f ]'%(Steps,Dt)))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Broyden ... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.EnergyIncr(Tol,1000,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.Broyden(8))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze %d %f ]'%(Steps,Dt)))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying KrylovNewton ... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.EnergyIncr(Tol,1000,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.KrylovNewton())
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze %d %f ]'%(Steps,Dt)))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

def SolutionAlgorithimV2(OData, Dt, Tol, Steps):
    #Insert within the While loop, make sure parameter "ok" is defined
    import OpenSeesAPI
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Lower Dt: %f and Tol: %f ... "'%(Dt,Tol)))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Krylov... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.EnergyIncr(Tol,1000,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.KrylovNewton(MaxDim = 6))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze %d %f ]'%(Steps,Dt)))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying NewtonLineSearch... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.NormDispIncr(Tol,1000,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch(Tolerance=0.8))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze %d %f ]'%(Steps,Dt)))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying NewtonLineSearch Bisection... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.EnergyIncr(Tol,1000,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch('Bisection'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze %d %f ]'%(Steps,Dt)))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying NewtonLineSearch Secant... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.EnergyIncr(Tol,1000,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch('Secant'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze %d %f ]'%(Steps,Dt)))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying NewtonLineSearch RegulaFalsi... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.EnergyIncr(Tol,1000,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch('RegulaFalsi'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze %d %f ]'%(Steps,Dt)))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

def SolutionAlgorithimKrylovOnly(OData, Dt, Tol, Steps, MaxDim = 6):
    #Insert within the While loop, make sure parameter "ok" is defined
    import OpenSeesAPI
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Lower Dt: %e and Tol: %e ... "'%(Dt,Tol)))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Krylov... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.NormDispIncr(Tol, 1000, 2))
    # OData.AddObject(OpenSeesAPI.Analysis.Test.EnergyIncr(Tol,1000,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.KrylovNewton(MaxDim = MaxDim))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze %d %e ]'%(Steps,Dt)))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

def SenSolutionAlgorithim(OData, Dt, Steps, Tol = 1e-12, KrylovMaxDim = 12, MinDt = 1e-12, NoOfIterations=3000):
    import OpenSeesAPI
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set conv_tol %e'%Tol))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set max_iter %d;'%NoOfIterations))
    OData.AddObject(OpenSeesAPI.Analysis.Test.NormDispIncr(Tol, 3000, 0))
    # OData.AddObject(OpenSeesAPI.TCL.TCLScript('test EnergyIncr $conv_tol $max_iter;'))
    # OData.AddObject(OpenSeesAPI.TCL.TCLScript('algorithm Newton;'))
    # OData.AddObject(OpenSeesAPI.TCL.TCLScript('integrator Newmark 0.5 0.25;'))
    # OData.AddObject(OpenSeesAPI.TCL.TCLScript('analysis Transient;'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set dt %e;'%Dt))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set min_dt %e;'%MinDt))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set n_steps %d;'%Steps))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set cur_step 1;'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set div 10.0;'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set tol 1.0e-12;'))
    # OData.AddObject(OpenSeesAPI.TCL.TCLScript('set eigenvalue [eigen 9];'))
    # OData.AddObject(OpenSeesAPI.TCL.TCLScript('modalDamping 0.02;'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('while {$cur_step < $n_steps} {'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.NormDispIncr(Tol, NoOfIterations, 0))
    # OData.AddObject(OpenSeesAPI.TCL.TCLScript('	test EnergyIncr $conv_tol $max_iter;'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('	algorithm Newton;'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('	set ok [analyze 1 $dt];'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('	if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('		set dt_temp [expr $dt];'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('		puts "> analysis failed to converge at step $cur_step";'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('		puts "> trying KrylovNewton";'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('		algorithm KrylovNewton -maxDim %d;'%KrylovMaxDim))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('		set ok [analyze 1 $dt];'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('		if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('			set t 0.0;'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('			set mini_t 0.0;'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('			set dt_temp [expr round($dt/$div/$tol)*$tol];'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('			set mini_dt_temp 0.0;'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('			while {$t < $dt} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('				if {$dt_temp < $min_dt} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('					puts "<< model did not converge (reason: time step less than $min_dt)";'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('					puts "<< exiting safely";'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('					wipe;'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('					exit;'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('				};'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('				if {$dt_temp < [expr $dt/pow($div, 2)]} {'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.NormDispIncr(Tol*10, NoOfIterations, 0))
    # OData.AddObject(OpenSeesAPI.TCL.TCLScript('					test EnergyIncr [expr $conv_tol*10.0] $max_iter;'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('				};'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('				set ok [analyze 1 $dt_temp];'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('				if {$ok == 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('					set t [expr round(($t + $dt_temp)/$tol)*$tol];'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('					set mini_t [expr round(($mini_t + $dt_temp)/$tol)*$tol];'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('					if {$mini_t >= $mini_dt_temp} {set dt_temp [expr round($dt_temp*$div/$tol)*$tol]};'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('				} else {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('					set mini_t 0.0;'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('					set mini_dt_temp [expr round($dt_temp/$tol)*$tol];'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('					set dt_temp [expr round($dt_temp/$div/$tol)*$tol];'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('				};'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('			};'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('		};'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('	};'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('	if {$cur_step % 1 == 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('		puts "Running Tim History Step: $cur_step out of %d (Sen Algo.)";'%Steps))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('	};'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('	incr cur_step;'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('};'))


def PushOverSolutionAlgorithim(OData, StepSize, Tol, ControlNode):
    #Insert within the While loop, make sure parameter "ok" is defined
    import OpenSeesAPI
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Smaller Step: %f and Tol: %f ... "'%(StepSize,Tol)))

    OData.AddObject(OpenSeesAPI.Analysis.Integrator.Static.DisplacementControl(ControlNode, 1, StepSize))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying KrylovNewton ... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.EnergyIncr(Tol,1000,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.KrylovNewton())
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze 1]'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Newton Line Search ... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.EnergyIncr(Tol,1000,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch(Tolerance=0.8))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze 1]'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    # OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    # OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Newton with Initial Tangent ... "'))
    # OData.AddObject(OpenSeesAPI.Analysis.Test.NormDispIncr(Tol,1000,0))
    # OData.AddObject(OpenSeesAPI.Analysis.Algorithm.Newton(Initial=True))
    # OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze 1]'))
    # OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))
    #
    # OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    # OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Broyden ... "'))
    # OData.AddObject(OpenSeesAPI.Analysis.Test.EnergyIncr(Tol,1000,0))
    # OData.AddObject(OpenSeesAPI.Analysis.Algorithm.Broyden(8))
    # OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze 1]'))
    # OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Newton Line Search BiSection ... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.EnergyIncr(Tol,1000,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch('Bisection'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze 1]'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Newton Line Search Secant... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.EnergyIncr(Tol,1000,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch('Secant'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze 1]'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Newton Line Search RegulaFalsi ... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.EnergyIncr(Tol,1000,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch('RegulaFalsi'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze 1]'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

def PushOverSolutionAlgorithimDispIncr(OData, StepSize, Tol, ControlNode):
    #Insert within the While loop, make sure parameter "ok" is defined
    import OpenSeesAPI
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Smaller Step: %f and Tol: %f ... "'%(StepSize,Tol)))

    OData.AddObject(OpenSeesAPI.Analysis.Integrator.Static.DisplacementControl(ControlNode, 1, StepSize))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying KrylovNewton ... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.NormDispIncr(Tol,1000,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.KrylovNewton())
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze 1]'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Newton Line Search ... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.NormDispIncr(Tol,1000,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch(Tolerance=0.8))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze 1]'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Newton Line Search BiSection ... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.NormDispIncr(Tol,1000,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch('Bisection'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze 1]'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Newton Line Search Secant... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.NormDispIncr(Tol,1000,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch('Secant'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze 1]'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Newton Line Search RegulaFalsi ... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.NormDispIncr(Tol,1000,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch('RegulaFalsi'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze 1]'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

def PushOverSolutionAlgorithimConstantAlgorithm(OData, StepSize, Tol, ControlNode, Iter=1000):
    import OpenSeesAPI
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Smaller Step: %f and Tol: %f ... "'%(StepSize,Tol)))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    OData.AddObject(OpenSeesAPI.Analysis.Integrator.Static.DisplacementControl(ControlNode, 1, StepSize))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying KrylovNewton ... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.EnergyIncr(Tol,1000,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.KrylovNewton())
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze 1]'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

def PushOverSolutionAlgorithimConstantAlgorithmDispIncr(OData, StepSize, Tol, ControlNode, NoOfIterations=1000):
    import OpenSeesAPI
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Smaller Step: %f and Tol: %f ... "'%(StepSize,Tol)))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    OData.AddObject(OpenSeesAPI.Analysis.Integrator.Static.DisplacementControl(ControlNode, 1, StepSize))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying KrylovNewton ... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.NormDispIncr(Tol,NoOfIterations,2))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.KrylovNewton())
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze 1]'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

def PushOverSolutionAlgorithimConstantTol(OData, Tol, Iter=1000):
    import OpenSeesAPI
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying KrylovNewton ... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.EnergyIncr(Tol,Iter,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.KrylovNewton())
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze 1]'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Newton Line Search ... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.EnergyIncr(Tol,Iter,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch(Tolerance=0.8))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze 1]'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Newton Line Search BiSection ... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.EnergyIncr(Tol,Iter,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch('Bisection'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze 1]'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Newton Line Search Secant... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.EnergyIncr(Tol,Iter,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch('Secant'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze 1]'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))

    OData.AddObject(OpenSeesAPI.TCL.TCLScript('if {$ok != 0} {'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('puts "Trying Newton Line Search RegulaFalsi ... "'))
    OData.AddObject(OpenSeesAPI.Analysis.Test.EnergyIncr(Tol,Iter,0))
    OData.AddObject(OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch('RegulaFalsi'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('set ok [analyze 1]'))
    OData.AddObject(OpenSeesAPI.TCL.TCLScript('}'))
[(8, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (9, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (10, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (11, 'OpenSeesAPI.Analysis.Test.EnergyIncr', 'OpenSeesAPI.Analysis.Test.EnergyIncr', False, 'import OpenSeesAPI\n'), (12, 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', False, 'import OpenSeesAPI\n'), (13, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (14, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (16, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (17, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (18, 'OpenSeesAPI.Analysis.Test.NormDispIncr', 'OpenSeesAPI.Analysis.Test.NormDispIncr', False, 'import OpenSeesAPI\n'), (19, 'OpenSeesAPI.Analysis.Algorithm.Newton', 'OpenSeesAPI.Analysis.Algorithm.Newton', False, 'import OpenSeesAPI\n'), (20, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (21, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (23, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (24, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (25, 'OpenSeesAPI.Analysis.Test.EnergyIncr', 'OpenSeesAPI.Analysis.Test.EnergyIncr', False, 'import OpenSeesAPI\n'), (26, 'OpenSeesAPI.Analysis.Algorithm.Broyden', 'OpenSeesAPI.Analysis.Algorithm.Broyden', False, 'import OpenSeesAPI\n'), (27, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (28, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (30, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (31, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (32, 'OpenSeesAPI.Analysis.Test.EnergyIncr', 'OpenSeesAPI.Analysis.Test.EnergyIncr', False, 'import OpenSeesAPI\n'), (33, 'OpenSeesAPI.Analysis.Algorithm.KrylovNewton', 'OpenSeesAPI.Analysis.Algorithm.KrylovNewton', False, 'import OpenSeesAPI\n'), (34, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (35, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (40, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (41, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (42, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (43, 'OpenSeesAPI.Analysis.Test.EnergyIncr', 'OpenSeesAPI.Analysis.Test.EnergyIncr', False, 'import OpenSeesAPI\n'), (44, 'OpenSeesAPI.Analysis.Algorithm.KrylovNewton', 'OpenSeesAPI.Analysis.Algorithm.KrylovNewton', False, 'import OpenSeesAPI\n'), (45, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (46, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (48, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (49, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (50, 'OpenSeesAPI.Analysis.Test.NormDispIncr', 'OpenSeesAPI.Analysis.Test.NormDispIncr', False, 'import OpenSeesAPI\n'), (51, 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', False, 'import OpenSeesAPI\n'), (52, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (53, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (55, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (56, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (57, 'OpenSeesAPI.Analysis.Test.EnergyIncr', 'OpenSeesAPI.Analysis.Test.EnergyIncr', False, 'import OpenSeesAPI\n'), (58, 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', False, 'import OpenSeesAPI\n'), (59, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (60, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (62, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (63, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (64, 'OpenSeesAPI.Analysis.Test.EnergyIncr', 'OpenSeesAPI.Analysis.Test.EnergyIncr', False, 'import OpenSeesAPI\n'), (65, 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', False, 'import OpenSeesAPI\n'), (66, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (67, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (69, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (70, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (71, 'OpenSeesAPI.Analysis.Test.EnergyIncr', 'OpenSeesAPI.Analysis.Test.EnergyIncr', False, 'import OpenSeesAPI\n'), (72, 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', False, 'import OpenSeesAPI\n'), (73, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (74, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (79, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (80, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (81, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (82, 'OpenSeesAPI.Analysis.Test.NormDispIncr', 'OpenSeesAPI.Analysis.Test.NormDispIncr', False, 'import OpenSeesAPI\n'), (84, 'OpenSeesAPI.Analysis.Algorithm.KrylovNewton', 'OpenSeesAPI.Analysis.Algorithm.KrylovNewton', False, 'import OpenSeesAPI\n'), (85, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (86, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (90, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (91, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (92, 'OpenSeesAPI.Analysis.Test.NormDispIncr', 'OpenSeesAPI.Analysis.Test.NormDispIncr', False, 'import OpenSeesAPI\n'), (97, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (98, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (99, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (100, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (101, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (102, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (105, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (106, 'OpenSeesAPI.Analysis.Test.NormDispIncr', 'OpenSeesAPI.Analysis.Test.NormDispIncr', False, 'import OpenSeesAPI\n'), (108, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (109, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (110, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (111, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (112, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (113, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (114, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (115, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (116, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (117, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (118, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (119, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (120, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (121, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (122, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (123, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (124, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (125, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (126, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (127, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (128, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (129, 'OpenSeesAPI.Analysis.Test.NormDispIncr', 'OpenSeesAPI.Analysis.Test.NormDispIncr', False, 'import OpenSeesAPI\n'), (131, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (132, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (133, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (134, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (135, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (136, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (137, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (138, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (139, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (140, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (141, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (142, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (143, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (144, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (145, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (146, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (147, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (148, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (149, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (155, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (156, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (158, 'OpenSeesAPI.Analysis.Integrator.Static.DisplacementControl', 'OpenSeesAPI.Analysis.Integrator.Static.DisplacementControl', False, 'import OpenSeesAPI\n'), (160, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (162, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (163, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (164, 'OpenSeesAPI.Analysis.Test.EnergyIncr', 'OpenSeesAPI.Analysis.Test.EnergyIncr', False, 'import OpenSeesAPI\n'), (165, 'OpenSeesAPI.Analysis.Algorithm.KrylovNewton', 'OpenSeesAPI.Analysis.Algorithm.KrylovNewton', False, 'import OpenSeesAPI\n'), (166, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (167, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (169, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (170, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (171, 'OpenSeesAPI.Analysis.Test.EnergyIncr', 'OpenSeesAPI.Analysis.Test.EnergyIncr', False, 'import OpenSeesAPI\n'), (172, 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', False, 'import OpenSeesAPI\n'), (173, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (174, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (190, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (191, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (192, 'OpenSeesAPI.Analysis.Test.EnergyIncr', 'OpenSeesAPI.Analysis.Test.EnergyIncr', False, 'import OpenSeesAPI\n'), (193, 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', False, 'import OpenSeesAPI\n'), (194, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (195, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (197, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (198, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (199, 'OpenSeesAPI.Analysis.Test.EnergyIncr', 'OpenSeesAPI.Analysis.Test.EnergyIncr', False, 'import OpenSeesAPI\n'), (200, 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', False, 'import OpenSeesAPI\n'), (201, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (202, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (204, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (205, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (206, 'OpenSeesAPI.Analysis.Test.EnergyIncr', 'OpenSeesAPI.Analysis.Test.EnergyIncr', False, 'import OpenSeesAPI\n'), (207, 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', False, 'import OpenSeesAPI\n'), (208, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (209, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (214, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (215, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (217, 'OpenSeesAPI.Analysis.Integrator.Static.DisplacementControl', 'OpenSeesAPI.Analysis.Integrator.Static.DisplacementControl', False, 'import OpenSeesAPI\n'), (219, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (221, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (222, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (223, 'OpenSeesAPI.Analysis.Test.NormDispIncr', 'OpenSeesAPI.Analysis.Test.NormDispIncr', False, 'import OpenSeesAPI\n'), (224, 'OpenSeesAPI.Analysis.Algorithm.KrylovNewton', 'OpenSeesAPI.Analysis.Algorithm.KrylovNewton', False, 'import OpenSeesAPI\n'), (225, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (226, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (228, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (229, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (230, 'OpenSeesAPI.Analysis.Test.NormDispIncr', 'OpenSeesAPI.Analysis.Test.NormDispIncr', False, 'import OpenSeesAPI\n'), (231, 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', False, 'import OpenSeesAPI\n'), (232, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (233, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (235, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (236, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (237, 'OpenSeesAPI.Analysis.Test.NormDispIncr', 'OpenSeesAPI.Analysis.Test.NormDispIncr', False, 'import OpenSeesAPI\n'), (238, 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', False, 'import OpenSeesAPI\n'), (239, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (240, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (242, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (243, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (244, 'OpenSeesAPI.Analysis.Test.NormDispIncr', 'OpenSeesAPI.Analysis.Test.NormDispIncr', False, 'import OpenSeesAPI\n'), (245, 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', False, 'import OpenSeesAPI\n'), (246, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (247, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (249, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (250, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (251, 'OpenSeesAPI.Analysis.Test.NormDispIncr', 'OpenSeesAPI.Analysis.Test.NormDispIncr', False, 'import OpenSeesAPI\n'), (252, 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', False, 'import OpenSeesAPI\n'), (253, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (254, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (258, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (259, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (260, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (262, 'OpenSeesAPI.Analysis.Integrator.Static.DisplacementControl', 'OpenSeesAPI.Analysis.Integrator.Static.DisplacementControl', False, 'import OpenSeesAPI\n'), (264, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (265, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (266, 'OpenSeesAPI.Analysis.Test.EnergyIncr', 'OpenSeesAPI.Analysis.Test.EnergyIncr', False, 'import OpenSeesAPI\n'), (267, 'OpenSeesAPI.Analysis.Algorithm.KrylovNewton', 'OpenSeesAPI.Analysis.Algorithm.KrylovNewton', False, 'import OpenSeesAPI\n'), (268, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (269, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (273, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (274, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (275, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (277, 'OpenSeesAPI.Analysis.Integrator.Static.DisplacementControl', 'OpenSeesAPI.Analysis.Integrator.Static.DisplacementControl', False, 'import OpenSeesAPI\n'), (279, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (280, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (281, 'OpenSeesAPI.Analysis.Test.NormDispIncr', 'OpenSeesAPI.Analysis.Test.NormDispIncr', False, 'import OpenSeesAPI\n'), (282, 'OpenSeesAPI.Analysis.Algorithm.KrylovNewton', 'OpenSeesAPI.Analysis.Algorithm.KrylovNewton', False, 'import OpenSeesAPI\n'), (283, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (284, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (288, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (289, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (290, 'OpenSeesAPI.Analysis.Test.EnergyIncr', 'OpenSeesAPI.Analysis.Test.EnergyIncr', False, 'import OpenSeesAPI\n'), (291, 'OpenSeesAPI.Analysis.Algorithm.KrylovNewton', 'OpenSeesAPI.Analysis.Algorithm.KrylovNewton', False, 'import OpenSeesAPI\n'), (292, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (293, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (295, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (296, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (297, 'OpenSeesAPI.Analysis.Test.EnergyIncr', 'OpenSeesAPI.Analysis.Test.EnergyIncr', False, 'import OpenSeesAPI\n'), (298, 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', False, 'import OpenSeesAPI\n'), (299, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (300, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (302, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (303, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (304, 'OpenSeesAPI.Analysis.Test.EnergyIncr', 'OpenSeesAPI.Analysis.Test.EnergyIncr', False, 'import OpenSeesAPI\n'), (305, 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', False, 'import OpenSeesAPI\n'), (306, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (307, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (309, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (310, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (311, 'OpenSeesAPI.Analysis.Test.EnergyIncr', 'OpenSeesAPI.Analysis.Test.EnergyIncr', False, 'import OpenSeesAPI\n'), (312, 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', False, 'import OpenSeesAPI\n'), (313, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (314, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (316, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (317, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (318, 'OpenSeesAPI.Analysis.Test.EnergyIncr', 'OpenSeesAPI.Analysis.Test.EnergyIncr', False, 'import OpenSeesAPI\n'), (319, 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', 'OpenSeesAPI.Analysis.Algorithm.NewtonLineSearch', False, 'import OpenSeesAPI\n'), (320, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n'), (321, 'OpenSeesAPI.TCL.TCLScript', 'OpenSeesAPI.TCL.TCLScript', False, 'import OpenSeesAPI\n')]