585 lines
18 KiB
Fortran
585 lines
18 KiB
Fortran
program test_shell_finite_element
|
|
use fem_precision
|
|
use fem_error
|
|
use fem_control
|
|
use fem_database
|
|
use fem_element_internal
|
|
use fem_element_stiffness
|
|
use fem_element_state
|
|
implicit none
|
|
|
|
real(rk), parameter :: YOUNG = 30.0_rk
|
|
real(rk), parameter :: POISSON = 0.25_rk
|
|
real(rk), parameter :: THICKNESS = 0.2_rk
|
|
real(rk), parameter :: TOL = 2.5e-4_rk
|
|
|
|
call check_membrane_state()
|
|
call check_drilling_energy()
|
|
call check_element_tangent_fd()
|
|
call check_membrane_locking_control()
|
|
call check_composite_coupling()
|
|
call check_composite_plastic_layer()
|
|
call check_plastic_large_rotation('J2', 100)
|
|
call check_plastic_large_rotation('J2_JC', 120)
|
|
call check_plastic_rollback()
|
|
|
|
contains
|
|
|
|
subroutine check_membrane_state()
|
|
integer :: ierr
|
|
integer :: gp
|
|
real(rk) :: exx
|
|
real(rk) :: expected
|
|
|
|
call setup_s4(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(10)
|
|
call element_state_begin_trial(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(11)
|
|
exx = 1.0e-4_rk
|
|
call set_extension(exx)
|
|
call element_compute_internal_force(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(12)
|
|
expected = exx + HALF * exx * exx
|
|
do gp = 1, 4
|
|
if (abs(strain(1,gp) - expected) .gt. 1.0e-10_rk) call fail(13)
|
|
if (abs(strain(2,gp)) .gt. 1.0e-10_rk) call fail(14)
|
|
if (abs(statev(10,gp)) .gt. 1.0e-10_rk) call fail(15)
|
|
if (maxval(abs(shell_resultant(1:3,gp))) .le. ZERO) call fail(16)
|
|
end do
|
|
call database_finalize(ierr)
|
|
shell_finite_strain_requested = .false.
|
|
if (ierr .ne. FEM_SUCCESS) call fail(17)
|
|
end subroutine check_membrane_state
|
|
|
|
subroutine check_drilling_energy()
|
|
integer, parameter :: NDOF = 24
|
|
integer :: ierr
|
|
integer :: elem_dofs(NDOF)
|
|
integer :: n_elem_dof
|
|
integer :: dof
|
|
integer :: pos
|
|
real(rk) :: ke(NDOF,NDOF)
|
|
real(rk) :: theta
|
|
|
|
call setup_s4(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(30)
|
|
call element_state_begin_trial(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(31)
|
|
theta = 0.03_rk
|
|
u = ZERO
|
|
u(dof_id(6,1)) = theta
|
|
call element_compute_internal_force(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(32)
|
|
dof = dof_id(6,1)
|
|
if (fint(dof) .le. ZERO) call fail(33)
|
|
|
|
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(34)
|
|
if (n_elem_dof .ne. NDOF) call fail(35)
|
|
pos = local_position(elem_dofs, n_elem_dof, dof)
|
|
if (pos .le. 0) call fail(36)
|
|
if (ke(pos,pos) .le. ZERO) call fail(37)
|
|
if (abs(fint(dof) - ke(pos,pos) * theta) .gt. &
|
|
1.0e-10_rk * max(ONE, abs(fint(dof)))) call fail(38)
|
|
if (shell_stability_last_drilling .le. ZERO) call fail(39)
|
|
|
|
call database_finalize(ierr)
|
|
shell_finite_strain_requested = .false.
|
|
if (ierr .ne. FEM_SUCCESS) call fail(40)
|
|
end subroutine check_drilling_energy
|
|
|
|
subroutine check_element_tangent_fd()
|
|
integer, parameter :: NDOF = 24
|
|
integer :: ierr
|
|
integer :: elem_dofs(NDOF)
|
|
integer :: n_elem_dof
|
|
integer :: col
|
|
real(rk) :: ubase(NDOF)
|
|
real(rk) :: delta(NDOF)
|
|
real(rk) :: f0(NDOF)
|
|
real(rk) :: fp(NDOF)
|
|
real(rk) :: fm(NDOF)
|
|
real(rk) :: fd(NDOF)
|
|
real(rk) :: ke(NDOF,NDOF)
|
|
real(rk) :: h
|
|
real(rk) :: err
|
|
real(rk) :: scale
|
|
|
|
ubase = ZERO
|
|
ubase(1) = 0.015_rk
|
|
ubase(2) = -0.006_rk
|
|
ubase(3) = 0.011_rk
|
|
ubase(8) = 0.018_rk
|
|
ubase(9) = 0.007_rk
|
|
ubase(10) = -0.012_rk
|
|
ubase(15) = 0.020_rk
|
|
ubase(16) = -0.015_rk
|
|
ubase(17) = 0.010_rk
|
|
ubase(22) = -0.014_rk
|
|
ubase(23) = 0.016_rk
|
|
ubase(24) = 0.009_rk
|
|
h = 1.0e-6_rk
|
|
|
|
call tangent_at(ubase, elem_dofs, n_elem_dof, ke, f0, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(60)
|
|
if (n_elem_dof .ne. NDOF) call fail(61)
|
|
|
|
do col = 1, NDOF
|
|
delta = ZERO
|
|
delta(col) = h
|
|
call force_after_increment(ubase, delta, fp, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(62)
|
|
delta(col) = -h
|
|
call force_after_increment(ubase, delta, fm, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(63)
|
|
fd = (fp - fm) / (2.0_rk * h)
|
|
err = maxval(abs(fd - ke(1:NDOF,col)))
|
|
scale = ONE + max(maxval(abs(fd)), maxval(abs(ke(1:NDOF,col))))
|
|
if (err .gt. TOL * scale) then
|
|
write(*,*) 'finite S4 element tangent mismatch col=', col, &
|
|
' err=', err, ' scale=', scale
|
|
call fail(64)
|
|
end if
|
|
end do
|
|
end subroutine check_element_tangent_fd
|
|
|
|
subroutine check_membrane_locking_control()
|
|
integer :: ierr
|
|
integer :: gp
|
|
real(rk) :: membrane_ref(3)
|
|
|
|
call setup_s4(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(165)
|
|
shell_membrane_locking_control = .true.
|
|
call element_state_begin_trial(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(166)
|
|
u = ZERO
|
|
u(1) = 0.015_rk
|
|
u(2) = -0.006_rk
|
|
u(8) = 0.018_rk
|
|
u(9) = 0.007_rk
|
|
u(15) = 0.020_rk
|
|
u(16) = -0.015_rk
|
|
u(22) = -0.014_rk
|
|
u(23) = 0.016_rk
|
|
call element_compute_internal_force(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(167)
|
|
membrane_ref = strain(1:3,elem_gp_start(1))
|
|
do gp = elem_gp_start(1), elem_gp_start(1) + 3
|
|
if (maxval(abs(strain(1:3,gp) - membrane_ref)) .gt. 1.0e-12_rk) &
|
|
call fail(168)
|
|
end do
|
|
if (maxval(abs(shell_resultant(1:3,elem_gp_start(1)))) .le. ZERO) &
|
|
call fail(169)
|
|
shell_membrane_locking_control = .false.
|
|
call database_finalize(ierr)
|
|
shell_finite_strain_requested = .false.
|
|
if (ierr .ne. FEM_SUCCESS) call fail(170)
|
|
end subroutine check_membrane_locking_control
|
|
|
|
subroutine check_composite_coupling()
|
|
integer, parameter :: NDOF = 24
|
|
integer :: ierr
|
|
integer :: elem_dofs(NDOF)
|
|
integer :: n_elem_dof
|
|
real(rk) :: ke(NDOF,NDOF)
|
|
real(rk) :: max_coupling
|
|
integer :: row
|
|
integer :: col
|
|
|
|
call setup_s4_composite(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(70)
|
|
call element_state_begin_trial(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(71)
|
|
call set_extension(0.01_rk)
|
|
u(dof_id(4,2)) = 0.05_rk
|
|
u(dof_id(5,3)) = -0.04_rk
|
|
call element_compute_internal_force(ierr, 0.1_rk)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(72)
|
|
if (shell_resultant(4,elem_gp_start(1)) .le. ZERO) call fail(73)
|
|
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(74)
|
|
max_coupling = ZERO
|
|
do row = 1, n_elem_dof
|
|
do col = 1, n_elem_dof
|
|
if (is_rotation_dof(elem_dofs(row)) .and. &
|
|
is_translation_dof(elem_dofs(col))) then
|
|
max_coupling = max(max_coupling, abs(ke(row,col)))
|
|
end if
|
|
end do
|
|
end do
|
|
if (max_coupling .le. 1.0e-12_rk) call fail(75)
|
|
call database_finalize(ierr)
|
|
shell_finite_strain_requested = .false.
|
|
if (ierr .ne. FEM_SUCCESS) call fail(76)
|
|
end subroutine check_composite_coupling
|
|
|
|
subroutine check_composite_plastic_layer()
|
|
integer, parameter :: NDOF = 24
|
|
integer :: ierr
|
|
integer :: elem_dofs(NDOF)
|
|
integer :: n_elem_dof
|
|
integer :: gp
|
|
real(rk) :: ke(NDOF,NDOF)
|
|
|
|
call setup_s4_composite_j2(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(77)
|
|
call element_state_begin_trial(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(78)
|
|
call apply_plastic_path()
|
|
call element_compute_internal_force(ierr, 0.1_rk)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(79)
|
|
gp = elem_gp_start(1)
|
|
if (shell_layer_gp_count(gp) .ne. 4) call fail(80)
|
|
if (statev(1,gp) .le. ZERO) call fail(81)
|
|
if (maxval(abs(shell_layer_statev)) .le. ZERO) call fail(82)
|
|
if (maxval(abs(shell_resultant(1:8,gp))) .le. ZERO) call fail(83)
|
|
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(84)
|
|
if (n_elem_dof .ne. NDOF) call fail(85)
|
|
if (maxval(abs(ke(1:NDOF,1:NDOF))) .le. ZERO) call fail(86)
|
|
call database_finalize(ierr)
|
|
shell_finite_strain_requested = .false.
|
|
if (ierr .ne. FEM_SUCCESS) call fail(87)
|
|
end subroutine check_composite_plastic_layer
|
|
|
|
subroutine check_plastic_large_rotation(model, code)
|
|
character(len=*), intent(in) :: model
|
|
integer, intent(in) :: code
|
|
integer, parameter :: NDOF = 24
|
|
integer :: ierr
|
|
integer :: elem_dofs(NDOF)
|
|
integer :: n_elem_dof
|
|
real(rk) :: ke(NDOF,NDOF)
|
|
|
|
call setup_s4_plastic(model, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(code)
|
|
call element_state_begin_trial(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(code + 1)
|
|
call apply_plastic_path()
|
|
call element_compute_internal_force(ierr, 0.1_rk)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(code + 2)
|
|
if (statev(1,elem_gp_start(1)) .le. ZERO) call fail(code + 3)
|
|
if (maxval(abs(shell_layer_statev)) .le. ZERO) call fail(code + 4)
|
|
if (maxval(abs(shell_resultant(1:8,elem_gp_start(1)))) .le. ZERO) &
|
|
call fail(code + 5)
|
|
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(code + 6)
|
|
if (n_elem_dof .ne. NDOF) call fail(code + 7)
|
|
if (maxval(abs(ke(1:NDOF,1:NDOF))) .le. ZERO) call fail(code + 8)
|
|
call database_finalize(ierr)
|
|
shell_finite_strain_requested = .false.
|
|
if (ierr .ne. FEM_SUCCESS) call fail(code + 9)
|
|
end subroutine check_plastic_large_rotation
|
|
|
|
subroutine check_plastic_rollback()
|
|
integer :: ierr
|
|
|
|
call setup_s4_plastic('J2', ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(150)
|
|
call element_state_begin_trial(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(151)
|
|
call apply_plastic_path()
|
|
call element_compute_internal_force(ierr, 0.1_rk)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(152)
|
|
if (maxval(abs(shell_layer_statev)) .le. ZERO) call fail(153)
|
|
call element_state_abort_trial(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) call fail(154)
|
|
if (maxval(abs(stress)) .gt. 1.0e-12_rk) call fail(155)
|
|
if (maxval(abs(strain)) .gt. 1.0e-12_rk) call fail(156)
|
|
if (maxval(abs(statev)) .gt. 1.0e-12_rk) call fail(157)
|
|
if (maxval(abs(shell_layer_stress)) .gt. 1.0e-12_rk) call fail(158)
|
|
if (maxval(abs(shell_layer_strain)) .gt. 1.0e-12_rk) call fail(159)
|
|
if (maxval(abs(shell_layer_statev)) .gt. 1.0e-12_rk) call fail(160)
|
|
call database_finalize(ierr)
|
|
shell_finite_strain_requested = .false.
|
|
if (ierr .ne. FEM_SUCCESS) call fail(161)
|
|
end subroutine check_plastic_rollback
|
|
|
|
subroutine tangent_at(uvec, elem_dofs, n_elem_dof, ke, force, ierr)
|
|
real(rk), intent(in) :: uvec(24)
|
|
integer, intent(out) :: elem_dofs(24)
|
|
integer, intent(out) :: n_elem_dof
|
|
real(rk), intent(out) :: ke(24,24)
|
|
real(rk), intent(out) :: force(24)
|
|
integer, intent(out) :: ierr
|
|
|
|
call setup_s4(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) return
|
|
call element_state_begin_trial(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) return
|
|
u(1:24) = uvec
|
|
call element_compute_internal_force(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) return
|
|
force = fint(1:24)
|
|
call element_linear_stiffness(1, elem_dofs, n_elem_dof, ke, ierr)
|
|
if (ierr .ne. FEM_SUCCESS) return
|
|
call database_finalize(ierr)
|
|
shell_finite_strain_requested = .false.
|
|
end subroutine tangent_at
|
|
|
|
subroutine force_after_increment(ubase, delta, force, ierr)
|
|
real(rk), intent(in) :: ubase(24)
|
|
real(rk), intent(in) :: delta(24)
|
|
real(rk), intent(out) :: force(24)
|
|
integer, intent(out) :: ierr
|
|
|
|
call setup_s4(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) return
|
|
call element_state_begin_trial(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) return
|
|
u(1:24) = ubase
|
|
call element_compute_internal_force(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) return
|
|
u(1:24) = ubase + delta
|
|
call element_compute_internal_force(ierr)
|
|
if (ierr .ne. FEM_SUCCESS) return
|
|
force = fint(1:24)
|
|
call database_finalize(ierr)
|
|
shell_finite_strain_requested = .false.
|
|
end subroutine force_after_increment
|
|
|
|
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
|
|
|
|
shell_finite_strain_requested = .true.
|
|
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) = 'ELASTIC'
|
|
|
|
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
|
|
call fill_s4_geometry()
|
|
elem_mat(1) = 1
|
|
elem_sec(1) = 1
|
|
mat_name(1) = 'LOW'
|
|
mat_density(1) = ONE
|
|
mat_e(1) = YOUNG
|
|
mat_nu(1) = POISSON
|
|
mat_plastic_model(1) = 'ELASTIC'
|
|
mat_name(2) = 'HIGH'
|
|
mat_density(2) = ONE
|
|
mat_e(2) = 2.0_rk * YOUNG
|
|
mat_nu(2) = POISSON
|
|
mat_plastic_model(2) = 'ELASTIC'
|
|
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
|
|
call fill_s4_geometry()
|
|
elem_mat(1) = 1
|
|
elem_sec(1) = 1
|
|
mat_name(1) = 'EL'
|
|
mat_density(1) = ONE
|
|
mat_e(1) = YOUNG
|
|
mat_nu(1) = POISSON
|
|
mat_plastic_model(1) = 'ELASTIC'
|
|
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_plastic(model, ierr)
|
|
character(len=*), intent(in) :: model
|
|
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
|
|
call fill_s4_geometry()
|
|
elem_mat(1) = 1
|
|
elem_sec(1) = 1
|
|
mat_name(1) = 'MAT'
|
|
mat_density(1) = ONE
|
|
mat_e(1) = YOUNG
|
|
mat_nu(1) = POISSON
|
|
mat_plastic_model(1) = model
|
|
mat_plastic_start(1) = 1
|
|
mat_plastic_count(1) = 1
|
|
mat_yield0(1) = 0.05_rk
|
|
mat_plastic_stress(1) = 0.05_rk
|
|
mat_plastic_strain(1) = ZERO
|
|
if (trim(model) .eq. 'J2_JC') then
|
|
mat_jc_a(1) = 0.05_rk
|
|
mat_jc_b(1) = ZERO
|
|
mat_jc_n(1) = ONE
|
|
end if
|
|
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_plastic
|
|
|
|
subroutine fill_s4_geometry()
|
|
shell_finite_strain_requested = .true.
|
|
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 /)
|
|
elset_name(1) = 'EALL'
|
|
elset_start(1) = 1
|
|
elset_count(1) = 1
|
|
elset_items(1) = 1
|
|
end subroutine fill_s4_geometry
|
|
|
|
subroutine set_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 set_extension
|
|
|
|
subroutine apply_plastic_path()
|
|
u = ZERO
|
|
call set_extension(0.03_rk)
|
|
u(dof_id(4,2)) = 0.08_rk
|
|
u(dof_id(5,3)) = -0.06_rk
|
|
u(dof_id(6,4)) = 0.04_rk
|
|
end subroutine apply_plastic_path
|
|
|
|
logical function is_translation_dof(dof)
|
|
integer, intent(in) :: dof
|
|
integer :: node
|
|
integer :: idir
|
|
|
|
is_translation_dof = .false.
|
|
do node = 1, nnode
|
|
do idir = 1, 3
|
|
if (dof_id(idir,node) .eq. dof) is_translation_dof = .true.
|
|
end do
|
|
end do
|
|
end function is_translation_dof
|
|
|
|
logical function is_rotation_dof(dof)
|
|
integer, intent(in) :: dof
|
|
integer :: node
|
|
integer :: idir
|
|
|
|
is_rotation_dof = .false.
|
|
do node = 1, nnode
|
|
do idir = 4, 6
|
|
if (dof_id(idir,node) .eq. dof) is_rotation_dof = .true.
|
|
end do
|
|
end do
|
|
end function is_rotation_dof
|
|
|
|
integer function local_position(elem_dofs, n_elem_dof, dof)
|
|
integer, intent(in) :: elem_dofs(:)
|
|
integer, intent(in) :: n_elem_dof
|
|
integer, intent(in) :: dof
|
|
integer :: i
|
|
|
|
local_position = 0
|
|
do i = 1, n_elem_dof
|
|
if (elem_dofs(i) .eq. dof) then
|
|
local_position = i
|
|
return
|
|
end if
|
|
end do
|
|
end function local_position
|
|
|
|
subroutine fail(code)
|
|
integer, intent(in) :: code
|
|
|
|
write(*,*) 'test_shell_finite_element failed:', code
|
|
stop 1
|
|
end subroutine fail
|
|
|
|
end program test_shell_finite_element
|