240 type(
mesh_t),
pointer :: msh
244 integer(kind=i8) :: num_dofs_edges(3)
245 integer(kind=i8) :: edge_id, edge_offset
246 logical :: shared_dof
252 num_dofs_edges(1) = int(xh%lx - 2,
i8)
253 num_dofs_edges(2) = int(xh%ly - 2,
i8)
254 num_dofs_edges(3) = int(xh%lz - 2,
i8)
255 edge_offset = int(msh%glb_mpts,
i8) + int(1,
i8)
260 select type (ep => msh%elements(i)%e)
265 shared_dof = msh%is_shared_edge(i, 1)
266 global_id = msh%get_global_edge(i, 1)
267 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
269 if (this%dof(1,1,1,i) .gt. this%dof(xh%lx, 1, 1, i))
then
270 do concurrent(j = 2:xh%lx - 1)
272 this%dof(k, 1, 1, i) = edge_id + (j-2)
273 this%shared_dof(k, 1, 1, i) = shared_dof
276 do concurrent(j = 2:xh%lx - 1)
278 this%dof(k, 1, 1, i) = edge_id + (j-2)
279 this%shared_dof(k, 1, 1, i) = shared_dof
283 shared_dof = msh%is_shared_edge(i, 3)
284 global_id = msh%get_global_edge(i, 3)
285 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
286 if (this%dof(1, 1, xh%lz, i) .gt. this%dof(xh%lx, 1, xh%lz, i))
then
287 do concurrent(j = 2:xh%lx - 1)
289 this%dof(k, 1, xh%lz, i) = edge_id + (j-2)
290 this%shared_dof(k, 1, xh%lz, i) = shared_dof
293 do concurrent(j = 2:xh%lx - 1)
295 this%dof(k, 1, xh%lz, i) = edge_id + (j-2)
296 this%shared_dof(k, 1, xh%lz, i) = shared_dof
300 shared_dof = msh%is_shared_edge(i, 2)
301 global_id = msh%get_global_edge(i, 2)
302 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
303 if (this%dof(1, xh%ly, 1, i) .gt. this%dof(xh%lx, xh%ly, 1, i))
then
304 do concurrent(j = 2:xh%lx - 1)
306 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
307 this%shared_dof(k, xh%ly, 1, i) = shared_dof
310 do concurrent(j = 2:xh%lx - 1)
312 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
313 this%shared_dof(k, xh%ly, 1, i) = shared_dof
317 shared_dof = msh%is_shared_edge(i, 4)
318 global_id = msh%get_global_edge(i, 4)
319 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
320 if (this%dof(1, xh%ly, xh%lz, i) .gt. &
321 this%dof(xh%lx, xh%ly, xh%lz, i))
then
322 do concurrent(j = 2:xh%lx - 1)
324 this%dof(k, xh%ly, xh%lz, i) = edge_id + (j-2)
325 this%shared_dof(k, xh%ly, xh%lz, i) = shared_dof
328 do concurrent(j = 2:xh%lx - 1)
330 this%dof(k, xh%ly, xh%lz, i) = edge_id + (j-2)
331 this%shared_dof(k, xh%ly, xh%lz, i) = shared_dof
339 shared_dof = msh%is_shared_edge(i, 5)
340 global_id = msh%get_global_edge(i, 5)
341 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
342 if (this%dof(1,1,1,i) .gt. this%dof(1, xh%ly, 1, i))
then
343 do concurrent(j = 2:xh%ly - 1)
345 this%dof(1, k, 1, i) = edge_id + (j-2)
346 this%shared_dof(1, k, 1, i) = shared_dof
349 do concurrent(j = 2:xh%ly - 1)
351 this%dof(1, k, 1, i) = edge_id + (j-2)
352 this%shared_dof(1, k, 1, i) = shared_dof
356 shared_dof = msh%is_shared_edge(i, 7)
357 global_id = msh%get_global_edge(i, 7)
358 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
359 if (this%dof(1, 1, xh%lz, i) .gt. this%dof(1, xh%ly, xh%lz, i))
then
360 do concurrent(j = 2:xh%ly - 1)
362 this%dof(1, k, xh%lz, i) = edge_id + (j-2)
363 this%shared_dof(1, k, xh%lz, i) = shared_dof
366 do concurrent(j = 2:xh%ly - 1)
368 this%dof(1, k, xh%lz, i) = edge_id + (j-2)
369 this%shared_dof(1, k, xh%lz, i) = shared_dof
373 shared_dof = msh%is_shared_edge(i, 6)
374 global_id = msh%get_global_edge(i, 6)
375 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
376 if (this%dof(xh%lx, 1, 1, i) .gt. this%dof(xh%lx, xh%ly, 1, i))
then
377 do concurrent(j = 2:xh%ly - 1)
379 this%dof(xh%lx, k, 1, i) = edge_id + (j-2)
380 this%shared_dof(xh%lx, k, 1, i) = shared_dof
383 do concurrent(j = 2:xh%ly - 1)
385 this%dof(xh%lx, k, 1, i) = edge_id + (j-2)
386 this%shared_dof(xh%lx, k, 1, i) = shared_dof
390 shared_dof = msh%is_shared_edge(i, 8)
391 global_id = msh%get_global_edge(i, 8)
392 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
393 if (this%dof(xh%lx, 1, xh%lz, i) .gt. &
394 this%dof(xh%lx, xh%ly, xh%lz, i))
then
395 do concurrent(j = 2:xh%ly - 1)
397 this%dof(xh%lx, k, xh%lz, i) = edge_id + (j-2)
398 this%shared_dof(xh%lx, k, xh%lz, i) = shared_dof
401 do concurrent(j = 2:xh%ly - 1)
403 this%dof(xh%lx, k, xh%lz, i) = edge_id + (j-2)
404 this%shared_dof(xh%lx, k, xh%lz, i) = shared_dof
411 shared_dof = msh%is_shared_edge(i, 9)
412 global_id = msh%get_global_edge(i, 9)
413 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
414 if (this%dof(1,1,1,i) .gt. this%dof(1, 1, xh%lz, i))
then
415 do concurrent(j = 2:xh%lz - 1)
417 this%dof(1, 1, k, i) = edge_id + (j-2)
418 this%shared_dof(1, 1, k, i) = shared_dof
421 do concurrent(j = 2:xh%lz - 1)
423 this%dof(1, 1, k, i) = edge_id + (j-2)
424 this%shared_dof(1, 1, k, i) = shared_dof
428 shared_dof = msh%is_shared_edge(i, 10)
429 global_id = msh%get_global_edge(i, 10)
430 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
431 if (this%dof(xh%lx,1,1,i) .gt. this%dof(xh%lx, 1, xh%lz, i))
then
432 do concurrent(j = 2:xh%lz - 1)
434 this%dof(xh%lx, 1, k, i) = edge_id + (j-2)
435 this%shared_dof(xh%lx, 1, k, i) = shared_dof
438 do concurrent(j = 2:xh%lz - 1)
440 this%dof(xh%lx, 1, k, i) = edge_id + (j-2)
441 this%shared_dof(xh%lx, 1, k, i) = shared_dof
445 shared_dof = msh%is_shared_edge(i, 11)
446 global_id = msh%get_global_edge(i, 11)
447 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
448 if (this%dof(1, xh%ly, 1, i) .gt. this%dof(1, xh%ly, xh%lz, i))
then
449 do concurrent(j = 2:xh%lz - 1)
451 this%dof(1, xh%ly, k, i) = edge_id + (j-2)
452 this%shared_dof(1, xh%ly, k, i) = shared_dof
455 do concurrent(j = 2:xh%lz - 1)
457 this%dof(1, xh%ly, k, i) = edge_id + (j-2)
458 this%shared_dof(1, xh%ly, k, i) = shared_dof
462 shared_dof = msh%is_shared_edge(i, 12)
463 global_id = msh%get_global_edge(i, 12)
464 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
465 if (this%dof(xh%lx, xh%ly, 1, i) .gt. &
466 this%dof(xh%lx, xh%ly, xh%lz, i))
then
467 do concurrent(j = 2:xh%lz - 1)
469 this%dof(xh%lx, xh%ly, k, i) = edge_id + (j-2)
470 this%shared_dof(xh%lx, xh%ly, k, i) = shared_dof
473 do concurrent(j = 2:xh%lz - 1)
475 this%dof(xh%lx, xh%ly, k, i) = edge_id + (j-2)
476 this%shared_dof(xh%lx, xh%ly, k, i) = shared_dof
483 shared_dof = msh%is_shared_edge(i, 3)
484 global_id = msh%get_global_edge(i, 3)
485 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
487 if (this%dof(1,1,1,i) .gt. this%dof(xh%lx, 1, 1, i))
then
488 do concurrent(j = 2:xh%lx - 1)
490 this%dof(k, 1, 1, i) = edge_id + (j-2)
491 this%shared_dof(k, 1, 1, i) = shared_dof
494 do concurrent(j = 2:xh%lx - 1)
496 this%dof(k, 1, 1, i) = edge_id + (j-2)
497 this%shared_dof(k, 1, 1, i) = shared_dof
501 shared_dof = msh%is_shared_edge(i, 4)
502 global_id = msh%get_global_edge(i, 4)
503 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
504 if (this%dof(1, xh%ly, 1, i) .gt. this%dof(xh%lx, xh%ly, 1, i))
then
505 do concurrent(j = 2:xh%lx - 1)
507 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
508 this%shared_dof(k, xh%ly, 1, i) = shared_dof
511 do concurrent(j = 2:xh%lx - 1)
513 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
514 this%shared_dof(k, xh%ly, 1, i) = shared_dof
521 shared_dof = msh%is_shared_edge(i, 1)
522 global_id = msh%get_global_edge(i, 1)
523 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
524 if (this%dof(1,1,1,i) .gt. this%dof(1, xh%ly, 1, i))
then
525 do concurrent(j = 2:xh%ly - 1)
527 this%dof(1, k, 1, i) = edge_id + (j-2)
528 this%shared_dof(1, k, 1, i) = shared_dof
531 do concurrent(j = 2:xh%ly - 1)
533 this%dof(1, k, 1, i) = edge_id + (j-2)
534 this%shared_dof(1, k, 1, i) = shared_dof
538 shared_dof = msh%is_shared_edge(i, 2)
539 global_id = msh%get_global_edge(i, 2)
540 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
541 if (this%dof(xh%lx,1,1,i) .gt. this%dof(xh%lx, xh%ly, 1, i))
then
542 do concurrent(j = 2:xh%ly - 1)
544 this%dof(xh%lx, k, 1, i) = edge_id + (j-2)
545 this%shared_dof(xh%lx, k, 1, i) = shared_dof
548 do concurrent(j = 2:xh%ly - 1)
550 this%dof(xh%lx, k, 1, i) = edge_id + (j-2)
551 this%shared_dof(xh%lx, k, 1, i) = shared_dof
563 type(
mesh_t),
pointer :: msh
568 integer(kind=i8) :: num_dofs_faces(3)
569 integer(kind=i8) :: facet_offset, facet_id
570 logical :: shared_dof
576 facet_offset = int(msh%glb_mpts,
i8) + &
577 int(msh%glb_meds,
i8) * int(xh%lx-2,
i8) + int(1,
i8)
580 num_dofs_faces(1) = int((xh%ly - 2) * (xh%lz - 2),
i8)
581 num_dofs_faces(2) = int((xh%lx - 2) * (xh%lz - 2),
i8)
582 num_dofs_faces(3) = int((xh%lx - 2) * (xh%ly - 2),
i8)
590 call msh%elements(i)%e%facet_id(face, 1)
591 call msh%elements(i)%e%facet_order(face_order, 1)
592 shared_dof = msh%is_shared_facet(i, 1)
593 global_id = msh%get_global_facet(i, 1)
594 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(1)
598 facet_id, j, k, xh%lz, xh%ly)
599 this%shared_dof(1, j, k, i) = shared_dof
603 call msh%elements(i)%e%facet_id(face, 2)
604 call msh%elements(i)%e%facet_order(face_order, 2)
605 shared_dof = msh%is_shared_facet(i, 2)
606 global_id = msh%get_global_facet(i, 2)
607 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(1)
611 facet_id, j, k, xh%lz, xh%ly)
612 this%shared_dof(xh%lx, j, k, i) = shared_dof
620 call msh%elements(i)%e%facet_id(face, 3)
621 call msh%elements(i)%e%facet_order(face_order, 3)
622 shared_dof = msh%is_shared_facet(i, 3)
623 global_id = msh%get_global_facet(i, 3)
624 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(2)
628 facet_id, k, j, xh%lz, xh%lx)
629 this%shared_dof(j, 1, k, i) = shared_dof
633 call msh%elements(i)%e%facet_id(face, 4)
634 call msh%elements(i)%e%facet_order(face_order, 4)
635 shared_dof = msh%is_shared_facet(i, 4)
636 global_id = msh%get_global_facet(i, 4)
637 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(2)
641 facet_id, k, j, xh%lz, xh%lx)
642 this%shared_dof(j, xh%ly, k, i) = shared_dof
650 call msh%elements(i)%e%facet_id(face, 5)
651 call msh%elements(i)%e%facet_order(face_order, 5)
652 shared_dof = msh%is_shared_facet(i, 5)
653 global_id = msh%get_global_facet(i, 5)
654 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(3)
658 facet_id, k, j, xh%ly, xh%lx)
659 this%shared_dof(j, k, 1, i) = shared_dof
663 call msh%elements(i)%e%facet_id(face, 6)
664 call msh%elements(i)%e%facet_order(face_order, 6)
665 shared_dof = msh%is_shared_facet(i, 6)
666 global_id = msh%get_global_facet(i, 6)
667 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(3)
671 facet_id, k, j, xh%lz, xh%lx)
672 this%shared_dof(j, k, xh%lz, i) = shared_dof
810 type(
mesh_t),
pointer,
intent(in) :: msh
811 type(
space_t),
intent(in) :: Xh
813 real(kind=
rp),
intent(inout) :: x(xh%lx, xh%ly, xh%lz), &
814 y(xh%lx, xh%ly, xh%lz), &
815 z(xh%lx, xh%ly, xh%lz)
816 real(kind=
rp) :: xyzb(2,2,2,3), zgml(xh%lx, 3)
817 real(kind=
rp) :: jx(xh%lx*2)
818 real(kind=
rp) :: jxt(xh%lx*2), jyt(xh%lx*2), jzt(xh%lx*2)
819 real(kind=
rp) :: w(4*xh%lx**3), tmp(xh%lx, xh%lx, xh%lx)
820 real(kind=
rp),
dimension(2),
parameter :: zlin = [-1d0, 1d0]
828 call copy(zgml(1,1), xh%zg(1,1), xh%lx)
829 call copy(zgml(1,2), xh%zg(1,2), xh%ly)
830 if (msh%gdim .gt. 2)
then
831 call copy(zgml(1,3), xh%zg(1,3), xh%lz)
838 if (msh%gdim .gt. 2)
then
843 call trsp(jx, xh%lx, jxt, 2)
845 if (msh%gdim .eq. 2)
then
849 if (msh%gdim .gt. 2)
then
850 do concurrent(j = 1:msh%gdim)
851 xyzb(1,1,1,j) =
element%pts(1)%p%x(j)
852 xyzb(2,1,1,j) =
element%pts(2)%p%x(j)
853 xyzb(1,2,1,j) =
element%pts(3)%p%x(j)
854 xyzb(2,2,1,j) =
element%pts(4)%p%x(j)
856 xyzb(1,1,2,j) =
element%pts(5)%p%x(j)
857 xyzb(2,1,2,j) =
element%pts(6)%p%x(j)
858 xyzb(1,2,2,j) =
element%pts(7)%p%x(j)
859 xyzb(2,2,2,j) =
element%pts(8)%p%x(j)
862 do concurrent(j = 1:msh%gdim)
863 xyzb(1,1,1,j) =
element%pts(1)%p%x(j)
864 xyzb(2,1,1,j) =
element%pts(2)%p%x(j)
865 xyzb(1,2,1,j) =
element%pts(3)%p%x(j)
866 xyzb(2,2,1,j) =
element%pts(4)%p%x(j)
869 if (msh%gdim .eq. 3)
then
870 call tensr3(tmp, xh%lx, xyzb(1,1,1,1), 2, jx, jyt, jzt, w)
871 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
872 call tensr3(tmp, xh%ly, xyzb(1,1,1,2), 2, jx, jyt, jzt, w)
873 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
874 call tensr3(tmp, xh%lz, xyzb(1,1,1,3), 2, jx, jyt, jzt, w)
875 call copy(z, tmp, xh%lx*xh%ly*xh%lz)
877 call tnsr2d_el(tmp, xh%lx, xyzb(1,1,1,1), 2, jx, jyt)
878 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
879 call tnsr2d_el(tmp, xh%ly, xyzb(1,1,1,2), 2, jx, jyt)
880 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
886 type(
mesh_t),
pointer,
intent(in) :: msh
887 type(
space_t),
intent(in) :: Xh
889 real(kind=
rp),
dimension(Xh%lx, Xh%ly, Xh%lz),
intent(inout) :: x, y, z
890 integer :: curve_type(12), eindx(12)
891 real(kind=
rp) :: curve_data(5,12), x3(3,3,3), y3(3,3,3), z3(3,3,3)
893 real(kind=
rp),
dimension(3),
parameter :: zquad = [-1d0, 0d0,1d0]
894 real(kind=
rp) :: zg(3)
895 real(kind=
rp),
dimension(Xh%lx, Xh%lx, Xh%lx) :: tmp
896 real(kind=
rp) :: jx(xh%lx*3)
897 real(kind=
rp) :: jxt(xh%lx*3), jyt(xh%lx*3), jzt(xh%lx*3)
898 real(kind=
rp) :: w(4*xh%lxyz,2)
899 integer :: j, k, n_edges
900 eindx = [2 , 6 , 8 , 4, &
905 if (msh%gdim .eq. 3)
then
907 call xh3%init(
gll, 3, 3, 3)
910 call xh3%init(
gll, 3, 3)
915 if (curve_type(k) .eq. 4)
then
916 x3(eindx(k),1,1) = curve_data(1,k)
917 y3(eindx(k),1,1) = curve_data(2,k)
918 z3(eindx(k),1,1) = curve_data(3,k)
924 if (msh%gdim .eq. 3)
then
929 call neko_warning(
' m deformation not supported for 2d yet')
937 if (msh%gdim .gt. 2)
then
942 call trsp(jx, xh%lx, jxt, 3)
943 if (msh%gdim .eq. 3)
then
944 call tensr3(tmp, xh%lx, x3, 3, jx, jyt, jzt, w)
945 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
946 call tensr3(tmp, xh%ly, y3, 3, jx, jyt, jzt, w)
947 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
948 call tensr3(tmp, xh%lz, z3, 3, jx, jyt, jzt, w)
949 call copy(z, tmp, xh%lx*xh%ly*xh%lz)
951 call tnsr2d_el(tmp, xh%lx, x3, 3, jx, jyt)
952 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
953 call tnsr2d_el(tmp, xh%ly, y3, 3, jx, jyt)
954 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
968 integer,
intent(in) :: n
969 real(kind=
rp),
intent(inout) :: x(n, n, n)
970 real(kind=
rp),
intent(in) :: zg(n)
971 real(kind=
rp),
intent(inout) :: e(n, n, n)
972 real(kind=
rp),
intent(inout) :: v(n, n, n)
973 integer :: gh_type, ntot, kk, jj, ii, k, j, i
974 real(kind=
xp) :: si, sj, sk, hi, hj, hk
980 do concurrent(i = 1:ntot)
984 do concurrent(i = 1:n, j = 1:n, k = 1:n, &
985 ii = 1:n:n-1, jj = 1:n:n-1, kk = 1:n:n-1)
986 si = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
987 sj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
988 sk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
989 v(i,j,k) = v(i,j,k) + si * sj* sk * x(ii, jj, kk)
992 if (gh_type .eq. 1)
then
993 do concurrent(i = 1:ntot)
1001 do concurrent(i = 1:ntot)
1007 do concurrent(i = 1:n, j = 1:n, k = 1:n, jj = 1:n:n-1, kk = 1:n:n-1)
1008 hj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
1009 hk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
1010 e(i,j,k) = e(i,j,k) + hj*hk*(x(i, jj, kk) - v(i, jj, kk))
1015 do concurrent(i = 1:n, j = 1:n, k = 1:n, ii = 1:n:n-1, kk = 1:n:n-1)
1016 hi = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
1017 hk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
1018 e(i,j,k) = e(i,j,k) + hi*hk*(x(ii, j, kk) - v(ii, j, kk))
1023 do concurrent(i = 1:n, j = 1:n, k = 1:n, ii = 1:n:n-1, jj = 1:n:n-1)
1024 hi = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
1025 hj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
1026 e(i,j,k) = e(i,j,k) + hi*hj*(x(ii, jj, k) - v(ii, jj, k))
1029 do concurrent(i = 1:ntot)
1030 e(i,1,1) = e(i,1,1) + v(i,1,1)
1033 if (gh_type .eq. 2)
then
1034 do concurrent(i = 1:ntot)
1042 do concurrent(i = 1:ntot)
1048 do concurrent(i = 1:n, j = 1:n, k = 1:n, ii = 1:n:n-1)
1049 hi = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
1050 v(i,j,k) = v(i,j,k) + hi*(x(ii,j,k)-e(ii,j,k))
1056 do concurrent(i = 1:n, j = 1:n, k = 1:n, jj = 1:n:n-1)
1057 hj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
1058 v(i,j,k) = v(i,j,k) + hj*(x(i, jj, k) - e(i, jj, k))
1064 do concurrent(i = 1:n, j = 1:n, k = 1:n, kk = 1:n:n-1)
1065 hk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
1066 v(i,j,k) = v(i,j,k) + hk*(x(i, j, kk) - e(i, j, kk))
1069 do concurrent(i = 1:ntot)
1070 v(i,1,1) = v(i,1,1) + e(i,1,1)
1142 integer,
intent(in) :: isid, gdim
1143 type(
space_t),
intent(in) :: Xh
1145 real(kind=
rp),
dimension(5),
intent(in) :: curve_data
1146 real(kind=
rp),
dimension(Xh%lx, Xh%ly, Xh%lz),
intent(inout) :: x, y, z
1147 real(kind=
rp) :: pt1x, pt1y, pt2x, pt2y, pt12x, pt12y
1148 real(kind=
rp) :: radius, dtheta, r, xys
1149 real(kind=
rp) :: theta0, xcenn, ycenn, h(xh%lx, 3, 2)
1150 real(kind=
rp) :: xcrved(xh%lx), ycrved(xh%lx), xs, ys
1151 integer :: isid1, ixt, iyt, izt, ix, itmp
1153 integer(i4),
dimension(6),
parameter :: fcyc_to_sym = [3, 2, 4, 1, 5, 6]
1155 integer(i4),
dimension(12),
parameter :: ecyc_to_sym = [1, 6, 2, 5, 3, 8, &
1156 4, 7, 9, 10, 12, 11]
1158 integer,
parameter,
dimension(2, 12) :: edge_nodes = reshape([1, 2, 3, 4, &
1159 5, 6, 7, 8, 1, 3, 2, 4, 5, 7, 6, 8, 1, 5, 2, 6, 3, 7, 4, 8], &
1167 itmp = ecyc_to_sym(isid)
1170 pt1x =
element%pts(edge_nodes(1, itmp))%p%x(1)
1171 pt1y =
element%pts(edge_nodes(1, itmp))%p%x(2)
1172 pt2x =
element%pts(edge_nodes(2, itmp))%p%x(1)
1173 pt2y =
element%pts(edge_nodes(2, itmp))%p%x(2)
1175 pt1x =
element%pts(edge_nodes(2, itmp))%p%x(1)
1176 pt1y =
element%pts(edge_nodes(2, itmp))%p%x(2)
1177 pt2x =
element%pts(edge_nodes(1, itmp))%p%x(1)
1178 pt2y =
element%pts(edge_nodes(1, itmp))%p%x(2)
1181 radius = curve_data(1)
1185 xys = sqrt(xs**2 + ys**2)
1187 if (abs(2.0 * radius) <= xys * 1.00001) &
1188 &
call neko_error(
'Radius to small for arced element surface')
1190 dtheta = abs(asin(0.5_xp*xys/radius))
1191 pt12x = (pt1x + pt2x)/2.0
1192 pt12y = (pt1y + pt2y)/2.0
1193 xcenn = pt12x - xs/xys * radius*cos(dtheta)
1194 ycenn = pt12y - ys/xys * radius*cos(dtheta)
1195 theta0 = atan2((pt12y-ycenn), (pt12x-xcenn))
1197 isid1 = mod(isid+4-1, 4)+1
1199 if (radius < 0.0) dtheta = -dtheta
1202 if (isid1 .gt. 2) ixt = xh%lx+1-ix
1204 xcrved(ixt) = xcenn + abs(radius) * cos(theta0 + r*dtheta) &
1205 - ( h(ix,1,1)*pt1x + h(ix,1,2)*pt2x )
1206 ycrved(ixt) = ycenn + abs(radius) * sin(theta0 + r*dtheta) &
1207 - ( h(ix,1,1)*pt1y + h(ix,1,2)*pt2y )
1212 isid1 = fcyc_to_sym(isid1)
1216 if (isid1 .le. 2)
then
1217 call addtnsr(x, h(1, 1, ixt), xcrved, h(1, 3, izt), &
1218 xh%lx, xh%ly, xh%lz)
1219 call addtnsr(y, h(1, 1, ixt), ycrved, h(1, 3, izt), &
1220 xh%lx, xh%ly, xh%lz)
1222 call addtnsr(x, xcrved, h(1, 2, iyt), h(1, 3, izt), &
1223 xh%lx, xh%ly, xh%lz)
1224 call addtnsr(y, ycrved, h(1, 2, iyt), h(1, 3, izt), &
1225 xh%lx, xh%ly, xh%lz)