This commit is contained in:
@@ -11,10 +11,14 @@ program test_element_stiffness
|
||||
|
||||
call check_c3d4_stiff()
|
||||
call check_c3d8_stiff()
|
||||
call check_c3d8r_stiff()
|
||||
call check_c3d8r_hourglass_stab()
|
||||
call check_c3d10_stiff()
|
||||
call check_c3d20_stiff()
|
||||
call check_s3_stiff()
|
||||
call check_s4_stiff()
|
||||
call check_s4r_stiff()
|
||||
call check_s4r_hourglass_stab()
|
||||
call check_s6_stiff()
|
||||
call check_s8_stiff()
|
||||
call check_shell_stab_controls()
|
||||
@@ -69,6 +73,63 @@ contains
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(29)
|
||||
end subroutine check_c3d8_stiff
|
||||
|
||||
subroutine check_c3d8r_stiff()
|
||||
integer :: ierr
|
||||
integer :: elem_dofs(MAX_TEST_DOF)
|
||||
integer :: n_elem_dof
|
||||
real(rk) :: ke(MAX_TEST_DOF,MAX_TEST_DOF)
|
||||
|
||||
call setup_c3d8r(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(170)
|
||||
|
||||
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(171)
|
||||
if (n_elem_dof .ne. 24) call fail(172)
|
||||
if (elem_dofs(1) .ne. 1 .or. elem_dofs(24) .ne. 24) call fail(173)
|
||||
call check_symmetric(ke, n_elem_dof, 174)
|
||||
call check_rigid_translation(ke, n_elem_dof, 1, 175)
|
||||
call check_rigid_translation(ke, n_elem_dof, 2, 176)
|
||||
call check_rigid_translation(ke, n_elem_dof, 3, 177)
|
||||
call check_positive_energy(ke, n_elem_dof, 178)
|
||||
|
||||
call database_finalize(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(179)
|
||||
end subroutine check_c3d8r_stiff
|
||||
|
||||
subroutine check_c3d8r_hourglass_stab()
|
||||
integer :: ierr
|
||||
integer :: elem_dofs(MAX_TEST_DOF)
|
||||
integer :: n_elem_dof
|
||||
real(rk) :: ke(MAX_TEST_DOF,MAX_TEST_DOF)
|
||||
real(rk) :: unstabilized_energy
|
||||
real(rk) :: stabilized_energy
|
||||
|
||||
call control_set_defaults()
|
||||
solid8r_hourglass_factor = ZERO
|
||||
call setup_c3d8r(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(180)
|
||||
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(181)
|
||||
unstabilized_energy = solid_hourglass_energy(ke, n_elem_dof, 1, 1)
|
||||
if (abs(unstabilized_energy) .gt. TOL) call fail(182)
|
||||
call database_finalize(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(183)
|
||||
|
||||
call control_set_defaults()
|
||||
call setup_c3d8r(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(184)
|
||||
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(185)
|
||||
stabilized_energy = solid_hourglass_energy(ke, n_elem_dof, 1, 1)
|
||||
if (stabilized_energy .le. TOL) call fail(186)
|
||||
call check_rigid_translation(ke, n_elem_dof, 1, 187)
|
||||
call check_rigid_translation(ke, n_elem_dof, 2, 188)
|
||||
call check_rigid_translation(ke, n_elem_dof, 3, 189)
|
||||
call database_finalize(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(190)
|
||||
call control_set_defaults()
|
||||
end subroutine check_c3d8r_hourglass_stab
|
||||
|
||||
subroutine check_c3d10_stiff()
|
||||
integer :: ierr
|
||||
integer :: elem_dofs(MAX_TEST_DOF)
|
||||
@@ -161,6 +222,63 @@ contains
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(69)
|
||||
end subroutine check_s4_stiff
|
||||
|
||||
subroutine check_s4r_stiff()
|
||||
integer :: ierr
|
||||
integer :: elem_dofs(MAX_TEST_DOF)
|
||||
integer :: n_elem_dof
|
||||
real(rk) :: ke(MAX_TEST_DOF,MAX_TEST_DOF)
|
||||
|
||||
call setup_s4r(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(140)
|
||||
|
||||
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(141)
|
||||
if (n_elem_dof .ne. 24) call fail(142)
|
||||
if (elem_dofs(1) .ne. 1 .or. elem_dofs(24) .ne. 24) call fail(143)
|
||||
call check_symmetric(ke, n_elem_dof, 144)
|
||||
call check_shell_rigid_translation(ke, n_elem_dof, 1, 145)
|
||||
call check_shell_rigid_translation(ke, n_elem_dof, 2, 146)
|
||||
call check_shell_rigid_translation(ke, n_elem_dof, 3, 147)
|
||||
call check_positive_energy(ke, n_elem_dof, 148)
|
||||
|
||||
call database_finalize(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(149)
|
||||
end subroutine check_s4r_stiff
|
||||
|
||||
subroutine check_s4r_hourglass_stab()
|
||||
integer :: ierr
|
||||
integer :: elem_dofs(MAX_TEST_DOF)
|
||||
integer :: n_elem_dof
|
||||
real(rk) :: ke(MAX_TEST_DOF,MAX_TEST_DOF)
|
||||
real(rk) :: unstabilized_energy
|
||||
real(rk) :: stabilized_energy
|
||||
|
||||
call control_set_defaults()
|
||||
shell4r_hourglass_factor = ZERO
|
||||
call setup_s4r(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(150)
|
||||
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(151)
|
||||
unstabilized_energy = shell_hourglass_energy(ke, n_elem_dof, 1)
|
||||
if (abs(unstabilized_energy) .gt. TOL) call fail(152)
|
||||
call database_finalize(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(153)
|
||||
|
||||
call control_set_defaults()
|
||||
call setup_s4r(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(154)
|
||||
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(155)
|
||||
stabilized_energy = shell_hourglass_energy(ke, n_elem_dof, 1)
|
||||
if (stabilized_energy .le. TOL) call fail(156)
|
||||
call check_shell_rigid_translation(ke, n_elem_dof, 1, 157)
|
||||
call check_shell_rigid_translation(ke, n_elem_dof, 2, 158)
|
||||
call check_shell_rigid_translation(ke, n_elem_dof, 3, 159)
|
||||
call database_finalize(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(160)
|
||||
call control_set_defaults()
|
||||
end subroutine check_s4r_hourglass_stab
|
||||
|
||||
subroutine check_s6_stiff()
|
||||
integer :: ierr
|
||||
integer :: elem_dofs(MAX_TEST_DOF)
|
||||
@@ -358,6 +476,14 @@ contains
|
||||
call database_assign_dofs(ierr)
|
||||
end subroutine setup_c3d8
|
||||
|
||||
subroutine setup_c3d8r(ierr)
|
||||
integer, intent(out) :: ierr
|
||||
|
||||
call setup_c3d8(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) return
|
||||
elem_type(1) = 'C3D8R'
|
||||
end subroutine setup_c3d8r
|
||||
|
||||
subroutine setup_c3d10(ierr)
|
||||
integer, intent(out) :: ierr
|
||||
|
||||
@@ -507,6 +633,45 @@ contains
|
||||
call database_assign_dofs(ierr)
|
||||
end subroutine setup_s4
|
||||
|
||||
subroutine setup_s4r(ierr)
|
||||
integer, intent(out) :: ierr
|
||||
|
||||
call database_allocate_model(4, 1, 0, 1, 0, 1, 1, 0, 1, &
|
||||
0, 0, 0, 0, 0, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) return
|
||||
call fill_node_ids(4)
|
||||
|
||||
coord0(:,1) = (/ ZERO, ZERO, ZERO /)
|
||||
coord0(:,2) = (/ ONE, ZERO, ZERO /)
|
||||
coord0(:,3) = (/ ONE, ONE, ZERO /)
|
||||
coord0(:,4) = (/ ZERO, ONE, ZERO /)
|
||||
|
||||
elem_id_ext(1) = 1
|
||||
elem_type(1) = 'S4R'
|
||||
elem_nnode(1) = 4
|
||||
elem_conn(:,1) = 0
|
||||
elem_conn(1:4,1) = (/ 1, 2, 3, 4 /)
|
||||
elem_mat(1) = 1
|
||||
elem_sec(1) = 1
|
||||
|
||||
elset_name(1) = 'EALL'
|
||||
elset_start(1) = 1
|
||||
elset_count(1) = 1
|
||||
elset_items(1) = 1
|
||||
|
||||
mat_name(1) = 'MAT'
|
||||
mat_density(1) = ONE
|
||||
mat_e(1) = 30.0_rk
|
||||
mat_nu(1) = 0.25_rk
|
||||
|
||||
section_type(1) = 'SHELL'
|
||||
section_elset_name(1) = 'EALL'
|
||||
section_material_name(1) = 'MAT'
|
||||
section_thickness(1) = 0.2_rk
|
||||
|
||||
call database_assign_dofs(ierr)
|
||||
end subroutine setup_s4r
|
||||
|
||||
subroutine setup_s6(ierr)
|
||||
integer, intent(out) :: ierr
|
||||
|
||||
@@ -683,6 +848,58 @@ contains
|
||||
shell_drilling_energy = dot_product(x(1:n), y(1:n))
|
||||
end function shell_drilling_energy
|
||||
|
||||
real(rk) function shell_hourglass_energy(ke, n, component)
|
||||
real(rk), intent(in) :: ke(MAX_TEST_DOF,MAX_TEST_DOF)
|
||||
integer, intent(in) :: n
|
||||
integer, intent(in) :: component
|
||||
real(rk) :: h(4)
|
||||
real(rk) :: x(MAX_TEST_DOF)
|
||||
real(rk) :: y(MAX_TEST_DOF)
|
||||
integer :: local_node
|
||||
integer :: pos
|
||||
|
||||
h = (/ ONE, -ONE, ONE, -ONE /)
|
||||
x = ZERO
|
||||
y = ZERO
|
||||
do local_node = 1, n / NDOF_NODE
|
||||
pos = NDOF_NODE * (local_node - 1) + component
|
||||
x(pos) = h(local_node)
|
||||
end do
|
||||
y(1:n) = matmul(ke(1:n,1:n), x(1:n))
|
||||
shell_hourglass_energy = dot_product(x(1:n), y(1:n))
|
||||
end function shell_hourglass_energy
|
||||
|
||||
real(rk) function solid_hourglass_energy(ke, n, component, mode)
|
||||
real(rk), intent(in) :: ke(MAX_TEST_DOF,MAX_TEST_DOF)
|
||||
integer, intent(in) :: n
|
||||
integer, intent(in) :: component
|
||||
integer, intent(in) :: mode
|
||||
real(rk) :: hg(8,4)
|
||||
real(rk) :: x(MAX_TEST_DOF)
|
||||
real(rk) :: y(MAX_TEST_DOF)
|
||||
integer :: local_node
|
||||
integer :: pos
|
||||
|
||||
call fill_hex8_hourglass_modes(hg)
|
||||
x = ZERO
|
||||
y = ZERO
|
||||
do local_node = 1, n / NDIM
|
||||
pos = NDIM * (local_node - 1) + component
|
||||
x(pos) = hg(local_node,mode)
|
||||
end do
|
||||
y(1:n) = matmul(ke(1:n,1:n), x(1:n))
|
||||
solid_hourglass_energy = dot_product(x(1:n), y(1:n))
|
||||
end function solid_hourglass_energy
|
||||
|
||||
subroutine fill_hex8_hourglass_modes(hg)
|
||||
real(rk), intent(out) :: hg(8,4)
|
||||
|
||||
hg(:,1) = (/ ONE, ONE, -ONE, -ONE, -ONE, -ONE, ONE, ONE /)
|
||||
hg(:,2) = (/ ONE, -ONE, -ONE, ONE, -ONE, ONE, ONE, -ONE /)
|
||||
hg(:,3) = (/ ONE, -ONE, ONE, -ONE, ONE, -ONE, ONE, -ONE /)
|
||||
hg(:,4) = (/-ONE, ONE, -ONE, ONE, ONE, -ONE, ONE, -ONE /)
|
||||
end subroutine fill_hex8_hourglass_modes
|
||||
|
||||
subroutine fail(code)
|
||||
integer, intent(in) :: code
|
||||
|
||||
|
||||
Reference in New Issue
Block a user