CONTAINS minimizer for MHD3D functional
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=40), | public | :: | MinimizerType |
defines the minimization algorithm: 0 = Gradient-Descent, 10 = Accelerated Gradient-Descent |
|||
| logical, | public | :: | restart_iter | ||||
| logical, | public | :: | logger_is_initialized | ||||
| integer, | public | :: | JacCheck |
switch for restarts, if detJ<0 JacCheck<=-1 |
|||
| integer, | public | :: | iter | ||||
| integer, | public | :: | nStepDecreased | ||||
| integer, | public | :: | nSkip_Jac | ||||
| integer, | public | :: | nSkip_dw | ||||
| integer, | public | :: | lastoutputIter | ||||
| integer, | public | :: | logiter_ramp | ||||
| integer, | public | :: | logscreen | ||||
| real(kind=wp), | public | :: | dt | ||||
| real(kind=wp), | public | :: | deltaW | ||||
| real(kind=wp), | public | :: | dW_allowed | ||||
| real(kind=wp), | public | :: | t_pseudo | ||||
| real(kind=wp), | public | :: | Fnorm(3) | ||||
| real(kind=wp), | public | :: | Fnorm0(3) | ||||
| real(kind=wp), | public | :: | Fnorm_old(3) | ||||
| real(kind=wp), | public | :: | W_MHD3D_0 | ||||
| real(kind=wp), | public | :: | min_dt_out | ||||
| real(kind=wp), | public | :: | max_dt_out | ||||
| real(kind=wp), | public | :: | min_dw_out | ||||
| real(kind=wp), | public | :: | max_dw_out | ||||
| real(kind=wp), | public | :: | sum_dW_out | ||||
| logical, | public | :: | DoCheckDistance | ||||
| logical, | public | :: | DoCheckAxis | ||||
| integer, | public | :: | outputIter | ||||
| integer, | public | :: | nlogScreen | ||||
| integer, | public | :: | logIter | ||||
| integer, | public | :: | logUnit | ||||
| integer, | public | :: | StartTimeArray(8) | ||||
| type(t_sol_var_MHD3D), | public, | ALLOCATABLE | :: | dofs(:) |
degrees of freedom at levels (k-1),(k),(k+1) |
||
| type(t_sol_var_MHD3D), | public, | ALLOCATABLE | :: | force(:) |
force |
||
| type(t_sol_var_MHD3D), | public, | ALLOCATABLE | :: | temp_dofs(:) |
temporary for update |
State variables for a Gradient descent minimizer
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=40), | public | :: | MinimizerType |
defines the minimization algorithm: 0 = Gradient-Descent, 10 = Accelerated Gradient-Descent |
|||
| logical, | public | :: | restart_iter | ||||
| logical, | public | :: | logger_is_initialized | ||||
| integer, | public | :: | JacCheck |
switch for restarts, if detJ<0 JacCheck<=-1 |
|||
| integer, | public | :: | iter | ||||
| integer, | public | :: | nStepDecreased | ||||
| integer, | public | :: | nSkip_Jac | ||||
| integer, | public | :: | nSkip_dw | ||||
| integer, | public | :: | lastoutputIter | ||||
| integer, | public | :: | logiter_ramp | ||||
| integer, | public | :: | logscreen | ||||
| real(kind=wp), | public | :: | dt | ||||
| real(kind=wp), | public | :: | deltaW | ||||
| real(kind=wp), | public | :: | dW_allowed | ||||
| real(kind=wp), | public | :: | t_pseudo | ||||
| real(kind=wp), | public | :: | Fnorm(3) | ||||
| real(kind=wp), | public | :: | Fnorm0(3) | ||||
| real(kind=wp), | public | :: | Fnorm_old(3) | ||||
| real(kind=wp), | public | :: | W_MHD3D_0 | ||||
| real(kind=wp), | public | :: | min_dt_out | ||||
| real(kind=wp), | public | :: | max_dt_out | ||||
| real(kind=wp), | public | :: | min_dw_out | ||||
| real(kind=wp), | public | :: | max_dw_out | ||||
| real(kind=wp), | public | :: | sum_dW_out | ||||
| logical, | public | :: | DoCheckDistance | ||||
| logical, | public | :: | DoCheckAxis | ||||
| integer, | public | :: | outputIter | ||||
| integer, | public | :: | nlogScreen | ||||
| integer, | public | :: | logIter | ||||
| integer, | public | :: | logUnit | ||||
| integer, | public | :: | StartTimeArray(8) | ||||
| type(t_sol_var_MHD3D), | public, | ALLOCATABLE | :: | dofs(:) |
degrees of freedom at levels (k-1),(k),(k+1) |
||
| type(t_sol_var_MHD3D), | public, | ALLOCATABLE | :: | force(:) |
force |
||
| type(t_sol_var_MHD3D), | public, | ALLOCATABLE | :: | temp_dofs(:) |
temporary for update |
State variables for an Accelerated Gradient-Descent descent minimizer
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=40), | public | :: | MinimizerType |
defines the minimization algorithm: 0 = Gradient-Descent, 10 = Accelerated Gradient-Descent |
|||
| logical, | public | :: | restart_iter | ||||
| logical, | public | :: | logger_is_initialized | ||||
| integer, | public | :: | JacCheck |
switch for restarts, if detJ<0 JacCheck<=-1 |
|||
| integer, | public | :: | iter | ||||
| integer, | public | :: | nStepDecreased | ||||
| integer, | public | :: | nSkip_Jac | ||||
| integer, | public | :: | nSkip_dw | ||||
| integer, | public | :: | lastoutputIter | ||||
| integer, | public | :: | logiter_ramp | ||||
| integer, | public | :: | logscreen | ||||
| real(kind=wp), | public | :: | dt | ||||
| real(kind=wp), | public | :: | deltaW | ||||
| real(kind=wp), | public | :: | dW_allowed | ||||
| real(kind=wp), | public | :: | t_pseudo | ||||
| real(kind=wp), | public | :: | Fnorm(3) | ||||
| real(kind=wp), | public | :: | Fnorm0(3) | ||||
| real(kind=wp), | public | :: | Fnorm_old(3) | ||||
| real(kind=wp), | public | :: | W_MHD3D_0 | ||||
| real(kind=wp), | public | :: | min_dt_out | ||||
| real(kind=wp), | public | :: | max_dt_out | ||||
| real(kind=wp), | public | :: | min_dw_out | ||||
| real(kind=wp), | public | :: | max_dw_out | ||||
| real(kind=wp), | public | :: | sum_dW_out | ||||
| logical, | public | :: | DoCheckDistance | ||||
| logical, | public | :: | DoCheckAxis | ||||
| integer, | public | :: | outputIter | ||||
| integer, | public | :: | nlogScreen | ||||
| integer, | public | :: | logIter | ||||
| integer, | public | :: | logUnit | ||||
| integer, | public | :: | StartTimeArray(8) | ||||
| type(t_sol_var_MHD3D), | public, | ALLOCATABLE | :: | dofs(:) |
degrees of freedom at levels (k-1),(k),(k+1) |
||
| type(t_sol_var_MHD3D), | public, | ALLOCATABLE | :: | force(:) |
force |
||
| type(t_sol_var_MHD3D), | public, | ALLOCATABLE | :: | temp_dofs(:) |
temporary for update |
||
| real(kind=wp), | public | :: | Vnorm(3) | ||||
| real(kind=wp), | public, | ALLOCATABLE | :: | tau(:) | |||
| integer, | public | :: | ndamp | ||||
| real(kind=wp), | public | :: | tau_bar | ||||
| type(t_sol_var_MHD3D), | public, | ALLOCATABLE | :: | velocity(:) |
'velocity' in minimizer |
Minimizer object
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| logical, | public | :: | initialized |
whether the object is initialized or ot |
|||
| integer, | public | :: | MinType |
gradient descent = 0, accelerated gradient descent = 10 |
|||
| class(a_minimizer_vars), | public, | ALLOCATABLE | :: | vars |
! depend on the MinimizerType |
| procedure, public :: minimize => MinimizeMHD3D_descent | |
| procedure, public :: reset => MinimizeMHD3d_ResetDescent | |
| procedure, public :: StartLogging => StartLogging_MHD3D | |
| procedure, public :: Logging => Logging_MHD3D | |
| procedure, public :: free => Free_minimizer |
Initialization method for a minimizer
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(t_minimizer_mhd3d), | intent(inout), | ALLOCATABLE | :: | sf |
allocatable minimizer object |
|
| integer, | intent(in) | :: | varsize_in(:) |
size of the dofs |
||
| real(kind=wp), | intent(in) | :: | dt_initial |
initial stepsize for the minimization |
||
| integer, | intent(in) | :: | MinType_in |
gradient descent = 0, accelerated gradient descent = 10 |
||
| real(kind=wp), | intent(in) | :: | dW_allowed_in |
for minimizer, accept step if dW |
||
| logical, | intent(in) | :: | DoCheckDistance |
TRUE: check distance between solutions of two log output states |
||
| logical, | intent(in) | :: | DoCheckAxis |
TRUE: check axis position |
||
| integer, | intent(in) | :: | outputIter |
number of iterations after which output files are written |
||
| integer, | intent(in) | :: | nlogScreen |
number of log outputs after a screen output is written |
||
| integer, | intent(in) | :: | logIter |
number of iterations after which a screen log is written |
Reset the minimizer state
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_minimizer_mhd3d), | intent(inout) | :: | sf |
minimizer |
Initialization of the Logging
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_minimizer_mhd3d), | intent(inout) | :: | sf |
minimizer |
Log the current minimizer and functional state
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_minimizer_mhd3d), | intent(inout) | :: | sf | |||
| logical, | intent(in) | :: | quiet |
Core minimization routine
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_minimizer_mhd3d), | intent(inout) | :: | sf |
minimizer |
||
| real(kind=wp), | intent(in) | :: | abstol |
tolerance on the forces. If reached terminaters the minimization |
||
| integer, | intent(in) | :: | maxIter_in |
maximum number of iterations after which the iterations are terminated |
Finalization method for a minimizer
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_minimizer_mhd3d), | intent(inout) | :: | sf |
minimizer |