Advance V5 nonlinear benchmarks and shell solver
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
program test_shell_internal
|
||||
use fem_precision
|
||||
use fem_error
|
||||
use fem_control
|
||||
use fem_database
|
||||
use fem_element_internal
|
||||
use fem_element_stiffness
|
||||
@@ -19,6 +20,12 @@ program test_shell_internal
|
||||
|
||||
call check_s3_membrane_patch()
|
||||
call check_s4_membrane_patch()
|
||||
call check_s4_corot_rigid()
|
||||
call check_s4_corot_small()
|
||||
call check_s4_corot_tangent()
|
||||
call check_s4_corot_fd_column()
|
||||
call check_s4_corot_geo()
|
||||
call check_s4_corot_rejects_j2()
|
||||
call check_s4_j2_membrane_plastic()
|
||||
call check_s4_j2_shear_plastic()
|
||||
call check_s4_j2_bending_plastic()
|
||||
@@ -74,6 +81,194 @@ contains
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(190)
|
||||
end subroutine check_s4_membrane_patch
|
||||
|
||||
subroutine check_s4_corot_rigid()
|
||||
integer :: ierr
|
||||
|
||||
call setup_s4(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(601)
|
||||
shell_geometric_nonlinear = .true.
|
||||
call apply_y_rigid_rotation(0.70_rk)
|
||||
|
||||
call element_compute_internal_force(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(602)
|
||||
if (maxval(abs(fint)) .gt. 1.0e-9_rk) call fail(603)
|
||||
|
||||
shell_geometric_nonlinear = .false.
|
||||
call database_finalize(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(604)
|
||||
end subroutine check_s4_corot_rigid
|
||||
|
||||
subroutine check_s4_corot_small()
|
||||
integer :: ierr
|
||||
|
||||
call setup_s4(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(611)
|
||||
shell_geometric_nonlinear = .true.
|
||||
call apply_x_extension(EXX)
|
||||
|
||||
call element_compute_internal_force(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(612)
|
||||
call check_state_shape(4, 613)
|
||||
call check_membrane_state(4, 620)
|
||||
call check_force_balance(630)
|
||||
|
||||
shell_geometric_nonlinear = .false.
|
||||
call database_finalize(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(640)
|
||||
end subroutine check_s4_corot_small
|
||||
|
||||
subroutine check_s4_corot_tangent()
|
||||
integer :: ierr
|
||||
integer, parameter :: MAX_SHELL_TEST_DOF = 60
|
||||
integer :: elem_dofs(MAX_SHELL_TEST_DOF)
|
||||
integer :: n_elem_dof
|
||||
integer :: i
|
||||
real(rk) :: ke(MAX_SHELL_TEST_DOF,MAX_SHELL_TEST_DOF)
|
||||
|
||||
call setup_s4(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(651)
|
||||
shell_geometric_nonlinear = .true.
|
||||
call apply_y_rigid_rotation(0.45_rk)
|
||||
|
||||
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(652)
|
||||
if (n_elem_dof .ne. 24) call fail(653)
|
||||
do i = 1, n_elem_dof
|
||||
if (ke(i,i) .le. ZERO) call fail(655)
|
||||
end do
|
||||
|
||||
shell_geometric_nonlinear = .false.
|
||||
call database_finalize(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(656)
|
||||
end subroutine check_s4_corot_tangent
|
||||
|
||||
subroutine check_s4_corot_fd_column()
|
||||
integer :: ierr
|
||||
integer, parameter :: MAX_SHELL_TEST_DOF = 60
|
||||
integer :: elem_dofs(MAX_SHELL_TEST_DOF)
|
||||
integer :: n_elem_dof
|
||||
integer :: i
|
||||
integer :: col
|
||||
integer :: target_dof
|
||||
real(rk) :: ke(MAX_SHELL_TEST_DOF,MAX_SHELL_TEST_DOF)
|
||||
real(rk) :: fplus(MAX_SHELL_TEST_DOF)
|
||||
real(rk) :: fminus(MAX_SHELL_TEST_DOF)
|
||||
real(rk) :: fd_col(MAX_SHELL_TEST_DOF)
|
||||
real(rk) :: diff_norm
|
||||
real(rk) :: ref_norm
|
||||
real(rk) :: step
|
||||
real(rk) :: old_value
|
||||
|
||||
call setup_s4(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(671)
|
||||
shell_geometric_nonlinear = .true.
|
||||
call apply_x_extension(0.015_rk)
|
||||
u(dof_id(3,3)) = u(dof_id(3,3)) + 0.04_rk
|
||||
u(dof_id(3,4)) = u(dof_id(3,4)) + 0.02_rk
|
||||
|
||||
call element_compute_internal_force(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(672)
|
||||
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(673)
|
||||
if (n_elem_dof .ne. 24) call fail(674)
|
||||
|
||||
target_dof = dof_id(3,3)
|
||||
col = 0
|
||||
do i = 1, n_elem_dof
|
||||
if (elem_dofs(i) .eq. target_dof) col = i
|
||||
end do
|
||||
if (col .le. 0) call fail(675)
|
||||
|
||||
old_value = u(target_dof)
|
||||
step = 1.0e-7_rk
|
||||
u(target_dof) = old_value + step
|
||||
call element_compute_internal_force(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(676)
|
||||
do i = 1, n_elem_dof
|
||||
fplus(i) = fint(elem_dofs(i))
|
||||
end do
|
||||
|
||||
u(target_dof) = old_value - step
|
||||
call element_compute_internal_force(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(677)
|
||||
do i = 1, n_elem_dof
|
||||
fminus(i) = fint(elem_dofs(i))
|
||||
end do
|
||||
u(target_dof) = old_value
|
||||
|
||||
fd_col(1:n_elem_dof) = (fplus(1:n_elem_dof) - fminus(1:n_elem_dof)) / &
|
||||
(2.0_rk * step)
|
||||
diff_norm = sqrt(sum((ke(1:n_elem_dof,col) - fd_col(1:n_elem_dof))**2))
|
||||
ref_norm = max(ONE, sqrt(sum(fd_col(1:n_elem_dof)**2)))
|
||||
if (diff_norm .gt. 1.0e-5_rk * ref_norm) call fail(678)
|
||||
|
||||
shell_geometric_nonlinear = .false.
|
||||
call database_finalize(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(679)
|
||||
end subroutine check_s4_corot_fd_column
|
||||
|
||||
subroutine check_s4_corot_geo()
|
||||
integer :: ierr
|
||||
integer, parameter :: MAX_SHELL_TEST_DOF = 60
|
||||
integer :: elem_dofs(MAX_SHELL_TEST_DOF)
|
||||
integer :: n_elem_dof
|
||||
integer :: local_node
|
||||
integer :: idx
|
||||
real(rk) :: ke_loaded(MAX_SHELL_TEST_DOF,MAX_SHELL_TEST_DOF)
|
||||
real(rk) :: ke_base(MAX_SHELL_TEST_DOF,MAX_SHELL_TEST_DOF)
|
||||
real(rk) :: gain
|
||||
|
||||
call setup_s4(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(661)
|
||||
shell_geometric_nonlinear = .true.
|
||||
call apply_x_extension(EXX)
|
||||
|
||||
call element_compute_internal_force(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(662)
|
||||
if (maxval(abs(stress)) .le. ZERO) call fail(663)
|
||||
|
||||
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke_loaded, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(664)
|
||||
if (n_elem_dof .ne. 24) call fail(665)
|
||||
|
||||
stress = ZERO
|
||||
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke_base, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(667)
|
||||
|
||||
gain = ZERO
|
||||
do local_node = 1, 4
|
||||
idx = 6 * (local_node - 1) + 3
|
||||
gain = gain + ke_loaded(idx,idx) - ke_base(idx,idx)
|
||||
end do
|
||||
if (gain .le. 1.0e-10_rk) call fail(669)
|
||||
|
||||
shell_geometric_nonlinear = .false.
|
||||
call database_finalize(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(670)
|
||||
end subroutine check_s4_corot_geo
|
||||
|
||||
subroutine check_s4_corot_rejects_j2()
|
||||
integer :: ierr
|
||||
integer, parameter :: MAX_SHELL_TEST_DOF = 60
|
||||
integer :: elem_dofs(MAX_SHELL_TEST_DOF)
|
||||
integer :: n_elem_dof
|
||||
real(rk) :: ke(MAX_SHELL_TEST_DOF,MAX_SHELL_TEST_DOF)
|
||||
|
||||
call setup_s4_j2(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(691)
|
||||
shell_geometric_nonlinear = .true.
|
||||
|
||||
call error_clear(ierr)
|
||||
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke, ierr)
|
||||
if (ierr .ne. FEM_ERR_MATERIAL) call fail(692)
|
||||
if (last_error_code .ne. FEM_ERR_MATERIAL) call fail(693)
|
||||
if (index(last_error_message, 'ELASTIC') .le. 0) call fail(694)
|
||||
|
||||
shell_geometric_nonlinear = .false.
|
||||
call database_finalize(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(695)
|
||||
end subroutine check_s4_corot_rejects_j2
|
||||
|
||||
subroutine check_s4_j2_membrane_plastic()
|
||||
integer :: ierr
|
||||
integer, parameter :: MAX_SHELL_TEST_DOF = 60
|
||||
@@ -569,6 +764,26 @@ contains
|
||||
end do
|
||||
end subroutine apply_x_bending
|
||||
|
||||
subroutine apply_y_rigid_rotation(theta)
|
||||
real(rk), intent(in) :: theta
|
||||
real(rk) :: ctheta
|
||||
real(rk) :: stheta
|
||||
real(rk) :: x
|
||||
real(rk) :: z
|
||||
integer :: node
|
||||
|
||||
ctheta = cos(theta)
|
||||
stheta = sin(theta)
|
||||
u = ZERO
|
||||
do node = 1, nnode
|
||||
x = coord0(1,node)
|
||||
z = coord0(3,node)
|
||||
u(dof_id(1,node)) = ctheta * x + stheta * z - x
|
||||
u(dof_id(3,node)) = -stheta * x + ctheta * z - z
|
||||
u(dof_id(5,node)) = theta
|
||||
end do
|
||||
end subroutine apply_y_rigid_rotation
|
||||
|
||||
subroutine check_state_shape(expected_ngp, code)
|
||||
integer, intent(in) :: expected_ngp
|
||||
integer, intent(in) :: code
|
||||
|
||||
Reference in New Issue
Block a user