288 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 shared_dof = msh%is_shared_edge(i, 1)
314 global_id = msh%get_global_edge(i, 1)
315 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
317 if (this%dof(1,1,1,i) .gt. this%dof(xh%lx, 1, 1, i))
then
318 do concurrent(j = 2:xh%lx - 1)
320 this%dof(k, 1, 1, i) = edge_id + (j-2)
321 this%shared_dof(k, 1, 1, i) = shared_dof
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
331 shared_dof = msh%is_shared_edge(i, 3)
332 global_id = msh%get_global_edge(i, 3)
333 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
334 if (this%dof(1, 1, xh%lz, i) .gt. this%dof(xh%lx, 1, xh%lz, i))
then
335 do concurrent(j = 2:xh%lx - 1)
337 this%dof(k, 1, xh%lz, i) = edge_id + (j-2)
338 this%shared_dof(k, 1, xh%lz, i) = shared_dof
341 do concurrent(j = 2:xh%lx - 1)
343 this%dof(k, 1, xh%lz, i) = edge_id + (j-2)
344 this%shared_dof(k, 1, xh%lz, i) = shared_dof
348 shared_dof = msh%is_shared_edge(i, 2)
349 global_id = msh%get_global_edge(i, 2)
350 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
351 if (this%dof(1, xh%ly, 1, i) .gt. this%dof(xh%lx, xh%ly, 1, i))
then
352 do concurrent(j = 2:xh%lx - 1)
354 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
355 this%shared_dof(k, xh%ly, 1, i) = shared_dof
358 do concurrent(j = 2:xh%lx - 1)
360 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
361 this%shared_dof(k, xh%ly, 1, i) = shared_dof
365 shared_dof = msh%is_shared_edge(i, 4)
366 global_id = msh%get_global_edge(i, 4)
367 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
368 if (this%dof(1, xh%ly, xh%lz, i) .gt. &
369 this%dof(xh%lx, xh%ly, xh%lz, i))
then
370 do concurrent(j = 2:xh%lx - 1)
372 this%dof(k, xh%ly, xh%lz, i) = edge_id + (j-2)
373 this%shared_dof(k, xh%ly, xh%lz, i) = shared_dof
376 do concurrent(j = 2:xh%lx - 1)
378 this%dof(k, xh%ly, xh%lz, i) = edge_id + (j-2)
379 this%shared_dof(k, xh%ly, xh%lz, i) = shared_dof
387 shared_dof = msh%is_shared_edge(i, 5)
388 global_id = msh%get_global_edge(i, 5)
389 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
390 if (this%dof(1,1,1,i) .gt. this%dof(1, xh%ly, 1, i))
then
391 do concurrent(j = 2:xh%ly - 1)
393 this%dof(1, k, 1, i) = edge_id + (j-2)
394 this%shared_dof(1, k, 1, i) = shared_dof
397 do concurrent(j = 2:xh%ly - 1)
399 this%dof(1, k, 1, i) = edge_id + (j-2)
400 this%shared_dof(1, k, 1, i) = shared_dof
404 shared_dof = msh%is_shared_edge(i, 7)
405 global_id = msh%get_global_edge(i, 7)
406 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
407 if (this%dof(1, 1, xh%lz, i) .gt. this%dof(1, xh%ly, xh%lz, i))
then
408 do concurrent(j = 2:xh%ly - 1)
410 this%dof(1, k, xh%lz, i) = edge_id + (j-2)
411 this%shared_dof(1, k, xh%lz, i) = shared_dof
414 do concurrent(j = 2:xh%ly - 1)
416 this%dof(1, k, xh%lz, i) = edge_id + (j-2)
417 this%shared_dof(1, k, xh%lz, i) = shared_dof
421 shared_dof = msh%is_shared_edge(i, 6)
422 global_id = msh%get_global_edge(i, 6)
423 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
424 if (this%dof(xh%lx, 1, 1, i) .gt. this%dof(xh%lx, xh%ly, 1, i))
then
425 do concurrent(j = 2:xh%ly - 1)
427 this%dof(xh%lx, k, 1, i) = edge_id + (j-2)
428 this%shared_dof(xh%lx, k, 1, i) = shared_dof
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
438 shared_dof = msh%is_shared_edge(i, 8)
439 global_id = msh%get_global_edge(i, 8)
440 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
441 if (this%dof(xh%lx, 1, xh%lz, i) .gt. &
442 this%dof(xh%lx, xh%ly, xh%lz, i))
then
443 do concurrent(j = 2:xh%ly - 1)
445 this%dof(xh%lx, k, xh%lz, i) = edge_id + (j-2)
446 this%shared_dof(xh%lx, k, xh%lz, i) = shared_dof
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
459 shared_dof = msh%is_shared_edge(i, 9)
460 global_id = msh%get_global_edge(i, 9)
461 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
462 if (this%dof(1,1,1,i) .gt. this%dof(1, 1, xh%lz, i))
then
463 do concurrent(j = 2:xh%lz - 1)
465 this%dof(1, 1, k, i) = edge_id + (j-2)
466 this%shared_dof(1, 1, k, i) = shared_dof
469 do concurrent(j = 2:xh%lz - 1)
471 this%dof(1, 1, k, i) = edge_id + (j-2)
472 this%shared_dof(1, 1, k, i) = shared_dof
476 shared_dof = msh%is_shared_edge(i, 10)
477 global_id = msh%get_global_edge(i, 10)
478 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
479 if (this%dof(xh%lx,1,1,i) .gt. this%dof(xh%lx, 1, xh%lz, i))
then
480 do concurrent(j = 2:xh%lz - 1)
482 this%dof(xh%lx, 1, k, i) = edge_id + (j-2)
483 this%shared_dof(xh%lx, 1, k, i) = shared_dof
486 do concurrent(j = 2:xh%lz - 1)
488 this%dof(xh%lx, 1, k, i) = edge_id + (j-2)
489 this%shared_dof(xh%lx, 1, k, i) = shared_dof
493 shared_dof = msh%is_shared_edge(i, 11)
494 global_id = msh%get_global_edge(i, 11)
495 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
496 if (this%dof(1, xh%ly, 1, i) .gt. this%dof(1, xh%ly, xh%lz, i))
then
497 do concurrent(j = 2:xh%lz - 1)
499 this%dof(1, xh%ly, k, i) = edge_id + (j-2)
500 this%shared_dof(1, xh%ly, k, i) = shared_dof
503 do concurrent(j = 2:xh%lz - 1)
505 this%dof(1, xh%ly, k, i) = edge_id + (j-2)
506 this%shared_dof(1, xh%ly, k, i) = shared_dof
510 shared_dof = msh%is_shared_edge(i, 12)
511 global_id = msh%get_global_edge(i, 12)
512 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
513 if (this%dof(xh%lx, xh%ly, 1, i) .gt. &
514 this%dof(xh%lx, xh%ly, xh%lz, i))
then
515 do concurrent(j = 2:xh%lz - 1)
517 this%dof(xh%lx, xh%ly, k, i) = edge_id + (j-2)
518 this%shared_dof(xh%lx, xh%ly, k, i) = shared_dof
521 do concurrent(j = 2:xh%lz - 1)
523 this%dof(xh%lx, xh%ly, k, i) = edge_id + (j-2)
524 this%shared_dof(xh%lx, xh%ly, k, i) = shared_dof
531 shared_dof = msh%is_shared_edge(i, 3)
532 global_id = msh%get_global_edge(i, 3)
533 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
535 if (this%dof(1,1,1,i) .gt. this%dof(xh%lx, 1, 1, i))
then
536 do concurrent(j = 2:xh%lx - 1)
538 this%dof(k, 1, 1, i) = edge_id + (j-2)
539 this%shared_dof(k, 1, 1, i) = shared_dof
542 do concurrent(j = 2:xh%lx - 1)
544 this%dof(k, 1, 1, i) = edge_id + (j-2)
545 this%shared_dof(k, 1, 1, i) = shared_dof
549 shared_dof = msh%is_shared_edge(i, 4)
550 global_id = msh%get_global_edge(i, 4)
551 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
552 if (this%dof(1, xh%ly, 1, i) .gt. this%dof(xh%lx, xh%ly, 1, i))
then
553 do concurrent(j = 2:xh%lx - 1)
555 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
556 this%shared_dof(k, xh%ly, 1, i) = shared_dof
559 do concurrent(j = 2:xh%lx - 1)
561 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
562 this%shared_dof(k, xh%ly, 1, i) = shared_dof
569 shared_dof = msh%is_shared_edge(i, 1)
570 global_id = msh%get_global_edge(i, 1)
571 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
572 if (this%dof(1,1,1,i) .gt. this%dof(1, xh%ly, 1, i))
then
573 do concurrent(j = 2:xh%ly - 1)
575 this%dof(1, k, 1, i) = edge_id + (j-2)
576 this%shared_dof(1, k, 1, i) = shared_dof
579 do concurrent(j = 2:xh%ly - 1)
581 this%dof(1, k, 1, i) = edge_id + (j-2)
582 this%shared_dof(1, k, 1, i) = shared_dof
586 shared_dof = msh%is_shared_edge(i, 2)
587 global_id = msh%get_global_edge(i, 2)
588 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
589 if (this%dof(xh%lx,1,1,i) .gt. this%dof(xh%lx, xh%ly, 1, i))
then
590 do concurrent(j = 2:xh%ly - 1)
592 this%dof(xh%lx, k, 1, i) = edge_id + (j-2)
593 this%shared_dof(xh%lx, k, 1, i) = shared_dof
596 do concurrent(j = 2:xh%ly - 1)
598 this%dof(xh%lx, k, 1, i) = edge_id + (j-2)
599 this%shared_dof(xh%lx, k, 1, i) = shared_dof
611 type(
mesh_t),
pointer :: msh
616 integer(kind=i8) :: num_dofs_faces(3)
617 integer(kind=i8) :: facet_offset, facet_id
618 logical :: shared_dof
624 facet_offset = int(msh%glb_mpts,
i8) + &
625 int(msh%glb_meds,
i8) * int(xh%lx-2,
i8) + int(1,
i8)
628 num_dofs_faces(1) = int((xh%ly - 2) * (xh%lz - 2),
i8)
629 num_dofs_faces(2) = int((xh%lx - 2) * (xh%lz - 2),
i8)
630 num_dofs_faces(3) = int((xh%lx - 2) * (xh%ly - 2),
i8)
638 call msh%elements(i)%e%facet_id(face, 1)
639 call msh%elements(i)%e%facet_order(face_order, 1)
640 shared_dof = msh%is_shared_facet(i, 1)
641 global_id = msh%get_global_facet(i, 1)
642 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(1)
646 facet_id, j, k, xh%lz, xh%ly)
647 this%shared_dof(1, j, k, i) = shared_dof
651 call msh%elements(i)%e%facet_id(face, 2)
652 call msh%elements(i)%e%facet_order(face_order, 2)
653 shared_dof = msh%is_shared_facet(i, 2)
654 global_id = msh%get_global_facet(i, 2)
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(xh%lx, j, k, i) = shared_dof
668 call msh%elements(i)%e%facet_id(face, 3)
669 call msh%elements(i)%e%facet_order(face_order, 3)
670 shared_dof = msh%is_shared_facet(i, 3)
671 global_id = msh%get_global_facet(i, 3)
672 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(2)
676 facet_id, k, j, xh%lz, xh%lx)
677 this%shared_dof(j, 1, k, i) = shared_dof
681 call msh%elements(i)%e%facet_id(face, 4)
682 call msh%elements(i)%e%facet_order(face_order, 4)
683 shared_dof = msh%is_shared_facet(i, 4)
684 global_id = msh%get_global_facet(i, 4)
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, xh%ly, k, i) = shared_dof
698 call msh%elements(i)%e%facet_id(face, 5)
699 call msh%elements(i)%e%facet_order(face_order, 5)
700 shared_dof = msh%is_shared_facet(i, 5)
701 global_id = msh%get_global_facet(i, 5)
702 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(3)
706 facet_id, k, j, xh%ly, xh%lx)
707 this%shared_dof(j, k, 1, i) = shared_dof
711 call msh%elements(i)%e%facet_id(face, 6)
712 call msh%elements(i)%e%facet_order(face_order, 6)
713 shared_dof = msh%is_shared_facet(i, 6)
714 global_id = msh%get_global_facet(i, 6)
715 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(3)
719 facet_id, k, j, xh%lz, xh%lx)
720 this%shared_dof(j, k, xh%lz, i) = shared_dof
854 type(
mesh_t),
pointer,
intent(in) :: msh
855 type(
space_t),
intent(in) :: Xh
857 real(kind=
rp),
intent(inout) :: x(xh%lx, xh%ly, xh%lz), &
858 y(xh%lx, xh%ly, xh%lz), &
859 z(xh%lx, xh%ly, xh%lz)
860 real(kind=
rp) :: xyzb(2,2,2,3), zgml(xh%lx, 3)
861 real(kind=
rp) :: jx(xh%lx*2)
862 real(kind=
rp) :: jxt(xh%lx*2), jyt(xh%lx*2), jzt(xh%lx*2)
863 real(kind=
rp) :: w(4*xh%lx**3), tmp(xh%lx, xh%lx, xh%lx)
864 real(kind=
rp),
dimension(2),
parameter :: zlin = [-1d0, 1d0]
872 call copy(zgml(1,1), xh%zg(1,1), xh%lx)
873 call copy(zgml(1,2), xh%zg(1,2), xh%ly)
874 if (msh%gdim .gt. 2)
then
875 call copy(zgml(1,3), xh%zg(1,3), xh%lz)
882 if (msh%gdim .gt. 2)
then
887 call trsp(jx, xh%lx, jxt, 2)
889 if (msh%gdim .eq. 2)
then
893 if (msh%gdim .gt. 2)
then
894 do concurrent(j = 1:msh%gdim)
895 xyzb(1,1,1,j) =
element%pts(1)%p%x(j)
896 xyzb(2,1,1,j) =
element%pts(2)%p%x(j)
897 xyzb(1,2,1,j) =
element%pts(3)%p%x(j)
898 xyzb(2,2,1,j) =
element%pts(4)%p%x(j)
900 xyzb(1,1,2,j) =
element%pts(5)%p%x(j)
901 xyzb(2,1,2,j) =
element%pts(6)%p%x(j)
902 xyzb(1,2,2,j) =
element%pts(7)%p%x(j)
903 xyzb(2,2,2,j) =
element%pts(8)%p%x(j)
906 do concurrent(j = 1:msh%gdim)
907 xyzb(1,1,1,j) =
element%pts(1)%p%x(j)
908 xyzb(2,1,1,j) =
element%pts(2)%p%x(j)
909 xyzb(1,2,1,j) =
element%pts(3)%p%x(j)
910 xyzb(2,2,1,j) =
element%pts(4)%p%x(j)
913 if (msh%gdim .eq. 3)
then
914 call tensr3(tmp, xh%lx, xyzb(1,1,1,1), 2, jx, jyt, jzt, w)
915 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
916 call tensr3(tmp, xh%ly, xyzb(1,1,1,2), 2, jx, jyt, jzt, w)
917 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
918 call tensr3(tmp, xh%lz, xyzb(1,1,1,3), 2, jx, jyt, jzt, w)
919 call copy(z, tmp, xh%lx*xh%ly*xh%lz)
921 call tnsr2d_el(tmp, xh%lx, xyzb(1,1,1,1), 2, jx, jyt)
922 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
923 call tnsr2d_el(tmp, xh%ly, xyzb(1,1,1,2), 2, jx, jyt)
924 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
930 type(
mesh_t),
pointer,
intent(in) :: msh
931 type(
space_t),
intent(in) :: Xh
933 real(kind=
rp),
dimension(Xh%lx, Xh%ly, Xh%lz),
intent(inout) :: x, y, z
934 integer :: curve_type(12), eindx(12)
935 real(kind=
rp) :: curve_data(5,12), x3(3,3,3), y3(3,3,3), z3(3,3,3)
937 real(kind=
rp),
dimension(3),
parameter :: zquad = [-1d0, 0d0,1d0]
938 real(kind=
rp) :: zg(3)
939 real(kind=
rp),
dimension(Xh%lx, Xh%lx, Xh%lx) :: tmp
940 real(kind=
rp) :: jx(xh%lx*3)
941 real(kind=
rp) :: jxt(xh%lx*3), jyt(xh%lx*3), jzt(xh%lx*3)
942 real(kind=
rp) :: w(4*xh%lxyz,2)
943 integer :: j, k, n_edges
944 eindx = [2 , 6 , 8 , 4, &
949 if (msh%gdim .eq. 3)
then
951 call xh3%init(
gll, 3, 3, 3)
954 call xh3%init(
gll, 3, 3)
959 if (curve_type(k) .eq. 4)
then
960 x3(eindx(k),1,1) = curve_data(1,k)
961 y3(eindx(k),1,1) = curve_data(2,k)
962 z3(eindx(k),1,1) = curve_data(3,k)
968 if (msh%gdim .eq. 3)
then
973 call neko_warning(
' m deformation not supported for 2d yet')
981 if (msh%gdim .gt. 2)
then
986 call trsp(jx, xh%lx, jxt, 3)
987 if (msh%gdim .eq. 3)
then
988 call tensr3(tmp, xh%lx, x3, 3, jx, jyt, jzt, w)
989 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
990 call tensr3(tmp, xh%ly, y3, 3, jx, jyt, jzt, w)
991 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
992 call tensr3(tmp, xh%lz, z3, 3, jx, jyt, jzt, w)
993 call copy(z, tmp, xh%lx*xh%ly*xh%lz)
995 call tnsr2d_el(tmp, xh%lx, x3, 3, jx, jyt)
996 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
997 call tnsr2d_el(tmp, xh%ly, y3, 3, jx, jyt)
998 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
1012 integer,
intent(in) :: n
1013 real(kind=
rp),
intent(inout) :: x(n, n, n)
1014 real(kind=
rp),
intent(in) :: zg(n)
1015 real(kind=
rp),
intent(inout) :: e(n, n, n)
1016 real(kind=
rp),
intent(inout) :: v(n, n, n)
1017 integer :: gh_type, ntot, kk, jj, ii, k, j, i
1018 real(kind=
xp) :: si, sj, sk, hi, hj, hk
1024 do concurrent(i = 1:ntot)
1028 do concurrent(i = 1:n, j = 1:n, k = 1:n, &
1029 ii = 1:n:n-1, jj = 1:n:n-1, kk = 1:n:n-1)
1030 si = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
1031 sj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
1032 sk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
1033 v(i,j,k) = v(i,j,k) + si * sj* sk * x(ii, jj, kk)
1036 if (gh_type .eq. 1)
then
1037 do concurrent(i = 1:ntot)
1045 do concurrent(i = 1:ntot)
1051 do concurrent(i = 1:n, j = 1:n, k = 1:n, jj = 1:n:n-1, kk = 1:n:n-1)
1052 hj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
1053 hk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
1054 e(i,j,k) = e(i,j,k) + hj*hk*(x(i, jj, kk) - v(i, jj, kk))
1059 do concurrent(i = 1:n, j = 1:n, k = 1:n, ii = 1:n:n-1, kk = 1:n:n-1)
1060 hi = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
1061 hk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
1062 e(i,j,k) = e(i,j,k) + hi*hk*(x(ii, j, kk) - v(ii, j, kk))
1067 do concurrent(i = 1:n, j = 1:n, k = 1:n, ii = 1:n:n-1, jj = 1:n:n-1)
1068 hi = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
1069 hj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
1070 e(i,j,k) = e(i,j,k) + hi*hj*(x(ii, jj, k) - v(ii, jj, k))
1073 do concurrent(i = 1:ntot)
1074 e(i,1,1) = e(i,1,1) + v(i,1,1)
1077 if (gh_type .eq. 2)
then
1078 do concurrent(i = 1:ntot)
1086 do concurrent(i = 1:ntot)
1092 do concurrent(i = 1:n, j = 1:n, k = 1:n, ii = 1:n:n-1)
1093 hi = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
1094 v(i,j,k) = v(i,j,k) + hi*(x(ii,j,k)-e(ii,j,k))
1100 do concurrent(i = 1:n, j = 1:n, k = 1:n, jj = 1:n:n-1)
1101 hj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
1102 v(i,j,k) = v(i,j,k) + hj*(x(i, jj, k) - e(i, jj, k))
1108 do concurrent(i = 1:n, j = 1:n, k = 1:n, kk = 1:n:n-1)
1109 hk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
1110 v(i,j,k) = v(i,j,k) + hk*(x(i, j, kk) - e(i, j, kk))
1113 do concurrent(i = 1:ntot)
1114 v(i,1,1) = v(i,1,1) + e(i,1,1)
1186 integer,
intent(in) :: isid, gdim
1187 type(
space_t),
intent(in) :: Xh
1189 real(kind=
rp),
dimension(5),
intent(in) :: curve_data
1190 real(kind=
rp),
dimension(Xh%lx, Xh%ly, Xh%lz),
intent(inout) :: x, y, z
1191 real(kind=
rp) :: pt1x, pt1y, pt2x, pt2y, pt12x, pt12y
1192 real(kind=
rp) :: radius, dtheta, r, xys
1193 real(kind=
rp) :: theta0, xcenn, ycenn, h(xh%lx, 3, 2)
1194 real(kind=
rp) :: xcrved(xh%lx), ycrved(xh%lx), xs, ys
1195 integer :: isid1, ixt, iyt, izt, ix, itmp
1197 integer(i4),
dimension(6),
parameter :: fcyc_to_sym = [3, 2, 4, 1, 5, 6]
1199 integer(i4),
dimension(12),
parameter :: ecyc_to_sym = [1, 6, 2, 5, 3, 8, &
1200 4, 7, 9, 10, 12, 11]
1202 integer,
parameter,
dimension(2, 12) :: edge_nodes = reshape([1, 2, 3, 4, &
1203 5, 6, 7, 8, 1, 3, 2, 4, 5, 7, 6, 8, 1, 5, 2, 6, 3, 7, 4, 8], &
1211 itmp = ecyc_to_sym(isid)
1214 pt1x =
element%pts(edge_nodes(1, itmp))%p%x(1)
1215 pt1y =
element%pts(edge_nodes(1, itmp))%p%x(2)
1216 pt2x =
element%pts(edge_nodes(2, itmp))%p%x(1)
1217 pt2y =
element%pts(edge_nodes(2, itmp))%p%x(2)
1219 pt1x =
element%pts(edge_nodes(2, itmp))%p%x(1)
1220 pt1y =
element%pts(edge_nodes(2, itmp))%p%x(2)
1221 pt2x =
element%pts(edge_nodes(1, itmp))%p%x(1)
1222 pt2y =
element%pts(edge_nodes(1, itmp))%p%x(2)
1225 radius = curve_data(1)
1229 xys = sqrt(xs**2 + ys**2)
1231 if (abs(2.0 * radius) <= xys * 1.00001) &
1232 &
call neko_error(
'Radius to small for arced element surface')
1234 dtheta = abs(asin(0.5_xp*xys/radius))
1235 pt12x = (pt1x + pt2x)/2.0
1236 pt12y = (pt1y + pt2y)/2.0
1237 xcenn = pt12x - xs/xys * radius*cos(dtheta)
1238 ycenn = pt12y - ys/xys * radius*cos(dtheta)
1239 theta0 = atan2((pt12y-ycenn), (pt12x-xcenn))
1241 isid1 = mod(isid+4-1, 4)+1
1243 if (radius < 0.0) dtheta = -dtheta
1246 if (isid1 .gt. 2) ixt = xh%lx+1-ix
1248 xcrved(ixt) = xcenn + abs(radius) * cos(theta0 + r*dtheta) &
1249 - ( h(ix,1,1)*pt1x + h(ix,1,2)*pt2x )
1250 ycrved(ixt) = ycenn + abs(radius) * sin(theta0 + r*dtheta) &
1251 - ( h(ix,1,1)*pt1y + h(ix,1,2)*pt2y )
1256 isid1 = fcyc_to_sym(isid1)
1260 if (isid1 .le. 2)
then
1261 call addtnsr(x, h(1, 1, ixt), xcrved, h(1, 3, izt), &
1262 xh%lx, xh%ly, xh%lz)
1263 call addtnsr(y, h(1, 1, ixt), ycrved, h(1, 3, izt), &
1264 xh%lx, xh%ly, xh%lz)
1266 call addtnsr(x, xcrved, h(1, 2, iyt), h(1, 3, izt), &
1267 xh%lx, xh%ly, xh%lz)
1268 call addtnsr(y, ycrved, h(1, 2, iyt), h(1, 3, izt), &
1269 xh%lx, xh%ly, xh%lz)