Neko  0.9.99
A portable framework for high-order spectral element flow simulations
scalar_residual_sx.f90
Go to the documentation of this file.
1 
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 math, only : copy, cfill
11  use field, only : field_t
12  use mesh, only : mesh_t
13  use ax_product, only : ax_t
14  use space, only : space_t
15  use coefs, only : coef_t
16  implicit none
17  private
18 
19  type, public, extends(scalar_residual_t) :: scalar_residual_sx_t
20  contains
21  procedure, nopass :: compute => scalar_residual_sx_compute
22  end type scalar_residual_sx_t
23 
24 contains
25 
26  subroutine scalar_residual_sx_compute(Ax, s, s_res, f_Xh, c_Xh, msh, Xh, &
27  lambda, rhocp, bd, dt, n)
28  class(ax_t), intent(in) :: Ax
29  type(mesh_t), intent(inout) :: msh
30  type(space_t), intent(inout) :: Xh
31  type(field_t), intent(inout) :: s
32  type(field_t), intent(inout) :: s_res
33  type(field_t), intent(inout) :: f_Xh
34  type(coef_t), intent(inout) :: c_Xh
35  type(field_t), intent(in) :: lambda
36  real(kind=rp), intent(in) :: rhocp
37  real(kind=rp), intent(in) :: bd
38  real(kind=rp), intent(in) :: dt
39  integer, intent(in) :: n
40  integer :: i
41 
42  call copy(c_xh%h1, lambda%x, n)
43  call cfill(c_xh%h2, rhocp * bd / dt, n)
44  c_xh%ifh2 = .true.
45 
46  call ax%compute(s_res%x, s%x, c_xh, msh, xh)
47 
48  do i = 1, n
49  s_res%x(i,1,1,1) = (-s_res%x(i,1,1,1)) + f_xh%x(i,1,1,1)
50  end do
51 
52  end subroutine scalar_residual_sx_compute
53 
54 end module scalar_residual_sx
Defines a Matrix-vector product.
Definition: ax.f90:34
Coefficients.
Definition: coef.f90:34
Defines a field.
Definition: field.f90:34
Definition: math.f90:60
subroutine, public cfill(a, c, n)
Set all elements to a constant c .
Definition: math.f90:348
subroutine, public copy(a, b, n)
Copy a vector .
Definition: math.f90:239
Defines a mesh.
Definition: mesh.f90:34
integer, parameter, public rp
Global precision used in computations.
Definition: num_types.f90:12
Residuals in the Pn-Pn formulation (SX version)
subroutine scalar_residual_sx_compute(Ax, s, s_res, f_Xh, c_Xh, msh, Xh, lambda, rhocp, bd, dt, n)
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:43
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Definition: coef.f90:55
Abstract type to compute scalar residual.
The function space for the SEM solution fields.
Definition: space.f90:62