|
Neko-TOP
A portable framework for high-order spectral element flow toplogy optimization.
|
Abstract optimizer class. More...

Public Member Functions | |
| 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, iter, design, overwrite, path, basename, extension) |
| Save a checkpoint of the optimizer state. | |
| procedure, pass(this) | load_checkpoint (this, filename, iter, design) |
| 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, checkpoint_file, checkpoint_path, checkpoint_base, checkpoint_format, checkpoint_interval) |
| 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) | print_status (this, stop_flag, iter) |
| Print status message. | |
| procedure, pass(this) | out_of_time (this, step_time) |
| Estimate if we are out of time. | |
Definition at line 56 of file optimizer.f90.
|
pure virtual |
Definition at line 92 of file optimizer.f90.
| this | The optimizer object. |
Definition at line 127 of file optimizer.f90.
| procedure, pass(this) optimizer::optimizer_t::init_base | ( | class(optimizer_t), intent(inout) | this, |
| character(len=*), intent(in) | optimizer_type, | ||
| integer, intent(in) | max_iterations, | ||
| real(kind=rp), intent(in), optional | max_runtime, | ||
| character(len=*), intent(in), optional | checkpoint_file, | ||
| character(len=*), intent(in), optional | checkpoint_path, | ||
| character(len=*), intent(in), optional | checkpoint_base, | ||
| character(len=*), intent(in), optional | checkpoint_format, | ||
| integer, intent(in), optional | checkpoint_interval | ||
| ) |
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. |
| checkpoint_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. |
Definition at line 125 of file optimizer.f90.
|
pure virtual |
Definition at line 89 of file optimizer.f90.
|
pure virtual |
Definition at line 95 of file optimizer.f90.
| procedure, pass(this) optimizer::optimizer_t::load_checkpoint | ( | class(optimizer_t), intent(inout) | this, |
| character(len=*), intent(in) | filename, | ||
| integer, intent(out) | iter, | ||
| class(design_t), intent(inout) | design | ||
| ) |
| this | The optimizer object. |
| filename | The name of the file to load the checkpoint from. |
| iter | The iteration number read from the checkpoint. |
| design | The design object. |
Definition at line 113 of file optimizer.f90.
|
pure virtual |
Definition at line 107 of file optimizer.f90.
| procedure, pass(this) optimizer::optimizer_t::out_of_time | ( | class(optimizer_t), intent(inout) | this, |
| real(kind=rp), intent(in) | step_time | ||
| ) |
| this | The optimizer object. |
| step_time | The time taken for the latest iteration. |
Definition at line 133 of file optimizer.f90.
| procedure, pass(this) optimizer::optimizer_t::print_status | ( | class(optimizer_t), intent(in) | this, |
| integer, intent(in) | stop_flag, | ||
| integer, intent(in) | iter | ||
| ) |
| this | The optimizer object. |
| stop_flag | The stopping flag. |
| iter | The number of iterations performed. |
Definition at line 131 of file optimizer.f90.
| procedure, pass(this) optimizer::optimizer_t::read_base_settings | ( | class(optimizer_t), intent(inout) | this, |
| type(json_file), intent(inout) | solver_params | ||
| ) |
| this | The optimizer object. |
| solver_params | The JSON file containing the optimizer parameters. |
Definition at line 129 of file optimizer.f90.
| procedure, pass, public optimizer::optimizer_t::run | ( | class(optimizer_t), intent(inout) | this, |
| class(problem_t), intent(inout) | problem, | ||
| class(design_t), intent(inout) | design, | ||
| type(simulation_t), intent(inout), optional | simulation | ||
| ) |
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.
| this | The optimizer object. |
| problem | The problem object. |
| design | The design object. |
| simulation | The simulation object. |
Definition at line 119 of file optimizer.f90.
| procedure, pass(this) optimizer::optimizer_t::save_checkpoint | ( | class(optimizer_t), intent(inout) | this, |
| integer, intent(in) | iter, | ||
| class(design_t), intent(inout) | design, | ||
| logical, intent(in) | overwrite, | ||
| character(len=*), intent(in), optional | path, | ||
| character(len=*), intent(in), optional | basename, | ||
| character(len=*), intent(in), optional | extension | ||
| ) |
| this | The optimizer object. |
| iter | The current iteration number. |
| design | The design object. |
| overwrite | Whether to overwrite the file if it exists. |
| path | The path where the checkpoint file will be saved. |
| basename | The base name of the file to save the checkpoint. |
| extension | The file extension to use for the checkpoint file. |
Definition at line 111 of file optimizer.f90.
|
pure virtual |
Definition at line 104 of file optimizer.f90.
|
pure virtual |
Definition at line 97 of file optimizer.f90.
|
pure virtual |
Definition at line 99 of file optimizer.f90.
|
pure virtual |
Definition at line 102 of file optimizer.f90.