This module provides the definition of various abort criteria upon which a simulation should be stopped. Note that solvers may extend this table and have their own set of addititonal abort parameters to be set in this table.
There are two primary options that may be set:
stop_file
this denotes a file that will be checked for existence in the
current working directory. If it exists the simulation will be stopped (if
restarts are active, a restart will be written).
If the file is empty the file will be deleted upon completion of the
application. Otherwise, if the file is not empty it will be kept around.steady_state
this is a boolean to indicate whether the simulation is to
halt when a steady state is reached. If this is true a convergence table,
where the condition for a steady state may be defined, is read. See
tem_convergence_module for details.If the abort criteria table is not provided, the defaults for both settings will be used, which is equivalent to the following definition:
abort_criteria = {stop_file = '', steady_state = false}
That is, no stop files to look for, and no check whether a steady state is reached.
A more complete example with a check for steady state and a convergence table (more details in tem_convergence_module could look like this:
abort_criteria = {
stop_file = 'stop',
steady_state = true,
convergence = {
variable = {'pressure', 'velocity'},
shape = {kind = 'all'},
time_control = {
min = {iter = 0},
max = {iter = tmax},
interval = {iter = 10}
},
reduction = { 'average', 'average' },
norm = 'average',
nvals = 100,
absolute = true,
condition = {
{ threshold = 1.e-15, operator = '<=' },
{ threshold = 1.e-12, operator = '<=' }
}
}
}
This results in the application to look for a file named stop
in the
working directory and will abort the run if it is found to exist.
The application will check for a steady state, where a steady state is
assumed when the average of pressure and velocity across the complete
domain does not deviate by more of 1.e-15 for pressure and not more than
1.e-12 for the velocity.
Loading additional parameters for solver specific abort criteria from the configuration file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tem_solverAborts_type), | intent(inout) | :: | me |
The solver specific type to hold additional abort parameters. |
||
type(flu_State), | intent(in) | :: | conf |
Handle to Lua configuration file to load parameters from. |
||
integer, | intent(in) | :: | abort_table |
Handle to the abort criteria table to read from. |
Abstract type to describe solver specific abort criteria.
procedure(load_aborts), public, deferred :: load |
Definition of the various abort criteria.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=labelLen), | public | :: | stop_file |
A file which should cause the simulation to stop. Default: ''. |
|||
logical, | public | :: | steady_state |
Should the simulation be checked for a steady state convergence and stop if it is detected? Default: .false. |
|||
type(tem_convergence_type), | public, | allocatable | :: | convergence(:) |
Convergence conditions for steady state check. Filled only when steady_state is True |
Define new abortCriteria.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in), | optional | :: | stop_file |
Name of the stop file to react on. Default=''. |
|
logical, | intent(in), | optional | :: | steady_state |
Flag to indicate if the simulation should stop upon reaching a steady state. What a steady state exactly is has to be defined in the solver. Default: .false. |
A new variable of abortCriteria filled with the values provided as arguments.
Check if the stop file exists.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_abortCriteria_type), | intent(in) | :: | abortCriteria |
Abort criteria settings to use in this check for a stop file. |
||
integer, | intent(in) | :: | rank |
Rank of the probing process, only rank==0 actually checks for the file. |
Result that indicates, if the stop files exists.
Load the abortCriteria from a given configuration.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_abortCriteria_type), | intent(out) | :: | me |
Abort criteria to load from the Lua table. |
||
type(flu_State) | :: | conf |
Handle for the Lua script. |
|||
integer, | intent(in), | optional | :: | parent |
Parent table to read from. |
|
character(len=*), | intent(in), | optional | :: | key |
Name of the time control table. Default: 'time_control' |
|
class(tem_solverAborts_type), | intent(inout), | optional | :: | solverAborts |
Solver specific abort criteria to load. |
Saves the abortCriteria to a given configuration.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_abortCriteria_type), | intent(in) | :: | me |
The abortCriteria to write out as a Lua table. |
||
type(aot_out_type), | intent(inout) | :: | conf |
Handle for the Lua script to write to. |
||
character(len=*), | optional | :: | key |
A name for the table to write the abortCriteria to. Default: 'abort_criteria'. |
Dump abort criteria information to the specified outUnit.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_abortCriteria_type), | intent(in) | :: | me |
Abort criteria settings to write on outUnit. |
||
integer, | intent(in) | :: | outUnit |
File unit to write the settings to. |