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, &
780 call mxm(dx, lx, x(1,1,1,e), lx, dxdr(1,1,1,e), lyz)
781 call mxm(dx, lx, y(1,1,1,e), lx, dydr(1,1,1,e), lyz)
782 call mxm(dx, lx, z(1,1,1,e), lx, dzdr(1,1,1,e), lyz)
785 call mxm(x(1,1,i,e), lx, dyt, ly, dxds(1,1,i,e), ly)
786 call mxm(y(1,1,i,e), lx, dyt, ly, dyds(1,1,i,e), ly)
787 call mxm(z(1,1,i,e), lx, dyt, ly, dzds(1,1,i,e), ly)
791 if(c%msh%gdim .eq. 3)
then
792 call mxm(x(1,1,1,e), lxy, dzt, lz, dxdt(1,1,1,e), lz)
793 call mxm(y(1,1,1,e), lxy, dzt, lz, dydt(1,1,1,e), lz)
794 call mxm(z(1,1,1,e), lxy, dzt, lz, dzdt(1,1,1,e), lz)
796 call rzero(dxdt(1,1,1,e), lxy)
797 call rzero(dydt(1,1,1,e), lxy)
798 call rone(dzdt(1,1,1,e), lxy)
802 if (c%msh%gdim .eq. 2)
then
803 call rzero (jac, ntot)
804 call addcol3 (jac, dxdr, dyds, ntot)
805 call subcol3 (jac, dxds, dydr, ntot)
806 call copy (drdx, dyds, ntot)
807 call copy (drdy, dxds, ntot)
809 call copy (dsdx, dydr, ntot)
811 call copy (dsdy, dxdr, ntot)
812 call rzero (drdz, ntot)
813 call rzero (dsdz, ntot)
814 call rone (dtdz, ntot)
818 c%jac(i, 1, 1, 1) = 0.0_rp
822 c%jac(i, 1, 1, 1) = c%jac(i, 1, 1, 1) + ( c%dxdr(i, 1, 1, 1) &
823 * c%dyds(i, 1, 1, 1) * c%dzdt(i, 1, 1, 1) )
825 c%jac(i, 1, 1, 1) = c%jac(i, 1, 1, 1) + ( c%dxdt(i, 1, 1, 1) &
826 * c%dydr(i, 1, 1, 1) * c%dzds(i, 1, 1, 1) )
828 c%jac(i, 1, 1, 1) = c%jac(i, 1, 1, 1) + ( c%dxds(i, 1, 1, 1) &
829 * c%dydt(i, 1, 1, 1) * c%dzdr(i, 1, 1, 1) )
833 c%jac(i, 1, 1, 1) = c%jac(i, 1, 1, 1) - ( c%dxdr(i, 1, 1, 1) &
834 * c%dydt(i, 1, 1, 1) * c%dzds(i, 1, 1, 1) )
836 c%jac(i, 1, 1, 1) = c%jac(i, 1, 1, 1) - ( c%dxds(i, 1, 1, 1) &
837 * c%dydr(i, 1, 1, 1) * c%dzdt(i, 1, 1, 1) )
839 c%jac(i, 1, 1, 1) = c%jac(i, 1, 1, 1) - ( c%dxdt(i, 1, 1, 1) &
840 * c%dyds(i, 1, 1, 1) * c%dzdr(i, 1, 1, 1) )
844 c%drdx(i, 1, 1, 1) = c%dyds(i, 1, 1, 1) * c%dzdt(i, 1, 1, 1) &
845 - c%dydt(i, 1, 1, 1) * c%dzds(i, 1, 1, 1)
847 c%drdy(i, 1, 1, 1) = c%dxdt(i, 1, 1, 1) * c%dzds(i, 1, 1, 1) &
848 - c%dxds(i, 1, 1, 1) * c%dzdt(i, 1, 1, 1)
850 c%drdz(i, 1, 1, 1) = c%dxds(i, 1, 1, 1) * c%dydt(i, 1, 1, 1) &
851 - c%dxdt(i, 1, 1, 1) * c%dyds(i, 1, 1, 1)
855 c%dsdx(i, 1, 1, 1) = c%dydt(i, 1, 1, 1) * c%dzdr(i, 1, 1, 1) &
856 - c%dydr(i, 1, 1, 1) * c%dzdt(i, 1, 1, 1)
858 c%dsdy(i, 1, 1, 1) = c%dxdr(i, 1, 1, 1) * c%dzdt(i, 1, 1, 1) &
859 - c%dxdt(i, 1, 1, 1) * c%dzdr(i, 1, 1, 1)
861 c%dsdz(i, 1, 1, 1) = c%dxdt(i, 1, 1, 1) * c%dydr(i, 1, 1, 1) &
862 - c%dxdr(i, 1, 1, 1) * c%dydt(i, 1, 1, 1)
866 c%dtdx(i, 1, 1, 1) = c%dydr(i, 1, 1, 1) * c%dzds(i, 1, 1, 1) &
867 - c%dyds(i, 1, 1, 1) * c%dzdr(i, 1, 1, 1)
869 c%dtdy(i, 1, 1, 1) = c%dxds(i, 1, 1, 1) * c%dzdr(i, 1, 1, 1) &
870 - c%dxdr(i, 1, 1, 1) * c%dzds(i, 1, 1, 1)
872 c%dtdz(i, 1, 1, 1) = c%dxdr(i, 1, 1, 1) * c%dyds(i, 1, 1, 1) &
873 - c%dxds(i, 1, 1, 1) * c%dydr(i, 1, 1, 1)
877 call invers2(jacinv, jac, ntot)
886 type(
coef_t),
intent(inout) :: c
887 integer :: e, i, lxyz, ntot
889 lxyz = c%Xh%lx * c%Xh%ly * c%Xh%lz
892 if (neko_bcknd_device .eq. 1)
then
894 call device_coef_generate_geo(c%G11_d, c%G12_d, c%G13_d, &
895 c%G22_d, c%G23_d, c%G33_d, &
896 c%drdx_d, c%drdy_d, c%drdz_d, &
897 c%dsdx_d, c%dsdy_d, c%dsdz_d, &
898 c%dtdx_d, c%dtdy_d, c%dtdz_d, &
899 c%jacinv_d, c%Xh%w3_d, c%msh%nelv, &
902 call device_memcpy(c%G11, c%G11_d, ntot, device_to_host, sync=.false.)
903 call device_memcpy(c%G22, c%G22_d, ntot, device_to_host, sync=.false.)
904 call device_memcpy(c%G33, c%G33_d, ntot, device_to_host, sync=.false.)
905 call device_memcpy(c%G12, c%G12_d, ntot, device_to_host, sync=.false.)
906 call device_memcpy(c%G13, c%G13_d, ntot, device_to_host, sync=.false.)
907 call device_memcpy(c%G23, c%G23_d, ntot, device_to_host, sync=.true.)
910 if(c%msh%gdim .eq. 2)
then
913 c%G11(i, 1, 1, 1) = c%drdx(i, 1, 1, 1) * c%drdx(i, 1, 1, 1) &
914 + c%drdy(i, 1, 1, 1) * c%drdy(i, 1, 1, 1)
916 c%G22(i, 1, 1, 1) = c%dsdx(i, 1, 1, 1) * c%dsdx(i, 1, 1, 1) &
917 + c%dsdy(i, 1, 1, 1) * c%dsdy(i, 1, 1, 1)
919 c%G12(i, 1, 1, 1) = c%drdx(i, 1, 1, 1) * c%dsdx(i, 1, 1, 1) &
920 + c%drdy(i, 1, 1, 1) * c%dsdy(i, 1, 1, 1)
924 c%G11(i, 1, 1, 1) = c%G11(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
925 c%G22(i, 1, 1, 1) = c%G22(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
926 c%G12(i, 1, 1, 1) = c%G12(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
927 c%G33(i, 1, 1, 1) = 0.0_rp
928 c%G13(i, 1, 1, 1) = 0.0_rp
929 c%G23(i, 1, 1, 1) = 0.0_rp
932 do concurrent(e = 1:c%msh%nelv)
933 do concurrent(i = 1:lxyz)
934 c%G11(i,1,1,e) = c%G11(i,1,1,e) * c%Xh%w3(i,1,1)
935 c%G22(i,1,1,e) = c%G22(i,1,1,e) * c%Xh%w3(i,1,1)
936 c%G12(i,1,1,e) = c%G12(i,1,1,e) * c%Xh%w3(i,1,1)
943 c%G11(i, 1, 1, 1) = c%drdx(i, 1, 1, 1) * c%drdx(i, 1, 1, 1) &
944 + c%drdy(i, 1, 1, 1) * c%drdy(i, 1, 1, 1) &
945 + c%drdz(i, 1, 1, 1) * c%drdz(i, 1, 1, 1)
947 c%G22(i, 1, 1, 1) = c%dsdx(i, 1, 1, 1) * c%dsdx(i, 1, 1, 1) &
948 + c%dsdy(i, 1, 1, 1) * c%dsdy(i, 1, 1, 1) &
949 + c%dsdz(i, 1, 1, 1) * c%dsdz(i, 1, 1, 1)
951 c%G33(i, 1, 1, 1) = c%dtdx(i, 1, 1, 1) * c%dtdx(i, 1, 1, 1) &
952 + c%dtdy(i, 1, 1, 1) * c%dtdy(i, 1, 1, 1) &
953 + c%dtdz(i, 1, 1, 1) * c%dtdz(i, 1, 1, 1)
957 c%G11(i, 1, 1, 1) = c%G11(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
958 c%G22(i, 1, 1, 1) = c%G22(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
959 c%G33(i, 1, 1, 1) = c%G33(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
963 c%G12(i, 1, 1, 1) = c%drdx(i, 1, 1, 1) * c%dsdx(i, 1, 1, 1) &
964 + c%drdy(i, 1, 1, 1) * c%dsdy(i, 1, 1, 1) &
965 + c%drdz(i, 1, 1, 1) * c%dsdz(i, 1, 1, 1)
967 c%G13(i, 1, 1, 1) = c%drdx(i, 1, 1, 1) * c%dtdx(i, 1, 1, 1) &
968 + c%drdy(i, 1, 1, 1) * c%dtdy(i, 1, 1, 1) &
969 + c%drdz(i, 1, 1, 1) * c%dtdz(i, 1, 1, 1)
971 c%G23(i, 1, 1, 1) = c%dsdx(i, 1, 1, 1) * c%dtdx(i, 1, 1, 1) &
972 + c%dsdy(i, 1, 1, 1) * c%dtdy(i, 1, 1, 1) &
973 + c%dsdz(i, 1, 1, 1) * c%dtdz(i, 1, 1, 1)
977 c%G12(i, 1, 1, 1) = c%G12(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
978 c%G13(i, 1, 1, 1) = c%G13(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
979 c%G23(i, 1, 1, 1) = c%G23(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
982 do concurrent(e = 1:c%msh%nelv)
983 do concurrent(i = 1:lxyz)
984 c%G11(i,1,1,e) = c%G11(i,1,1,e) * c%Xh%w3(i,1,1)
985 c%G22(i,1,1,e) = c%G22(i,1,1,e) * c%Xh%w3(i,1,1)
986 c%G12(i,1,1,e) = c%G12(i,1,1,e) * c%Xh%w3(i,1,1)
988 c%G33(i,1,1,e) = c%G33(i,1,1,e) * c%Xh%w3(i,1,1)
989 c%G13(i,1,1,e) = c%G13(i,1,1,e) * c%Xh%w3(i,1,1)
990 c%G23(i,1,1,e) = c%G23(i,1,1,e) * c%Xh%w3(i,1,1)
1079 type(
coef_t),
intent(inout) :: coef
1080 real(kind=rp),
allocatable :: a(:,:,:,:)
1081 real(kind=rp),
allocatable :: b(:,:,:,:)
1082 real(kind=rp),
allocatable :: c(:,:,:,:)
1083 real(kind=rp),
allocatable :: dot(:,:,:,:)
1084 integer :: n, e, i, j, k, lx
1085 real(kind=rp) :: weight, len
1089 allocate(a(coef%Xh%lx, coef%Xh%lx, coef%Xh%lx, coef%msh%nelv))
1090 allocate(b(coef%Xh%lx, coef%Xh%lx, coef%Xh%lx, coef%msh%nelv))
1091 allocate(c(coef%Xh%lx, coef%Xh%lx, coef%Xh%lx, coef%msh%nelv))
1092 allocate(dot(coef%Xh%lx, coef%Xh%lx, coef%Xh%lx, coef%msh%nelv))
1096 a(i, 1, 1, 1) = coef%dyds(i, 1, 1, 1) * coef%dzdt(i, 1, 1, 1) &
1097 - coef%dzds(i, 1, 1, 1) * coef%dydt(i, 1, 1, 1)
1099 b(i, 1, 1, 1) = coef%dzds(i, 1, 1, 1) * coef%dxdt(i, 1, 1, 1) &
1100 - coef%dxds(i, 1, 1, 1) * coef%dzdt(i, 1, 1, 1)
1102 c(i, 1, 1, 1) = coef%dxds(i, 1, 1, 1) * coef%dydt(i, 1, 1, 1) &
1103 - coef%dyds(i, 1, 1, 1) * coef%dxdt(i, 1, 1, 1)
1107 dot(i, 1, 1, 1) = a(i, 1, 1, 1) * a(i, 1, 1, 1) &
1108 + b(i, 1, 1, 1) * b(i, 1, 1, 1) &
1109 + c(i, 1, 1, 1) * c(i, 1, 1, 1)
1112 do concurrent(e = 1:coef%msh%nelv)
1113 do concurrent(k = 1:coef%Xh%lx)
1114 do concurrent(j = 1:coef%Xh%lx)
1115 weight = coef%Xh%wy(j) * coef%Xh%wz(k)
1116 coef%area(j, k, 2, e) = sqrt(dot(lx, j, k, e)) * weight
1117 coef%area(j, k, 1, e) = sqrt(dot(1, j, k, e)) * weight
1118 coef%nx(j,k, 1, e) = -a(1, j, k, e)
1119 coef%nx(j,k, 2, e) = a(lx, j, k, e)
1120 coef%ny(j,k, 1, e) = -b(1, j, k, e)
1121 coef%ny(j,k, 2, e) = b(lx, j, k, e)
1122 coef%nz(j,k, 1, e) = -c(1, j, k, e)
1123 coef%nz(j,k, 2, e) = c(lx, j, k, e)
1130 a(i, 1, 1, 1) = coef%dydr(i, 1, 1, 1) * coef%dzdt(i, 1, 1, 1) &
1131 - coef%dzdr(i, 1, 1, 1) * coef%dydt(i, 1, 1, 1)
1133 b(i, 1, 1, 1) = coef%dzdr(i, 1, 1, 1) * coef%dxdt(i, 1, 1, 1) &
1134 - coef%dxdr(i, 1, 1, 1) * coef%dzdt(i, 1, 1, 1)
1136 c(i, 1, 1, 1) = coef%dxdr(i, 1, 1, 1) * coef%dydt(i, 1, 1, 1) &
1137 - coef%dydr(i, 1, 1, 1) * coef%dxdt(i, 1, 1, 1)
1141 dot(i, 1, 1, 1) = a(i, 1, 1, 1) * a(i, 1, 1, 1) &
1142 + b(i, 1, 1, 1) * b(i, 1, 1, 1) &
1143 + c(i, 1, 1, 1) * c(i, 1, 1, 1)
1146 do concurrent(e = 1:coef%msh%nelv)
1147 do concurrent(k = 1:coef%Xh%lx)
1148 do concurrent(j = 1:coef%Xh%lx)
1149 weight = coef%Xh%wx(j) * coef%Xh%wz(k)
1150 coef%area(j, k, 3, e) = sqrt(dot(j, 1, k, e)) * weight
1151 coef%area(j, k, 4, e) = sqrt(dot(j, lx, k, e)) * weight
1152 coef%nx(j,k, 3, e) = a(j, 1, k, e)
1153 coef%nx(j,k, 4, e) = -a(j, lx, k, e)
1154 coef%ny(j,k, 3, e) = b(j, 1, k, e)
1155 coef%ny(j,k, 4, e) = -b(j, lx, k, e)
1156 coef%nz(j,k, 3, e) = c(j, 1, k, e)
1157 coef%nz(j,k, 4, e) = -c(j, lx, k, e)
1164 a(i, 1, 1, 1) = coef%dydr(i, 1, 1, 1) * coef%dzds(i, 1, 1, 1) &
1165 - coef%dzdr(i, 1, 1, 1) * coef%dyds(i, 1, 1, 1)
1167 b(i, 1, 1, 1) = coef%dzdr(i, 1, 1, 1) * coef%dxds(i, 1, 1, 1) &
1168 - coef%dxdr(i, 1, 1, 1) * coef%dzds(i, 1, 1, 1)
1170 c(i, 1, 1, 1) = coef%dxdr(i, 1, 1, 1) * coef%dyds(i, 1, 1, 1) &
1171 - coef%dydr(i, 1, 1, 1) * coef%dxds(i, 1, 1, 1)
1175 dot(i, 1, 1, 1) = a(i, 1, 1, 1) * a(i, 1, 1, 1) &
1176 + b(i, 1, 1, 1) * b(i, 1, 1, 1) &
1177 + c(i, 1, 1, 1) * c(i, 1, 1, 1)
1180 do concurrent(e = 1:coef%msh%nelv)
1181 do concurrent(k = 1:coef%Xh%lx)
1182 do concurrent(j = 1:coef%Xh%lx)
1183 weight = coef%Xh%wx(j) * coef%Xh%wy(k)
1184 coef%area(j, k, 5, e) = sqrt(dot(j, k, 1, e)) * weight
1185 coef%area(j, k, 6, e) = sqrt(dot(j, k, lx, e)) * weight
1186 coef%nx(j,k, 5, e) = -a(j, k, 1, e)
1187 coef%nx(j,k, 6, e) = a(j, k, lx, e)
1188 coef%ny(j,k, 5, e) = -b(j, k, 1, e)
1189 coef%ny(j,k, 6, e) = b(j, k, lx, e)
1190 coef%nz(j,k, 5, e) = -c(j, k, 1, e)
1191 coef%nz(j,k, 6, e) = c(j, k, lx, e)
1197 do j = 1,
size(coef%nz)
1198 len = sqrt(coef%nx(j,1,1,1)**2 + &
1199 coef%ny(j,1,1,1)**2 + coef%nz(j,1,1,1)**2)
1200 if (len .gt. neko_eps)
then
1201 coef%nx(j,1,1,1) = coef%nx(j,1,1,1) / len
1202 coef%ny(j,1,1,1) = coef%ny(j,1,1,1) / len
1203 coef%nz(j,1,1,1) = coef%nz(j,1,1,1) / len
1212 if (neko_bcknd_device .eq. 1)
then
1214 call device_memcpy(coef%area, coef%area_d, n, &
1215 host_to_device, sync=.false.)
1216 call device_memcpy(coef%nx, coef%nx_d, n, &
1217 host_to_device, sync=.false.)
1218 call device_memcpy(coef%ny, coef%ny_d, n, &
1219 host_to_device, sync=.false.)
1220 call device_memcpy(coef%nz, coef%nz_d, n, &
1221 host_to_device, sync=.false.)