############################################################################
# Mesh convergence study for plate pentration verification                 #
# problem in ABAQUS/Explicit                                               #
# Study parameters:                                                        #
#       velo: Missile velocity                                             #
############################################################################

# Create the study
velo = parStudy(par='velo')

# Define the parameters
velo.define(DISCRETE, par='velo', domain=(400,600,800,1000))

# CONSIDER SHEAR FAILURE
# Sample the parameters
velo.sample(INTERVAL, par='velo', interval=1)

# Combine the samples into design points
velo.combine(MESH, name='velo')

# Generate analysis job data
velo.generate(template='pp_velo_study')

# Execute all analysis jobs sequentially
velo.execute(ALL)

# Study output at end of step 1
velo.output(step=1)

# Gather the results for the velocity of the projectile
velo.gather(results='vel', variable='V', node=99999)

# Report the gathered results to an output file
velo.report(FILE, results=('vel.2'), par=('velo'),
	    file='pp_velo_study.psr')


###################################
# using ODB API

# Study output at end of step 1
velo.output(step=1, file=ODB)

# Gather the results for the velocity of the projectile
velo.gather(results='vel', variable='V2', node=99999, request=HISTORY, instance="PART-1-1")

# Report the gathered results to an output file
velo.report(FILE, results=('vel'), par=('velo'),
	    file='pp_velo_study.psr')