36 use neko,
only: neko_init, neko_finalize
42 use json_module,
only: json_file
43 use json_utils,
only: json_get
44 use utils,
only: neko_error
45 use json_utils_ext,
only: json_read_file
47 use user,
only: user_setup
54 character(len=256) :: parameter_file
55 type(json_file) :: parameters, design_parameters
58 type(simulation_t) :: sim
60 class(design_t),
allocatable :: des
62 type(problem_t) :: prob
64 class(optimizer_t),
allocatable :: opt
75 argc = command_argument_count()
76 if (argc .lt. 1)
call neko_error(
'Missing parameter file')
77 call get_command_argument(1, parameter_file)
80 parameters = json_read_file(trim(parameter_file))
81 call json_get(parameters,
'optimization.design', design_parameters)
87 call nekotop_continuation%init(parameters)
90 call user_setup(sim%neko_case%user)
93 call sim%init(parameters)
99 call prob%init(parameters, des, sim)
107 call opt%run(prob, des, sim)
116 call nekotop_continuation%free()
118 if (
allocated(des))
deallocate(des)
119 if (
allocated(opt))
deallocate(opt)
124end program topopt_user
Factory function for the design object.
Factory function for the optimizer.
Continuation scheduler for the optimization loop.
subroutine neko_top_register_types()
Add all known types to the Neko registries.
Defines the abstract type optimizer.
Module for handling the optimization problem.
Implements the steady_problem_t type.
Abstract optimizer class.
The abstract problem type.