forked from idaholab/moose
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move PenaltyDirichletBC from tests and add solid_mechanics test closes …
…idaholab#5268 Also made the penalty a required parameter. Seems to me that if you're using penalty anything, you'd better know what the penalty is.
- Loading branch information
Showing
15 changed files
with
165 additions
and
11 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
142 changes: 142 additions & 0 deletions
142
modules/solid_mechanics/tests/penalty_dirichlet/penalty_dirichlet.i
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 | ||
[../] | ||
[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[Tests] | ||
[./test] | ||
type = 'Exodiff' | ||
input = 'penalty_dirichlet.i' | ||
exodiff = 'out.e' | ||
[../] | ||
[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,7 @@ | |
variable = u | ||
function = solution | ||
boundary = 'top left right bottom' | ||
penalty = 1e6 | ||
[../] | ||
[] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters