287 type(
mesh_t),
pointer :: msh
292 integer(kind=i8) :: num_dofs_edges(3)
293 integer(kind=i8) :: edge_id, edge_offset
294 logical :: shared_dof
300 num_dofs_edges(1) = int(xh%lx - 2,
i8)
301 num_dofs_edges(2) = int(xh%ly - 2,
i8)
302 num_dofs_edges(3) = int(xh%lz - 2,
i8)
303 edge_offset = int(msh%glb_mpts,
i8) + int(1,
i8)
308 select type (ep => msh%elements(i)%e)
313 call ep%edge_id(edge, 1)
314 shared_dof = msh%is_shared(edge)
315 global_id = msh%get_global(edge)
316 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
318 if (int(edge%x(1),
i8) .ne. this%dof(1,1,1,i))
then
319 do concurrent(j = 2:xh%lx - 1)
321 this%dof(k, 1, 1, i) = edge_id + (j-2)
322 this%shared_dof(k, 1, 1, i) = shared_dof
325 do concurrent(j = 2:xh%lx - 1)
327 this%dof(k, 1, 1, i) = edge_id + (j-2)
328 this%shared_dof(k, 1, 1, i) = shared_dof
332 call ep%edge_id(edge, 3)
333 shared_dof = msh%is_shared(edge)
334 global_id = msh%get_global(edge)
335 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
336 if (int(edge%x(1),
i8) .ne. this%dof(1, 1, xh%lz, i))
then
337 do concurrent(j = 2:xh%lx - 1)
339 this%dof(k, 1, xh%lz, i) = edge_id + (j-2)
340 this%shared_dof(k, 1, xh%lz, i) = shared_dof
343 do concurrent(j = 2:xh%lx - 1)
345 this%dof(k, 1, xh%lz, i) = edge_id + (j-2)
346 this%shared_dof(k, 1, xh%lz, i) = shared_dof
350 call ep%edge_id(edge, 2)
351 shared_dof = msh%is_shared(edge)
352 global_id = msh%get_global(edge)
353 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
354 if (int(edge%x(1),
i8) .ne. this%dof(1, xh%ly, 1, i))
then
355 do concurrent(j = 2:xh%lx - 1)
357 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
358 this%shared_dof(k, xh%ly, 1, i) = shared_dof
361 do concurrent(j = 2:xh%lx - 1)
363 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
364 this%shared_dof(k, xh%ly, 1, i) = shared_dof
368 call ep%edge_id(edge, 4)
369 shared_dof = msh%is_shared(edge)
370 global_id = msh%get_global(edge)
371 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
372 if (int(edge%x(1),
i8) .ne. this%dof(1, xh%ly, xh%lz, i))
then
373 do concurrent(j = 2:xh%lx - 1)
375 this%dof(k, xh%ly, xh%lz, i) = edge_id + (j-2)
376 this%shared_dof(k, xh%ly, xh%lz, i) = shared_dof
379 do concurrent(j = 2:xh%lx - 1)
381 this%dof(k, xh%ly, xh%lz, i) = edge_id + (j-2)
382 this%shared_dof(k, xh%ly, xh%lz, i) = shared_dof
390 call ep%edge_id(edge, 5)
391 shared_dof = msh%is_shared(edge)
392 global_id = msh%get_global(edge)
393 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
394 if (int(edge%x(1),
i8) .ne. this%dof(1,1,1,i))
then
395 do concurrent(j = 2:xh%ly - 1)
397 this%dof(1, k, 1, i) = edge_id + (j-2)
398 this%shared_dof(1, k, 1, i) = shared_dof
401 do concurrent(j = 2:xh%ly - 1)
403 this%dof(1, k, 1, i) = edge_id + (j-2)
404 this%shared_dof(1, k, 1, i) = shared_dof
408 call ep%edge_id(edge, 7)
409 shared_dof = msh%is_shared(edge)
410 global_id = msh%get_global(edge)
411 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
412 if (int(edge%x(1),
i8) .ne. this%dof(1, 1, xh%lz, i))
then
413 do concurrent(j = 2:xh%ly - 1)
415 this%dof(1, k, xh%lz, i) = edge_id + (j-2)
416 this%shared_dof(1, k, xh%lz, i) = shared_dof
419 do concurrent(j = 2:xh%ly - 1)
421 this%dof(1, k, xh%lz, i) = edge_id + (j-2)
422 this%shared_dof(1, k, xh%lz, i) = shared_dof
426 call ep%edge_id(edge, 6)
427 shared_dof = msh%is_shared(edge)
428 global_id = msh%get_global(edge)
429 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
430 if (int(edge%x(1),
i8) .ne. this%dof(xh%lx, 1, 1, i))
then
431 do concurrent(j = 2:xh%ly - 1)
433 this%dof(xh%lx, k, 1, i) = edge_id + (j-2)
434 this%shared_dof(xh%lx, k, 1, i) = shared_dof
437 do concurrent(j = 2:xh%ly - 1)
439 this%dof(xh%lx, k, 1, i) = edge_id + (j-2)
440 this%shared_dof(xh%lx, k, 1, i) = shared_dof
444 call ep%edge_id(edge, 8)
445 shared_dof = msh%is_shared(edge)
446 global_id = msh%get_global(edge)
447 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
448 if (int(edge%x(1),
i8) .ne. this%dof(xh%lx, 1, xh%lz, i))
then
449 do concurrent(j = 2:xh%ly - 1)
451 this%dof(xh%lx, k, xh%lz, i) = edge_id + (j-2)
452 this%shared_dof(xh%lx, k, xh%lz, i) = shared_dof
455 do concurrent(j = 2:xh%ly - 1)
457 this%dof(xh%lx, k, xh%lz, i) = edge_id + (j-2)
458 this%shared_dof(xh%lx, k, xh%lz, i) = shared_dof
465 call ep%edge_id(edge, 9)
466 shared_dof = msh%is_shared(edge)
467 global_id = msh%get_global(edge)
468 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
469 if (int(edge%x(1),
i8) .ne. this%dof(1,1,1,i))
then
470 do concurrent(j = 2:xh%lz - 1)
472 this%dof(1, 1, k, i) = edge_id + (j-2)
473 this%shared_dof(1, 1, k, i) = shared_dof
476 do concurrent(j = 2:xh%lz - 1)
478 this%dof(1, 1, k, i) = edge_id + (j-2)
479 this%shared_dof(1, 1, k, i) = shared_dof
483 call ep%edge_id(edge, 10)
484 shared_dof = msh%is_shared(edge)
485 global_id = msh%get_global(edge)
486 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
487 if (int(edge%x(1),
i8) .ne. this%dof(xh%lx,1,1,i))
then
488 do concurrent(j = 2:xh%lz - 1)
490 this%dof(xh%lx, 1, k, i) = edge_id + (j-2)
491 this%shared_dof(xh%lx, 1, k, i) = shared_dof
494 do concurrent(j = 2:xh%lz - 1)
496 this%dof(xh%lx, 1, k, i) = edge_id + (j-2)
497 this%shared_dof(xh%lx, 1, k, i) = shared_dof
501 call ep%edge_id(edge, 11)
502 shared_dof = msh%is_shared(edge)
503 global_id = msh%get_global(edge)
504 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
505 if (int(edge%x(1),
i8) .ne. this%dof(1, xh%ly, 1, i))
then
506 do concurrent(j = 2:xh%lz - 1)
508 this%dof(1, xh%ly, k, i) = edge_id + (j-2)
509 this%shared_dof(1, xh%ly, k, i) = shared_dof
512 do concurrent(j = 2:xh%lz - 1)
514 this%dof(1, xh%ly, k, i) = edge_id + (j-2)
515 this%shared_dof(1, xh%ly, k, i) = shared_dof
519 call ep%edge_id(edge, 12)
520 shared_dof = msh%is_shared(edge)
521 global_id = msh%get_global(edge)
522 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
523 if (int(edge%x(1),
i8) .ne. this%dof(xh%lx, xh%ly, 1, i))
then
524 do concurrent(j = 2:xh%lz - 1)
526 this%dof(xh%lx, xh%ly, k, i) = edge_id + (j-2)
527 this%shared_dof(xh%lx, xh%ly, k, i) = shared_dof
530 do concurrent(j = 2:xh%lz - 1)
532 this%dof(xh%lx, xh%ly, k, i) = edge_id + (j-2)
533 this%shared_dof(xh%lx, xh%ly, k, i) = shared_dof
540 call ep%facet_id(edge, 3)
541 shared_dof = msh%is_shared(edge)
542 global_id = msh%get_global(edge)
543 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
545 if (int(edge%x(1),
i8) .ne. this%dof(1,1,1,i))
then
546 do concurrent(j = 2:xh%lx - 1)
548 this%dof(k, 1, 1, i) = edge_id + (j-2)
549 this%shared_dof(k, 1, 1, i) = shared_dof
552 do concurrent(j = 2:xh%lx - 1)
554 this%dof(k, 1, 1, i) = edge_id + (j-2)
555 this%shared_dof(k, 1, 1, i) = shared_dof
559 call ep%facet_id(edge, 4)
560 shared_dof = msh%is_shared(edge)
561 global_id = msh%get_global(edge)
562 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
563 if (int(edge%x(1),
i8) .ne. this%dof(1, xh%ly, 1, i))
then
564 do concurrent(j = 2:xh%lx - 1)
566 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
567 this%shared_dof(k, xh%ly, 1, i) = shared_dof
570 do concurrent(j = 2:xh%lx - 1)
572 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
573 this%shared_dof(k, xh%ly, 1, i) = shared_dof
580 call ep%facet_id(edge, 1)
581 shared_dof = msh%is_shared(edge)
582 global_id = msh%get_global(edge)
583 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
584 if (int(edge%x(1),
i8) .ne. this%dof(1,1,1,i))
then
585 do concurrent(j = 2:xh%ly - 1)
587 this%dof(1, k, 1, i) = edge_id + (j-2)
588 this%shared_dof(1, k, 1, i) = shared_dof
591 do concurrent(j = 2:xh%ly - 1)
593 this%dof(1, k, 1, i) = edge_id + (j-2)
594 this%shared_dof(1, k, 1, i) = shared_dof
598 call ep%facet_id(edge, 2)
599 shared_dof = msh%is_shared(edge)
600 global_id = msh%get_global(edge)
601 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
602 if (int(edge%x(1),
i8) .ne. this%dof(xh%lx,1,1,i))
then
603 do concurrent(j = 2:xh%ly - 1)
605 this%dof(xh%lx, k, 1, i) = edge_id + (j-2)
606 this%shared_dof(xh%lx, k, 1, i) = shared_dof
609 do concurrent(j = 2:xh%ly - 1)
611 this%dof(xh%lx, k, 1, i) = edge_id + (j-2)
612 this%shared_dof(xh%lx, k, 1, i) = shared_dof
624 type(
mesh_t),
pointer :: msh
629 integer(kind=i8) :: num_dofs_faces(3)
630 integer(kind=i8) :: facet_offset, facet_id
631 logical :: shared_dof
637 facet_offset = int(msh%glb_mpts,
i8) + &
638 int(msh%glb_meds,
i8) * int(xh%lx-2,
i8) + int(1,
i8)
641 num_dofs_faces(1) = int((xh%ly - 2) * (xh%lz - 2),
i8)
642 num_dofs_faces(2) = int((xh%lx - 2) * (xh%lz - 2),
i8)
643 num_dofs_faces(3) = int((xh%lx - 2) * (xh%ly - 2),
i8)
651 call msh%elements(i)%e%facet_id(face, 1)
652 call msh%elements(i)%e%facet_order(face_order, 1)
653 shared_dof = msh%is_shared(face)
654 global_id = msh%get_global(face)
655 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(1)
659 facet_id, j, k, xh%lz, xh%ly)
660 this%shared_dof(1, j, k, i) = shared_dof
664 call msh%elements(i)%e%facet_id(face, 2)
665 call msh%elements(i)%e%facet_order(face_order, 2)
666 shared_dof = msh%is_shared(face)
667 global_id = msh%get_global(face)
668 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(1)
672 facet_id, j, k, xh%lz, xh%ly)
673 this%shared_dof(xh%lx, j, k, i) = shared_dof
681 call msh%elements(i)%e%facet_id(face, 3)
682 call msh%elements(i)%e%facet_order(face_order, 3)
683 shared_dof = msh%is_shared(face)
684 global_id = msh%get_global(face)
685 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(2)
689 facet_id, k, j, xh%lz, xh%lx)
690 this%shared_dof(j, 1, k, i) = shared_dof
694 call msh%elements(i)%e%facet_id(face, 4)
695 call msh%elements(i)%e%facet_order(face_order, 4)
696 shared_dof = msh%is_shared(face)
697 global_id = msh%get_global(face)
698 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(2)
702 facet_id, k, j, xh%lz, xh%lx)
703 this%shared_dof(j, xh%ly, k, i) = shared_dof
711 call msh%elements(i)%e%facet_id(face, 5)
712 call msh%elements(i)%e%facet_order(face_order, 5)
713 shared_dof = msh%is_shared(face)
714 global_id = msh%get_global(face)
715 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(3)
719 facet_id, k, j, xh%ly, xh%lx)
720 this%shared_dof(j, k, 1, i) = shared_dof
724 call msh%elements(i)%e%facet_id(face, 6)
725 call msh%elements(i)%e%facet_order(face_order, 6)
726 shared_dof = msh%is_shared(face)
727 global_id = msh%get_global(face)
728 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(3)
732 facet_id, k, j, xh%lz, xh%lx)
733 this%shared_dof(j, k, xh%lz, i) = shared_dof
867 type(
mesh_t),
pointer,
intent(in) :: msh
868 type(
space_t),
intent(in) :: Xh
870 real(kind=
rp),
intent(inout) :: x(xh%lx, xh%ly, xh%lz), &
871 y(xh%lx, xh%ly, xh%lz), &
872 z(xh%lx, xh%ly, xh%lz)
873 real(kind=
rp) :: xyzb(2,2,2,3), zgml(xh%lx, 3)
874 real(kind=
rp) :: jx(xh%lx*2)
875 real(kind=
rp) :: jxt(xh%lx*2), jyt(xh%lx*2), jzt(xh%lx*2)
876 real(kind=
rp) :: w(4*xh%lx**3), tmp(xh%lx, xh%lx, xh%lx)
877 real(kind=
rp),
dimension(2),
parameter :: zlin = [-1d0, 1d0]
885 call copy(zgml(1,1), xh%zg(1,1), xh%lx)
886 call copy(zgml(1,2), xh%zg(1,2), xh%ly)
887 if (msh%gdim .gt. 2)
then
888 call copy(zgml(1,3), xh%zg(1,3), xh%lz)
895 if (msh%gdim .gt. 2)
then
900 call trsp(jx, xh%lx, jxt, 2)
902 if (msh%gdim .eq. 2)
then
906 if (msh%gdim .gt. 2)
then
907 do concurrent(j = 1:msh%gdim)
908 xyzb(1,1,1,j) =
element%pts(1)%p%x(j)
909 xyzb(2,1,1,j) =
element%pts(2)%p%x(j)
910 xyzb(1,2,1,j) =
element%pts(3)%p%x(j)
911 xyzb(2,2,1,j) =
element%pts(4)%p%x(j)
913 xyzb(1,1,2,j) =
element%pts(5)%p%x(j)
914 xyzb(2,1,2,j) =
element%pts(6)%p%x(j)
915 xyzb(1,2,2,j) =
element%pts(7)%p%x(j)
916 xyzb(2,2,2,j) =
element%pts(8)%p%x(j)
919 do concurrent(j = 1:msh%gdim)
920 xyzb(1,1,1,j) =
element%pts(1)%p%x(j)
921 xyzb(2,1,1,j) =
element%pts(2)%p%x(j)
922 xyzb(1,2,1,j) =
element%pts(3)%p%x(j)
923 xyzb(2,2,1,j) =
element%pts(4)%p%x(j)
926 if (msh%gdim .eq. 3)
then
927 call tensr3(tmp, xh%lx, xyzb(1,1,1,1), 2, jx, jyt, jzt, w)
928 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
929 call tensr3(tmp, xh%ly, xyzb(1,1,1,2), 2, jx, jyt, jzt, w)
930 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
931 call tensr3(tmp, xh%lz, xyzb(1,1,1,3), 2, jx, jyt, jzt, w)
932 call copy(z, tmp, xh%lx*xh%ly*xh%lz)
934 call tnsr2d_el(tmp, xh%lx, xyzb(1,1,1,1), 2, jx, jyt)
935 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
936 call tnsr2d_el(tmp, xh%ly, xyzb(1,1,1,2), 2, jx, jyt)
937 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
943 type(
mesh_t),
pointer,
intent(in) :: msh
944 type(
space_t),
intent(in) :: Xh
946 real(kind=
rp),
dimension(Xh%lx, Xh%ly, Xh%lz),
intent(inout) :: x, y, z
947 integer :: curve_type(12), eindx(12)
948 real(kind=
rp) :: curve_data(5,12), x3(3,3,3), y3(3,3,3), z3(3,3,3)
950 real(kind=
rp),
dimension(3),
parameter :: zquad = [-1d0, 0d0,1d0]
951 real(kind=
rp) :: zg(3)
952 real(kind=
rp),
dimension(Xh%lx, Xh%lx, Xh%lx) :: tmp
953 real(kind=
rp) :: jx(xh%lx*3)
954 real(kind=
rp) :: jxt(xh%lx*3), jyt(xh%lx*3), jzt(xh%lx*3)
955 real(kind=
rp) :: w(4*xh%lxyz,2)
956 integer :: j, k, n_edges
957 eindx = [2 , 6 , 8 , 4, &
962 if (msh%gdim .eq. 3)
then
964 call xh3%init(
gll, 3, 3, 3)
967 call xh3%init(
gll, 3, 3)
972 if (curve_type(k) .eq. 4)
then
973 x3(eindx(k),1,1) = curve_data(1,k)
974 y3(eindx(k),1,1) = curve_data(2,k)
975 z3(eindx(k),1,1) = curve_data(3,k)
981 if (msh%gdim .eq. 3)
then
986 call neko_warning(
' m deformation not supported for 2d yet')
994 if (msh%gdim .gt. 2)
then
999 call trsp(jx, xh%lx, jxt, 3)
1000 if (msh%gdim .eq. 3)
then
1001 call tensr3(tmp, xh%lx, x3, 3, jx, jyt, jzt, w)
1002 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
1003 call tensr3(tmp, xh%ly, y3, 3, jx, jyt, jzt, w)
1004 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
1005 call tensr3(tmp, xh%lz, z3, 3, jx, jyt, jzt, w)
1006 call copy(z, tmp, xh%lx*xh%ly*xh%lz)
1008 call tnsr2d_el(tmp, xh%lx, x3, 3, jx, jyt)
1009 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
1010 call tnsr2d_el(tmp, xh%ly, y3, 3, jx, jyt)
1011 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
1025 integer,
intent(in) :: n
1026 real(kind=
rp),
intent(inout) :: x(n, n, n)
1027 real(kind=
rp),
intent(in) :: zg(n)
1028 real(kind=
rp),
intent(inout) :: e(n, n, n)
1029 real(kind=
rp),
intent(inout) :: v(n, n, n)
1030 integer :: gh_type, ntot, kk, jj, ii, k, j, i
1031 real(kind=
xp) :: si, sj, sk, hi, hj, hk
1037 do concurrent(i = 1:ntot)
1041 do concurrent(i = 1:n, j = 1:n, k = 1:n, &
1042 ii = 1:n:n-1, jj = 1:n:n-1, kk = 1:n:n-1)
1043 si = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
1044 sj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
1045 sk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
1046 v(i,j,k) = v(i,j,k) + si * sj* sk * x(ii, jj, kk)
1049 if (gh_type .eq. 1)
then
1050 do concurrent(i = 1:ntot)
1058 do concurrent(i = 1:ntot)
1064 do concurrent(i = 1:n, j = 1:n, k = 1:n, jj = 1:n:n-1, kk = 1:n:n-1)
1065 hj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
1066 hk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
1067 e(i,j,k) = e(i,j,k) + hj*hk*(x(i, jj, kk) - v(i, jj, kk))
1072 do concurrent(i = 1:n, j = 1:n, k = 1:n, ii = 1:n:n-1, kk = 1:n:n-1)
1073 hi = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
1074 hk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
1075 e(i,j,k) = e(i,j,k) + hi*hk*(x(ii, j, kk) - v(ii, j, kk))
1080 do concurrent(i = 1:n, j = 1:n, k = 1:n, ii = 1:n:n-1, jj = 1:n:n-1)
1081 hi = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
1082 hj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
1083 e(i,j,k) = e(i,j,k) + hi*hj*(x(ii, jj, k) - v(ii, jj, k))
1086 do concurrent(i = 1:ntot)
1087 e(i,1,1) = e(i,1,1) + v(i,1,1)
1090 if (gh_type .eq. 2)
then
1091 do concurrent(i = 1:ntot)
1099 do concurrent(i = 1:ntot)
1105 do concurrent(i = 1:n, j = 1:n, k = 1:n, ii = 1:n:n-1)
1106 hi = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
1107 v(i,j,k) = v(i,j,k) + hi*(x(ii,j,k)-e(ii,j,k))
1113 do concurrent(i = 1:n, j = 1:n, k = 1:n, jj = 1:n:n-1)
1114 hj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
1115 v(i,j,k) = v(i,j,k) + hj*(x(i, jj, k) - e(i, jj, k))
1121 do concurrent(i = 1:n, j = 1:n, k = 1:n, kk = 1:n:n-1)
1122 hk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
1123 v(i,j,k) = v(i,j,k) + hk*(x(i, j, kk) - e(i, j, kk))
1126 do concurrent(i = 1:ntot)
1127 v(i,1,1) = v(i,1,1) + e(i,1,1)
1199 integer,
intent(in) :: isid, gdim
1200 type(
space_t),
intent(in) :: Xh
1202 real(kind=
rp),
dimension(5),
intent(in) :: curve_data
1203 real(kind=
rp),
dimension(Xh%lx, Xh%ly, Xh%lz),
intent(inout) :: x, y, z
1204 real(kind=
rp) :: pt1x, pt1y, pt2x, pt2y, pt12x, pt12y
1205 real(kind=
rp) :: radius, dtheta, r, xys
1206 real(kind=
rp) :: theta0, xcenn, ycenn, h(xh%lx, 3, 2)
1207 real(kind=
rp) :: xcrved(xh%lx), ycrved(xh%lx), xs, ys
1208 integer :: isid1, ixt, iyt, izt, ix, itmp
1210 integer(i4),
dimension(6),
parameter :: fcyc_to_sym = [3, 2, 4, 1, 5, 6]
1212 integer(i4),
dimension(12),
parameter :: ecyc_to_sym = [1, 6, 2, 5, 3, 8, &
1213 4, 7, 9, 10, 12, 11]
1215 integer,
parameter,
dimension(2, 12) :: edge_nodes = reshape([1, 2, 3, 4, &
1216 5, 6, 7, 8, 1, 3, 2, 4, 5, 7, 6, 8, 1, 5, 2, 6, 3, 7, 4, 8], &
1224 itmp = ecyc_to_sym(isid)
1227 pt1x =
element%pts(edge_nodes(1, itmp))%p%x(1)
1228 pt1y =
element%pts(edge_nodes(1, itmp))%p%x(2)
1229 pt2x =
element%pts(edge_nodes(2, itmp))%p%x(1)
1230 pt2y =
element%pts(edge_nodes(2, itmp))%p%x(2)
1232 pt1x =
element%pts(edge_nodes(2, itmp))%p%x(1)
1233 pt1y =
element%pts(edge_nodes(2, itmp))%p%x(2)
1234 pt2x =
element%pts(edge_nodes(1, itmp))%p%x(1)
1235 pt2y =
element%pts(edge_nodes(1, itmp))%p%x(2)
1238 radius = curve_data(1)
1242 xys = sqrt(xs**2 + ys**2)
1244 if (abs(2.0 * radius) <= xys * 1.00001) &
1245 &
call neko_error(
'Radius to small for arced element surface')
1247 dtheta = abs(asin(0.5_xp*xys/radius))
1248 pt12x = (pt1x + pt2x)/2.0
1249 pt12y = (pt1y + pt2y)/2.0
1250 xcenn = pt12x - xs/xys * radius*cos(dtheta)
1251 ycenn = pt12y - ys/xys * radius*cos(dtheta)
1252 theta0 = atan2((pt12y-ycenn), (pt12x-xcenn))
1254 isid1 = mod(isid+4-1, 4)+1
1256 if (radius < 0.0) dtheta = -dtheta
1259 if (isid1 .gt. 2) ixt = xh%lx+1-ix
1261 xcrved(ixt) = xcenn + abs(radius) * cos(theta0 + r*dtheta) &
1262 - ( h(ix,1,1)*pt1x + h(ix,1,2)*pt2x )
1263 ycrved(ixt) = ycenn + abs(radius) * sin(theta0 + r*dtheta) &
1264 - ( h(ix,1,1)*pt1y + h(ix,1,2)*pt2y )
1269 isid1 = fcyc_to_sym(isid1)
1273 if (isid1 .le. 2)
then
1274 call addtnsr(x, h(1, 1, ixt), xcrved, h(1, 3, izt), &
1275 xh%lx, xh%ly, xh%lz)
1276 call addtnsr(y, h(1, 1, ixt), ycrved, h(1, 3, izt), &
1277 xh%lx, xh%ly, xh%lz)
1279 call addtnsr(x, xcrved, h(1, 2, iyt), h(1, 3, izt), &
1280 xh%lx, xh%ly, xh%lz)
1281 call addtnsr(y, ycrved, h(1, 2, iyt), h(1, 3, izt), &
1282 xh%lx, xh%ly, xh%lz)