Neko 1.99.11
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
operators Module Reference

Operators.

Data Types

interface  dudxyz
 Compute derivative of a scalar field along a single direction. More...
interface  div
 Compute the divergence of a vector field. More...
interface  grad
 Compute the gradient of a scalar field, multiplied by the mass matrix. More...
interface  cfl
 Compute CFL condition. More...
interface  cfl_compressible
 Compute CFL condition for compressible flow. More...
interface  rotate_cyc
 Apply cyclic boundary condition to a vector field. More...
interface  strain_rate
 Compute the strain rate tensor of a vector field. More...

Functions/Subroutines

subroutine dudxyz_r4 (du, u, dr, ds, dt, coef)
 Compute derivative of a scalar field along a single direction.
subroutine dudxyz_f (du, u, dr, ds, dt, coef)
 Compute derivative of a scalar field along a single direction.
subroutine div_r4 (res, ux, uy, uz, coef)
 Compute the divergence of a vector field.
subroutine div_d (res_d, ux_d, uy_d, uz_d, coef)
 Compute the divergence of a vector field.
subroutine grad_r4 (ux, uy, uz, u, coef)
 Compute the gradient of a scalar field.
subroutine grad_d (ux_d, uy_d, uz_d, u_d, coef)
 Compute the gradient of a scalar field.
subroutine, public opgrad (ux, uy, uz, u, coef, es, ee)
 Compute the weak gradient of a scalar field, i.e. the gradient multiplied by the mass matrix.
subroutine, public ortho (x, glb_n_points, n)
 Othogonalize with regard to vector (1,1,1,1,1,1...,1)^T.
subroutine, public cdtp (dtx, x, dr, ds, dt, coef, es, ee)
 Apply D^T to a scalar field, where D is the derivative matrix.
subroutine, public conv1 (du, u, vx, vy, vz, xh, coef, es, ee)
 Compute the advection term.
subroutine convect_scalar (du, u, cr, cs, ct, xh_gll, xh_gl, coef_gll, coef_gl, gll_to_gl)
 Apply the convecting velocity c to the to the scalar field u, used in the OIFS scheme.
subroutine, public curl (w1, w2, w3, u1, u2, u3, work1, work2, coef, event)
real(kind=dp) function cfl_r4 (dt, u, v, w, xh, coef, nelv, gdim)
real(kind=dp) function cfl_d (dt, u_d, v_d, w_d, xh, coef, nelv, gdim)
real(kind=dp) function cfl_f (dt, u, v, w, xh, coef, nelv, gdim)
real(kind=dp) function cfl_compressible_r4 (dt, max_wave_speed, xh, coef, nelv, gdim)
real(kind=dp) function cfl_compressible_d (dt, max_wave_speed, xh, coef, nelv, gdim)
real(kind=dp) function cfl_compressible_f (dt, max_wave_speed, xh, coef, nelv, gdim)
subroutine strain_rate_r4 (s11, s22, s33, s12, s13, s23, u, v, w, coef)
 Compute the strain rate tensor, i.e 0.5 * du_i/dx_j + du_j/dx_i.
subroutine strain_rate_d (s11_d, s22_d, s33_d, s12_d, s13_d, s23_d, u_d, v_d, w_d, coef)
 Compute the strain rate tensor, i.e 0.5 * du_i/dx_j + du_j/dx_i.
subroutine strain_rate_f (s11, s22, s33, s12, s13, s23, u, v, w, coef)
 Compute the strain rate tensor, i.e 0.5 * du_i/dx_j + du_j/dx_i.
subroutine, public lambda2op (lambda2, u, v, w, coef)
 Compute the Lambda2 field for a given velocity field.
subroutine, public set_convect_rst (cr, cs, ct, cx, cy, cz, xh, coef)
 Transforms the convecting velocity field to the rst form of the GL space.
subroutine, public runge_kutta (phi, conv_k1, conv_k23, conv_k4, xh_gll, xh_gl, coef, coef_gl, gll_to_gl, tau, dtau, n, nel, n_gl)
 Compute one step of Runge Kutta time interpolation for OIFS scheme.
