86 f_x, f_y, f_z, c_Xh, gs_Xh, bc_prs_surface, bc_sym_surface, &
87 Ax, bd, dt, mu, rho, event)
88 type(field_t),
intent(inout) :: p, u, v, w
89 type(field_t),
intent(inout) :: p_res
90 type(field_t),
intent(in) :: f_x, f_y, f_z
91 type(coef_t),
intent(inout) :: c_Xh
92 type(gs_t),
intent(inout) :: gs_Xh
93 type(facet_normal_t),
intent(in) :: bc_prs_surface
94 type(facet_normal_t),
intent(in) :: bc_sym_surface
95 class(ax_t),
intent(inout) :: Ax
96 real(kind=rp),
intent(in) :: bd
97 real(kind=rp),
intent(in) :: dt
98 type(field_t),
intent(in) :: mu
99 type(field_t),
intent(in) :: rho
100 type(c_ptr),
intent(inout) :: event
101 real(kind=rp) :: rho_val
103 type(field_t),
pointer :: ta1, ta2, ta3, wa1, wa2, wa3
104 integer :: temp_indices(6)
106 call neko_scratch_registry%request_field(ta1, temp_indices(1), .false.)
107 call neko_scratch_registry%request_field(ta2, temp_indices(2), .false.)
108 call neko_scratch_registry%request_field(ta3, temp_indices(3), .false.)
109 call neko_scratch_registry%request_field(wa1, temp_indices(4), .false.)
110 call neko_scratch_registry%request_field(wa2, temp_indices(5), .false.)
111 call neko_scratch_registry%request_field(wa3, temp_indices(6), .false.)
116 rho_val = rho%x(1,1,1,1)
117 call cfill(c_xh%h1, 1.0_rp / rho_val, n)
118 call cfill(c_xh%h2, 0.0_rp, n)
121 call col3(ta1%x, f_x%x, c_xh%B, n)
122 call col3(ta2%x, f_y%x, c_xh%B, n)
123 call col3(ta3%x, f_z%x, c_xh%B, n)
124 call cmult(ta1%x, 1.0_rp / rho_val, n)
125 call cmult(ta2%x, 1.0_rp / rho_val, n)
126 call cmult(ta3%x, 1.0_rp / rho_val, n)
128 call gs_xh%op(ta1, gs_op_add)
129 call gs_xh%op(ta2, gs_op_add)
130 call gs_xh%op(ta3, gs_op_add)
132 call col2(ta1%x, c_xh%Binv, n)
133 call col2(ta2%x, c_xh%Binv, n)
134 call col2(ta3%x, c_xh%Binv, n)
136 call cdtp(wa1%x, ta1%x, c_xh%drdx, c_xh%dsdx, c_xh%dtdx, c_xh)
137 call cdtp(wa2%x, ta2%x, c_xh%drdy, c_xh%dsdy, c_xh%dtdy, c_xh)
138 call cdtp(wa3%x, ta3%x, c_xh%drdz, c_xh%dsdz, c_xh%dtdz, c_xh)
142 call ax%compute(p_res%x, p%x, c_xh, p%msh, p%Xh)
144 call chsign(p_res%x, n)
145 call add2(p_res%x, wa1%x, n)
146 call add2(p_res%x, wa2%x, n)
147 call add2(p_res%x, wa3%x, n)
179 call neko_scratch_registry%relinquish_field(temp_indices)
204 v_res, w_res, p, f_x, f_y, f_z, c_Xh, msh, Xh, mu, rho, bd, dt, n)
subroutine adjoint_pnpn_prs_res_cpu_compute(p, p_res, u, v, w, f_x, f_y, f_z, c_xh, gs_xh, bc_prs_surface, bc_sym_surface, ax, bd, dt, mu, rho, event)
Compute adjoint pressure residual (CPU backend).