forked from idaholab/moose
/
penalty_dirichlet.i
142 lines (130 loc) · 2.5 KB
/
penalty_dirichlet.i
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#This tests the PenaltyDirichletBC and PenaltyFunctionDirichletBC on
#a simple solid mechanics problem. A unit cube of material has
#penalty BCs on the left and right hand side. The penalty for both of
#those BCs is the same as the stiffness of the block in that direction,
#so the compliance is due to the left BC, block, and right BC in equal
#portions. As a result, the displacement on the left side is 1/3 the
#displacement imposed by the function, and on the right side it is 2/3
#that value.
[Mesh]
type = GeneratedMesh
dim = 2
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
nx = 2
ny = 2
displacements = 'disp_x disp_y'
[]
[Variables]
[./disp_x]
order = FIRST
family = LAGRANGE
[../]
[./disp_y]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./stress_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_zz]
order = CONSTANT
family = MONOMIAL
[../]
[]
[SolidMechanics]
[./solid]
disp_x = disp_x
disp_y = disp_y
[../]
[]
[AuxKernels]
[./stress_xx]
type = MaterialTensorAux
variable = stress_xx
tensor = stress
index = 0
[../]
[./stress_yy]
type = MaterialTensorAux
variable = stress_yy
tensor = stress
index = 1
[../]
[./stress_zz]
type = MaterialTensorAux
variable = stress_zz
tensor = stress
index = 2
[../]
[]
[Functions]
[./pull]
type = PiecewiseLinear
xy_data = '0 0
1 0.001'
[../]
[]
[BCs]
[./left_x]
type = PenaltyDirichletBC
variable = disp_x
boundary = left
value = 0.0
penalty = 1e4
[../]
[./right_x]
type = FunctionPenaltyDirichletBC
variable = disp_x
boundary = right
function = pull
penalty = 1e4
[../]
[./bottom_y]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[../]
[]
[Materials]
[./solid]
type = Elastic
block = 0
disp_x = disp_x
disp_y = disp_y
youngs_modulus = 1e4
poissons_ratio = 0.0
[../]
[]
[Executioner]
type = Transient
#Preconditioned JFNK (default)
solve_type = 'PJFNK'
petsc_options = '-snes_ksp_ew '
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type'
petsc_options_value = '101 hypre boomeramg'
nl_rel_tol = 1e-12
l_tol = 1e-5
start_time = 0.0
dt = 1
num_steps = 1
[]
[Outputs]
file_base = out
output_initial = true
print_linear_residuals = true
print_perf_log = true
[./exodus]
type = Exodus
[../]
[]