subroutine rotate_cyc_r1 (vx, vy, vz, idir, coef)
subroutine rotate_cyc_r4 (vx, vy, vz, idir, coef)
subroutine rotate_cyc_d (vx_d, vy_d, vz_d, idir, coef)
subroutine rotate_cyc_f (vx, vy, vz, idir, coef)

Function/Subroutine Documentation

◆ cdtp()

subroutine, public operators::cdtp ( real(kind=rp), dimension(coef%xh%lxyz, coef%msh%nelv), intent(inout) dtx,
real(kind=rp), dimension(coef%xh%lxyz, coef%msh%nelv), intent(inout) x,
real(kind=rp), dimension(coef%xh%lxyz, coef%msh%nelv), intent(in) dr,
real(kind=rp), dimension(coef%xh%lxyz, coef%msh%nelv), intent(in) ds,
real(kind=rp), dimension(coef%xh%lxyz, coef%msh%nelv), intent(in) dt,
type(coef_t), intent(in) coef,
integer, optional es,
integer, optional ee )
Parameters
dtxWill store the result.
xThe values of the field.
drThe derivative of r with respect to the chosen direction.
dsThe derivative of s with respect to the chosen direction.
dtThe derivative of t with respect to the chosen direction.
coefThe SEM coefficients.
esStarting element index, optional, defaults to 1.
eeEnding element index, optional, defaults to nelv.
Note
This needs to be revised... the loop over n1,n2 is probably unnecessary

Definition at line 382 of file operators.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cfl_compressible_d()

real(kind=dp) function operators::cfl_compressible_d ( real(kind=dp), intent(in) dt,
type(c_ptr), intent(in) max_wave_speed,
type(space_t), intent(in) xh,
type(coef_t), intent(in) coef,
integer, intent(in) nelv,
integer, intent(in) gdim )
private

Definition at line 674 of file operators.f90.

Here is the caller graph for this function:

◆ cfl_compressible_f()

real(kind=dp) function operators::cfl_compressible_f ( real(kind=dp), intent(in) dt,
type(field_t), intent(in) max_wave_speed,
type(space_t), intent(in) xh,
type(coef_t), intent(in) coef,
integer, intent(in) nelv,
integer, intent(in) gdim )
private

Definition at line 694 of file operators.f90.

Here is the caller graph for this function:

◆ cfl_compressible_r4()

real(kind=dp) function operators::cfl_compressible_r4 ( real(kind=dp), intent(in) dt,
real(kind=rp), dimension(:,:,:,:), intent(in), contiguous max_wave_speed,
type(space_t), intent(in) xh,
type(coef_t), intent(in) coef,
integer, intent(in) nelv,
integer, intent(in) gdim )
private

Definition at line 654 of file operators.f90.

Here is the caller graph for this function:

◆ cfl_d()

real(kind=dp) function operators::cfl_d ( real(kind=dp), intent(in) dt,
type(c_ptr), intent(in) u_d,
type(c_ptr), intent(in) v_d,
type(c_ptr), intent(in) w_d,
type(space_t), intent(in) xh,
type(coef_t), intent(in) coef,
integer, intent(in) nelv,
integer, intent(in) gdim )
private

Definition at line 605 of file operators.f90.

Here is the caller graph for this function:

◆ cfl_f()

real(kind=dp) function operators::cfl_f ( real(kind=dp), intent(in) dt,
type(field_t), intent(in) u,
type(field_t), intent(in) v,
type(field_t), intent(in) w,
type(space_t), intent(in) xh,
type(coef_t), intent(in) coef,
integer, intent(in) nelv,
integer, intent(in) gdim )
private

Definition at line 623 of file operators.f90.

Here is the caller graph for this function:

◆ cfl_r4()

real(kind=dp) function operators::cfl_r4 ( real(kind=dp), intent(in) dt,
real(kind=rp), dimension(:,:,:,:), intent(in), contiguous u,
real(kind=rp), dimension(:,:,:,:), intent(in), contiguous v,
real(kind=rp), dimension(:,:,:,:), intent(in), contiguous w,
type(space_t), intent(in) xh,
type(coef_t), intent(in) coef,
integer, intent(in) nelv,
integer, intent(in) gdim )
private

Definition at line 573 of file operators.f90.

Here is the caller graph for this function:

◆ conv1()

subroutine, public operators::conv1 ( real(kind=rp), dimension(xh%lxyz, coef%msh%nelv), intent(inout) du,
real(kind=rp), dimension(xh%lx, xh%ly, xh%lz, coef%msh%nelv), intent(in) u,
real(kind=rp), dimension(xh%lx, xh%ly, xh%lz, coef%msh%nelv), intent(in) vx,
real(kind=rp), dimension(xh%lx, xh%ly, xh%lz, coef%msh%nelv), intent(in) vy,
real(kind=rp), dimension(xh%lx, xh%ly, xh%lz, coef%msh%nelv), intent(in) vz,
type(space_t), intent(in) xh,
type(coef_t), intent(in) coef,
integer, optional es,
integer, optional ee )
Parameters
duHolds the result.
uThe advected field.
vxThe x component of the advecting velocity.
vyThe y component of the advecting velocity.
vzThe z component of the advecting velocity.
XhThe function space for the fields involved.
coefThe SEM coefficients.
esStarting element index, defaults to 1.
eeLast element index, defaults to mesh size.

Definition at line 432 of file operators.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ convect_scalar()

subroutine operators::convect_scalar ( real(kind=rp), dimension(xh_gll%lx, xh_gll%ly, xh_gll%lz, coef_gl%msh%nelv), intent(inout) du,
real(kind=rp), dimension(xh_gl%lx, xh_gl%lx, xh_gl%lx, coef_gl%msh%nelv), intent(inout) u,
type(field_t), intent(inout) cr,
type(field_t), intent(inout) cs,
type(field_t), intent(inout) ct,
type(space_t), intent(in) xh_gll,
type(space_t), intent(in) xh_gl,
type(coef_t), intent(in) coef_gll,
type(coef_t), intent(in) coef_gl,
type(interpolator_t), intent(inout) gll_to_gl )
private
Parameters
duHolds the result
crThe r-component of convecting velocity
csThe s-component of convecting velocity
ctThe t-component of convecting velocity
uThe convected scalar field
Xh_GLLThe GLL space used in simulation
Xh_GLThe GL space used for dealiasing
coefThe coefficients of the original space in simulation
coef_GLThe coefficients of the GL space used for dealiasing
GLL_to_GLthe interpolator between the GLL and GL spaces
Note
This subroutine is equal to the convop_fst_3d of the NEK5000.
This subroutine is used specifically in the OIFS scheme, calculateing eq(17) in https://publications.anl.gov/anlpubs/2017/12/140626.pdf. The convecting term is calculated in the rst format and the GL grid. Then converted back to the GLL grid, going through an ADD gatter scatter operation at the element boundaries, before being multiplied by inverse of mass matrix.

Definition at line 492 of file operators.f90.

Here is the caller graph for this function:

◆ curl()

subroutine, public operators::curl ( type(field_t), intent(inout) w1,
type(field_t), intent(inout) w2,
type(field_t), intent(inout) w3,
type(field_t), intent(in) u1,
type(field_t), intent(in) u2,
type(field_t), intent(in) u3,
type(field_t), intent(inout) work1,
type(field_t), intent(inout) work2,
type(coef_t), intent(in) coef,
type(c_ptr), intent(inout), optional event )

Definition at line 536 of file operators.f90.

Here is the caller graph for this function:

◆ div_d()

subroutine operators::div_d ( type(c_ptr), intent(inout) res_d,
type(c_ptr), intent(in) ux_d,
type(c_ptr), intent(in) uy_d,
type(c_ptr), intent(in) uz_d,
type(coef_t), intent(in), target coef )
private
Parameters
resHolds the resulting divergence values.
uxThe x component of the vector field.
uyThe y component of the vector field.
uzThe z component of the vector field.
coefThe SEM coefficients.

Definition at line 236 of file operators.f90.

◆ div_r4()

subroutine operators::div_r4 ( real(kind=rp), dimension(:,:,:,:), intent(inout), contiguous res,
real(kind=rp), dimension(:,:,:,:), intent(in), contiguous ux,
real(kind=rp), dimension(:,:,:,:), intent(in), contiguous uy,
real(kind=rp), dimension(:,:,:,:), intent(in), contiguous uz,
type(coef_t), intent(in), target coef )
private
Parameters
resHolds the resulting divergence values.
uxThe x component of the vector field.
uyThe y component of the vector field.
uzThe z component of the vector field.
coefThe SEM coefficients.

Definition at line 191 of file operators.f90.

◆ dudxyz_f()

subroutine operators::dudxyz_f ( type(field_t), intent(inout) du,
type(field_t), intent(in) u,
type(field_t), intent(in) dr,
type(field_t), intent(in) ds,
type(field_t), intent(in) dt,
type(coef_t), intent(in) coef )
private
Parameters
duHolds the resulting derivative values.
uThe values of the field.
drThe derivative of r with respect to the chosen direction.
dsThe derivative of s with respect to the chosen direction.
dtThe derivative of t with respect to the chosen direction.
coefThe SEM coefficients.

Definition at line 168 of file operators.f90.

◆ dudxyz_r4()

subroutine operators::dudxyz_r4 ( real(kind=rp), dimension(:,:,:,:), intent(inout), contiguous du,
real(kind=rp), dimension(:,:,:,:), intent(in), contiguous u,
real(kind=rp), dimension(:,:,:,:), intent(in), contiguous dr,
real(kind=rp), dimension(:,:,:,:), intent(in), contiguous ds,
real(kind=rp), dimension(:,:,:,:), intent(in), contiguous dt,
type(coef_t), intent(in) coef )
private
Parameters
duHolds the resulting derivative values.
uThe values of the field.
drThe derivative of r with respect to the chosen direction.
dsThe derivative of s with respect to the chosen direction.
dtThe derivative of t with respect to the chosen direction.
coefThe SEM coefficients.

Definition at line 134 of file operators.f90.

◆ grad_d()

subroutine operators::grad_d ( type(c_ptr), intent(inout) ux_d,
type(c_ptr), intent(inout) uy_d,
type(c_ptr), intent(inout) uz_d,
type(c_ptr), intent(in) u_d,
type(coef_t), intent(in) coef )
private
Parameters
uxWill store the x component of the gradient.
uyWill store the y component of the gradient.
uzWill store the z component of the gradient.
uThe values of the field.
coefThe SEM coefficients.

Definition at line 285 of file operators.f90.

◆ grad_r4()

subroutine operators::grad_r4 ( real(kind=rp), dimension(:,:,:,:), intent(inout), contiguous ux,
real(kind=rp), dimension(:,:,:,:), intent(inout), contiguous uy,
real(kind=rp), dimension(:,:,:,:), intent(inout), contiguous uz,
real(kind=rp), dimension(:,:,:,:), intent(in), contiguous u,
type(coef_t), intent(in) coef )
private
Parameters
uxWill store the x component of the gradient.
uyWill store the y component of the gradient.
uzWill store the z component of the gradient.
uThe values of the field.
coefThe SEM coefficients.

Definition at line 266 of file operators.f90.

◆ lambda2op()

subroutine, public operators::lambda2op ( type(field_t), intent(inout) lambda2,
type(field_t), intent(in) u,
type(field_t), intent(in) v,
type(field_t), intent(in) w,
type(coef_t), intent(in) coef )
Parameters
lambda2Holds the computed Lambda2 field.
uThe x-velocity.
vThe y-velocity.
wthe z-velocity.
coefThe SEM coefficients.

Definition at line 902 of file operators.f90.

Here is the caller graph for this function:

◆ opgrad()

subroutine, public operators::opgrad ( real(kind=rp), dimension(coef%xh%lxyz, coef%msh%nelv), intent(inout) ux,
real(kind=rp), dimension(coef%xh%lxyz, coef%msh%nelv), intent(inout) uy,
real(kind=rp), dimension(coef%xh%lxyz, coef%msh%nelv), intent(inout) uz,
real(kind=rp), dimension(coef%xh%lxyz, coef%msh%nelv), intent(in) u,
type(coef_t), intent(in) coef,
integer, optional es,
integer, optional ee )

By providing es and ee, it is possible to compute only for a range of element indices.

