Skip to content

Commit

Permalink
Minor code cleanup and notes (idaholab#28471)
Browse files Browse the repository at this point in the history
  • Loading branch information
dschwen committed Sep 10, 2024
1 parent 757ea46 commit 1331028
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ ADComputeIncrementalShellStrain::computeGMatrix()
gmn(0, 2) += (*_dxyz_dxi[j])[i](component) * (*_dxyz_dzeta[j])[i](component);
gmn(1, 2) += (*_dxyz_deta[j])[i](component) * (*_dxyz_dzeta[j])[i](component);

// why are we dropping derivatives here?!
J(0, component) = MetaPhysicL::raw_value((*_dxyz_dxi[j])[i](component));
J(1, component) = MetaPhysicL::raw_value((*_dxyz_deta[j])[i](component));
J(2, component) = MetaPhysicL::raw_value((*_dxyz_dzeta[j])[i](component));
Expand Down Expand Up @@ -384,6 +385,7 @@ ADComputeIncrementalShellStrain::computeGMatrix()
J(2, 1) /= normz;
J(2, 2) /= normz;

// _transformation_matrix is an AD property, but we're not setting the derivatives!
(*_transformation_matrix)[i] = J;

// calculate ge
Expand All @@ -393,27 +395,16 @@ ADComputeIncrementalShellStrain::computeGMatrix()
ADRealVectorValue e2 = e3.cross(e1);
e2 /= e2.norm();

ADRankTwoTensor local_rotation_mat;
local_rotation_mat(0, 0) = e1(0);
local_rotation_mat(0, 1) = e1(1);
local_rotation_mat(0, 2) = e1(2);
local_rotation_mat(1, 0) = e2(0);
local_rotation_mat(1, 1) = e2(1);
local_rotation_mat(1, 2) = e2(2);
local_rotation_mat(2, 0) = e3(0);
local_rotation_mat(2, 1) = e3(1);
local_rotation_mat(2, 2) = e3(2);

// Calculate the contravariant base vectors g^0, g^1, g^2
// The base vectors for the strain tensor in the convected coordinate
// are g_0, g_1, g_2 (g_i=dx/dr_i)
// The following contravariant base vectors have the property:
// g^i*g_j= 1 if {i=j} otherwise g^i*g_j= 0

ADReal denom = ((*_dxyz_dxi[j])[i] * ((*_dxyz_deta[j])[i].cross((*_dxyz_dzeta[j])[i])));
ADRealVectorValue gi0 = ((*_dxyz_deta[j])[i].cross((*_dxyz_dzeta[j])[i])) / denom;
ADRealVectorValue gi1 = ((*_dxyz_dzeta[j])[i].cross((*_dxyz_dxi[j])[i])) / denom;
ADRealVectorValue gi2 = ((*_dxyz_dxi[j])[i].cross((*_dxyz_deta[j])[i])) / denom;
const auto denom = (*_dxyz_dxi[j])[i] * (*_dxyz_deta[j])[i].cross((*_dxyz_dzeta[j])[i]);
const auto gi0 = (*_dxyz_deta[j])[i].cross((*_dxyz_dzeta[j])[i]) / denom;
const auto gi1 = (*_dxyz_dzeta[j])[i].cross((*_dxyz_dxi[j])[i]) / denom;
const auto gi2 = (*_dxyz_dxi[j])[i].cross((*_dxyz_deta[j])[i]) / denom;

// Calculate the rotation matrix for the elasticity tensor that maps
// the strain tensor (with g_1, g2_, g_3 base vectors) to
Expand Down
63 changes: 31 additions & 32 deletions modules/solid_mechanics/test/tests/shell/static/tests
Original file line number Diff line number Diff line change
@@ -1,112 +1,111 @@
[Tests]
design = "ShellElements.md"
issues = "#14280 #21384 #28471"
[./beam_bending]
[beam_bending]
type = 'Exodiff'
input = 'beam_bending_moment_AD.i'
exodiff = 'beam_bending_moment_AD_out.e'

requirement = "The mechanics system shall accurately compute the deflection of a cantilever beam when it is modeled using shell elements."
[../]
[./rotated_beam_bending]
[]
[rotated_beam_bending]
type = 'Exodiff'
input = 'beam_bending_moment_AD_2.i'
exodiff = 'beam_bending_moment_AD_2_out.e'

requirement = "The mechanics system shall accurately compute the deflection of a rotated cantilever beam when it is modeled using shell elements."
[../]
[./large_beam_bending]
[]
[large_beam_bending]
type = 'Exodiff'
input = 'large_strain_m_40_AD.i'
exodiff = 'large_strain_m_40_AD_out.e'
petsc_version = '>=3.9.0'
requirement = "The mechanics system shall accurately compute the deflection of a cantilever beam when it is modeled using shell elements under large strain and rotations are included."
[../]
[./beam_bending_jacobian]
[]
[beam_bending_jacobian]
type = 'PetscJacobianTester'
input = 'beam_bending_moment_AD.i'

requirement = "The mechanics system shall accurately compute the Jacobian for a small strain quasi-static shell element."
[../]
[./large_beam_bending_jacobian]
[]
[large_beam_bending_jacobian]
type = 'PetscJacobianTester'
input = 'large_strain_m_40_AD.i'
cli_args = 'Executioner/num_steps=1'
petsc_version = '>=3.9.0'
requirement = "The mechanics system shall accurately compute the Jacobian for a large strain quasi-static shell element."
[../]
[./plate_bending]
[]
[plate_bending]
type = 'Exodiff'
input = 'plate_bending.i'
exodiff = 'plate_bending_out.e'
heavy = true

requirement = "The mechanics system shall accurately model the deflection of a simply supported under uniform loading."
[../]
[./plate_bending2]
[]
[plate_bending2]
type = 'Exodiff'
input = plate_bending2.i
exodiff = 'plate_bending2_out.e'

requirement = "The mechanics system shall accurately model deflection of a plate with multiple force and moment boundary conditions."
[../]
[./pinched_cylinder]
[]
[pinched_cylinder]
type = 'Exodiff'
input = pinched_cylinder_symm.i
exodiff = 'pinched_cylinder_symm_out.e'

requirement = "The mechanics system shall accurately model the deflection of a pinched cylinder modeled when it is modeled using shell elements."
[../]
[./inclined_plane]
[]
[inclined_plane]
type = 'Exodiff'
input = inclined_straintest.i
exodiff = 'inclined_straintest_out.e'

requirement = "The mechanics system shall accurately model the deflection of a inclined shell elements."
[../]
[./straintest_axial]
[]
[straintest_axial]
type = 'Exodiff'
input = straintest.i
exodiff = 'straintest_out.e'

requirement = "The mechanics system shall accurately compute the axial stress and strain of the shell elements."
[../]
[./finite_straintest_axial]
[]
[finite_straintest_axial]
type = 'Exodiff'
input = finite_straintest.i
exodiff = 'finite_straintest_out.e'

issues = '#25266'

requirement = "The mechanics system shall accurately compute the axial stress and strain of the shell elements using the finite strain formulation."
[../]
[./straintest_shear]
[]
[straintest_shear]
type = 'Exodiff'
input = straintest_shear.i
exodiff = 'straintest_shear_out.e'

requirement = "The mechanics system shall accurately compute the stress and strain of the shell elements subjected to shear deformation."
[../]
[./tapered]
[]
[tapered]
type = 'Exodiff'
input = tapered.i
exodiff = 'tapered_out.e'

requirement = "The mechanics system shall accurately compute the stress and strain of the tapered shell elements."
[../]
[./qp_error]
[]
[qp_error]
type = 'RunException'
input = pressure_error.i
expect_err = 'Shell element needs to have exactly four quadrature points.'

requirement = "The system shall generate an error if the shell strain material is evaluated when the number of quadrature points does not equal 4."
[../]
[./pinched_cylinder_symm_unstructured]
[]
[pinched_cylinder_symm_unstructured]
type = 'Exodiff'
input = pinched_cylinder_symm_unstructured.i
exodiff = 'pinched_cylinder_symm_unstructured_out.e'

requirement = "Shell elements should have compatible stresses even for unstructured meshes."
[../]

[]
[]

0 comments on commit 1331028

Please sign in to comment.