|
Neko-TOP
A portable framework for high-order spectral element flow toplogy optimization.
|
Steepest descent optimizer with move limits. More...


Public Member Functions | |
| procedure, pass(this) | init_from_json (this, parameters, problem, design, simulation) |
| Initialise the steepest descent optimizer from the case file. | |
| procedure, pass(this) | free (this) |
| Free the steepest descent optimizer. | |
| procedure, pass(this) | initialize (this, problem, design, simulation) |
| Evaluate the problem and its sensitivity at the starting design. | |
| procedure, pass(this) | step (this, iter, problem, design, simulation) |
| Take one steepest descent step and re-evaluate the problem. | |
| procedure, pass(this) | validate (this, problem, design) |
| Validate the final design. | |
| procedure, pass(this) | write (this, iter, problem) |
| Write the progress of the optimizer to the log file. | |
| procedure, pass(this) | save_checkpoint_components (this, filename, overwrite) |
| Save the steepest descent state to a checkpoint. | |
| procedure, pass(this) | load_checkpoint_components (this, filename) |
| Restore the steepest descent state from a checkpoint. | |
| procedure(optimizer_init_from_json), deferred, pass, public | init_from_json (this, parameters, problem, design, simulation) |
| Initialize the optimizer, associate it with a specific problem. | |
| procedure(optimizer_free), deferred, pass, public | free (this) |
| Free resources. | |
| procedure(optimizer_initialize), deferred, pass, public | initialize (this, problem, design, simulation) |
| Prepare the optimizer before starting the optimization loop. | |
| procedure(optimizer_step), deferred, pass, public | step (this, iter, problem, design, simulation) |
| Perform a single optimization step. | |
| procedure(optimizer_validate), deferred, pass, public | validate (this, problem, design) |
| Validate the solution. | |
| procedure(optimizer_write), deferred, pass, public | write (this, iter, problem) |
| Write the progress of the optimizer to the log file. | |
| procedure(optimizer_save_checkpoint_components), deferred, pass | save_checkpoint_components (this, filename, overwrite) |
| Save optimizer-specific components to checkpoint. | |
| procedure(optimizer_load_checkpoint_components), deferred, pass | load_checkpoint_components (this, filename) |
| Load optimizer-specific components from checkpoint. | |
| procedure, pass(this) | save_checkpoint (this, design, overwrite, filename, path, basename, format, iteration) |
| Save a checkpoint of the optimizer state. | |
| procedure, pass(this) | load_checkpoint (this, design, filename, path, basename, format, iteration) |
| Restore the optimizer state from a checkpoint. | |
| procedure, pass, public | run (this, problem, design, simulation) |
| Run the optimization loop. | |
| procedure, pass(this) | init_base (this, optimizer_type, max_iterations, max_runtime, stop_design_change, restart_file, checkpoint_path, checkpoint_base, checkpoint_format, checkpoint_interval, checkpoint_overwrite) |
| The base initializer. | |
| procedure, pass(this) | free_base (this) |
| Free base resources. | |
| procedure, pass(this) | read_base_settings (this, solver_params) |
| Read settings from JSON parameters file. | |
| procedure, pass(this) | get_iteration (this) |
| Return the current iteration number. | |
| procedure, pass(this) | print_status (this, stop_flag, iteration) |
| Print status message. | |
| procedure, pass(this) | out_of_time (this, step_time) |
| Estimate if we are out of time. | |
| procedure, pass(this) | init_log (this, problem, extra_headers, include_constraints, filename) |
| Initialize optimization log. | |
| procedure, pass(this) | write_log (this, iter, problem, extra_values) |
| Write optimization log entry. | |
Public Attributes | |
| real(kind=rp), public | max_design_change = 0.0_rp |
| The maximum observed design change. | |
| real(kind=rp), public | norm2_design_change = 0.0_rp |
| The L2 norm of the design change. | |
Definition at line 83 of file steepest_descent_optimizer.f90.
|
pure virtualinherited |
Definition at line 117 of file optimizer.f90.
| procedure, pass(this) steepest_descent_optimizer::steepest_descent_optimizer_t::free | ( | class(steepest_descent_optimizer_t), intent(inout) | this | ) |
| this | The steepest descent optimizer. |
Definition at line 118 of file steepest_descent_optimizer.f90.
|
inherited |
| this | The optimizer object. |
Definition at line 152 of file optimizer.f90.
|
inherited |
| this | The optimizer object. |
Definition at line 156 of file optimizer.f90.
|
inherited |
Interface for reading a checkpoint Base initializer for the optimizer
| this | The optimizer object. |
| optimizer_type | The type of the optimizer. |
| max_iterations | The maximum number of iterations. |
| max_runtime | The maximum runtime in seconds. |
| stop_design_change | The stopping criteria for design change. |
| restart_file | The checkpoint file to restart from. |
| checkpoint_path | The path for saving checkpoint files. |
| checkpoint_base | The base name for checkpoint files. |
| checkpoint_format | The file format for checkpoint files. |
| checkpoint_interval | The interval for saving checkpoints in iterations. |
| checkpoint_overwrite | Whether to overwrite existing checkpoint files. |
Definition at line 150 of file optimizer.f90.
|
pure virtualinherited |
Definition at line 114 of file optimizer.f90.
| procedure, pass(this) steepest_descent_optimizer::steepest_descent_optimizer_t::init_from_json | ( | class(steepest_descent_optimizer_t), intent(inout) | this, |
| type(json_file), intent(inout) | parameters, | ||
| class(problem_t), intent(inout) | problem, | ||
| class(design_t), intent(in) | design, | ||
| type(simulation_t), intent(in), optional | simulation | ||
| ) |
Reads optimization.solver and its steepest_descent object. The base settings are read after free, which resets them, and before init_base, which keeps them.
| this | The steepest descent optimizer. |
| parameters | The JSON case file. |
| problem | The problem to optimise, which must have no constraints. |
| design | The design whose values start the optimisation. |
| simulation | The simulation, unused. |
Definition at line 117 of file steepest_descent_optimizer.f90.
|
inherited |
| [in,out] | this | The optimizer object. |
| [in] | problem | The problem object. |
| [in] | extra_headers | Header labels for extra log entries. |
| [in] | include_constraints | Include constraints in the log. |
| [in] | filename | Output filename for the log. |
Definition at line 162 of file optimizer.f90.
|
pure virtualinherited |
Definition at line 120 of file optimizer.f90.
| procedure, pass(this) steepest_descent_optimizer::steepest_descent_optimizer_t::initialize | ( | class(steepest_descent_optimizer_t), intent(inout) | this, |
| class(problem_t), intent(inout) | problem, | ||
| class(design_t), intent(inout) | design, | ||
| type(simulation_t), intent(inout), optional | simulation | ||
| ) |
| this | The steepest descent optimizer. |
| problem | The problem to optimise. |
| design | The design. |
| simulation | The simulation, if any. |
Definition at line 119 of file steepest_descent_optimizer.f90.
|
inherited |
| this | The optimizer object. |
| filename | The name of the file to load the checkpoint from. |
| design | The design object. |
| path | The path where the checkpoint file is located. |
| basename | The base name of the file to load the checkpoint from. |
| format | The file format to use for the checkpoint file. |
| iteration | The iteration to load. |
Definition at line 138 of file optimizer.f90.
|
pure virtualinherited |
Definition at line 132 of file optimizer.f90.
| procedure, pass(this) steepest_descent_optimizer::steepest_descent_optimizer_t::load_checkpoint_components | ( | class(steepest_descent_optimizer_t), intent(inout) | this, |
| character(len=*), intent(in) | filename | ||
| ) |
| this | The steepest descent optimizer. |
| filename | The checkpoint file. |
Definition at line 126 of file steepest_descent_optimizer.f90.
|
inherited |
| this | The optimizer object. |
| step_time | The time taken for the latest iteration. |
Definition at line 160 of file optimizer.f90.
|
inherited |
| this | The optimizer object. |
| stop_flag | The stopping flag. |
| iteration | The number of iterations performed. |
Definition at line 158 of file optimizer.f90.
|
inherited |
| this | The optimizer object. |
| solver_params | The JSON file containing the optimizer parameters. |
Definition at line 154 of file optimizer.f90.
|
inherited |
The optimization loop can be terminated based on a maximum runtime. In this case, a cumulative average is used to determine if the next iteration would exceed the maximum runtime.
When restarting from a checkpoint, the continuation parameters are set to their values at the checkpointed iteration before the problem is re-evaluated.
| this | The optimizer object. |
| problem | The problem object. |
| design | The design object. |
| simulation | The simulation object. |
Definition at line 144 of file optimizer.f90.
|
inherited |
| this | The optimizer object. |
| design | The design object. |
| overwrite | Whether to overwrite the file if it exists. |
| filename | The name of the file to save the checkpoint to. |
| path | The path where the checkpoint file will be saved. |
| basename | The base name of the file to save the checkpoint. |
| format | The file format to use for the checkpoint file. |
| iteration | The iteration used to construct the checkpoint filename. |
Definition at line 136 of file optimizer.f90.
|
pure virtualinherited |
Definition at line 129 of file optimizer.f90.
| procedure, pass(this) steepest_descent_optimizer::steepest_descent_optimizer_t::save_checkpoint_components | ( | class(steepest_descent_optimizer_t), intent(inout) | this, |
| character(len=*), intent(in) | filename, | ||
| logical, intent(in), optional | overwrite | ||
| ) |
| this | The steepest descent optimizer. |
| filename | The checkpoint file. |
| overwrite | Replace an existing steepest descent group. |
Definition at line 124 of file steepest_descent_optimizer.f90.
|
pure virtualinherited |
Definition at line 122 of file optimizer.f90.
| procedure, pass(this) steepest_descent_optimizer::steepest_descent_optimizer_t::step | ( | class(steepest_descent_optimizer_t), intent(inout) | this, |
| integer, intent(in) | iter, | ||
| class(problem_t), intent(inout) | problem, | ||
| class(design_t), intent(inout) | design, | ||
| type(simulation_t), intent(inout), optional | simulation | ||
| ) |
The sensitivity of the current design must be up to date on entry; it is on exit, for the updated design.
| this | The steepest descent optimizer. |
| iter | The current iteration, starting from 1. |
| problem | The problem to optimise. |
| design | The design, updated in place. |
| simulation | The simulation, if any. |
.true. only when the bound-projected gradient vanishes. Definition at line 120 of file steepest_descent_optimizer.f90.
|
pure virtualinherited |
Definition at line 124 of file optimizer.f90.
| procedure, pass(this) steepest_descent_optimizer::steepest_descent_optimizer_t::validate | ( | class(steepest_descent_optimizer_t), intent(inout) | this, |
| class(problem_t), intent(in) | problem, | ||
| class(design_t), intent(in) | design | ||
| ) |
Nothing to check: the update keeps the design within its box bounds by construction, and problems with constraints are rejected at initialisation.
| this | The steepest descent optimizer. |
| problem | The problem. |
| design | The design. |
Definition at line 121 of file steepest_descent_optimizer.f90.
|
pure virtualinherited |
Definition at line 127 of file optimizer.f90.
| procedure, pass(this) steepest_descent_optimizer::steepest_descent_optimizer_t::write | ( | class(steepest_descent_optimizer_t), intent(inout) | this, |
| integer, intent(in) | iter, | ||
| class(problem_t), intent(inout) | problem | ||
| ) |
| this | The steepest descent optimizer. |
| iter | The current iteration. |
| problem | The problem. |
Definition at line 122 of file steepest_descent_optimizer.f90.
|
inherited |
| [in,out] | this | The optimizer object. |
| [in] | iter | Current iteration number. |
| [in] | problem | The problem object. |
| [in] | extra_values | Extra log values appended after problem entries. |
Definition at line 164 of file optimizer.f90.
Definition at line 75 of file optimizer.f90.
Definition at line 77 of file optimizer.f90.