Neko-TOP
A portable framework for high-order spectral element flow toplogy optimization.
Loading...
Searching...
No Matches
adjoint_source_term.f90
Go to the documentation of this file.
1
34!
37 use user_source_term, only: user_source_term_t
38 use source_term, only: source_term_t
39 use source_term_handler, only: source_term_handler_t
40 use field, only: field_t
41 use field_list, only: field_list_t
42 use coefs, only: coef_t
43 use user_intf, only: user_t
44 implicit none
45 private
46
51 type, public, extends(source_term_handler_t) :: adjoint_source_term_t
52
53 contains
55 procedure, pass(this) :: init => adjoint_source_term_init
57 procedure, nopass :: init_user_source => adjoint_init_user_source
58
60
61contains
62
64 subroutine adjoint_source_term_init(this, f_x, f_y, f_z, coef, user, &
65 scheme_name)
66 class(adjoint_source_term_t), intent(inout) :: this
67 type(field_t), pointer, intent(in) :: f_x, f_y, f_z
68 type(coef_t), target, intent(in) :: coef
69 type(user_t), target, intent(in) :: user
70 character(len=*), intent(in) :: scheme_name
71
72 type(field_list_t) :: rhs_fields
73
74 ! We package the fields for the source term to operate on in a field list.
75 call rhs_fields%init(3)
76 call rhs_fields%assign(1, f_x)
77 call rhs_fields%assign(2, f_y)
78 call rhs_fields%assign(3, f_z)
79
80 ! is this ever used??
81 call this%init_base(rhs_fields, coef, user, scheme_name)
82 end subroutine adjoint_source_term_init
83
90 subroutine adjoint_init_user_source(source_term, rhs_fields, coef, user, &
91 scheme_name)
92 class(source_term_t), allocatable, intent(inout) :: source_term
93 type(field_list_t) :: rhs_fields
94 type(coef_t), intent(in) :: coef
95 type(user_t), intent(in) :: user
96 character(len=*), intent(in) :: scheme_name
97
98 allocate(user_source_term_t::source_term)
99
100 select type (source_term)
101 type is (user_source_term_t)
102 call source_term%init_from_components(rhs_fields, coef, &
103 user%source_term, scheme_name)
104 end select
105 end subroutine adjoint_init_user_source
106
107end module adjoint_source_term
Implements the adjoint_source_term_t type.
subroutine adjoint_source_term_init(this, f_x, f_y, f_z, coef, user, scheme_name)
Constructor.
Wrapper contaning and executing the adjoint source terms.