Parameters
uxWill store the x component of the gradient.
uyWill store the y component of the gradient.
uzWill store the z component of the gradient.
uThe values of the field.
coefThe SEM coefficients.
esStarting element index, optional, defaults to 1.
eeEnding element index, optional, defaults to nelv.
Note
Equals wgradm1 in Nek5000, the weak form of the gradient.

Definition at line 308 of file operators.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ortho()

subroutine, public operators::ortho ( real(kind=rp), dimension(n), intent(inout) x,
integer(kind=i8), intent(in) glb_n_points,
integer, intent(in) n )
Parameters
xThe vector to orthogonolize.
glb_n_pointsThe global number of non-unique gll points in the grid.
Note
This is equivalent to subtracting the mean of x from each of its elements.

Definition at line 350 of file operators.f90.

Here is the call graph for this function:

◆ rotate_cyc_d()

subroutine operators::rotate_cyc_d ( type(c_ptr), intent(inout) vx_d,
type(c_ptr), intent(inout) vy_d,
type(c_ptr), intent(inout) vz_d,
integer, intent(in) idir,
type(coef_t), intent(in) coef )
private

Definition at line 1124 of file operators.f90.

◆ rotate_cyc_f()

subroutine operators::rotate_cyc_f ( type(field_t), intent(inout) vx,
type(field_t), intent(inout) vy,
type(field_t), intent(inout) vz,
integer, intent(in) idir,
type(coef_t), intent(in) coef )
private

Definition at line 1134 of file operators.f90.

◆ rotate_cyc_r1()

subroutine operators::rotate_cyc_r1 ( real(kind=rp), dimension(:), intent(inout), contiguous vx,
real(kind=rp), dimension(:), intent(inout), contiguous vy,
real(kind=rp), dimension(:), intent(inout), contiguous vz,
integer, intent(in) idir,
type(coef_t), intent(in) coef )
private

Definition at line 1082 of file operators.f90.

◆ rotate_cyc_r4()

subroutine operators::rotate_cyc_r4 ( real(kind=rp), dimension(:,:,:,:), intent(inout), contiguous vx,
real(kind=rp), dimension(:,:,:,:), intent(inout), contiguous vy,
real(kind=rp), dimension(:,:,:,:), intent(inout), contiguous vz,
integer, intent(in) idir,
type(coef_t), intent(in) coef )
private

Definition at line 1103 of file operators.f90.

◆ runge_kutta()

subroutine, public operators::runge_kutta ( type(field_t), intent(inout) phi,
type(field_list_t) conv_k1,
type(field_list_t) conv_k23,
type(field_list_t) conv_k4,
type(space_t), intent(in) xh_gll,
type(space_t), intent(inout) xh_gl,
type(coef_t), intent(in) coef,
type(coef_t), intent(inout) coef_gl,
type(interpolator_t) gll_to_gl,
real(kind=dp), intent(inout) tau,
real(kind=dp), intent(inout) dtau,
integer, intent(in) n,
integer, intent(in) nel,
integer, intent(in) n_gl )
Parameters
phiThe iterpolated field
conv_k1The covecting velocity for the first stage
conv_k23The convecting velocity for the second and third stage
conv_k4The convecting velocity for the fourth stage
Xh_GLLThe GLL space used in simulation
Xh_GLThe GL space used for dealiasing
coefThe coefficients of the original space in simulation
coef_GLThe coefficients of the GL space used for dealiasing
GLL_to_GLthe interpolator between the GLL and GL spaces
tauThe the starting time
dtauThe time step used for the Runge Kutta scheme
nsize of phi
nelTotal number of elements
n_GLthe size in the GL space

Definition at line 966 of file operators.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_convect_rst()

subroutine, public operators::set_convect_rst ( type(field_t), intent(inout) cr,
type(field_t), intent(inout) cs,
type(field_t), intent(inout) ct,
real(kind=rp), dimension(xh%lxyz, coef%msh%nelv), intent(in) cx,
real(kind=rp), dimension(xh%lxyz, coef%msh%nelv), intent(in) cy,
real(kind=rp), dimension(xh%lxyz, coef%msh%nelv), intent(in) cz,
type(space_t), intent(inout) xh,
type(coef_t), intent(inout) coef )
Parameters
crconvecting velocity in r-direction
csconvecting velocity in s-direction
ctconvecting velocity in t-direction
cxconvecting velocity in x-direction
cyconvecting velocity in y-direction
czconvecting velocity in z-direction
XhThe GL space used for dealiasing
coefThe coeffiecients of the GL space used for dealiasing
Note
This subroutine is equal to the set_convect_new subroutine of NEK5000

