5 use json_module,
only: json_file
6 use json_utils,
only: json_extract_object
7 use json_utils_ext,
only: json_read_file
8 use utils,
only: neko_error
9 use user,
only: user_setup
11 use neko_top,
only: neko_top_register_types
13 use mpi_f08,
only: mpi_init
19 character(len=256) :: parameter_file
20 type(json_file) :: parameters, design_parameters
26 type(simulation_t) :: sim
28 type(problem_t) :: prob
30 class(design_t),
allocatable :: des
32 class(optimizer_t),
allocatable :: opt
37 call neko_top_register_types()
42 argc = command_argument_count()
43 if (argc .lt. 1)
call neko_error(
'Missing parameter file')
44 call get_command_argument(1, parameter_file)
47 parameters = json_read_file(trim(parameter_file))
48 call json_extract_object(parameters,
'optimization.design', design_parameters)
54 call user_setup(sim%neko_case%user)
57 call sim%init(parameters)
63 call prob%init(parameters, des, sim)
71 call opt%run(prob, des, sim)
77 if (
allocated(opt))
deallocate(opt)
83end program topopt_user
Factory function for the design object.
Factory function for the optimizer.
Module for handling the optimization problem.
Implements the steady_problem_t type.
Abstract optimizer class.
The abstract problem type.