63 real(kind=
rp),
allocatable :: g11(:,:,:,:)
65 real(kind=
rp),
allocatable :: g22(:,:,:,:)
67 real(kind=
rp),
allocatable :: g33(:,:,:,:)
69 real(kind=
rp),
allocatable :: g12(:,:,:,:)
71 real(kind=
rp),
allocatable :: g13(:,:,:,:)
73 real(kind=
rp),
allocatable :: g23(:,:,:,:)
75 real(kind=
rp),
allocatable :: mult(:,:,:,:)
80 real(kind=
rp),
allocatable :: dxdr(:,:,:,:), dydr(:,:,:,:), dzdr(:,:,:,:)
81 real(kind=
rp),
allocatable :: dxds(:,:,:,:), dyds(:,:,:,:), dzds(:,:,:,:)
82 real(kind=
rp),
allocatable :: dxdt(:,:,:,:), dydt(:,:,:,:), dzdt(:,:,:,:)
86 real(kind=
rp),
allocatable :: drdx(:,:,:,:), drdy(:,:,:,:), drdz(:,:,:,:)
87 real(kind=
rp),
allocatable :: dsdx(:,:,:,:), dsdy(:,:,:,:), dsdz(:,:,:,:)
88 real(kind=
rp),
allocatable :: dtdx(:,:,:,:), dtdy(:,:,:,:), dtdz(:,:,:,:)
90 real(kind=
rp),
allocatable :: h1(:,:,:,:)
91 real(kind=
rp),
allocatable :: h2(:,:,:,:)
94 real(kind=
rp),
allocatable :: jac(:,:,:,:)
95 real(kind=
rp),
allocatable :: jacinv(:,:,:,:)
96 real(kind=
rp),
allocatable :: b(:,:,:,:)
97 real(kind=
rp),
allocatable :: binv(:,:,:,:)
99 real(kind=
rp),
allocatable :: area(:,:,:,:)
100 real(kind=
rp),
allocatable :: nx(:,:,:,:)
101 real(kind=
rp),
allocatable :: ny(:,:,:,:)
102 real(kind=
rp),
allocatable :: nz(:,:,:,:)
103 logical :: cyclic = .false.
104 integer,
allocatable :: cyc_msk(:)
105 real(kind=
rp),
allocatable :: r11(:)
106 real(kind=
rp),
allocatable :: r12(:)
109 real(kind=
rp) :: volume
114 type(
gs_t),
pointer :: gs_h=> null()
120 type(c_ptr) :: g11_d = c_null_ptr
121 type(c_ptr) :: g22_d = c_null_ptr
122 type(c_ptr) :: g33_d = c_null_ptr
123 type(c_ptr) :: g12_d = c_null_ptr
124 type(c_ptr) :: g13_d = c_null_ptr
125 type(c_ptr) :: g23_d = c_null_ptr
126 type(c_ptr) :: dxdr_d = c_null_ptr
127 type(c_ptr) :: dydr_d = c_null_ptr
128 type(c_ptr) :: dzdr_d = c_null_ptr
129 type(c_ptr) :: dxds_d = c_null_ptr
130 type(c_ptr) :: dyds_d = c_null_ptr
131 type(c_ptr) :: dzds_d = c_null_ptr
132 type(c_ptr) :: dxdt_d = c_null_ptr
133 type(c_ptr) :: dydt_d = c_null_ptr
134 type(c_ptr) :: dzdt_d = c_null_ptr
135 type(c_ptr) :: drdx_d = c_null_ptr
136 type(c_ptr) :: drdy_d = c_null_ptr
137 type(c_ptr) :: drdz_d = c_null_ptr
138 type(c_ptr) :: dsdx_d = c_null_ptr
139 type(c_ptr) :: dsdy_d = c_null_ptr
140 type(c_ptr) :: dsdz_d = c_null_ptr
141 type(c_ptr) :: dtdx_d = c_null_ptr
142 type(c_ptr) :: dtdy_d = c_null_ptr
143 type(c_ptr) :: dtdz_d = c_null_ptr
144 type(c_ptr) :: mult_d = c_null_ptr
145 type(c_ptr) :: h1_d = c_null_ptr
146 type(c_ptr) :: h2_d = c_null_ptr
147 type(c_ptr) :: jac_d = c_null_ptr
148 type(c_ptr) :: jacinv_d = c_null_ptr
149 type(c_ptr) :: b_d = c_null_ptr
150 type(c_ptr) :: binv_d = c_null_ptr
151 type(c_ptr) :: area_d = c_null_ptr
152 type(c_ptr) :: nx_d = c_null_ptr
153 type(c_ptr) :: ny_d = c_null_ptr
154 type(c_ptr) :: nz_d = c_null_ptr
155 type(c_ptr) :: cyc_msk_d = c_null_ptr
156 type(c_ptr) :: r11_d = c_null_ptr
157 type(c_ptr) :: r12_d = c_null_ptr
168 generic :: init => init_empty, init_all
221 class(
coef_t),
intent(inout) :: this
222 type(
gs_t),
intent(inout),
target :: gs_h
223 integer :: n, m, ncyc
226 this%msh => gs_h%dofmap%msh
227 this%Xh => gs_h%dofmap%Xh
228 this%dof => gs_h%dofmap
235 allocate(this%G11(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
236 allocate(this%G22(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
237 allocate(this%G33(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
238 allocate(this%G12(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
239 allocate(this%G13(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
240 allocate(this%G23(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
242 allocate(this%dxdr(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
243 allocate(this%dxds(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
244 allocate(this%dxdt(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
246 allocate(this%dydr(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
247 allocate(this%dyds(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
248 allocate(this%dydt(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
250 allocate(this%dzdr(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
251 allocate(this%dzds(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
252 allocate(this%dzdt(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
254 allocate(this%drdx(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
255 allocate(this%dsdx(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
256 allocate(this%dtdx(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
258 allocate(this%drdy(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
259 allocate(this%dsdy(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
260 allocate(this%dtdy(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
262 allocate(this%drdz(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
263 allocate(this%dsdz(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
264 allocate(this%dtdz(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
266 allocate(this%jac(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
267 allocate(this%jacinv(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
269 allocate(this%area(this%Xh%lx, this%Xh%ly, 6, this%msh%nelv))
270 allocate(this%nx(this%Xh%lx, this%Xh%ly, 6, this%msh%nelv))
271 allocate(this%ny(this%Xh%lx, this%Xh%ly, 6, this%msh%nelv))
272 allocate(this%nz(this%Xh%lx, this%Xh%ly, 6, this%msh%nelv))
274 allocate(this%B(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
275 allocate(this%Binv(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
277 allocate(this%h1(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
278 allocate(this%h2(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
280 allocate(this%mult(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
287 n = this%Xh%lx * this%Xh%ly * this%Xh%lz * this%msh%nelv
325 call device_map(this%jacinv, this%jacinv_d, n)
329 m = this%Xh%lx * this%Xh%ly * 6 * this%msh%nelv
369 call rone(this%mult, n)
382 ncyc = this%msh%periodic%size * this%Xh%lx * this%Xh%lx
383 allocate(this%cyc_msk(0:ncyc))
384 this%cyc_msk(0) = ncyc + 1
385 if (ncyc .gt. 0)
then
386 allocate(this%R11(ncyc))
387 allocate(this%R12(ncyc))
390 call rone(this%R11, ncyc)
391 call rzero(this%R12, ncyc)
394 call device_map(this%cyc_msk, this%cyc_msk_d, ncyc+1)
728 type(
coef_t),
intent(inout) :: c
729 integer :: e,i,lxy,lyz,ntot
735 associate(drdx => c%drdx, drdy => c%drdy, drdz => c%drdz, &
736 dsdx => c%dsdx, dsdy => c%dsdy, dsdz => c%dsdz, &
737 dtdx => c%dtdx, dtdy => c%dtdy, dtdz => c%dtdz, &
738 dxdr => c%dxdr, dydr => c%dydr, dzdr => c%dzdr, &
739 dxds => c%dxds, dyds => c%dyds, dzds => c%dzds, &
740 dxdt => c%dxdt, dydt => c%dydt, dzdt => c%dzdt, &
741 dx => c%Xh%dx, dy => c%Xh%dy, dz => c%Xh%dz, &
742 x => c%dof%x, y => c%dof%y, z => c%dof%z, &
743 lx => c%Xh%lx, ly => c%Xh%ly, lz => c%Xh%lz, &
744 dyt => c%Xh%dyt, dzt => c%Xh%dzt, &
745 jacinv => c%jacinv, jac => c%jac)
750 c%dsdx_d, c%dsdy_d, c%dsdz_d, c%dtdx_d, c%dtdy_d, c%dtdz_d, &
751 c%dxdr_d, c%dydr_d, c%dzdr_d, c%dxds_d, c%dyds_d, c%dzds_d, &
752 c%dxdt_d, c%dydt_d, c%dzdt_d, c%Xh%dx_d, c%Xh%dy_d, c%Xh%dz_d, &
753 c%dof%x_d, c%dof%y_d, c%dof%z_d, c%jacinv_d, c%jac_d, &
781 call mxm(dx, lx, x(1,1,1,e), lx, dxdr(1,1,1,e), lyz)
782 call mxm(dx, lx, y(1,1,1,e), lx, dydr(1,1,1,e), lyz)
783 call mxm(dx, lx, z(1,1,1,e), lx, dzdr(1,1,1,e), lyz)
786 call mxm(x(1,1,i,e), lx, dyt, ly, dxds(1,1,i,e), ly)
787 call mxm(y(1,1,i,e), lx, dyt, ly, dyds(1,1,i,e), ly)
788 call mxm(z(1,1,i,e), lx, dyt, ly, dzds(1,1,i,e), ly)
792 if(c%msh%gdim .eq. 3)
then
793 call mxm(x(1,1,1,e), lxy, dzt, lz, dxdt(1,1,1,e), lz)
794 call mxm(y(1,1,1,e), lxy, dzt, lz, dydt(1,1,1,e), lz)
795 call mxm(z(1,1,1,e), lxy, dzt, lz, dzdt(1,1,1,e), lz)
797 call rzero(dxdt(1,1,1,e), lxy)
798 call rzero(dydt(1,1,1,e), lxy)
799 call rone(dzdt(1,1,1,e), lxy)
804 if (c%msh%gdim .eq. 2)
then
805 call rzero (jac, ntot)
806 call addcol3 (jac, dxdr, dyds, ntot)
807 call subcol3 (jac, dxds, dydr, ntot)
808 call copy (drdx, dyds, ntot)
809 call copy (drdy, dxds, ntot)
811 call copy (dsdx, dydr, ntot)
813 call copy (dsdy, dxdr, ntot)
814 call rzero (drdz, ntot)
815 call rzero (dsdz, ntot)
816 call rone (dtdz, ntot)
821 c%jac(i, 1, 1, 1) = 0.0_rp
826 c%jac(i, 1, 1, 1) = c%jac(i, 1, 1, 1) + ( c%dxdr(i, 1, 1, 1) &
827 * c%dyds(i, 1, 1, 1) * c%dzdt(i, 1, 1, 1) )
829 c%jac(i, 1, 1, 1) = c%jac(i, 1, 1, 1) + ( c%dxdt(i, 1, 1, 1) &
830 * c%dydr(i, 1, 1, 1) * c%dzds(i, 1, 1, 1) )
832 c%jac(i, 1, 1, 1) = c%jac(i, 1, 1, 1) + ( c%dxds(i, 1, 1, 1) &
833 * c%dydt(i, 1, 1, 1) * c%dzdr(i, 1, 1, 1) )
838 c%jac(i, 1, 1, 1) = c%jac(i, 1, 1, 1) - ( c%dxdr(i, 1, 1, 1) &
839 * c%dydt(i, 1, 1, 1) * c%dzds(i, 1, 1, 1) )
841 c%jac(i, 1, 1, 1) = c%jac(i, 1, 1, 1) - ( c%dxds(i, 1, 1, 1) &
842 * c%dydr(i, 1, 1, 1) * c%dzdt(i, 1, 1, 1) )
844 c%jac(i, 1, 1, 1) = c%jac(i, 1, 1, 1) - ( c%dxdt(i, 1, 1, 1) &
845 * c%dyds(i, 1, 1, 1) * c%dzdr(i, 1, 1, 1) )
850 c%drdx(i, 1, 1, 1) = c%dyds(i, 1, 1, 1) * c%dzdt(i, 1, 1, 1) &
851 - c%dydt(i, 1, 1, 1) * c%dzds(i, 1, 1, 1)
853 c%drdy(i, 1, 1, 1) = c%dxdt(i, 1, 1, 1) * c%dzds(i, 1, 1, 1) &
854 - c%dxds(i, 1, 1, 1) * c%dzdt(i, 1, 1, 1)
856 c%drdz(i, 1, 1, 1) = c%dxds(i, 1, 1, 1) * c%dydt(i, 1, 1, 1) &
857 - c%dxdt(i, 1, 1, 1) * c%dyds(i, 1, 1, 1)
862 c%dsdx(i, 1, 1, 1) = c%dydt(i, 1, 1, 1) * c%dzdr(i, 1, 1, 1) &
863 - c%dydr(i, 1, 1, 1) * c%dzdt(i, 1, 1, 1)
865 c%dsdy(i, 1, 1, 1) = c%dxdr(i, 1, 1, 1) * c%dzdt(i, 1, 1, 1) &
866 - c%dxdt(i, 1, 1, 1) * c%dzdr(i, 1, 1, 1)
868 c%dsdz(i, 1, 1, 1) = c%dxdt(i, 1, 1, 1) * c%dydr(i, 1, 1, 1) &
869 - c%dxdr(i, 1, 1, 1) * c%dydt(i, 1, 1, 1)
874 c%dtdx(i, 1, 1, 1) = c%dydr(i, 1, 1, 1) * c%dzds(i, 1, 1, 1) &
875 - c%dyds(i, 1, 1, 1) * c%dzdr(i, 1, 1, 1)
877 c%dtdy(i, 1, 1, 1) = c%dxds(i, 1, 1, 1) * c%dzdr(i, 1, 1, 1) &
878 - c%dxdr(i, 1, 1, 1) * c%dzds(i, 1, 1, 1)
880 c%dtdz(i, 1, 1, 1) = c%dxdr(i, 1, 1, 1) * c%dyds(i, 1, 1, 1) &
881 - c%dxds(i, 1, 1, 1) * c%dydr(i, 1, 1, 1)
886 call invers2(jacinv, jac, ntot)
895 type(
coef_t),
intent(inout) :: c
896 integer :: e, i, lxyz, ntot
898 lxyz = c%Xh%lx * c%Xh%ly * c%Xh%lz
901 if (neko_bcknd_device .eq. 1)
then
903 call device_coef_generate_geo(c%G11_d, c%G12_d, c%G13_d, &
904 c%G22_d, c%G23_d, c%G33_d, &
905 c%drdx_d, c%drdy_d, c%drdz_d, &
906 c%dsdx_d, c%dsdy_d, c%dsdz_d, &
907 c%dtdx_d, c%dtdy_d, c%dtdz_d, &
908 c%jacinv_d, c%Xh%w3_d, c%msh%nelv, &
911 call device_memcpy(c%G11, c%G11_d, ntot, device_to_host, sync=.false.)
912 call device_memcpy(c%G22, c%G22_d, ntot, device_to_host, sync=.false.)
913 call device_memcpy(c%G33, c%G33_d, ntot, device_to_host, sync=.false.)
914 call device_memcpy(c%G12, c%G12_d, ntot, device_to_host, sync=.false.)
915 call device_memcpy(c%G13, c%G13_d, ntot, device_to_host, sync=.false.)
916 call device_memcpy(c%G23, c%G23_d, ntot, device_to_host, sync=.true.)
919 if(c%msh%gdim .eq. 2)
then
922 c%G11(i, 1, 1, 1) = c%drdx(i, 1, 1, 1) * c%drdx(i, 1, 1, 1) &
923 + c%drdy(i, 1, 1, 1) * c%drdy(i, 1, 1, 1)
925 c%G22(i, 1, 1, 1) = c%dsdx(i, 1, 1, 1) * c%dsdx(i, 1, 1, 1) &
926 + c%dsdy(i, 1, 1, 1) * c%dsdy(i, 1, 1, 1)
928 c%G12(i, 1, 1, 1) = c%drdx(i, 1, 1, 1) * c%dsdx(i, 1, 1, 1) &
929 + c%drdy(i, 1, 1, 1) * c%dsdy(i, 1, 1, 1)
933 c%G11(i, 1, 1, 1) = c%G11(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
934 c%G22(i, 1, 1, 1) = c%G22(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
935 c%G12(i, 1, 1, 1) = c%G12(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
936 c%G33(i, 1, 1, 1) = 0.0_rp
937 c%G13(i, 1, 1, 1) = 0.0_rp
938 c%G23(i, 1, 1, 1) = 0.0_rp
941 do concurrent(e = 1:c%msh%nelv)
942 do concurrent(i = 1:lxyz)
943 c%G11(i,1,1,e) = c%G11(i,1,1,e) * c%Xh%w3(i,1,1)
944 c%G22(i,1,1,e) = c%G22(i,1,1,e) * c%Xh%w3(i,1,1)
945 c%G12(i,1,1,e) = c%G12(i,1,1,e) * c%Xh%w3(i,1,1)
953 c%G11(i, 1, 1, 1) = c%drdx(i, 1, 1, 1) * c%drdx(i, 1, 1, 1) &
954 + c%drdy(i, 1, 1, 1) * c%drdy(i, 1, 1, 1) &
955 + c%drdz(i, 1, 1, 1) * c%drdz(i, 1, 1, 1)
957 c%G22(i, 1, 1, 1) = c%dsdx(i, 1, 1, 1) * c%dsdx(i, 1, 1, 1) &
958 + c%dsdy(i, 1, 1, 1) * c%dsdy(i, 1, 1, 1) &
959 + c%dsdz(i, 1, 1, 1) * c%dsdz(i, 1, 1, 1)
961 c%G33(i, 1, 1, 1) = c%dtdx(i, 1, 1, 1) * c%dtdx(i, 1, 1, 1) &
962 + c%dtdy(i, 1, 1, 1) * c%dtdy(i, 1, 1, 1) &
963 + c%dtdz(i, 1, 1, 1) * c%dtdz(i, 1, 1, 1)
968 c%G11(i, 1, 1, 1) = c%G11(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
969 c%G22(i, 1, 1, 1) = c%G22(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
970 c%G33(i, 1, 1, 1) = c%G33(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
975 c%G12(i, 1, 1, 1) = c%drdx(i, 1, 1, 1) * c%dsdx(i, 1, 1, 1) &
976 + c%drdy(i, 1, 1, 1) * c%dsdy(i, 1, 1, 1) &
977 + c%drdz(i, 1, 1, 1) * c%dsdz(i, 1, 1, 1)
979 c%G13(i, 1, 1, 1) = c%drdx(i, 1, 1, 1) * c%dtdx(i, 1, 1, 1) &
980 + c%drdy(i, 1, 1, 1) * c%dtdy(i, 1, 1, 1) &
981 + c%drdz(i, 1, 1, 1) * c%dtdz(i, 1, 1, 1)
983 c%G23(i, 1, 1, 1) = c%dsdx(i, 1, 1, 1) * c%dtdx(i, 1, 1, 1) &
984 + c%dsdy(i, 1, 1, 1) * c%dtdy(i, 1, 1, 1) &
985 + c%dsdz(i, 1, 1, 1) * c%dtdz(i, 1, 1, 1)
990 c%G12(i, 1, 1, 1) = c%G12(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
991 c%G13(i, 1, 1, 1) = c%G13(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
992 c%G23(i, 1, 1, 1) = c%G23(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
997 do concurrent(i = 1:lxyz)
998 c%G11(i,1,1,e) = c%G11(i,1,1,e) * c%Xh%w3(i,1,1)
999 c%G22(i,1,1,e) = c%G22(i,1,1,e) * c%Xh%w3(i,1,1)
1000 c%G12(i,1,1,e) = c%G12(i,1,1,e) * c%Xh%w3(i,1,1)
1002 c%G33(i,1,1,e) = c%G33(i,1,1,e) * c%Xh%w3(i,1,1)
1003 c%G13(i,1,1,e) = c%G13(i,1,1,e) * c%Xh%w3(i,1,1)
1004 c%G23(i,1,1,e) = c%G23(i,1,1,e) * c%Xh%w3(i,1,1)
1094 type(
coef_t),
intent(inout) :: coef
1095 real(kind=rp),
allocatable :: a(:,:,:,:)
1096 real(kind=rp),
allocatable :: b(:,:,:,:)
1097 real(kind=rp),
allocatable :: c(:,:,:,:)
1098 real(kind=rp),
allocatable :: dot(:,:,:,:)
1099 integer :: n, e, i, j, k, lx
1100 real(kind=rp) :: weight, len
1104 allocate(a(coef%Xh%lx, coef%Xh%lx, coef%Xh%lx, coef%msh%nelv))
1105 allocate(b(coef%Xh%lx, coef%Xh%lx, coef%Xh%lx, coef%msh%nelv))
1106 allocate(c(coef%Xh%lx, coef%Xh%lx, coef%Xh%lx, coef%msh%nelv))
1107 allocate(dot(coef%Xh%lx, coef%Xh%lx, coef%Xh%lx, coef%msh%nelv))
1111 a(i, 1, 1, 1) = coef%dyds(i, 1, 1, 1) * coef%dzdt(i, 1, 1, 1) &
1112 - coef%dzds(i, 1, 1, 1) * coef%dydt(i, 1, 1, 1)
1114 b(i, 1, 1, 1) = coef%dzds(i, 1, 1, 1) * coef%dxdt(i, 1, 1, 1) &
1115 - coef%dxds(i, 1, 1, 1) * coef%dzdt(i, 1, 1, 1)
1117 c(i, 1, 1, 1) = coef%dxds(i, 1, 1, 1) * coef%dydt(i, 1, 1, 1) &
1118 - coef%dyds(i, 1, 1, 1) * coef%dxdt(i, 1, 1, 1)
1122 dot(i, 1, 1, 1) = a(i, 1, 1, 1) * a(i, 1, 1, 1) &
1123 + b(i, 1, 1, 1) * b(i, 1, 1, 1) &
1124 + c(i, 1, 1, 1) * c(i, 1, 1, 1)
1127 do concurrent(e = 1:coef%msh%nelv)
1128 do concurrent(k = 1:coef%Xh%lx)
1129 do concurrent(j = 1:coef%Xh%lx)
1130 weight = coef%Xh%wy(j) * coef%Xh%wz(k)
1131 coef%area(j, k, 2, e) = sqrt(dot(lx, j, k, e)) * weight
1132 coef%area(j, k, 1, e) = sqrt(dot(1, j, k, e)) * weight
1133 coef%nx(j,k, 1, e) = -a(1, j, k, e)
1134 coef%nx(j,k, 2, e) = a(lx, j, k, e)
1135 coef%ny(j,k, 1, e) = -b(1, j, k, e)
1136 coef%ny(j,k, 2, e) = b(lx, j, k, e)
1137 coef%nz(j,k, 1, e) = -c(1, j, k, e)
1138 coef%nz(j,k, 2, e) = c(lx, j, k, e)
1145 a(i, 1, 1, 1) = coef%dydr(i, 1, 1, 1) * coef%dzdt(i, 1, 1, 1) &
1146 - coef%dzdr(i, 1, 1, 1) * coef%dydt(i, 1, 1, 1)
1148 b(i, 1, 1, 1) = coef%dzdr(i, 1, 1, 1) * coef%dxdt(i, 1, 1, 1) &
1149 - coef%dxdr(i, 1, 1, 1) * coef%dzdt(i, 1, 1, 1)
1151 c(i, 1, 1, 1) = coef%dxdr(i, 1, 1, 1) * coef%dydt(i, 1, 1, 1) &
1152 - coef%dydr(i, 1, 1, 1) * coef%dxdt(i, 1, 1, 1)
1156 dot(i, 1, 1, 1) = a(i, 1, 1, 1) * a(i, 1, 1, 1) &
1157 + b(i, 1, 1, 1) * b(i, 1, 1, 1) &
1158 + c(i, 1, 1, 1) * c(i, 1, 1, 1)
1161 do concurrent(e = 1:coef%msh%nelv)
1162 do concurrent(k = 1:coef%Xh%lx)
1163 do concurrent(j = 1:coef%Xh%lx)
1164 weight = coef%Xh%wx(j) * coef%Xh%wz(k)
1165 coef%area(j, k, 3, e) = sqrt(dot(j, 1, k, e)) * weight
1166 coef%area(j, k, 4, e) = sqrt(dot(j, lx, k, e)) * weight
1167 coef%nx(j,k, 3, e) = a(j, 1, k, e)
1168 coef%nx(j,k, 4, e) = -a(j, lx, k, e)
1169 coef%ny(j,k, 3, e) = b(j, 1, k, e)
1170 coef%ny(j,k, 4, e) = -b(j, lx, k, e)
1171 coef%nz(j,k, 3, e) = c(j, 1, k, e)
1172 coef%nz(j,k, 4, e) = -c(j, lx, k, e)
1179 a(i, 1, 1, 1) = coef%dydr(i, 1, 1, 1) * coef%dzds(i, 1, 1, 1) &
1180 - coef%dzdr(i, 1, 1, 1) * coef%dyds(i, 1, 1, 1)
1182 b(i, 1, 1, 1) = coef%dzdr(i, 1, 1, 1) * coef%dxds(i, 1, 1, 1) &
1183 - coef%dxdr(i, 1, 1, 1) * coef%dzds(i, 1, 1, 1)
1185 c(i, 1, 1, 1) = coef%dxdr(i, 1, 1, 1) * coef%dyds(i, 1, 1, 1) &
1186 - coef%dydr(i, 1, 1, 1) * coef%dxds(i, 1, 1, 1)
1190 dot(i, 1, 1, 1) = a(i, 1, 1, 1) * a(i, 1, 1, 1) &
1191 + b(i, 1, 1, 1) * b(i, 1, 1, 1) &
1192 + c(i, 1, 1, 1) * c(i, 1, 1, 1)
1195 do concurrent(e = 1:coef%msh%nelv)
1196 do concurrent(k = 1:coef%Xh%lx)
1197 do concurrent(j = 1:coef%Xh%lx)
1198 weight = coef%Xh%wx(j) * coef%Xh%wy(k)
1199 coef%area(j, k, 5, e) = sqrt(dot(j, k, 1, e)) * weight
1200 coef%area(j, k, 6, e) = sqrt(dot(j, k, lx, e)) * weight
1201 coef%nx(j,k, 5, e) = -a(j, k, 1, e)
1202 coef%nx(j,k, 6, e) = a(j, k, lx, e)
1203 coef%ny(j,k, 5, e) = -b(j, k, 1, e)
1204 coef%ny(j,k, 6, e) = b(j, k, lx, e)
1205 coef%nz(j,k, 5, e) = -c(j, k, 1, e)
1206 coef%nz(j,k, 6, e) = c(j, k, lx, e)
1212 do j = 1,
size(coef%nz)
1213 len = sqrt(coef%nx(j,1,1,1)**2 + &
1214 coef%ny(j,1,1,1)**2 + coef%nz(j,1,1,1)**2)
1215 if (len .gt. neko_eps)
then
1216 coef%nx(j,1,1,1) = coef%nx(j,1,1,1) / len
1217 coef%ny(j,1,1,1) = coef%ny(j,1,1,1) / len
1218 coef%nz(j,1,1,1) = coef%nz(j,1,1,1) / len
1227 if (neko_bcknd_device .eq. 1)
then
1229 call device_memcpy(coef%area, coef%area_d, n, &
1230 host_to_device, sync=.false.)
1231 call device_memcpy(coef%nx, coef%nx_d, n, &
1232 host_to_device, sync=.false.)
1233 call device_memcpy(coef%ny, coef%ny_d, n, &
1234 host_to_device, sync=.false.)
1235 call device_memcpy(coef%nz, coef%nz_d, n, &
1236 host_to_device, sync=.false.)