Add S6 shell internal force path
This commit is contained in:
@@ -12,6 +12,7 @@ program test_shell_internal
|
||||
real(rk), parameter :: EXX = 0.01_rk
|
||||
|
||||
call check_s3_membrane_patch()
|
||||
call check_s6_membrane_patch()
|
||||
|
||||
contains
|
||||
|
||||
@@ -25,8 +26,8 @@ contains
|
||||
call element_compute_internal_force(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(2)
|
||||
if (elem_status(1) .ne. 0) call fail(3)
|
||||
call check_state_shape(4)
|
||||
call check_membrane_state(10)
|
||||
call check_state_shape(1, 4)
|
||||
call check_membrane_state(1, 10)
|
||||
call check_force_balance(20)
|
||||
call check_no_normal_or_rotation(30)
|
||||
|
||||
@@ -34,6 +35,25 @@ contains
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(40)
|
||||
end subroutine check_s3_membrane_patch
|
||||
|
||||
subroutine check_s6_membrane_patch()
|
||||
integer :: ierr
|
||||
|
||||
call setup_s6(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(51)
|
||||
call apply_x_extension(EXX)
|
||||
|
||||
call element_compute_internal_force(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(52)
|
||||
if (elem_status(1) .ne. 0) call fail(53)
|
||||
call check_state_shape(3, 54)
|
||||
call check_membrane_state(3, 60)
|
||||
call check_force_balance(70)
|
||||
call check_no_normal_or_rotation(80)
|
||||
|
||||
call database_finalize(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(90)
|
||||
end subroutine check_s6_membrane_patch
|
||||
|
||||
subroutine setup_s3(ierr)
|
||||
integer, intent(out) :: ierr
|
||||
|
||||
@@ -75,6 +95,53 @@ contains
|
||||
call database_assign_dofs(ierr)
|
||||
end subroutine setup_s3
|
||||
|
||||
subroutine setup_s6(ierr)
|
||||
integer, intent(out) :: ierr
|
||||
|
||||
call database_allocate_model(6, 1, 0, 1, 0, 1, 1, 0, 1, &
|
||||
0, 0, 0, 0, 0, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) return
|
||||
|
||||
node_id_ext(1) = 1
|
||||
node_id_ext(2) = 2
|
||||
node_id_ext(3) = 3
|
||||
node_id_ext(4) = 4
|
||||
node_id_ext(5) = 5
|
||||
node_id_ext(6) = 6
|
||||
coord0(:,1) = (/ ZERO, ZERO, ZERO /)
|
||||
coord0(:,2) = (/ ONE, ZERO, ZERO /)
|
||||
coord0(:,3) = (/ ZERO, ONE, ZERO /)
|
||||
coord0(:,4) = HALF * (coord0(:,1) + coord0(:,2))
|
||||
coord0(:,5) = HALF * (coord0(:,2) + coord0(:,3))
|
||||
coord0(:,6) = HALF * (coord0(:,3) + coord0(:,1))
|
||||
coord = coord0
|
||||
|
||||
elem_id_ext(1) = 1
|
||||
elem_type(1) = 'S6'
|
||||
elem_nnode(1) = 6
|
||||
elem_conn(:,1) = 0
|
||||
elem_conn(1:6,1) = (/ 1, 2, 3, 4, 5, 6 /)
|
||||
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) = YOUNG
|
||||
mat_nu(1) = POISSON
|
||||
|
||||
section_type(1) = 'SHELL'
|
||||
section_elset_name(1) = 'EALL'
|
||||
section_material_name(1) = 'MAT'
|
||||
section_thickness(1) = THICKNESS
|
||||
|
||||
call database_assign_dofs(ierr)
|
||||
end subroutine setup_s6
|
||||
|
||||
subroutine apply_x_extension(exx)
|
||||
real(rk), intent(in) :: exx
|
||||
integer :: node
|
||||
@@ -85,21 +152,24 @@ contains
|
||||
end do
|
||||
end subroutine apply_x_extension
|
||||
|
||||
subroutine check_state_shape(code)
|
||||
subroutine check_state_shape(expected_ngp, code)
|
||||
integer, intent(in) :: expected_ngp
|
||||
integer, intent(in) :: code
|
||||
|
||||
if (elem_gp_start(1) .ne. 1) call fail(code)
|
||||
if (elem_ngp(1) .ne. 1) call fail(code + 1)
|
||||
if (ngauss_total .ne. 1) call fail(code + 2)
|
||||
if (elem_ngp(1) .ne. expected_ngp) call fail(code + 1)
|
||||
if (ngauss_total .ne. expected_ngp) call fail(code + 2)
|
||||
if (.not. allocated(stress)) call fail(code + 3)
|
||||
if (.not. allocated(strain)) call fail(code + 4)
|
||||
end subroutine check_state_shape
|
||||
|
||||
subroutine check_membrane_state(code)
|
||||
subroutine check_membrane_state(npoint, code)
|
||||
integer, intent(in) :: npoint
|
||||
integer, intent(in) :: code
|
||||
real(rk) :: coeff
|
||||
real(rk) :: expected_stress(NSTRESS)
|
||||
real(rk) :: expected_strain(NSTRESS)
|
||||
integer :: gp
|
||||
|
||||
coeff = YOUNG / (ONE - POISSON * POISSON)
|
||||
expected_strain = ZERO
|
||||
@@ -108,11 +178,13 @@ contains
|
||||
expected_stress(1) = coeff * EXX
|
||||
expected_stress(2) = coeff * POISSON * EXX
|
||||
|
||||
call check_vector_close(strain(:,1), expected_strain, code)
|
||||
call check_vector_close(stress(:,1), expected_stress, code + 1)
|
||||
if (abs(statev(10,1)) .gt. TOL) call fail(code + 2)
|
||||
if (abs(statev(11,1)) .gt. TOL) call fail(code + 3)
|
||||
if (abs(statev(12,1)) .gt. TOL) call fail(code + 4)
|
||||
do gp = 1, npoint
|
||||
call check_vector_close(strain(:,gp), expected_strain, code)
|
||||
call check_vector_close(stress(:,gp), expected_stress, code + 1)
|
||||
if (abs(statev(10,gp)) .gt. TOL) call fail(code + 2)
|
||||
if (abs(statev(11,gp)) .gt. TOL) call fail(code + 3)
|
||||
if (abs(statev(12,gp)) .gt. TOL) call fail(code + 4)
|
||||
end do
|
||||
end subroutine check_membrane_state
|
||||
|
||||
subroutine check_force_balance(code)
|
||||
|
||||
Reference in New Issue
Block a user