Endchecker
Module providing utilities for choosing and initializing end checkers for simulations.
ElasticEnergyDropEndChecker
Class for checking if the end of the simulation is reached based on elastic energy drop. With this end checker, the end of the simulation is reached when elastic energy reaches drop % of its maximum value.
Attributes:
| Name | Type | Description |
|---|---|---|
postprocessor |
PostProcessor
|
Post-processor for analyzing simulation results. |
maximum_elastic_energy |
float
|
Maximum elastic energy encountered during the simulation. |
drop |
float
|
Drop coefficient. |
Source code in src/fragma/endchecker.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |
__init__(postprocessor, drop)
Initialize the ElasticEnergyEndChecker.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
postprocessor
|
PostProcessor
|
Post-processor for analyzing simulation results. |
required |
drop
|
float
|
Drop coefficient. |
required |
Source code in src/fragma/endchecker.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
end()
Check if the end time of the simulation is reached based on elastic energy drop.
Returns:
| Type | Description |
|---|---|
bool
|
True if the end time of the simulation is reached, False otherwise. |
Source code in src/fragma/endchecker.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |
TimeEndChecker
Class for checking if the end of the simulation is reached based on time. With this end checker, the end of the simulation is reached when the time reaches 1.
Attributes:
| Name | Type | Description |
|---|---|---|
stepper |
ProportionalTimeStepper
|
Time stepper for time integration during simulation. |
t_max |
int
|
Final time step. |
Source code in src/fragma/endchecker.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
__init__(time_stepper, t_max)
Initialize the EndChecker.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time_stepper
|
ProportionalTimeStepper
|
Time stepper for time integration during simulation. |
required |
t_max
|
int
|
Final time step. |
required |
Source code in src/fragma/endchecker.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
end()
Check if the end time of the simulation is reached.
Returns:
| Type | Description |
|---|---|
bool
|
True if the end time of the simulation is reached, False otherwise. |
Source code in src/fragma/endchecker.py
71 72 73 74 75 76 77 78 79 80 | |
choose_end_checker(end_pars, time_stepper, postprocessor)
Choose and initialize the end checker.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
end_pars
|
dict
|
Parameters used to determine the end of the simulation. |
required |
time_stepper
|
ProportionalTimeStepper
|
Time stepper for time integration during simulation. |
required |
postprocessor
|
PostProcessor
|
Post-processor for analyzing simulation results. |
required |
Returns:
| Type | Description |
|---|---|
EndChecker
|
The initialized end checker. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If the specified end criterion does not exist. |
Source code in src/fragma/endchecker.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |