292 type(
mesh_t),
pointer :: msh
297 integer(kind=i8) :: num_dofs_edges(3)
298 integer(kind=i8) :: edge_id, edge_offset
299 logical :: shared_dof
305 num_dofs_edges(1) = int(xh%lx - 2,
i8)
306 num_dofs_edges(2) = int(xh%ly - 2,
i8)
307 num_dofs_edges(3) = int(xh%lz - 2,
i8)
308 edge_offset = int(msh%glb_mpts,
i8) + int(1,
i8)
313 select type (ep => msh%elements(i)%e)
318 call ep%edge_id(edge, 1)
319 shared_dof = msh%is_shared(edge)
320 global_id = msh%get_global(edge)
321 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
323 if (int(edge%x(1),
i8) .ne. this%dof(1,1,1,i))
then
324 do concurrent(j = 2:xh%lx - 1)
326 this%dof(k, 1, 1, i) = edge_id + (j-2)
327 this%shared_dof(k, 1, 1, i) = shared_dof
330 do concurrent(j = 2:xh%lx - 1)
332 this%dof(k, 1, 1, i) = edge_id + (j-2)
333 this%shared_dof(k, 1, 1, i) = shared_dof
337 call ep%edge_id(edge, 3)
338 shared_dof = msh%is_shared(edge)
339 global_id = msh%get_global(edge)
340 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
341 if (int(edge%x(1),
i8) .ne. this%dof(1, 1, xh%lz, i))
then
342 do concurrent(j = 2:xh%lx - 1)
344 this%dof(k, 1, xh%lz, i) = edge_id + (j-2)
345 this%shared_dof(k, 1, xh%lz, i) = shared_dof
348 do concurrent(j = 2:xh%lx - 1)
350 this%dof(k, 1, xh%lz, i) = edge_id + (j-2)
351 this%shared_dof(k, 1, xh%lz, i) = shared_dof
355 call ep%edge_id(edge, 2)
356 shared_dof = msh%is_shared(edge)
357 global_id = msh%get_global(edge)
358 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
359 if (int(edge%x(1),
i8) .ne. this%dof(1, xh%ly, 1, i))
then
360 do concurrent(j = 2:xh%lx - 1)
362 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
363 this%shared_dof(k, xh%ly, 1, i) = shared_dof
366 do concurrent(j = 2:xh%lx - 1)
368 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
369 this%shared_dof(k, xh%ly, 1, i) = shared_dof
373 call ep%edge_id(edge, 4)
374 shared_dof = msh%is_shared(edge)
375 global_id = msh%get_global(edge)
376 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
377 if (int(edge%x(1),
i8) .ne. this%dof(1, xh%ly, xh%lz, i))
then
378 do concurrent(j = 2:xh%lx - 1)
380 this%dof(k, xh%ly, xh%lz, i) = edge_id + (j-2)
381 this%shared_dof(k, xh%ly, xh%lz, i) = shared_dof
384 do concurrent(j = 2:xh%lx - 1)
386 this%dof(k, xh%ly, xh%lz, i) = edge_id + (j-2)
387 this%shared_dof(k, xh%ly, xh%lz, i) = shared_dof
395 call ep%edge_id(edge, 5)
396 shared_dof = msh%is_shared(edge)
397 global_id = msh%get_global(edge)
398 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
399 if (int(edge%x(1),
i8) .ne. this%dof(1,1,1,i))
then
400 do concurrent(j = 2:xh%ly - 1)
402 this%dof(1, k, 1, i) = edge_id + (j-2)
403 this%shared_dof(1, k, 1, i) = shared_dof
406 do concurrent(j = 2:xh%ly - 1)
408 this%dof(1, k, 1, i) = edge_id + (j-2)
409 this%shared_dof(1, k, 1, i) = shared_dof
413 call ep%edge_id(edge, 7)
414 shared_dof = msh%is_shared(edge)
415 global_id = msh%get_global(edge)
416 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
417 if (int(edge%x(1),
i8) .ne. this%dof(1, 1, xh%lz, i))
then
418 do concurrent(j = 2:xh%ly - 1)
420 this%dof(1, k, xh%lz, i) = edge_id + (j-2)
421 this%shared_dof(1, k, xh%lz, i) = shared_dof
424 do concurrent(j = 2:xh%ly - 1)
426 this%dof(1, k, xh%lz, i) = edge_id + (j-2)
427 this%shared_dof(1, k, xh%lz, i) = shared_dof
431 call ep%edge_id(edge, 6)
432 shared_dof = msh%is_shared(edge)
433 global_id = msh%get_global(edge)
434 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
435 if (int(edge%x(1),
i8) .ne. this%dof(xh%lx, 1, 1, i))
then
436 do concurrent(j = 2:xh%ly - 1)
438 this%dof(xh%lx, k, 1, i) = edge_id + (j-2)
439 this%shared_dof(xh%lx, k, 1, i) = shared_dof
442 do concurrent(j = 2:xh%ly - 1)
444 this%dof(xh%lx, k, 1, i) = edge_id + (j-2)
445 this%shared_dof(xh%lx, k, 1, i) = shared_dof
449 call ep%edge_id(edge, 8)
450 shared_dof = msh%is_shared(edge)
451 global_id = msh%get_global(edge)
452 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
453 if (int(edge%x(1),
i8) .ne. this%dof(xh%lx, 1, xh%lz, i))
then
454 do concurrent(j = 2:xh%ly - 1)
456 this%dof(xh%lx, k, xh%lz, i) = edge_id + (j-2)
457 this%shared_dof(xh%lx, k, xh%lz, i) = shared_dof
460 do concurrent(j = 2:xh%ly - 1)
462 this%dof(xh%lx, k, xh%lz, i) = edge_id + (j-2)
463 this%shared_dof(xh%lx, k, xh%lz, i) = shared_dof
470 call ep%edge_id(edge, 9)
471 shared_dof = msh%is_shared(edge)
472 global_id = msh%get_global(edge)
473 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
474 if (int(edge%x(1),
i8) .ne. this%dof(1,1,1,i))
then
475 do concurrent(j = 2:xh%lz - 1)
477 this%dof(1, 1, k, i) = edge_id + (j-2)
478 this%shared_dof(1, 1, k, i) = shared_dof
481 do concurrent(j = 2:xh%lz - 1)
483 this%dof(1, 1, k, i) = edge_id + (j-2)
484 this%shared_dof(1, 1, k, i) = shared_dof
488 call ep%edge_id(edge, 10)
489 shared_dof = msh%is_shared(edge)
490 global_id = msh%get_global(edge)
491 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
492 if (int(edge%x(1),
i8) .ne. this%dof(xh%lx,1,1,i))
then
493 do concurrent(j = 2:xh%lz - 1)
495 this%dof(xh%lx, 1, k, i) = edge_id + (j-2)
496 this%shared_dof(xh%lx, 1, k, i) = shared_dof
499 do concurrent(j = 2:xh%lz - 1)
501 this%dof(xh%lx, 1, k, i) = edge_id + (j-2)
502 this%shared_dof(xh%lx, 1, k, i) = shared_dof
506 call ep%edge_id(edge, 11)
507 shared_dof = msh%is_shared(edge)
508 global_id = msh%get_global(edge)
509 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
510 if (int(edge%x(1),
i8) .ne. this%dof(1, xh%ly, 1, i))
then
511 do concurrent(j = 2:xh%lz - 1)
513 this%dof(1, xh%ly, k, i) = edge_id + (j-2)
514 this%shared_dof(1, xh%ly, k, i) = shared_dof
517 do concurrent(j = 2:xh%lz - 1)
519 this%dof(1, xh%ly, k, i) = edge_id + (j-2)
520 this%shared_dof(1, xh%ly, k, i) = shared_dof
524 call ep%edge_id(edge, 12)
525 shared_dof = msh%is_shared(edge)
526 global_id = msh%get_global(edge)
527 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
528 if (int(edge%x(1),
i8) .ne. this%dof(xh%lx, xh%ly, 1, i))
then
529 do concurrent(j = 2:xh%lz - 1)
531 this%dof(xh%lx, xh%ly, k, i) = edge_id + (j-2)
532 this%shared_dof(xh%lx, xh%ly, k, i) = shared_dof
535 do concurrent(j = 2:xh%lz - 1)
537 this%dof(xh%lx, xh%ly, k, i) = edge_id + (j-2)
538 this%shared_dof(xh%lx, xh%ly, k, i) = shared_dof
545 call ep%facet_id(edge, 3)
546 shared_dof = msh%is_shared(edge)
547 global_id = msh%get_global(edge)
548 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
550 if (int(edge%x(1),
i8) .ne. this%dof(1,1,1,i))
then
551 do concurrent(j = 2:xh%lx - 1)
553 this%dof(k, 1, 1, i) = edge_id + (j-2)
554 this%shared_dof(k, 1, 1, i) = shared_dof
557 do concurrent(j = 2:xh%lx - 1)
559 this%dof(k, 1, 1, i) = edge_id + (j-2)
560 this%shared_dof(k, 1, 1, i) = shared_dof
564 call ep%facet_id(edge, 4)
565 shared_dof = msh%is_shared(edge)
566 global_id = msh%get_global(edge)
567 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
568 if (int(edge%x(1),
i8) .ne. this%dof(1, xh%ly, 1, i))
then
569 do concurrent(j = 2:xh%lx - 1)
571 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
572 this%shared_dof(k, xh%ly, 1, i) = shared_dof
575 do concurrent(j = 2:xh%lx - 1)
577 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
578 this%shared_dof(k, xh%ly, 1, i) = shared_dof
585 call ep%facet_id(edge, 1)
586 shared_dof = msh%is_shared(edge)
587 global_id = msh%get_global(edge)
588 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
589 if (int(edge%x(1),
i8) .ne. this%dof(1,1,1,i))
then
590 do concurrent(j = 2:xh%ly - 1)
592 this%dof(1, k, 1, i) = edge_id + (j-2)
593 this%shared_dof(1, k, 1, i) = shared_dof
596 do concurrent(j = 2:xh%ly - 1)
598 this%dof(1, k, 1, i) = edge_id + (j-2)
599 this%shared_dof(1, k, 1, i) = shared_dof
603 call ep%facet_id(edge, 2)
604 shared_dof = msh%is_shared(edge)
605 global_id = msh%get_global(edge)
606 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
607 if (int(edge%x(1),
i8) .ne. this%dof(xh%lx,1,1,i))
then
608 do concurrent(j = 2:xh%ly - 1)
610 this%dof(xh%lx, k, 1, i) = edge_id + (j-2)
611 this%shared_dof(xh%lx, k, 1, i) = shared_dof
614 do concurrent(j = 2:xh%ly - 1)
616 this%dof(xh%lx, k, 1, i) = edge_id + (j-2)
617 this%shared_dof(xh%lx, k, 1, i) = shared_dof
629 type(
mesh_t),
pointer :: msh
634 integer(kind=i8) :: num_dofs_faces(3)
635 integer(kind=i8) :: facet_offset, facet_id
636 logical :: shared_dof
642 facet_offset = int(msh%glb_mpts,
i8) + &
643 int(msh%glb_meds,
i8) * int(xh%lx-2,
i8) + int(1,
i8)
646 num_dofs_faces(1) = int((xh%ly - 2) * (xh%lz - 2),
i8)
647 num_dofs_faces(2) = int((xh%lx - 2) * (xh%lz - 2),
i8)
648 num_dofs_faces(3) = int((xh%lx - 2) * (xh%ly - 2),
i8)
656 call msh%elements(i)%e%facet_id(face, 1)
657 call msh%elements(i)%e%facet_order(face_order, 1)
658 shared_dof = msh%is_shared(face)
659 global_id = msh%get_global(face)
660 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(1)
661 do concurrent(j = 2:(xh%ly - 1), k = 2:(xh%lz -1))
662 this%dof(1, j, k, i) = &
664 this%shared_dof(1, j, k, i) = shared_dof
667 call msh%elements(i)%e%facet_id(face, 2)
668 call msh%elements(i)%e%facet_order(face_order, 2)
669 shared_dof = msh%is_shared(face)
670 global_id = msh%get_global(face)
671 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(1)
672 do concurrent(j = 2:(xh%ly - 1), k = 2:(xh%lz -1))
673 this%dof(xh%lx, j, k, i) = &
675 this%shared_dof(xh%lx, j, k, i) = shared_dof
682 call msh%elements(i)%e%facet_id(face, 3)
683 call msh%elements(i)%e%facet_order(face_order, 3)
684 shared_dof = msh%is_shared(face)
685 global_id = msh%get_global(face)
686 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(2)
687 do concurrent(j = 2:(xh%lx - 1), k = 2:(xh%lz - 1))
688 this%dof(j, 1, k, i) = &
690 this%shared_dof(j, 1, k, i) = shared_dof
693 call msh%elements(i)%e%facet_id(face, 4)
694 call msh%elements(i)%e%facet_order(face_order, 4)
695 shared_dof = msh%is_shared(face)
696 global_id = msh%get_global(face)
697 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(2)
698 do concurrent(j = 2:(xh%lx - 1), k = 2:(xh%lz - 1))
699 this%dof(j, xh%ly, k, i) = &
701 this%shared_dof(j, xh%ly, k, i) = shared_dof
708 call msh%elements(i)%e%facet_id(face, 5)
709 call msh%elements(i)%e%facet_order(face_order, 5)
710 shared_dof = msh%is_shared(face)
711 global_id = msh%get_global(face)
712 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(3)
713 do concurrent(j = 2:(xh%lx - 1), k = 2:(xh%ly - 1))
714 this%dof(j, k, 1, i) = &
716 this%shared_dof(j, k, 1, i) = shared_dof
719 call msh%elements(i)%e%facet_id(face, 6)
720 call msh%elements(i)%e%facet_order(face_order, 6)
721 shared_dof = msh%is_shared(face)
722 global_id = msh%get_global(face)
723 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(3)
724 do concurrent(j = 2:(xh%lx - 1), k = 2:(xh%ly - 1))
725 this%dof(j, k, xh%lz, i) = &
727 this%shared_dof(j, k, xh%lz, i) = shared_dof
860 type(
mesh_t),
pointer,
intent(in) :: msh
861 type(
space_t),
intent(in) :: Xh
863 real(kind=
rp),
intent(inout) :: x(xh%lx, xh%ly, xh%lz), &
864 y(xh%lx, xh%ly, xh%lz), &
865 z(xh%lx, xh%ly, xh%lz)
866 real(kind=
rp) :: xyzb(2,2,2,3), zgml(xh%lx, 3)
867 real(kind=
rp) :: jx(xh%lx*2)
868 real(kind=
rp) :: jxt(xh%lx*2), jyt(xh%lx*2), jzt(xh%lx*2)
869 real(kind=
rp) :: w(4*xh%lx**3), tmp(xh%lx, xh%lx, xh%lx)
870 real(kind=
rp),
dimension(2),
parameter :: zlin = [-1d0, 1d0]
878 call copy(zgml(1,1), xh%zg(1,1), xh%lx)
879 call copy(zgml(1,2), xh%zg(1,2), xh%ly)
880 if (msh%gdim .gt. 2)
then
881 call copy(zgml(1,3), xh%zg(1,3), xh%lz)
888 if (msh%gdim .gt. 2)
then
893 call trsp(jx, xh%lx, jxt, 2)
895 if (msh%gdim .eq. 2)
then
899 if (msh%gdim .gt. 2)
then
900 do concurrent(j = 1:msh%gdim)
901 xyzb(1,1,1,j) =
element%pts(1)%p%x(j)
902 xyzb(2,1,1,j) =
element%pts(2)%p%x(j)
903 xyzb(1,2,1,j) =
element%pts(3)%p%x(j)
904 xyzb(2,2,1,j) =
element%pts(4)%p%x(j)
906 xyzb(1,1,2,j) =
element%pts(5)%p%x(j)
907 xyzb(2,1,2,j) =
element%pts(6)%p%x(j)
908 xyzb(1,2,2,j) =
element%pts(7)%p%x(j)
909 xyzb(2,2,2,j) =
element%pts(8)%p%x(j)
912 do concurrent(j = 1:msh%gdim)
913 xyzb(1,1,1,j) =
element%pts(1)%p%x(j)
914 xyzb(2,1,1,j) =
element%pts(2)%p%x(j)
915 xyzb(1,2,1,j) =
element%pts(3)%p%x(j)
916 xyzb(2,2,1,j) =
element%pts(4)%p%x(j)
919 if (msh%gdim .eq. 3)
then
920 call tensr3(tmp, xh%lx, xyzb(1,1,1,1), 2, jx, jyt, jzt, w)
921 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
922 call tensr3(tmp, xh%ly, xyzb(1,1,1,2), 2, jx, jyt, jzt, w)
923 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
924 call tensr3(tmp, xh%lz, xyzb(1,1,1,3), 2, jx, jyt, jzt, w)
925 call copy(z, tmp, xh%lx*xh%ly*xh%lz)
927 call tnsr2d_el(tmp, xh%lx, xyzb(1,1,1,1), 2, jx, jyt)
928 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
929 call tnsr2d_el(tmp, xh%ly, xyzb(1,1,1,2), 2, jx, jyt)
930 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
936 type(
mesh_t),
pointer,
intent(in) :: msh
937 type(
space_t),
intent(in) :: Xh
939 real(kind=
rp),
dimension(Xh%lx, Xh%ly, Xh%lz),
intent(inout) :: x, y, z
940 integer :: curve_type(12), eindx(12)
941 real(kind=
rp) :: curve_data(5,12), x3(3,3,3), y3(3,3,3), z3(3,3,3)
943 real(kind=
rp),
dimension(3),
parameter :: zquad = [-1d0, 0d0,1d0]
944 real(kind=
rp) :: zg(3)
945 real(kind=
rp),
dimension(Xh%lx, Xh%lx, Xh%lx) :: tmp
946 real(kind=
rp) :: jx(xh%lx*3)
947 real(kind=
rp) :: jxt(xh%lx*3), jyt(xh%lx*3), jzt(xh%lx*3)
948 real(kind=
rp) :: w(4*xh%lxyz,2)
949 integer :: j, k, n_edges
950 eindx = [2 , 6 , 8 , 4, &
955 if (msh%gdim .eq. 3)
then
957 call xh3%init(
gll, 3, 3, 3)
960 call xh3%init(
gll, 3, 3)
965 if (curve_type(k) .eq. 4)
then
966 x3(eindx(k),1,1) = curve_data(1,k)
967 y3(eindx(k),1,1) = curve_data(2,k)
968 z3(eindx(k),1,1) = curve_data(3,k)
974 if (msh%gdim .eq. 3)
then
979 call neko_warning(
' m deformation not supported for 2d yet')
987 if (msh%gdim .gt. 2)
then
992 call trsp(jx, xh%lx, jxt, 3)
993 if (msh%gdim .eq. 3)
then
994 call tensr3(tmp, xh%lx, x3, 3, jx, jyt, jzt, w)
995 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
996 call tensr3(tmp, xh%ly, y3, 3, jx, jyt, jzt, w)
997 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
998 call tensr3(tmp, xh%lz, z3, 3, jx, jyt, jzt, w)
999 call copy(z, tmp, xh%lx*xh%ly*xh%lz)
1001 call tnsr2d_el(tmp, xh%lx, x3, 3, jx, jyt)
1002 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
1003 call tnsr2d_el(tmp, xh%ly, y3, 3, jx, jyt)
1004 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
1018 integer,
intent(in) :: n
1019 real(kind=
rp),
intent(inout) :: x(n, n, n)
1020 real(kind=
rp),
intent(in) :: zg(n)
1021 real(kind=
rp),
intent(inout) :: e(n, n, n)
1022 real(kind=
rp),
intent(inout) :: v(n, n, n)
1023 integer :: gh_type, ntot, kk, jj, ii, k, j, i
1024 real(kind=
xp) :: si, sj, sk, hi, hj, hk
1030 do concurrent(i = 1:ntot)
1034 do concurrent(i = 1:n, j = 1:n, k = 1:n, &
1035 ii = 1:n:n-1, jj = 1:n:n-1, kk = 1:n:n-1)
1036 si = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
1037 sj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
1038 sk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
1039 v(i,j,k) = v(i,j,k) + si * sj* sk * x(ii, jj, kk)
1042 if (gh_type .eq. 1)
then
1043 do concurrent(i = 1:ntot)
1051 do concurrent(i = 1:ntot)
1057 do concurrent(i = 1:n, j = 1:n, k = 1:n, jj = 1:n:n-1, kk = 1:n:n-1)
1058 hj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
1059 hk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
1060 e(i,j,k) = e(i,j,k) + hj*hk*(x(i, jj, kk) - v(i, jj, kk))
1065 do concurrent(i = 1:n, j = 1:n, k = 1:n, ii = 1:n:n-1, kk = 1:n:n-1)
1066 hi = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
1067 hk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
1068 e(i,j,k) = e(i,j,k) + hi*hk*(x(ii, j, kk) - v(ii, j, kk))
1073 do concurrent(i = 1:n, j = 1:n, k = 1:n, ii = 1:n:n-1, jj = 1:n:n-1)
1074 hi = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
1075 hj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
1076 e(i,j,k) = e(i,j,k) + hi*hj*(x(ii, jj, k) - v(ii, jj, k))
1079 do concurrent(i = 1:ntot)
1080 e(i,1,1) = e(i,1,1) + v(i,1,1)
1083 if (gh_type .eq. 2)
then
1084 do concurrent(i = 1:ntot)
1092 do concurrent(i = 1:ntot)
1098 do concurrent(i = 1:n, j = 1:n, k = 1:n, ii = 1:n:n-1)
1099 hi = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
1100 v(i,j,k) = v(i,j,k) + hi*(x(ii,j,k)-e(ii,j,k))
1106 do concurrent(i = 1:n, j = 1:n, k = 1:n, jj = 1:n:n-1)
1107 hj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
1108 v(i,j,k) = v(i,j,k) + hj*(x(i, jj, k) - e(i, jj, k))
1114 do concurrent(i = 1:n, j = 1:n, k = 1:n, kk = 1:n:n-1)
1115 hk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
1116 v(i,j,k) = v(i,j,k) + hk*(x(i, j, kk) - e(i, j, kk))
1119 do concurrent(i = 1:ntot)
1120 v(i,1,1) = v(i,1,1) + e(i,1,1)
1192 integer,
intent(in) :: isid, gdim
1193 type(
space_t),
intent(in) :: Xh
1195 real(kind=
rp),
dimension(5),
intent(in) :: curve_data
1196 real(kind=
rp),
dimension(Xh%lx, Xh%ly, Xh%lz),
intent(inout) :: x, y, z
1197 real(kind=
rp) :: pt1x, pt1y, pt2x, pt2y, pt12x, pt12y
1198 real(kind=
rp) :: radius, dtheta, r, xys
1199 real(kind=
rp) :: theta0, xcenn, ycenn, h(xh%lx, 3, 2)
1200 real(kind=
rp) :: xcrved(xh%lx), ycrved(xh%lx), xs, ys
1201 integer :: isid1, ixt, iyt, izt, ix, itmp
1203 integer(i4),
dimension(6),
parameter :: fcyc_to_sym = [3, 2, 4, 1, 5, 6]
1205 integer(i4),
dimension(12),
parameter :: ecyc_to_sym = [1, 6, 2, 5, 3, 8, &
1206 4, 7, 9, 10, 12, 11]
1208 integer,
parameter,
dimension(2, 12) :: edge_nodes = reshape([1, 2, 3, 4, &
1209 5, 6, 7, 8, 1, 3, 2, 4, 5, 7, 6, 8, 1, 5, 2, 6, 3, 7, 4, 8], &
1217 itmp = ecyc_to_sym(isid)
1220 pt1x =
element%pts(edge_nodes(1, itmp))%p%x(1)
1221 pt1y =
element%pts(edge_nodes(1, itmp))%p%x(2)
1222 pt2x =
element%pts(edge_nodes(2, itmp))%p%x(1)
1223 pt2y =
element%pts(edge_nodes(2, itmp))%p%x(2)
1225 pt1x =
element%pts(edge_nodes(2, itmp))%p%x(1)
1226 pt1y =
element%pts(edge_nodes(2, itmp))%p%x(2)
1227 pt2x =
element%pts(edge_nodes(1, itmp))%p%x(1)
1228 pt2y =
element%pts(edge_nodes(1, itmp))%p%x(2)
1231 radius = curve_data(1)
1235 xys = sqrt(xs**2 + ys**2)
1237 if (abs(2.0 * radius) <= xys * 1.00001) &
1238 &
call neko_error(
'Radius to small for arced element surface')
1240 dtheta = abs(asin(0.5_xp*xys/radius))
1241 pt12x = (pt1x + pt2x)/2.0
1242 pt12y = (pt1y + pt2y)/2.0
1243 xcenn = pt12x - xs/xys * radius*cos(dtheta)
1244 ycenn = pt12y - ys/xys * radius*cos(dtheta)
1245 theta0 = atan2((pt12y-ycenn), (pt12x-xcenn))
1247 isid1 = mod(isid+4-1, 4)+1
1249 if (radius < 0.0) dtheta = -dtheta
1252 if (isid1 .gt. 2) ixt = xh%lx+1-ix
1254 xcrved(ixt) = xcenn + abs(radius) * cos(theta0 + r*dtheta) &
1255 - ( h(ix,1,1)*pt1x + h(ix,1,2)*pt2x )
1256 ycrved(ixt) = ycenn + abs(radius) * sin(theta0 + r*dtheta) &
1257 - ( h(ix,1,1)*pt1y + h(ix,1,2)*pt2y )
1262 isid1 = fcyc_to_sym(isid1)
1266 if (isid1 .le. 2)
then
1267 call addtnsr(x, h(1, 1, ixt), xcrved, h(1, 3, izt), &
1268 xh%lx, xh%ly, xh%lz)
1269 call addtnsr(y, h(1, 1, ixt), ycrved, h(1, 3, izt), &
1270 xh%lx, xh%ly, xh%lz)
1272 call addtnsr(x, xcrved, h(1, 2, iyt), h(1, 3, izt), &
1273 xh%lx, xh%ly, xh%lz)
1274 call addtnsr(y, ycrved, h(1, 2, iyt), h(1, 3, izt), &
1275 xh%lx, xh%ly, xh%lz)