Definition at line 927 of file operators.f90.

Here is the caller graph for this function:

◆ strain_rate_d()

subroutine operators::strain_rate_d ( type(c_ptr), intent(inout) s11_d,
type(c_ptr), intent(inout) s22_d,
type(c_ptr), intent(inout) s33_d,
type(c_ptr), intent(inout) s12_d,
type(c_ptr), intent(inout) s13_d,
type(c_ptr), intent(inout) s23_d,
type(c_ptr), intent(in) u_d,
type(c_ptr), intent(in) v_d,
type(c_ptr), intent(in) w_d,
type(coef_t), intent(in) coef )
private
Parameters
s11_dWill hold the 1,1 component of the strain rate tensor.
s22_dWill hold the 2,2 component of the strain rate tensor.
s33_dWill hold the 3,3 component of the strain rate tensor.
s12_dWill hold the 1,2 component of the strain rate tensor.
s13_dWill hold the 1,3 component of the strain rate tensor.
s23_dWill hold the 2,3 component of the strain rate tensor.
u_dThe x component of velocity.
v_dThe y component of velocity.
w_dThe z component of velocity.
coefThe SEM coefficients.
Note
Similar to comp_sij in Nek5000.

Definition at line 802 of file operators.f90.

◆ strain_rate_f()

subroutine operators::strain_rate_f ( type(field_t), intent(inout) s11,
type(field_t), intent(inout) s22,
type(field_t), intent(inout) s33,
type(field_t), intent(inout) s12,
type(field_t), intent(inout) s13,
type(field_t), intent(inout) s23,
type(field_t), intent(in) u,
type(field_t), intent(in) v,
type(field_t), intent(in) w,
type(coef_t), intent(in) coef )
private
Parameters
s11Will hold the 1,1 component of the strain rate tensor.
s22Will hold the 2,2 component of the strain rate tensor.
s33Will hold the 3,3 component of the strain rate tensor.
s12Will hold the 1,2 component of the strain rate tensor.
s13Will hold the 1,3 component of the strain rate tensor.
s23Will hold the 2,3 component of the strain rate tensor.
uThe x component of velocity.
vThe y component of velocity.
wThe z component of velocity.
coefThe SEM coefficients.
Note
Similar to comp_sij in Nek5000.

Definition at line 846 of file operators.f90.

◆ strain_rate_r4()

subroutine operators::strain_rate_r4 ( real(kind=rp), dimension(:,:,:,:), intent(inout), contiguous s11,
real(kind=rp), dimension(:,:,:,:), intent(inout), contiguous s22,
real(kind=rp), dimension(:,:,:,:), intent(inout), contiguous s33,
real(kind=rp), dimension(:,:,:,:), intent(inout), contiguous s12,
real(kind=rp), dimension(:,:,:,:), intent(inout), contiguous s13,
real(kind=rp), dimension(:,:,:,:), intent(inout), contiguous s23,
real(kind=rp), dimension(:,:,:,:), intent(in), contiguous u,
real(kind=rp), dimension(:,:,:,:), intent(in), contiguous v,
real(kind=rp), dimension(:,:,:,:), intent(in), contiguous w,
type(coef_t), intent(in) coef )
private
Parameters
s11Will hold the 1,1 component of the strain rate tensor.
s22Will hold the 2,2 component of the strain rate tensor.
s33Will hold the 3,3 component of the strain rate tensor.
s12Will hold the 1,2 component of the strain rate tensor.
s13Will hold the 1,3 component of the strain rate tensor.
s23Will hold the 2,3 component of the strain rate tensor.
uThe x component of velocity.
vThe y component of velocity.
wThe z component of velocity.
coefThe SEM coefficients.
Note
Similar to comp_sij in Nek5000.

Definition at line 719 of file operators.f90.