Neko-TOP
A portable framework for high-order spectral element flow toplogy optimization.
Loading...
Searching...
No Matches
neko_top_source_terms.f90
1! Copyright (c) 2025, The Neko Authors
2! All rights reserved.
3!
4! Redistribution and use in source and binary forms, with or without
5! modification, are permitted provided that the following conditions
6! are met:
7!
8! * Redistributions of source code must retain the above copyright
9! notice, this list of conditions and the following disclaimer.
10!
11! * Redistributions in binary form must reproduce the above
12! copyright notice, this list of conditions and the following
13! disclaimer in the documentation and/or other materials provided
14! with the distribution.
15!
16! * Neither the name of the authors nor the names of its
17! contributors may be used to endorse or promote products derived
18! from this software without specific prior written permission.
19!
20! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23! FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24! COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25! INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26! BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30! ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31! POSSIBILITY OF SUCH DAMAGE.
32
34submodule(neko_top) neko_top_source_terms
35 use source_term, only: source_term_t, source_term_allocate, &
36 register_source_term
37
38 ! Our user-defined source terms
47
48contains
49
51 module subroutine register_source_terms()
52 procedure(source_term_allocate), pointer :: adjoint_lube
53 procedure(source_term_allocate), pointer :: adjoint_minimum_dissipation
54 procedure(source_term_allocate), pointer :: adjoint_mixing_scalar
55 procedure(source_term_allocate), pointer :: adjoint_scalar_convection
56 procedure(source_term_allocate), pointer :: simple_brinkman
57
58 ! Assign the pointers
59 adjoint_lube => &
60 adjoint_lube_source_term_allocate
61 adjoint_minimum_dissipation => &
62 adjoint_minimum_dissipation_source_term_allocate
63 adjoint_mixing_scalar => &
64 adjoint_mixing_scalar_source_term_allocate
65 adjoint_scalar_convection => &
66 adjoint_scalar_convection_source_term_allocate
67 simple_brinkman => &
68 simple_brinkman_source_term_allocate
69
70 ! Register the source terms
71 call register_source_term('adjoint_lube', &
72 adjoint_lube)
73 call register_source_term('adjoint_minimum_dissipation', &
74 adjoint_minimum_dissipation)
75 call register_source_term('adjoint_mixing_scalar', &
76 adjoint_mixing_scalar)
77 call register_source_term('adjoint_scalar_convection', &
78 adjoint_scalar_convection)
79 call register_source_term('simple_brinkman', &
80 simple_brinkman)
81 end subroutine register_source_terms
82
83 ! ========================================================================== !
84 ! Definitions of the source term allocators
85
87 subroutine adjoint_lube_source_term_allocate(obj)
88 class(source_term_t), allocatable, intent(inout) :: obj
89 allocate(adjoint_lube_source_term_t::obj)
90 end subroutine adjoint_lube_source_term_allocate
91
93 subroutine adjoint_minimum_dissipation_source_term_allocate(obj)
94 class(source_term_t), allocatable, intent(inout) :: obj
96 end subroutine adjoint_minimum_dissipation_source_term_allocate
97
99 subroutine adjoint_mixing_scalar_source_term_allocate(obj)
100 class(source_term_t), allocatable, intent(inout) :: obj
102 end subroutine adjoint_mixing_scalar_source_term_allocate
103
105 subroutine adjoint_scalar_convection_source_term_allocate(obj)
106 class(source_term_t), allocatable, intent(inout) :: obj
108 end subroutine adjoint_scalar_convection_source_term_allocate
109
111 subroutine simple_brinkman_source_term_allocate(obj)
112 class(source_term_t), allocatable, intent(inout) :: obj
113 allocate(simple_brinkman_source_term_t::obj)
114 end subroutine simple_brinkman_source_term_allocate
115
116end submodule neko_top_source_terms
Implements the adjoint_lube_source_term_t type.
Implements the adjoint_minimum_dissipation_source_term_t type.
Implements the adjoint_mixing_scalar_source_term type.
Implements the adjoint_scalar_convection_source_term type.
Implements the simple_brinkman_source_term_t type.
A adjoint source term corresponding to an objective of.