41 use json_module,
only: json_file
42 use json_utils,
only: json_get
43 use utils,
only: neko_error
44 use json_utils_ext,
only: json_read_file
45 use neko_top,
only: neko_top_register_types
46 use user,
only: user_setup
48 use mpi_f08,
only: mpi_init
54 character(len=256) :: parameter_file
55 type(json_file) :: parameters, design_parameters
61 type(simulation_t) :: sim
63 class(design_t),
allocatable :: des
65 type(problem_t) :: prob
67 class(optimizer_t),
allocatable :: opt
73 call neko_top_register_types()
78 argc = command_argument_count()
79 if (argc .lt. 1)
call neko_error(
'Missing parameter file')
80 call get_command_argument(1, parameter_file)
83 parameters = json_read_file(trim(parameter_file))
84 call json_get(parameters,
'optimization.design', design_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)
117 if (
allocated(des))
deallocate(des)
118 if (
allocated(opt))
deallocate(opt)
120end 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.