58 real(kind=
rp),
allocatable :: g11(:,:,:,:)
60 real(kind=
rp),
allocatable :: g22(:,:,:,:)
62 real(kind=
rp),
allocatable :: g33(:,:,:,:)
64 real(kind=
rp),
allocatable :: g12(:,:,:,:)
66 real(kind=
rp),
allocatable :: g13(:,:,:,:)
68 real(kind=
rp),
allocatable :: g23(:,:,:,:)
70 real(kind=
rp),
allocatable :: mult(:,:,:,:)
75 real(kind=
rp),
allocatable :: dxdr(:,:,:,:), dydr(:,:,:,:), dzdr(:,:,:,:)
76 real(kind=
rp),
allocatable :: dxds(:,:,:,:), dyds(:,:,:,:), dzds(:,:,:,:)
77 real(kind=
rp),
allocatable :: dxdt(:,:,:,:), dydt(:,:,:,:), dzdt(:,:,:,:)
81 real(kind=
rp),
allocatable :: drdx(:,:,:,:), drdy(:,:,:,:), drdz(:,:,:,:)
82 real(kind=
rp),
allocatable :: dsdx(:,:,:,:), dsdy(:,:,:,:), dsdz(:,:,:,:)
83 real(kind=
rp),
allocatable :: dtdx(:,:,:,:), dtdy(:,:,:,:), dtdz(:,:,:,:)
85 real(kind=
rp),
allocatable :: h1(:,:,:,:)
86 real(kind=
rp),
allocatable :: h2(:,:,:,:)
89 real(kind=
rp),
allocatable :: jac(:,:,:,:)
90 real(kind=
rp),
allocatable :: jacinv(:,:,:,:)
91 real(kind=
rp),
allocatable :: b(:,:,:,:)
92 real(kind=
rp),
allocatable :: binv(:,:,:,:)
94 real(kind=
rp),
allocatable :: area(:,:,:,:)
95 real(kind=
rp),
allocatable :: nx(:,:,:,:)
96 real(kind=
rp),
allocatable :: ny(:,:,:,:)
97 real(kind=
rp),
allocatable :: nz(:,:,:,:)
98 logical :: cyclic = .false.
99 integer,
allocatable :: cyc_msk(:)
100 real(kind=
rp),
allocatable :: r11(:)
101 real(kind=
rp),
allocatable :: r12(:)
104 real(kind=
rp) :: volume
109 type(
gs_t),
pointer :: gs_h=> null()
115 type(c_ptr) :: g11_d = c_null_ptr
116 type(c_ptr) :: g22_d = c_null_ptr
117 type(c_ptr) :: g33_d = c_null_ptr
118 type(c_ptr) :: g12_d = c_null_ptr
119 type(c_ptr) :: g13_d = c_null_ptr
120 type(c_ptr) :: g23_d = c_null_ptr
121 type(c_ptr) :: dxdr_d = c_null_ptr
122 type(c_ptr) :: dydr_d = c_null_ptr
123 type(c_ptr) :: dzdr_d = c_null_ptr
124 type(c_ptr) :: dxds_d = c_null_ptr
125 type(c_ptr) :: dyds_d = c_null_ptr
126 type(c_ptr) :: dzds_d = c_null_ptr
127 type(c_ptr) :: dxdt_d = c_null_ptr
128 type(c_ptr) :: dydt_d = c_null_ptr
129 type(c_ptr) :: dzdt_d = c_null_ptr
130 type(c_ptr) :: drdx_d = c_null_ptr
131 type(c_ptr) :: drdy_d = c_null_ptr
132 type(c_ptr) :: drdz_d = c_null_ptr
133 type(c_ptr) :: dsdx_d = c_null_ptr
134 type(c_ptr) :: dsdy_d = c_null_ptr
135 type(c_ptr) :: dsdz_d = c_null_ptr
136 type(c_ptr) :: dtdx_d = c_null_ptr
137 type(c_ptr) :: dtdy_d = c_null_ptr
138 type(c_ptr) :: dtdz_d = c_null_ptr
139 type(c_ptr) :: mult_d = c_null_ptr
140 type(c_ptr) :: h1_d = c_null_ptr
141 type(c_ptr) :: h2_d = c_null_ptr
142 type(c_ptr) :: jac_d = c_null_ptr
143 type(c_ptr) :: jacinv_d = c_null_ptr
144 type(c_ptr) :: b_d = c_null_ptr
145 type(c_ptr) :: binv_d = c_null_ptr
146 type(c_ptr) :: area_d = c_null_ptr
147 type(c_ptr) :: nx_d = c_null_ptr
148 type(c_ptr) :: ny_d = c_null_ptr
149 type(c_ptr) :: nz_d = c_null_ptr
150 type(c_ptr) :: cyc_msk_d = c_null_ptr
151 type(c_ptr) :: r11_d = c_null_ptr
152 type(c_ptr) :: r12_d = c_null_ptr
162 generic :: init => init_empty, init_all
215 class(
coef_t),
intent(inout) :: this
216 type(
gs_t),
intent(inout),
target :: gs_h
217 integer :: n, m, ncyc
220 this%msh => gs_h%dofmap%msh
221 this%Xh => gs_h%dofmap%Xh
222 this%dof => gs_h%dofmap
229 allocate(this%G11(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
230 allocate(this%G22(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
231 allocate(this%G33(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
232 allocate(this%G12(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
233 allocate(this%G13(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
234 allocate(this%G23(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
236 allocate(this%dxdr(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
237 allocate(this%dxds(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
238 allocate(this%dxdt(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
240 allocate(this%dydr(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
241 allocate(this%dyds(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
242 allocate(this%dydt(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
244 allocate(this%dzdr(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
245 allocate(this%dzds(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
246 allocate(this%dzdt(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
248 allocate(this%drdx(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
249 allocate(this%dsdx(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
250 allocate(this%dtdx(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
252 allocate(this%drdy(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
253 allocate(this%dsdy(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
254 allocate(this%dtdy(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
256 allocate(this%drdz(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
257 allocate(this%dsdz(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
258 allocate(this%dtdz(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
260 allocate(this%jac(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
261 allocate(this%jacinv(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
263 allocate(this%area(this%Xh%lx, this%Xh%ly, 6, this%msh%nelv))
264 allocate(this%nx(this%Xh%lx, this%Xh%ly, 6, this%msh%nelv))
265 allocate(this%ny(this%Xh%lx, this%Xh%ly, 6, this%msh%nelv))
266 allocate(this%nz(this%Xh%lx, this%Xh%ly, 6, this%msh%nelv))
268 allocate(this%B(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
269 allocate(this%Binv(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
271 allocate(this%h1(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
272 allocate(this%h2(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
274 allocate(this%mult(this%Xh%lx, this%Xh%ly, this%Xh%lz, this%msh%nelv))
281 n = this%Xh%lx * this%Xh%ly * this%Xh%lz * this%msh%nelv
319 call device_map(this%jacinv, this%jacinv_d, n)
323 m = this%Xh%lx * this%Xh%ly * 6 * this%msh%nelv
363 call rone(this%mult, n)
376 ncyc = this%msh%periodic%size * this%Xh%lx * this%Xh%lx
377 allocate(this%cyc_msk(0:ncyc))
378 allocate(this%R11(ncyc))
379 allocate(this%R12(ncyc))
381 call device_map(this%cyc_msk, this%cyc_msk_d, ncyc+1)
710 type(
coef_t),
intent(inout) :: c
711 integer :: e,i,lxy,lyz,ntot
717 associate(drdx => c%drdx, drdy => c%drdy, drdz => c%drdz, &
718 dsdx => c%dsdx, dsdy => c%dsdy, dsdz => c%dsdz, &
719 dtdx => c%dtdx, dtdy => c%dtdy, dtdz => c%dtdz, &
720 dxdr => c%dxdr, dydr => c%dydr, dzdr => c%dzdr, &
721 dxds => c%dxds, dyds => c%dyds, dzds => c%dzds, &
722 dxdt => c%dxdt, dydt => c%dydt, dzdt => c%dzdt, &
723 dx => c%Xh%dx, dy => c%Xh%dy, dz => c%Xh%dz, &
724 x => c%dof%x, y => c%dof%y, z => c%dof%z, &
725 lx => c%Xh%lx, ly => c%Xh%ly, lz => c%Xh%lz, &
726 dyt => c%Xh%dyt, dzt => c%Xh%dzt, &
727 jacinv => c%jacinv, jac => c%jac)
732 c%dsdx_d, c%dsdy_d, c%dsdz_d, c%dtdx_d, c%dtdy_d, c%dtdz_d, &
733 c%dxdr_d, c%dydr_d, c%dzdr_d, c%dxds_d, c%dyds_d, c%dzds_d, &
734 c%dxdt_d, c%dydt_d, c%dzdt_d, c%Xh%dx_d, c%Xh%dy_d, c%Xh%dz_d, &
735 c%dof%x_d, c%dof%y_d, c%dof%z_d, c%jacinv_d, c%jac_d, &
762 call mxm(dx, lx, x(1,1,1,e), lx, dxdr(1,1,1,e), lyz)
763 call mxm(dx, lx, y(1,1,1,e), lx, dydr(1,1,1,e), lyz)
764 call mxm(dx, lx, z(1,1,1,e), lx, dzdr(1,1,1,e), lyz)
767 call mxm(x(1,1,i,e), lx, dyt, ly, dxds(1,1,i,e), ly)
768 call mxm(y(1,1,i,e), lx, dyt, ly, dyds(1,1,i,e), ly)
769 call mxm(z(1,1,i,e), lx, dyt, ly, dzds(1,1,i,e), ly)
773 if(c%msh%gdim .eq. 3)
then
774 call mxm(x(1,1,1,e), lxy, dzt, lz, dxdt(1,1,1,e), lz)
775 call mxm(y(1,1,1,e), lxy, dzt, lz, dydt(1,1,1,e), lz)
776 call mxm(z(1,1,1,e), lxy, dzt, lz, dzdt(1,1,1,e), lz)
778 call rzero(dxdt(1,1,1,e), lxy)
779 call rzero(dydt(1,1,1,e), lxy)
780 call rone(dzdt(1,1,1,e), lxy)
784 if (c%msh%gdim .eq. 2)
then
785 call rzero (jac, ntot)
786 call addcol3 (jac, dxdr, dyds, ntot)
787 call subcol3 (jac, dxds, dydr, ntot)
788 call copy (drdx, dyds, ntot)
789 call copy (drdy, dxds, ntot)
791 call copy (dsdx, dydr, ntot)
793 call copy (dsdy, dxdr, ntot)
794 call rzero (drdz, ntot)
795 call rzero (dsdz, ntot)
796 call rone (dtdz, ntot)
800 c%jac(i, 1, 1, 1) = 0.0_rp
804 c%jac(i, 1, 1, 1) = c%jac(i, 1, 1, 1) + ( c%dxdr(i, 1, 1, 1) &
805 * c%dyds(i, 1, 1, 1) * c%dzdt(i, 1, 1, 1) )
807 c%jac(i, 1, 1, 1) = c%jac(i, 1, 1, 1) + ( c%dxdt(i, 1, 1, 1) &
808 * c%dydr(i, 1, 1, 1) * c%dzds(i, 1, 1, 1) )
810 c%jac(i, 1, 1, 1) = c%jac(i, 1, 1, 1) + ( c%dxds(i, 1, 1, 1) &
811 * c%dydt(i, 1, 1, 1) * c%dzdr(i, 1, 1, 1) )
815 c%jac(i, 1, 1, 1) = c%jac(i, 1, 1, 1) - ( c%dxdr(i, 1, 1, 1) &
816 * c%dydt(i, 1, 1, 1) * c%dzds(i, 1, 1, 1) )
818 c%jac(i, 1, 1, 1) = c%jac(i, 1, 1, 1) - ( c%dxds(i, 1, 1, 1) &
819 * c%dydr(i, 1, 1, 1) * c%dzdt(i, 1, 1, 1) )
821 c%jac(i, 1, 1, 1) = c%jac(i, 1, 1, 1) - ( c%dxdt(i, 1, 1, 1) &
822 * c%dyds(i, 1, 1, 1) * c%dzdr(i, 1, 1, 1) )
826 c%drdx(i, 1, 1, 1) = c%dyds(i, 1, 1, 1) * c%dzdt(i, 1, 1, 1) &
827 - c%dydt(i, 1, 1, 1) * c%dzds(i, 1, 1, 1)
829 c%drdy(i, 1, 1, 1) = c%dxdt(i, 1, 1, 1) * c%dzds(i, 1, 1, 1) &
830 - c%dxds(i, 1, 1, 1) * c%dzdt(i, 1, 1, 1)
832 c%drdz(i, 1, 1, 1) = c%dxds(i, 1, 1, 1) * c%dydt(i, 1, 1, 1) &
833 - c%dxdt(i, 1, 1, 1) * c%dyds(i, 1, 1, 1)
837 c%dsdx(i, 1, 1, 1) = c%dydt(i, 1, 1, 1) * c%dzdr(i, 1, 1, 1) &
838 - c%dydr(i, 1, 1, 1) * c%dzdt(i, 1, 1, 1)
840 c%dsdy(i, 1, 1, 1) = c%dxdr(i, 1, 1, 1) * c%dzdt(i, 1, 1, 1) &
841 - c%dxdt(i, 1, 1, 1) * c%dzdr(i, 1, 1, 1)
843 c%dsdz(i, 1, 1, 1) = c%dxdt(i, 1, 1, 1) * c%dydr(i, 1, 1, 1) &
844 - c%dxdr(i, 1, 1, 1) * c%dydt(i, 1, 1, 1)
848 c%dtdx(i, 1, 1, 1) = c%dydr(i, 1, 1, 1) * c%dzds(i, 1, 1, 1) &
849 - c%dyds(i, 1, 1, 1) * c%dzdr(i, 1, 1, 1)
851 c%dtdy(i, 1, 1, 1) = c%dxds(i, 1, 1, 1) * c%dzdr(i, 1, 1, 1) &
852 - c%dxdr(i, 1, 1, 1) * c%dzds(i, 1, 1, 1)
854 c%dtdz(i, 1, 1, 1) = c%dxdr(i, 1, 1, 1) * c%dyds(i, 1, 1, 1) &
855 - c%dxds(i, 1, 1, 1) * c%dydr(i, 1, 1, 1)
859 call invers2(jacinv, jac, ntot)
868 type(
coef_t),
intent(inout) :: c
869 integer :: e, i, lxyz, ntot
871 lxyz = c%Xh%lx * c%Xh%ly * c%Xh%lz
874 if (neko_bcknd_device .eq. 1)
then
876 call device_coef_generate_geo(c%G11_d, c%G12_d, c%G13_d, &
877 c%G22_d, c%G23_d, c%G33_d, &
878 c%drdx_d, c%drdy_d, c%drdz_d, &
879 c%dsdx_d, c%dsdy_d, c%dsdz_d, &
880 c%dtdx_d, c%dtdy_d, c%dtdz_d, &
881 c%jacinv_d, c%Xh%w3_d, c%msh%nelv, &
884 call device_memcpy(c%G11, c%G11_d, ntot, device_to_host, sync=.false.)
885 call device_memcpy(c%G22, c%G22_d, ntot, device_to_host, sync=.false.)
886 call device_memcpy(c%G33, c%G33_d, ntot, device_to_host, sync=.false.)
887 call device_memcpy(c%G12, c%G12_d, ntot, device_to_host, sync=.false.)
888 call device_memcpy(c%G13, c%G13_d, ntot, device_to_host, sync=.false.)
889 call device_memcpy(c%G23, c%G23_d, ntot, device_to_host, sync=.true.)
892 if(c%msh%gdim .eq. 2)
then
895 c%G11(i, 1, 1, 1) = c%drdx(i, 1, 1, 1) * c%drdx(i, 1, 1, 1) &
896 + c%drdy(i, 1, 1, 1) * c%drdy(i, 1, 1, 1)
898 c%G22(i, 1, 1, 1) = c%dsdx(i, 1, 1, 1) * c%dsdx(i, 1, 1, 1) &
899 + c%dsdy(i, 1, 1, 1) * c%dsdy(i, 1, 1, 1)
901 c%G12(i, 1, 1, 1) = c%drdx(i, 1, 1, 1) * c%dsdx(i, 1, 1, 1) &
902 + c%drdy(i, 1, 1, 1) * c%dsdy(i, 1, 1, 1)
906 c%G11(i, 1, 1, 1) = c%G11(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
907 c%G22(i, 1, 1, 1) = c%G22(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
908 c%G12(i, 1, 1, 1) = c%G12(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
909 c%G33(i, 1, 1, 1) = 0.0_rp
910 c%G13(i, 1, 1, 1) = 0.0_rp
911 c%G23(i, 1, 1, 1) = 0.0_rp
914 do concurrent(e = 1:c%msh%nelv)
915 do concurrent(i = 1:lxyz)
916 c%G11(i,1,1,e) = c%G11(i,1,1,e) * c%Xh%w3(i,1,1)
917 c%G22(i,1,1,e) = c%G22(i,1,1,e) * c%Xh%w3(i,1,1)
918 c%G12(i,1,1,e) = c%G12(i,1,1,e) * c%Xh%w3(i,1,1)
925 c%G11(i, 1, 1, 1) = c%drdx(i, 1, 1, 1) * c%drdx(i, 1, 1, 1) &
926 + c%drdy(i, 1, 1, 1) * c%drdy(i, 1, 1, 1) &
927 + c%drdz(i, 1, 1, 1) * c%drdz(i, 1, 1, 1)
929 c%G22(i, 1, 1, 1) = c%dsdx(i, 1, 1, 1) * c%dsdx(i, 1, 1, 1) &
930 + c%dsdy(i, 1, 1, 1) * c%dsdy(i, 1, 1, 1) &
931 + c%dsdz(i, 1, 1, 1) * c%dsdz(i, 1, 1, 1)
933 c%G33(i, 1, 1, 1) = c%dtdx(i, 1, 1, 1) * c%dtdx(i, 1, 1, 1) &
934 + c%dtdy(i, 1, 1, 1) * c%dtdy(i, 1, 1, 1) &
935 + c%dtdz(i, 1, 1, 1) * c%dtdz(i, 1, 1, 1)
939 c%G11(i, 1, 1, 1) = c%G11(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
940 c%G22(i, 1, 1, 1) = c%G22(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
941 c%G33(i, 1, 1, 1) = c%G33(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
945 c%G12(i, 1, 1, 1) = c%drdx(i, 1, 1, 1) * c%dsdx(i, 1, 1, 1) &
946 + c%drdy(i, 1, 1, 1) * c%dsdy(i, 1, 1, 1) &
947 + c%drdz(i, 1, 1, 1) * c%dsdz(i, 1, 1, 1)
949 c%G13(i, 1, 1, 1) = c%drdx(i, 1, 1, 1) * c%dtdx(i, 1, 1, 1) &
950 + c%drdy(i, 1, 1, 1) * c%dtdy(i, 1, 1, 1) &
951 + c%drdz(i, 1, 1, 1) * c%dtdz(i, 1, 1, 1)
953 c%G23(i, 1, 1, 1) = c%dsdx(i, 1, 1, 1) * c%dtdx(i, 1, 1, 1) &
954 + c%dsdy(i, 1, 1, 1) * c%dtdy(i, 1, 1, 1) &
955 + c%dsdz(i, 1, 1, 1) * c%dtdz(i, 1, 1, 1)
959 c%G12(i, 1, 1, 1) = c%G12(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
960 c%G13(i, 1, 1, 1) = c%G13(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
961 c%G23(i, 1, 1, 1) = c%G23(i, 1, 1, 1) * c%jacinv(i, 1, 1, 1)
964 do concurrent(e = 1:c%msh%nelv)
965 do concurrent(i = 1:lxyz)
966 c%G11(i,1,1,e) = c%G11(i,1,1,e) * c%Xh%w3(i,1,1)
967 c%G22(i,1,1,e) = c%G22(i,1,1,e) * c%Xh%w3(i,1,1)
968 c%G12(i,1,1,e) = c%G12(i,1,1,e) * c%Xh%w3(i,1,1)
970 c%G33(i,1,1,e) = c%G33(i,1,1,e) * c%Xh%w3(i,1,1)
971 c%G13(i,1,1,e) = c%G13(i,1,1,e) * c%Xh%w3(i,1,1)
972 c%G23(i,1,1,e) = c%G23(i,1,1,e) * c%Xh%w3(i,1,1)
1061 type(
coef_t),
intent(inout) :: coef
1062 real(kind=rp),
allocatable :: a(:,:,:,:)
1063 real(kind=rp),
allocatable :: b(:,:,:,:)
1064 real(kind=rp),
allocatable :: c(:,:,:,:)
1065 real(kind=rp),
allocatable :: dot(:,:,:,:)
1066 integer :: n, e, i, j, k, lx
1067 real(kind=rp) :: weight, len
1071 allocate(a(coef%Xh%lx, coef%Xh%lx, coef%Xh%lx, coef%msh%nelv))
1072 allocate(b(coef%Xh%lx, coef%Xh%lx, coef%Xh%lx, coef%msh%nelv))
1073 allocate(c(coef%Xh%lx, coef%Xh%lx, coef%Xh%lx, coef%msh%nelv))
1074 allocate(dot(coef%Xh%lx, coef%Xh%lx, coef%Xh%lx, coef%msh%nelv))
1078 a(i, 1, 1, 1) = coef%dyds(i, 1, 1, 1) * coef%dzdt(i, 1, 1, 1) &
1079 - coef%dzds(i, 1, 1, 1) * coef%dydt(i, 1, 1, 1)
1081 b(i, 1, 1, 1) = coef%dzds(i, 1, 1, 1) * coef%dxdt(i, 1, 1, 1) &
1082 - coef%dxds(i, 1, 1, 1) * coef%dzdt(i, 1, 1, 1)
1084 c(i, 1, 1, 1) = coef%dxds(i, 1, 1, 1) * coef%dydt(i, 1, 1, 1) &
1085 - coef%dyds(i, 1, 1, 1) * coef%dxdt(i, 1, 1, 1)
1089 dot(i, 1, 1, 1) = a(i, 1, 1, 1) * a(i, 1, 1, 1) &
1090 + b(i, 1, 1, 1) * b(i, 1, 1, 1) &
1091 + c(i, 1, 1, 1) * c(i, 1, 1, 1)
1094 do concurrent(e = 1:coef%msh%nelv)
1095 do concurrent(k = 1:coef%Xh%lx)
1096 do concurrent(j = 1:coef%Xh%lx)
1097 weight = coef%Xh%wy(j) * coef%Xh%wz(k)
1098 coef%area(j, k, 2, e) = sqrt(dot(lx, j, k, e)) * weight
1099 coef%area(j, k, 1, e) = sqrt(dot(1, j, k, e)) * weight
1100 coef%nx(j,k, 1, e) = -a(1, j, k, e)
1101 coef%nx(j,k, 2, e) = a(lx, j, k, e)
1102 coef%ny(j,k, 1, e) = -b(1, j, k, e)
1103 coef%ny(j,k, 2, e) = b(lx, j, k, e)
1104 coef%nz(j,k, 1, e) = -c(1, j, k, e)
1105 coef%nz(j,k, 2, e) = c(lx, j, k, e)
1112 a(i, 1, 1, 1) = coef%dydr(i, 1, 1, 1) * coef%dzdt(i, 1, 1, 1) &
1113 - coef%dzdr(i, 1, 1, 1) * coef%dydt(i, 1, 1, 1)
1115 b(i, 1, 1, 1) = coef%dzdr(i, 1, 1, 1) * coef%dxdt(i, 1, 1, 1) &
1116 - coef%dxdr(i, 1, 1, 1) * coef%dzdt(i, 1, 1, 1)
1118 c(i, 1, 1, 1) = coef%dxdr(i, 1, 1, 1) * coef%dydt(i, 1, 1, 1) &
1119 - coef%dydr(i, 1, 1, 1) * coef%dxdt(i, 1, 1, 1)
1123 dot(i, 1, 1, 1) = a(i, 1, 1, 1) * a(i, 1, 1, 1) &
1124 + b(i, 1, 1, 1) * b(i, 1, 1, 1) &
1125 + c(i, 1, 1, 1) * c(i, 1, 1, 1)
1128 do concurrent(e = 1:coef%msh%nelv)
1129 do concurrent(k = 1:coef%Xh%lx)
1130 do concurrent(j = 1:coef%Xh%lx)
1131 weight = coef%Xh%wx(j) * coef%Xh%wz(k)
1132 coef%area(j, k, 3, e) = sqrt(dot(j, 1, k, e)) * weight
1133 coef%area(j, k, 4, e) = sqrt(dot(j, lx, k, e)) * weight
1134 coef%nx(j,k, 3, e) = a(j, 1, k, e)
1135 coef%nx(j,k, 4, e) = -a(j, lx, k, e)
1136 coef%ny(j,k, 3, e) = b(j, 1, k, e)
1137 coef%ny(j,k, 4, e) = -b(j, lx, k, e)
1138 coef%nz(j,k, 3, e) = c(j, 1, k, e)
1139 coef%nz(j,k, 4, e) = -c(j, lx, k, e)
1146 a(i, 1, 1, 1) = coef%dydr(i, 1, 1, 1) * coef%dzds(i, 1, 1, 1) &
1147 - coef%dzdr(i, 1, 1, 1) * coef%dyds(i, 1, 1, 1)
1149 b(i, 1, 1, 1) = coef%dzdr(i, 1, 1, 1) * coef%dxds(i, 1, 1, 1) &
1150 - coef%dxdr(i, 1, 1, 1) * coef%dzds(i, 1, 1, 1)
1152 c(i, 1, 1, 1) = coef%dxdr(i, 1, 1, 1) * coef%dyds(i, 1, 1, 1) &
1153 - coef%dydr(i, 1, 1, 1) * coef%dxds(i, 1, 1, 1)
1157 dot(i, 1, 1, 1) = a(i, 1, 1, 1) * a(i, 1, 1, 1) &
1158 + b(i, 1, 1, 1) * b(i, 1, 1, 1) &
1159 + c(i, 1, 1, 1) * c(i, 1, 1, 1)
1162 do concurrent(e = 1:coef%msh%nelv)
1163 do concurrent(k = 1:coef%Xh%lx)
1164 do concurrent(j = 1:coef%Xh%lx)
1165 weight = coef%Xh%wx(j) * coef%Xh%wy(k)
1166 coef%area(j, k, 5, e) = sqrt(dot(j, k, 1, e)) * weight
1167 coef%area(j, k, 6, e) = sqrt(dot(j, k, lx, e)) * weight
1168 coef%nx(j,k, 5, e) = -a(j, k, 1, e)
1169 coef%nx(j,k, 6, e) = a(j, k, lx, e)
1170 coef%ny(j,k, 5, e) = -b(j, k, 1, e)
1171 coef%ny(j,k, 6, e) = b(j, k, lx, e)
1172 coef%nz(j,k, 5, e) = -c(j, k, 1, e)
1173 coef%nz(j,k, 6, e) = c(j, k, lx, e)
1179 do j = 1,
size(coef%nz)
1180 len = sqrt(coef%nx(j,1,1,1)**2 + &
1181 coef%ny(j,1,1,1)**2 + coef%nz(j,1,1,1)**2)
1182 if (len .gt. neko_eps)
then
1183 coef%nx(j,1,1,1) = coef%nx(j,1,1,1) / len
1184 coef%ny(j,1,1,1) = coef%ny(j,1,1,1) / len
1185 coef%nz(j,1,1,1) = coef%nz(j,1,1,1) / len
1194 if (neko_bcknd_device .eq. 1)
then
1196 call device_memcpy(coef%area, coef%area_d, n, &
1197 host_to_device, sync=.false.)
1198 call device_memcpy(coef%nx, coef%nx_d, n, &
1199 host_to_device, sync=.false.)
1200 call device_memcpy(coef%ny, coef%ny_d, n, &
1201 host_to_device, sync=.false.)
1202 call device_memcpy(coef%nz, coef%nz_d, n, &
1203 host_to_device, sync=.false.)