Neko 1.99.11
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
scalar_residual_cpu.f90
Go to the documentation of this file.
1!> Residuals in the scalar equation (CPU version).
4 use ax_product, only : ax_t
5 use field, only : field_t
6 use coefs, only : coef_t
7 use space, only : space_t
8 use mesh, only : mesh_t
9 use num_types, only : rp
10 use field, only : field_t
11 use mesh, only : mesh_t
12 use ax_product, only : ax_t
13 use space, only : space_t
14 use coefs, only : coef_t
15 implicit none
16 private
17
18 !> Wrapper type for the routine to compute the scalar residual on the CPU.
19 type, public, extends(scalar_residual_t) :: scalar_residual_cpu_t
20 contains
21 !> Compute the residual.
22 procedure, nopass :: compute => scalar_residual_cpu_compute
24
25contains
26
27 !> Compute the residual.
28 !! @param Ax The Helmholtz operator.
29 !! @param s The values of the scalar.
30 !! @param s_res The values of the scalar residual.
31 !! @param f_xH The right hand side.
32 !! @param c_xH The SEM coefficients.
33 !! @param msh The mesh.
34 !! @param Xh The SEM function space.
35 !! @param lambda The thermal conductivity.
36 !! @param rho_cp The density multiplied by the specific heat capacity.
37 !! @param bd The coefficeints from the BDF differencing scheme.
38 !! @param dt The timestep.
39 !! @param n The total number of degrees of freedom.
40 subroutine scalar_residual_cpu_compute(Ax, s, s_res, f_Xh, c_Xh, msh, Xh, &
41 lambda, rho_cp, bd, dt, n)
42 class(ax_t), intent(in) :: Ax
43 type(mesh_t), intent(inout) :: msh
44 type(space_t), intent(inout) :: Xh
45 type(field_t), intent(inout) :: s
46 type(field_t), intent(inout) :: s_res
47 type(field_t), intent(in) :: f_Xh
48 type(coef_t), intent(inout) :: c_Xh
49 type(field_t), intent(in) :: lambda, rho_cp
50 real(kind=rp), intent(in) :: bd
51 real(kind=rp), intent(in) :: dt
52 integer, intent(in) :: n
53 integer :: i
54
55 !OCL NORECURRENCE, NOVREC, NOALIAS
56 !DIR$ CONCURRENT
57 !DIR$ IVDEP
58 !GCC$ ivdep
59 !$omp parallel do
60 do i = 1, n
61 c_xh%h1(i,1,1,1) = lambda%x(i,1,1,1)
62 c_xh%h2(i,1,1,1) = rho_cp%x(i,1,1,1) * bd / dt
63 end do
64 !$omp end parallel do
65
66 c_xh%ifh2 = .true.
67
68 call ax%compute(s_res%x, s%x, c_xh, msh, xh)
69
70 !OCL NORECURRENCE, NOVREC, NOALIAS
71 !DIR$ CONCURRENT
72 !DIR$ IVDEP
73 !GCC$ ivdep
74 !$omp parallel do
75 do i = 1, n
76 s_res%x(i,1,1,1) = (-s_res%x(i,1,1,1)) + f_xh%x(i,1,1,1)
77 end do
78 !$omp end parallel do
79
80 end subroutine scalar_residual_cpu_compute
81
82end module scalar_residual_cpu
Defines a Matrix-vector product.
Definition ax.f90:34
Coefficients.
Definition coef.f90:34
Defines a field.
Definition field.f90:34
Defines a mesh.
Definition mesh.f90:34
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:14
Residuals in the scalar equation (CPU version).
subroutine scalar_residual_cpu_compute(ax, s, s_res, f_xh, c_xh, msh, xh, lambda, rho_cp, bd, dt, n)
Compute the residual.
Defines the residual for the scalar transport equation.
Defines a function space.
Definition space.f90:34
Base type for a matrix-vector product providing .
Definition ax.f90:44
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Definition coef.f90:136
Abstract type to compute scalar residual.
Wrapper type for the routine to compute the scalar residual on the CPU.
The function space for the SEM solution fields.
Definition space.f90:64