Neko-TOP
A portable framework for high-order spectral element flow toplogy optimization.
Loading...
Searching...
No Matches
driver.f90
Go to the documentation of this file.
1program usrneko
2 use simulation, only: simulation_t
4 use problem, only: problem_t
5 use optimizer, only : optimizer_t, optimizer_factory
6
7 use json_module, only: json_file
8 use utils, only: neko_error
10
11 use mpi_f08, only: mpi_init
12
13 implicit none
14
15 ! JSON related arguments
16 integer :: argc
17 type(json_file) :: parameters
18 character(len=256) :: parameter_file
19
20 ! MPI parameters
21 integer :: ierr
22
26 type(problem_t) :: problem
30 class(optimizer_t), allocatable :: optimizer
31
32 ! -------------------------------------------------------------------------- !
33 ! Initialize the MPI environment
34 call mpi_init(ierr)
35
36 ! -------------------------------------------------------------------------- !
37 ! Read the parameters file as the first terminal argument
38
39 argc = command_argument_count()
40 if (argc .lt. 1) call neko_error('Missing parameter file')
41 call get_command_argument(1, parameter_file)
42
43 ! Read the parameters file
44 parameters = json_read_file(trim(parameter_file))
45
46 ! -------------------------------------------------------------------------- !
47 ! Initialization of the components
48
49 call simulation%init(parameters)
50
51 call design%init(parameters, simulation)
52
53
54 call problem%init(parameters, design, simulation)
55 call optimizer_factory(optimizer, parameters, problem, design, simulation)
56
57 ! -------------------------------------------------------------------------- !
58 ! Execute the optimization
59
61
62 ! -------------------------------------------------------------------------- !
63 ! Clean up the components
64
65 call optimizer%free()
66 if (allocated(optimizer)) deallocate(optimizer)
67
68 call problem%free()
69 call design%free()
70 call simulation%free()
71
72end program usrneko
program usrneko
Definition driver.f90:1
Implements the design_t.
Definition design.f90:34
type(json_file) function, public json_read_file(filename)
Read a json file taking mpi into account. This function reads a json file and broadcasts it to all ra...
Module for handling the optimization problem.
Definition problem.f90:35
Implements the steady_problem_t type.
A topology optimization design variable.
Abstract optimizer class.
Definition optimizer.f90:18
The abstract problem type.
Definition problem.f90:61