This commit is contained in:
@@ -36,6 +36,9 @@ program test_solver_implicit
|
||||
call check_static_arc_load_riks()
|
||||
call check_static_arc_no_control()
|
||||
call check_static_arc_disp_path()
|
||||
call check_static_arc_amp_path()
|
||||
call check_static_arc_disp_adaptive()
|
||||
call check_static_arc_disp_trust()
|
||||
call check_nonlinear_cg_fallback()
|
||||
|
||||
contains
|
||||
@@ -786,6 +789,9 @@ contains
|
||||
if (nlc_path_int(NLC_PATH_I_CONTROL_DOF_COUNT, 2) .ne. 1) call fail(238)
|
||||
call check_close(nlc_path_real(NLC_PATH_R_TIME, 1), 0.5_rk, 239)
|
||||
call check_close(nlc_path_real(NLC_PATH_R_TIME, 2), ONE, 240)
|
||||
call check_close(nlc_path_real(NLC_PATH_R_TARGET_DT, 1), 0.5_rk, 249)
|
||||
call check_close(nlc_path_real(NLC_PATH_R_ACTUAL_DT, 2), 0.5_rk, 250)
|
||||
call check_close(nlc_path_real(NLC_PATH_R_NEXT_DT, 2), ZERO, 251)
|
||||
call check_close(nlc_path_real(NLC_PATH_R_PRESCRIBED_L2, 1), 0.125_rk, &
|
||||
241)
|
||||
call check_close(nlc_path_real(NLC_PATH_R_ACTUAL_L2, 2), 0.25_rk, 242)
|
||||
@@ -803,6 +809,146 @@ contains
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(248)
|
||||
end subroutine check_static_arc_disp_path
|
||||
|
||||
subroutine check_static_arc_amp_path()
|
||||
integer :: ierr
|
||||
integer :: iter
|
||||
integer :: old_method
|
||||
real(rk) :: res_norm
|
||||
|
||||
call setup_prescribed_amp_model(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(290)
|
||||
|
||||
old_method = nonlinear_continuation_method
|
||||
nonlinear_continuation_method = NLC_ARC_DISP
|
||||
current_time = ZERO
|
||||
current_step = 0
|
||||
call implicit_solve_nonlinear_static(ONE, 2, 50, 1.0e-12_rk, &
|
||||
iter, res_norm, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(291)
|
||||
if (nlc_path_count .ne. 2) call fail(292)
|
||||
call check_close(nlc_path_real(NLC_PATH_R_TIME, 1), 0.5_rk, 293)
|
||||
call check_close(nlc_path_real(NLC_PATH_R_PRESCRIBED_L2, 1), &
|
||||
0.125_rk, 294)
|
||||
call check_close(nlc_path_real(NLC_PATH_R_ACTUAL_L2, 2), 0.25_rk, &
|
||||
295)
|
||||
if (nlc_path_real(NLC_PATH_R_RESIDUAL_LINF, 2) .gt. TOL) call fail(296)
|
||||
|
||||
nonlinear_continuation_method = old_method
|
||||
|
||||
call database_finalize(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(297)
|
||||
end subroutine check_static_arc_amp_path
|
||||
|
||||
subroutine check_static_arc_disp_adaptive()
|
||||
integer :: ierr
|
||||
integer :: iter
|
||||
integer :: old_method
|
||||
integer :: old_target
|
||||
real(rk) :: res_norm
|
||||
real(rk) :: old_growth
|
||||
real(rk) :: old_shrink
|
||||
real(rk) :: old_initial
|
||||
real(rk) :: old_min
|
||||
real(rk) :: old_max
|
||||
logical :: old_disp_adaptive
|
||||
|
||||
call setup_prescribed_model(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(298)
|
||||
|
||||
old_method = nonlinear_continuation_method
|
||||
old_target = nlc_target_newton
|
||||
old_growth = nlc_growth_factor
|
||||
old_shrink = nlc_shrink_factor
|
||||
old_initial = static_initial_increment
|
||||
old_min = static_min_increment
|
||||
old_max = static_max_increment
|
||||
old_disp_adaptive = use_disp_path_adaptive
|
||||
|
||||
nonlinear_continuation_method = NLC_ARC_DISP
|
||||
use_disp_path_adaptive = .true.
|
||||
nlc_target_newton = 4
|
||||
nlc_growth_factor = 2.0_rk
|
||||
nlc_shrink_factor = 0.5_rk
|
||||
static_initial_increment = 0.25_rk
|
||||
static_min_increment = 0.01_rk
|
||||
static_max_increment = 0.5_rk
|
||||
current_time = ZERO
|
||||
current_step = 0
|
||||
call implicit_solve_nonlinear_static(ONE, 4, 50, 1.0e-12_rk, &
|
||||
iter, res_norm, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(299)
|
||||
call check_close(current_time, ONE, 300)
|
||||
if (nlc_path_count .lt. 2 .or. nlc_path_count .gt. 16) call fail(301)
|
||||
call check_close(nlc_path_real(NLC_PATH_R_TIME, 1), 0.25_rk, 302)
|
||||
call check_close(nlc_path_real(NLC_PATH_R_TIME, nlc_path_count), ONE, 303)
|
||||
call check_close(nlc_path_real(NLC_PATH_R_TARGET_DT, 1), 0.25_rk, 307)
|
||||
call check_close(nlc_path_real(NLC_PATH_R_ACTUAL_DT, 1), 0.25_rk, 308)
|
||||
if (nlc_path_real(NLC_PATH_R_NEXT_DT, 1) .le. ZERO) call fail(309)
|
||||
if (nlc_path_int(NLC_PATH_I_ADAPT_ADJUST, 1) .lt. NLC_ADJ_FAILED .or. &
|
||||
nlc_path_int(NLC_PATH_I_ADAPT_ADJUST, 1) .gt. NLC_ADJ_CUTBACK) &
|
||||
call fail(310)
|
||||
if (nlc_path_int(NLC_PATH_I_CUTBACK_COUNT, 1) .ne. 0) call fail(311)
|
||||
if (nlc_path_int(NLC_PATH_I_CONTROL_DOF_COUNT, nlc_path_count) .ne. 1) &
|
||||
call fail(304)
|
||||
if (nlc_path_int(NLC_PATH_I_STATUS_CODE, nlc_path_count) .ne. &
|
||||
CONVERGENCE_STATUS_CONVERGED) call fail(305)
|
||||
|
||||
nonlinear_continuation_method = old_method
|
||||
nlc_target_newton = old_target
|
||||
nlc_growth_factor = old_growth
|
||||
nlc_shrink_factor = old_shrink
|
||||
static_initial_increment = old_initial
|
||||
static_min_increment = old_min
|
||||
static_max_increment = old_max
|
||||
use_disp_path_adaptive = old_disp_adaptive
|
||||
|
||||
call database_finalize(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(306)
|
||||
end subroutine check_static_arc_disp_adaptive
|
||||
|
||||
subroutine check_static_arc_disp_trust()
|
||||
integer :: ierr
|
||||
integer :: iter
|
||||
integer :: old_method
|
||||
real(rk) :: res_norm
|
||||
real(rk) :: old_radius
|
||||
real(rk) :: old_min_radius
|
||||
real(rk) :: old_max_radius
|
||||
|
||||
call setup_prescribed_model(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(312)
|
||||
|
||||
old_method = nonlinear_continuation_method
|
||||
old_radius = nlc_trust_radius
|
||||
old_min_radius = nlc_trust_min_radius
|
||||
old_max_radius = nlc_trust_max_radius
|
||||
|
||||
nonlinear_continuation_method = NLC_ARC_DISP
|
||||
nlc_trust_radius = 0.05_rk
|
||||
nlc_trust_min_radius = 0.01_rk
|
||||
nlc_trust_max_radius = 0.10_rk
|
||||
current_time = ZERO
|
||||
current_step = 0
|
||||
call implicit_solve_nonlinear_static(ONE, 2, 50, 1.0e-12_rk, &
|
||||
iter, res_norm, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(313)
|
||||
if (nlc_path_count .ne. 2) call fail(314)
|
||||
call check_close(nlc_path_real(NLC_PATH_R_TIME, 2), ONE, 315)
|
||||
if (nlc_trust_radius .le. ZERO) call fail(316)
|
||||
if (nlc_last_damping .le. ZERO .or. &
|
||||
nlc_last_damping .gt. ONE + TOL) call fail(318)
|
||||
if (nlc_path_int(NLC_PATH_I_STATUS_CODE, 2) .ne. &
|
||||
CONVERGENCE_STATUS_CONVERGED) call fail(319)
|
||||
|
||||
nonlinear_continuation_method = old_method
|
||||
nlc_trust_radius = old_radius
|
||||
nlc_trust_min_radius = old_min_radius
|
||||
nlc_trust_max_radius = old_max_radius
|
||||
|
||||
call database_finalize(ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) call fail(320)
|
||||
end subroutine check_static_arc_disp_trust
|
||||
|
||||
subroutine check_nonlinear_cg_fallback()
|
||||
integer :: ierr
|
||||
integer :: iter
|
||||
@@ -947,19 +1093,71 @@ contains
|
||||
ierr = FEM_SUCCESS
|
||||
end subroutine setup_prescribed_model
|
||||
|
||||
subroutine setup_base_tet(num_bc, num_cload, ierr, num_dload)
|
||||
subroutine setup_prescribed_amp_model(ierr)
|
||||
integer, intent(out) :: ierr
|
||||
|
||||
call setup_base_tet(5, 0, ierr, num_amp=1, num_amp_items=2)
|
||||
if (ierr .ne. FEM_SUCCESS) return
|
||||
|
||||
bc_target(1) = '1'
|
||||
bc_dof_start(1) = 1
|
||||
bc_dof_end(1) = 3
|
||||
bc_value(1) = ZERO
|
||||
|
||||
bc_target(2) = '2'
|
||||
bc_dof_start(2) = 1
|
||||
bc_dof_end(2) = 1
|
||||
bc_value(2) = 0.25_rk
|
||||
bc_amp(2) = 1
|
||||
|
||||
bc_target(3) = '2'
|
||||
bc_dof_start(3) = 2
|
||||
bc_dof_end(3) = 3
|
||||
bc_value(3) = ZERO
|
||||
|
||||
bc_target(4) = '3'
|
||||
bc_dof_start(4) = 1
|
||||
bc_dof_end(4) = 3
|
||||
bc_value(4) = ZERO
|
||||
|
||||
bc_target(5) = '4'
|
||||
bc_dof_start(5) = 1
|
||||
bc_dof_end(5) = 3
|
||||
bc_value(5) = ZERO
|
||||
|
||||
amp_name(1) = 'RAMP'
|
||||
amp_start(1) = 1
|
||||
amp_count(1) = 2
|
||||
amp_time(1) = ZERO
|
||||
amp_value(1) = ZERO
|
||||
amp_time(2) = ONE
|
||||
amp_value(2) = ONE
|
||||
ierr = FEM_SUCCESS
|
||||
end subroutine setup_prescribed_amp_model
|
||||
|
||||
subroutine setup_base_tet(num_bc, num_cload, ierr, num_dload, num_amp, &
|
||||
num_amp_items)
|
||||
integer, intent(in) :: num_bc
|
||||
integer, intent(in) :: num_cload
|
||||
integer, intent(out) :: ierr
|
||||
integer, intent(in), optional :: num_dload
|
||||
integer, intent(in), optional :: num_amp
|
||||
integer, intent(in), optional :: num_amp_items
|
||||
integer :: i
|
||||
integer :: ndload_local
|
||||
integer :: namp_local
|
||||
integer :: namp_item_local
|
||||
|
||||
ndload_local = 0
|
||||
if (present(num_dload)) ndload_local = num_dload
|
||||
namp_local = 0
|
||||
if (present(num_amp)) namp_local = num_amp
|
||||
namp_item_local = 0
|
||||
if (present(num_amp_items)) namp_item_local = num_amp_items
|
||||
|
||||
call database_allocate_model(4, 1, 0, 0, 0, 0, 1, 0, 1, &
|
||||
0, 0, num_bc, num_cload, ndload_local, ierr)
|
||||
namp_local, namp_item_local, num_bc, &
|
||||
num_cload, ndload_local, ierr)
|
||||
if (ierr .ne. FEM_SUCCESS) return
|
||||
|
||||
do i = 1, 4
|
||||
|
||||
Reference in New Issue
Block a user