Skip to content

Commit

Permalink
Add test for skip_times option in Predictor closes #6506
Browse files Browse the repository at this point in the history
  • Loading branch information
bwspenc committed Mar 4, 2016
1 parent 3e5f806 commit 052b00b
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 20 deletions.
Binary file removed modules/solid_mechanics/tests/predictor/gold/out.e
Binary file not shown.
@@ -0,0 +1,4 @@
time,nonlinear_its
0,0
1,2

@@ -0,0 +1,4 @@
time,nonlinear_its
0,0
1,0

157 changes: 157 additions & 0 deletions modules/solid_mechanics/tests/predictor/predictor_skip_test.i
@@ -0,0 +1,157 @@
#The purpose of this test is to test the loadstep predictor. This is a very
#small, monotonically loaded block of material. If things are working right,
#the predictor should come very close to exactly nailing the solution on steps
#after the first step. Because of nonlinear geometry, the predictor is slightly
#off in general, but that is mitigated by setting this up so that the elements
#undergo no rotations.

#This test checks to see that the predictor is skipped in the last step.

[Mesh]
displacements = 'disp_x disp_y disp_z'
file = predictor_test.e
[] # Mesh

[Functions]
[./ramp1]
type = PiecewiseLinear
x = '0. 1.'
y = '0. 1.'
scale_factor = 0.2
[../]
[] # Functions

[Variables]

[./disp_x]
order = FIRST
family = LAGRANGE
[../]

[./disp_y]
order = FIRST
family = LAGRANGE
[../]

[./disp_z]
order = FIRST
family = LAGRANGE
[../]

[] # Variables

[SolidMechanics]
[./solid]
disp_x = disp_x
disp_y = disp_y
disp_z = disp_z
[../]
[]

[BCs]

[./ss1_x]
type = PresetBC
variable = disp_x
boundary = 4
value = 0.0
[../]
[./ss1_y]
type = PresetBC
variable = disp_y
boundary = 4
value = 0.0
[../]
[./ss1_z]
type = PresetBC
variable = disp_z
boundary = 4
value = 0.0
[../]

[./ss2_x]
type = FunctionPresetBC
variable = disp_x
boundary = 2
function = ramp1
[../]
[./ss2_y]
type = FunctionPresetBC
variable = disp_y
boundary = 2
function = ramp1
[../]
[./ss2_z]
type = PresetBC
variable = disp_z
boundary = 2
value = 0.0
[../]

[] # BCs

[Materials]

[./stiffStuff1]
type = Elastic
block = 1

disp_x = disp_x
disp_y = disp_y
disp_z = disp_z

youngs_modulus = 1e6
poissons_ratio = 0.0
[../]
[] # Materials

[Executioner]

type = Transient


#Preconditioned JFNK (default)
solve_type = 'PJFNK'




# controls for linear iterations
l_max_its = 100
l_tol = 1e-8

# controls for nonlinear iterations
nl_max_its = 15
nl_rel_tol = 1e-5
nl_abs_tol = 1e-7

# l_max_its = 20

start_time = 0.0
dt = 0.25
num_steps = 4
end_time = 1.0

[./Predictor]
type = SimplePredictor
scale = 1.0
skip_times = '1.0'
[../]
[] # Executioner

[Postprocessors]
[./nonlinear_its]
type = NumNonlinearIterations
[../]
[]

[Outputs]
[./out]
type=Exodus
interval = 4
[../]
[./csv]
type=CSV
interval = 4
[../]
[] # Outputs
25 changes: 8 additions & 17 deletions modules/solid_mechanics/tests/predictor/predictor_test.i
Expand Up @@ -11,21 +11,7 @@
#has to work.

[Mesh]
# generated =true
displacements = 'disp_x disp_y disp_z'
# [./Generation]
# dim = 3
# nx = 2
# ny = 2
# nz = 1
# xmin = 0
# xmax = 2
# ymin = 0
# ymax = 2
# zmin = 0
# zmax = 1
# elem_type = HEX8
# [../]
file = predictor_test.e
[] # Mesh

Expand Down Expand Up @@ -162,7 +148,12 @@
[]

[Outputs]
file_base = out
interval = 4
exodus = true
[./out]
type=Exodus
interval = 4
[../]
[./csv]
type=CSV
interval = 4
[../]
[] # Outputs
10 changes: 7 additions & 3 deletions modules/solid_mechanics/tests/predictor/tests
@@ -1,8 +1,12 @@
[Tests]
[./test]
type = 'Exodiff'
type = 'CSVDiff'
input = 'predictor_test.i'
exodiff = 'out.e'
abs_zero = 1e-10
csvdiff = 'predictor_test_csv.csv'
[../]
[./test_skip]
type = 'CSVDiff'
input = 'predictor_skip_test.i'
csvdiff = 'predictor_skip_test_csv.csv'
[../]
[]

0 comments on commit 052b00b

Please sign in to comment.