39 use num_types,
only: rp
40 use point_zone_registry,
only: neko_point_zone_registry
41 use json_module,
only: json_file
52 real(kind=rp) :: weight = 1.0_rp
76 class(objective_t),
allocatable,
intent(inout) :: object
77 type(json_file),
intent(inout) :: json
80 end subroutine objective_factory
92 subroutine objective_init_base(this, name, design_size, weight, mask_name)
93 class(objective_t),
intent(inout) :: this
94 character(len=*),
intent(in) :: name
95 integer,
intent(in) :: design_size
96 real(kind=rp),
intent(in) :: weight
97 character(len=*),
intent(in),
optional :: mask_name
101 call this%sensitivity%init(design_size)
105 this%has_mask = .false.
106 if (trim(mask_name) .ne.
"")
then
107 this%has_mask = .true.
108 this%mask => neko_point_zone_registry%get_point_zone(mask_name)
111 end subroutine objective_init_base
114 subroutine objective_free_base(this)
115 class(objective_t),
target,
intent(inout) :: this
118 call this%sensitivity%free()
120 this%has_mask = .false.
121 if (
associated(this%mask))
nullify(this%mask)
123 end subroutine objective_free_base
129 subroutine objective_wrapper_free(this)
130 class(objective_wrapper_t),
intent(inout) :: this
131 if (
allocated(this%objective))
then
132 call this%objective%free()
133 deallocate(this%objective)
135 end subroutine objective_wrapper_free
Defines the abstract the base_functional_t type.
Implements the objective_t type.
subroutine objective_wrapper_free(this)
Free the objective wrapper.
subroutine objective_free_base(this)
Free the base class.
subroutine objective_init_base(this, name, design_size, weight, mask_name)
Factory function interface.
Implements the steady_problem_t type.
The base functional type.
The abstract objective type.
Wrapper for objectives for use in lists.