Neko-TOP
A portable framework for high-order spectral element flow toplogy optimization.
Loading...
Searching...
No Matches
objective_factory.f90
1
34
36submodule(objective) objective_factory_mod
37 use json_utils, only: json_get
38 use utils, only: neko_type_error
39
40 ! Import the objective function types
44
45 implicit none
46
48 character(len=25), parameter :: KNOWN_TYPES(3) = [ character(len=25) :: &
49 "minimum_dissipation", &
50 "scalar_mixing", &
51 "lube_term"]
52
53contains
54
55 ! -------------------------------------------------------------------------- !
56 ! Factory function
57
59 module subroutine objective_factory(object, json, design, simulation)
60 class(objective_t), allocatable, intent(inout) :: object
61 type(json_file), intent(inout) :: json
62 class(design_t), intent(in) :: design
63 type(simulation_t), target, optional, intent(inout) :: simulation
64 character(len=:), allocatable :: type
65
66 if (allocated(object)) then
67 call object%free()
68 deallocate(object)
69 end if
70
71 call json_get(json, "type", type)
72 select case (trim(type))
73 case ("minimum_dissipation")
74 allocate(minimum_dissipation_objective_t::object)
75 case ("scalar_mixing")
76 allocate(scalar_mixing_objective_t::object)
77 case ("lube_term")
78 allocate(lube_term_objective_t::object)
79
80 case default
81 call neko_type_error("Objective", type, KNOWN_TYPES)
82 end select
83
84 call object%init(json, design, simulation)
85 end subroutine objective_factory
86
87end submodule objective_factory_mod
Implements the design_t.
Definition design.f90:36
Implements the lube_term_objective_t type.
Implements the minimum_dissipation_objective_t type.
Implements the objective_t type.
Definition objective.f90:36
An objective function corresponding to the mixing of a passive scalar .
An objective function corresponding to out of plane stresses .
An objective function corresponding to minimum dissipation .
An objective function corresponding to the mixing of a passive scalar .