992 lines
30 KiB
Fortran
992 lines
30 KiB
Fortran
program test_shell_internal
|
|
use fem_precision
|
|
use fem_error
|
|
use fem_control
|
|
use fem_database
|
|
use fem_element_internal
|
|
use fem_element_stiffness
|
|
use fem_element_state
|
|
use fem_quadrature
|
|
use fem_shape_functions
|
|
implicit none
|
|
|
|
real(rk), parameter :: TOL = 1.0e-10_rk
|
|
real(rk), parameter :: YOUNG = 30.0_rk
|
|
real(rk), parameter :: POISSON = 0.25_rk
|
|
real(rk), parameter :: THICKNESS = 0.2_rk
|
|
real(rk), parameter :: EXX = 0.01_rk
|
|
real(rk), parameter :: GAMMA_XZ = 0.02_rk
|
|
real(rk), parameter :: KAPPA_X = 0.03_rk
|
|
|
|
call check_s3_membrane_patch()
|
|
call check_s4_membrane_patch()
|
|
call check_s4_composite_coupling()
|
|
call check_s4_composite_j2_layers()
|
|
call check_s4_j2_membrane_plastic()
|
|
call check_s4_j2_shear_plastic()
|
|
call check_s4_j2_bending_plastic()
|
|
call check_s4_j2_trial_rollback()
|
|
call check_s6_membrane_patch()
|
|
call check_s8_membrane_patch()
|
|
call check_shear_patch('S3', 1, 200)
|
|
call check_shear_patch('S4', 4, 230)
|
|
call check_shear_patch('S6', 3, 260)
|
|
call check_shear_patch('S8', 9, 290)
|
|
call check_bending_patch('S3', 1, 330)
|
|
call check_bending_patch('S4', 4, 360)
|
|
call check_bending_patch('S6', 3, 390)
|
|
call check_bending_patch('S8', 9, 420)
|
|
|
|
contains
|
|
|
|
subroutine check_s3_membrane_patch()
|
|
integer :: ierr
|
|
|
|
call setup_s3(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(1)
|
|
call apply_x_extension(EXX)
|
|
|
|
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(1, 4)
|
|
call check_membrane_state(1, 10)
|
|
call check_force_balance(20)
|
|
call check_no_normal_or_rotation(30)
|
|
|
|
call database_finalize(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(40)
|
|
end subroutine check_s3_membrane_patch
|
|
|
|
subroutine check_s4_membrane_patch()
|
|
integer :: ierr
|
|
|
|
call setup_s4(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(151)
|
|
call apply_x_extension(EXX)
|
|
|
|
call element_compute_internal_force(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(152)
|
|
if (elem_status(1) .ne. 0) call fail(153)
|
|
call check_state_shape(4, 154)
|
|
call check_membrane_state(4, 160)
|
|
call check_force_balance(170)
|
|
call check_no_normal_or_rotation(180)
|
|
|
|
call database_finalize(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(190)
|
|
end subroutine check_s4_membrane_patch
|
|
|
|
subroutine check_s4_composite_coupling()
|
|
integer :: ierr
|
|
integer, parameter :: MAX_SHELL_TEST_DOF = 60
|
|
integer :: elem_dofs(MAX_SHELL_TEST_DOF)
|
|
integer :: n_elem_dof
|
|
integer :: row
|
|
integer :: col
|
|
integer :: node
|
|
real(rk) :: ke(MAX_SHELL_TEST_DOF,MAX_SHELL_TEST_DOF)
|
|
real(rk) :: c_low
|
|
real(rk) :: c_high
|
|
real(rk) :: layer_t
|
|
real(rk) :: expected_mx
|
|
real(rk) :: max_coupling
|
|
|
|
call setup_s4_composite(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(701)
|
|
call database_validate_model(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(702)
|
|
|
|
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(703)
|
|
max_coupling = ZERO
|
|
do row = 1, n_elem_dof
|
|
do col = 1, n_elem_dof
|
|
do node = 1, 4
|
|
if ((elem_dofs(row) .eq. dof_id(4,node) .or. &
|
|
elem_dofs(row) .eq. dof_id(5,node)) .and. &
|
|
(elem_dofs(col) .eq. dof_id(1,node) .or. &
|
|
elem_dofs(col) .eq. dof_id(2,node))) then
|
|
max_coupling = max(max_coupling, abs(ke(row,col)))
|
|
end if
|
|
end do
|
|
end do
|
|
end do
|
|
if (max_coupling .le. 1.0e-12_rk) call fail(704)
|
|
|
|
call apply_x_extension(EXX)
|
|
call element_compute_internal_force(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(705)
|
|
c_low = YOUNG / (ONE - POISSON * POISSON)
|
|
c_high = (2.0_rk * YOUNG) / (ONE - POISSON * POISSON)
|
|
layer_t = HALF * THICKNESS
|
|
expected_mx = HALF * layer_t * layer_t * (c_high - c_low) * EXX
|
|
if (abs(shell_resultant(4,elem_gp_start(1)) - expected_mx) .gt. &
|
|
1.0e-10_rk * max(ONE, abs(expected_mx))) call fail(706)
|
|
|
|
call database_finalize(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(707)
|
|
end subroutine check_s4_composite_coupling
|
|
|
|
subroutine check_s4_composite_j2_layers()
|
|
integer :: ierr
|
|
integer, parameter :: MAX_SHELL_TEST_DOF = 60
|
|
integer :: elem_dofs(MAX_SHELL_TEST_DOF)
|
|
integer :: n_elem_dof
|
|
integer :: gp
|
|
integer :: first
|
|
integer :: last
|
|
real(rk) :: ke(MAX_SHELL_TEST_DOF,MAX_SHELL_TEST_DOF)
|
|
real(rk) :: ke_elastic(MAX_SHELL_TEST_DOF,MAX_SHELL_TEST_DOF)
|
|
|
|
call setup_s4_composite_j2(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(711)
|
|
call database_validate_model(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(712)
|
|
|
|
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke_elastic, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(713)
|
|
call apply_x_extension(EXX)
|
|
call element_compute_internal_force(ierr, 0.1_rk)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(714)
|
|
|
|
gp = elem_gp_start(1)
|
|
if (shell_layer_gp_count(gp) .ne. 4) call fail(715)
|
|
first = shell_layer_gp_start(gp)
|
|
last = first + shell_layer_gp_count(gp) - 1
|
|
if (maxval(abs(shell_layer_stress(3,first:last))) .gt. 1.0e-8_rk) &
|
|
call fail(716)
|
|
if (maxval(shell_layer_statev(22,first:last)) .le. ZERO) call fail(717)
|
|
if (statev(1,gp) .le. ZERO) call fail(718)
|
|
if (statev(22,gp) .le. ZERO) call fail(719)
|
|
|
|
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(720)
|
|
if (n_elem_dof .ne. 24) call fail(721)
|
|
if (ke(1,1) .ge. ke_elastic(1,1)) call fail(722)
|
|
if (maxval(abs(shell_resultant(1:8,gp))) .le. ZERO) call fail(723)
|
|
|
|
call database_finalize(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(724)
|
|
end subroutine check_s4_composite_j2_layers
|
|
|
|
subroutine check_s4_j2_membrane_plastic()
|
|
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)
|
|
real(rk) :: ke_elastic(MAX_SHELL_TEST_DOF,MAX_SHELL_TEST_DOF)
|
|
|
|
call setup_s4_j2(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(451)
|
|
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke_elastic, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(450)
|
|
call apply_x_extension(EXX)
|
|
|
|
call element_compute_internal_force(ierr, 0.1_rk)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(452)
|
|
if (elem_status(1) .ne. 0) call fail(453)
|
|
if (statev(1,1) .le. ZERO) call fail(454)
|
|
if (statev(22,1) .le. ZERO) call fail(455)
|
|
if (abs(stress(1,1)) .ge. YOUNG * EXX) call fail(456)
|
|
|
|
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(457)
|
|
if (n_elem_dof .ne. 24) call fail(458)
|
|
call check_matrix_symmetric(ke, n_elem_dof, 459)
|
|
if (ke(1,1) .ge. ke_elastic(1,1)) call fail(461)
|
|
if (ke(5,5) .ge. ke_elastic(5,5)) call fail(462)
|
|
if (ke(3,3) .le. ZERO) call fail(463)
|
|
|
|
call database_finalize(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(460)
|
|
end subroutine check_s4_j2_membrane_plastic
|
|
|
|
subroutine check_s4_j2_shear_plastic()
|
|
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)
|
|
real(rk) :: ke_elastic(MAX_SHELL_TEST_DOF,MAX_SHELL_TEST_DOF)
|
|
real(rk) :: gamma_large
|
|
real(rk) :: elastic_shear
|
|
real(rk) :: shear_mod
|
|
|
|
gamma_large = 0.20_rk
|
|
shear_mod = YOUNG / (2.0_rk * (ONE + POISSON))
|
|
elastic_shear = shear_mod * gamma_large
|
|
|
|
call setup_s4_j2(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(470)
|
|
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke_elastic, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(471)
|
|
call apply_xz_shear(gamma_large)
|
|
|
|
call element_compute_internal_force(ierr, 0.1_rk)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(472)
|
|
if (elem_status(1) .ne. 0) call fail(473)
|
|
if (statev(1,1) .le. ZERO) call fail(474)
|
|
if (statev(22,1) .le. ZERO) call fail(475)
|
|
if (abs(stress(5,1)) .ge. elastic_shear) call fail(476)
|
|
|
|
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(477)
|
|
if (n_elem_dof .ne. 24) call fail(478)
|
|
call check_matrix_symmetric(ke, n_elem_dof, 479)
|
|
if (ke(3,3) .ge. ke_elastic(3,3)) call fail(480)
|
|
|
|
call database_finalize(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(481)
|
|
end subroutine check_s4_j2_shear_plastic
|
|
|
|
subroutine check_s4_j2_bending_plastic()
|
|
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)
|
|
real(rk) :: ke_elastic(MAX_SHELL_TEST_DOF,MAX_SHELL_TEST_DOF)
|
|
real(rk) :: kappa_large
|
|
|
|
kappa_large = 0.80_rk
|
|
|
|
call setup_s4_j2(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(490)
|
|
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke_elastic, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(491)
|
|
call apply_x_bending(kappa_large)
|
|
|
|
call element_compute_internal_force(ierr, 0.1_rk)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(492)
|
|
if (elem_status(1) .ne. 0) call fail(493)
|
|
if (statev(1,1) .le. ZERO) call fail(494)
|
|
if (statev(22,1) .le. ZERO) call fail(495)
|
|
if (abs(statev(13,1) - kappa_large) .gt. 1.0e-8_rk) call fail(496)
|
|
if (shell_layer_gp_count(elem_gp_start(1)) .ne. 2) call fail(497)
|
|
if (maxval(abs(shell_layer_stress(1, &
|
|
shell_layer_gp_start(elem_gp_start(1)): &
|
|
shell_layer_gp_start(elem_gp_start(1)) + &
|
|
shell_layer_gp_count(elem_gp_start(1)) - 1))) .le. ZERO) call fail(502)
|
|
if (abs(shell_resultant(4,elem_gp_start(1))) .le. ZERO) call fail(503)
|
|
|
|
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(498)
|
|
if (n_elem_dof .ne. 24) call fail(499)
|
|
call check_matrix_symmetric(ke, n_elem_dof, 500)
|
|
if (ke(5,5) .ge. ke_elastic(5,5)) call fail(501)
|
|
|
|
call database_finalize(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(502)
|
|
end subroutine check_s4_j2_bending_plastic
|
|
|
|
subroutine check_s4_j2_trial_rollback()
|
|
integer :: ierr
|
|
|
|
call setup_s4_j2(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(510)
|
|
call element_state_begin_trial(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(511)
|
|
|
|
call apply_xz_shear(0.20_rk)
|
|
call element_compute_internal_force(ierr, 0.1_rk)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(512)
|
|
if (statev(1,1) .le. ZERO) call fail(513)
|
|
if (statev(22,1) .le. ZERO) call fail(514)
|
|
if (maxval(abs(shell_layer_statev)) .le. ZERO) call fail(522)
|
|
|
|
call element_state_abort_trial(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(515)
|
|
if (maxval(abs(statev)) .gt. TOL) call fail(516)
|
|
if (maxval(abs(stress)) .gt. TOL) call fail(517)
|
|
if (maxval(abs(strain)) .gt. TOL) call fail(518)
|
|
if (maxval(abs(shell_layer_statev)) .gt. TOL) call fail(523)
|
|
if (maxval(abs(shell_layer_stress)) .gt. TOL) call fail(524)
|
|
if (maxval(abs(shell_layer_strain)) .gt. TOL) call fail(525)
|
|
|
|
u = ZERO
|
|
call element_compute_internal_force(ierr, 0.1_rk)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(519)
|
|
if (maxval(abs(fint)) .gt. TOL) call fail(520)
|
|
|
|
call database_finalize(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(521)
|
|
end subroutine check_s4_j2_trial_rollback
|
|
|
|
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 check_s8_membrane_patch()
|
|
integer :: ierr
|
|
|
|
call setup_s8(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(101)
|
|
call apply_x_extension(EXX)
|
|
|
|
call element_compute_internal_force(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(102)
|
|
if (elem_status(1) .ne. 0) call fail(103)
|
|
call check_state_shape(9, 104)
|
|
call check_membrane_state(9, 110)
|
|
call check_force_balance(120)
|
|
call check_no_normal_or_rotation(130)
|
|
|
|
call database_finalize(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(140)
|
|
end subroutine check_s8_membrane_patch
|
|
|
|
subroutine check_shear_patch(etype, expected_ngp, code)
|
|
character(len=*), intent(in) :: etype
|
|
integer, intent(in) :: expected_ngp
|
|
integer, intent(in) :: code
|
|
integer :: ierr
|
|
|
|
call setup_shell_by_type(etype, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(code)
|
|
call apply_xz_shear(GAMMA_XZ)
|
|
|
|
call element_compute_internal_force(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(code + 1)
|
|
if (elem_status(1) .ne. 0) call fail(code + 2)
|
|
call check_state_shape(expected_ngp, code + 3)
|
|
call check_shear_state(expected_ngp, code + 10)
|
|
call check_translational_balance(code + 20)
|
|
|
|
call database_finalize(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(code + 21)
|
|
end subroutine check_shear_patch
|
|
|
|
subroutine check_bending_patch(etype, expected_ngp, code)
|
|
character(len=*), intent(in) :: etype
|
|
integer, intent(in) :: expected_ngp
|
|
integer, intent(in) :: code
|
|
integer :: ierr
|
|
|
|
call setup_shell_by_type(etype, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(code)
|
|
call apply_x_bending(KAPPA_X)
|
|
|
|
call element_compute_internal_force(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(code + 1)
|
|
if (elem_status(1) .ne. 0) call fail(code + 2)
|
|
call check_state_shape(expected_ngp, code + 3)
|
|
call check_bending_state(etype, expected_ngp, code + 10)
|
|
call check_translational_balance(code + 20)
|
|
|
|
call database_finalize(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(code + 21)
|
|
end subroutine check_bending_patch
|
|
|
|
subroutine setup_shell_by_type(etype, ierr)
|
|
character(len=*), intent(in) :: etype
|
|
integer, intent(out) :: ierr
|
|
character(len=ELEM_TYPE_LEN) :: local_type
|
|
|
|
local_type = adjustl(etype)
|
|
select case (trim(local_type))
|
|
case ('S3')
|
|
call setup_s3(ierr)
|
|
case ('S4')
|
|
call setup_s4(ierr)
|
|
case ('S6')
|
|
call setup_s6(ierr)
|
|
case ('S8')
|
|
call setup_s8(ierr)
|
|
case default
|
|
call fail(900)
|
|
end select
|
|
end subroutine setup_shell_by_type
|
|
|
|
subroutine setup_s3(ierr)
|
|
integer, intent(out) :: ierr
|
|
|
|
call database_allocate_model(3, 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
|
|
coord0(:,1) = (/ ZERO, ZERO, ZERO /)
|
|
coord0(:,2) = (/ ONE, ZERO, ZERO /)
|
|
coord0(:,3) = (/ ZERO, ONE, ZERO /)
|
|
coord = coord0
|
|
|
|
elem_id_ext(1) = 1
|
|
elem_type(1) = 'S3'
|
|
elem_nnode(1) = 3
|
|
elem_conn(:,1) = 0
|
|
elem_conn(1:3,1) = (/ 1, 2, 3 /)
|
|
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_s3
|
|
|
|
subroutine setup_s4(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
|
|
|
|
node_id_ext(1) = 1
|
|
node_id_ext(2) = 2
|
|
node_id_ext(3) = 3
|
|
node_id_ext(4) = 4
|
|
coord0(:,1) = (/ ZERO, ZERO, ZERO /)
|
|
coord0(:,2) = (/ ONE, ZERO, ZERO /)
|
|
coord0(:,3) = (/ ONE, ONE, ZERO /)
|
|
coord0(:,4) = (/ ZERO, ONE, ZERO /)
|
|
coord = coord0
|
|
|
|
elem_id_ext(1) = 1
|
|
elem_type(1) = 'S4'
|
|
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) = 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_s4
|
|
|
|
subroutine setup_s4_composite(ierr)
|
|
integer, intent(out) :: ierr
|
|
|
|
call database_allocate_model(4, 1, 0, 1, 0, 1, 2, 0, 1, &
|
|
0, 0, 0, 0, 0, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) return
|
|
call database_allocate_sec_layers(2, 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
|
|
coord0(:,1) = (/ ZERO, ZERO, ZERO /)
|
|
coord0(:,2) = (/ ONE, ZERO, ZERO /)
|
|
coord0(:,3) = (/ ONE, ONE, ZERO /)
|
|
coord0(:,4) = (/ ZERO, ONE, ZERO /)
|
|
coord = coord0
|
|
|
|
elem_id_ext(1) = 1
|
|
elem_nnode(1) = 4
|
|
elem_type(1) = 'S4'
|
|
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) = 'LOW'
|
|
mat_density(1) = ONE
|
|
mat_e(1) = YOUNG
|
|
mat_nu(1) = POISSON
|
|
mat_name(2) = 'HIGH'
|
|
mat_density(2) = ONE
|
|
mat_e(2) = 2.0_rk * YOUNG
|
|
mat_nu(2) = POISSON
|
|
|
|
section_type(1) = 'SHELL_COMPOSITE'
|
|
section_elset_name(1) = 'EALL'
|
|
section_material_name(1) = 'LOW'
|
|
section_thickness(1) = THICKNESS
|
|
section_layer_start(1) = 1
|
|
section_layer_count(1) = 2
|
|
section_layer_thickness(1) = HALF * THICKNESS
|
|
section_layer_material_name(1) = 'LOW'
|
|
section_layer_material(1) = 1
|
|
section_layer_thickness(2) = HALF * THICKNESS
|
|
section_layer_material_name(2) = 'HIGH'
|
|
section_layer_material(2) = 2
|
|
|
|
call database_assign_dofs(ierr)
|
|
end subroutine setup_s4_composite
|
|
|
|
subroutine setup_s4_composite_j2(ierr)
|
|
integer, intent(out) :: ierr
|
|
|
|
call database_allocate_model(4, 1, 0, 1, 0, 1, 2, 1, 1, &
|
|
0, 0, 0, 0, 0, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) return
|
|
call database_allocate_sec_layers(2, 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
|
|
coord0(:,1) = (/ ZERO, ZERO, ZERO /)
|
|
coord0(:,2) = (/ ONE, ZERO, ZERO /)
|
|
coord0(:,3) = (/ ONE, ONE, ZERO /)
|
|
coord0(:,4) = (/ ZERO, ONE, ZERO /)
|
|
coord = coord0
|
|
|
|
elem_id_ext(1) = 1
|
|
elem_nnode(1) = 4
|
|
elem_type(1) = 'S4'
|
|
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) = 'EL'
|
|
mat_density(1) = ONE
|
|
mat_e(1) = YOUNG
|
|
mat_nu(1) = POISSON
|
|
mat_name(2) = 'J2LAY'
|
|
mat_density(2) = ONE
|
|
mat_e(2) = YOUNG
|
|
mat_nu(2) = POISSON
|
|
mat_plastic_model(2) = 'J2'
|
|
mat_plastic_start(2) = 1
|
|
mat_plastic_count(2) = 1
|
|
mat_yield0(2) = 0.05_rk
|
|
mat_plastic_stress(1) = 0.05_rk
|
|
mat_plastic_strain(1) = ZERO
|
|
|
|
section_type(1) = 'SHELL_COMPOSITE'
|
|
section_elset_name(1) = 'EALL'
|
|
section_material_name(1) = 'EL'
|
|
section_thickness(1) = THICKNESS
|
|
section_layer_start(1) = 1
|
|
section_layer_count(1) = 2
|
|
section_layer_thickness(1) = HALF * THICKNESS
|
|
section_layer_material_name(1) = 'EL'
|
|
section_layer_material(1) = 1
|
|
section_layer_thickness(2) = HALF * THICKNESS
|
|
section_layer_material_name(2) = 'J2LAY'
|
|
section_layer_material(2) = 2
|
|
|
|
call database_assign_dofs(ierr)
|
|
end subroutine setup_s4_composite_j2
|
|
|
|
subroutine setup_s4_j2(ierr)
|
|
integer, intent(out) :: ierr
|
|
|
|
call database_allocate_model(4, 1, 0, 1, 0, 1, 1, 1, 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
|
|
coord0(:,1) = (/ ZERO, ZERO, ZERO /)
|
|
coord0(:,2) = (/ ONE, ZERO, ZERO /)
|
|
coord0(:,3) = (/ ONE, ONE, ZERO /)
|
|
coord0(:,4) = (/ ZERO, ONE, ZERO /)
|
|
coord = coord0
|
|
|
|
elem_id_ext(1) = 1
|
|
elem_type(1) = 'S4'
|
|
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) = YOUNG
|
|
mat_nu(1) = POISSON
|
|
mat_plastic_model(1) = 'J2'
|
|
mat_plastic_start(1) = 1
|
|
mat_plastic_count(1) = 1
|
|
mat_plastic_stress(1) = 0.05_rk
|
|
mat_plastic_strain(1) = ZERO
|
|
|
|
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_s4_j2
|
|
|
|
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 setup_s8(ierr)
|
|
integer, intent(out) :: ierr
|
|
|
|
call database_allocate_model(8, 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
|
|
node_id_ext(7) = 7
|
|
node_id_ext(8) = 8
|
|
coord0(:,1) = (/ ZERO, ZERO, ZERO /)
|
|
coord0(:,2) = (/ ONE, ZERO, ZERO /)
|
|
coord0(:,3) = (/ ONE, ONE, ZERO /)
|
|
coord0(:,4) = (/ ZERO, ONE, ZERO /)
|
|
coord0(:,5) = HALF * (coord0(:,1) + coord0(:,2))
|
|
coord0(:,6) = HALF * (coord0(:,2) + coord0(:,3))
|
|
coord0(:,7) = HALF * (coord0(:,3) + coord0(:,4))
|
|
coord0(:,8) = HALF * (coord0(:,4) + coord0(:,1))
|
|
coord = coord0
|
|
|
|
elem_id_ext(1) = 1
|
|
elem_type(1) = 'S8'
|
|
elem_nnode(1) = 8
|
|
elem_conn(:,1) = 0
|
|
elem_conn(1:8,1) = (/ 1, 2, 3, 4, 5, 6, 7, 8 /)
|
|
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_s8
|
|
|
|
subroutine apply_x_extension(exx)
|
|
real(rk), intent(in) :: exx
|
|
integer :: node
|
|
|
|
u = ZERO
|
|
do node = 1, nnode
|
|
u(dof_id(1,node)) = exx * coord0(1,node)
|
|
end do
|
|
end subroutine apply_x_extension
|
|
|
|
subroutine apply_xz_shear(gamma_xz)
|
|
real(rk), intent(in) :: gamma_xz
|
|
integer :: node
|
|
|
|
u = ZERO
|
|
do node = 1, nnode
|
|
u(dof_id(3,node)) = gamma_xz * coord0(1,node)
|
|
end do
|
|
end subroutine apply_xz_shear
|
|
|
|
subroutine apply_x_bending(kappa_x)
|
|
real(rk), intent(in) :: kappa_x
|
|
integer :: node
|
|
|
|
u = ZERO
|
|
do node = 1, nnode
|
|
u(dof_id(5,node)) = kappa_x * coord0(1,node)
|
|
end do
|
|
end subroutine apply_x_bending
|
|
|
|
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. 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(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
|
|
expected_strain(1) = EXX
|
|
expected_stress = ZERO
|
|
expected_stress(1) = coeff * EXX
|
|
expected_stress(2) = coeff * POISSON * EXX
|
|
|
|
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_shear_state(npoint, code)
|
|
integer, intent(in) :: npoint
|
|
integer, intent(in) :: code
|
|
real(rk) :: shear_mod
|
|
real(rk) :: expected_stress(NSTRESS)
|
|
real(rk) :: expected_strain(NSTRESS)
|
|
integer :: gp
|
|
|
|
shear_mod = YOUNG / (2.0_rk * (ONE + POISSON))
|
|
expected_strain = ZERO
|
|
expected_strain(5) = GAMMA_XZ
|
|
expected_stress = ZERO
|
|
expected_stress(5) = (5.0_rk / 6.0_rk) * shear_mod * GAMMA_XZ
|
|
|
|
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_shear_state
|
|
|
|
subroutine check_bending_state(etype, npoint, code)
|
|
character(len=*), intent(in) :: etype
|
|
integer, intent(in) :: npoint
|
|
integer, intent(in) :: code
|
|
integer, parameter :: MAX_QP_TEST = 16
|
|
real(rk) :: gp_nat(NDIM,MAX_QP_TEST)
|
|
real(rk) :: gp_weight(MAX_QP_TEST)
|
|
real(rk) :: nshape(MAX_NEN)
|
|
real(rk) :: dndr(NDIM,MAX_NEN)
|
|
real(rk) :: expected_stress(NSTRESS)
|
|
real(rk) :: expected_strain(NSTRESS)
|
|
real(rk) :: shear_mod
|
|
real(rk) :: x_gp
|
|
integer :: gp
|
|
integer :: nquad
|
|
integer :: local_node
|
|
integer :: node
|
|
integer :: ierr
|
|
|
|
call quadrature_get_rule(etype, MAX_QP_TEST, nquad, gp_nat, gp_weight, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(code)
|
|
if (nquad .ne. npoint) call fail(code + 1)
|
|
|
|
shear_mod = YOUNG / (2.0_rk * (ONE + POISSON))
|
|
do gp = 1, npoint
|
|
call shape_evaluate(etype, gp_nat(:,gp), nshape, dndr, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(code + 2)
|
|
|
|
x_gp = ZERO
|
|
do local_node = 1, elem_nnode(1)
|
|
node = elem_conn(local_node,1)
|
|
x_gp = x_gp + nshape(local_node) * coord0(1,node)
|
|
end do
|
|
|
|
expected_strain = ZERO
|
|
expected_strain(5) = KAPPA_X * x_gp
|
|
expected_stress = ZERO
|
|
expected_stress(5) = (5.0_rk / 6.0_rk) * shear_mod * expected_strain(5)
|
|
|
|
call check_vector_close(strain(:,gp), expected_strain, code + 3)
|
|
call check_vector_close(stress(:,gp), expected_stress, code + 4)
|
|
if (abs(statev(10,gp) - KAPPA_X) .gt. TOL) call fail(code + 5)
|
|
if (abs(statev(11,gp)) .gt. TOL) call fail(code + 6)
|
|
if (abs(statev(12,gp)) .gt. TOL) call fail(code + 7)
|
|
end do
|
|
end subroutine check_bending_state
|
|
|
|
subroutine check_force_balance(code)
|
|
integer, intent(in) :: code
|
|
real(rk) :: balance(NDOF_NODE)
|
|
real(rk) :: max_force
|
|
integer :: node
|
|
integer :: idir
|
|
|
|
balance = ZERO
|
|
max_force = ZERO
|
|
do node = 1, nnode
|
|
do idir = 1, NDOF_NODE
|
|
balance(idir) = balance(idir) + fint(dof_id(idir,node))
|
|
max_force = max(max_force, abs(fint(dof_id(idir,node))))
|
|
end do
|
|
end do
|
|
|
|
if (maxval(abs(balance)) .gt. TOL) call fail(code)
|
|
if (max_force .le. TOL) call fail(code + 1)
|
|
end subroutine check_force_balance
|
|
|
|
subroutine check_translational_balance(code)
|
|
integer, intent(in) :: code
|
|
real(rk) :: balance(NDIM)
|
|
real(rk) :: max_force
|
|
integer :: node
|
|
integer :: idir
|
|
|
|
balance = ZERO
|
|
max_force = ZERO
|
|
do node = 1, nnode
|
|
do idir = 1, NDIM
|
|
balance(idir) = balance(idir) + fint(dof_id(idir,node))
|
|
end do
|
|
do idir = 1, NDOF_NODE
|
|
max_force = max(max_force, abs(fint(dof_id(idir,node))))
|
|
end do
|
|
end do
|
|
|
|
if (maxval(abs(balance)) .gt. TOL) call fail(code)
|
|
if (max_force .le. TOL) call fail(code + 1)
|
|
end subroutine check_translational_balance
|
|
|
|
subroutine check_no_normal_or_rotation(code)
|
|
integer, intent(in) :: code
|
|
integer :: node
|
|
integer :: idir
|
|
|
|
do node = 1, nnode
|
|
if (abs(fint(dof_id(3,node))) .gt. TOL) call fail(code)
|
|
do idir = 4, NDOF_NODE
|
|
if (abs(fint(dof_id(idir,node))) .gt. TOL) call fail(code + 1)
|
|
end do
|
|
end do
|
|
end subroutine check_no_normal_or_rotation
|
|
|
|
subroutine check_vector_close(actual, expected, code)
|
|
real(rk), intent(in) :: actual(NSTRESS)
|
|
real(rk), intent(in) :: expected(NSTRESS)
|
|
integer, intent(in) :: code
|
|
integer :: i
|
|
|
|
do i = 1, NSTRESS
|
|
if (abs(actual(i) - expected(i)) .gt. TOL * max(ONE, abs(expected(i)))) then
|
|
call fail(code)
|
|
end if
|
|
end do
|
|
end subroutine check_vector_close
|
|
|
|
subroutine check_matrix_symmetric(mat, n, code)
|
|
real(rk), intent(in) :: mat(:,:)
|
|
integer, intent(in) :: n
|
|
integer, intent(in) :: code
|
|
integer :: i
|
|
integer :: j
|
|
|
|
do i = 1, n
|
|
do j = 1, n
|
|
if (abs(mat(i,j) - mat(j,i)) .gt. 1.0e-8_rk) call fail(code)
|
|
end do
|
|
end do
|
|
end subroutine check_matrix_symmetric
|
|
|
|
subroutine fail(code)
|
|
integer, intent(in) :: code
|
|
|
|
write(*,*) 'test_shell_internal failed:', code
|
|
stop 1
|
|
end subroutine fail
|
|
|
|
end program test_shell_internal
|