246 type(
mesh_t),
pointer :: msh
251 integer(kind=i8) :: num_dofs_edges(3)
252 integer(kind=i8) :: edge_id, edge_offset
253 logical :: shared_dof
259 num_dofs_edges(1) = int(xh%lx - 2,
i8)
260 num_dofs_edges(2) = int(xh%ly - 2,
i8)
261 num_dofs_edges(3) = int(xh%lz - 2,
i8)
262 edge_offset = int(msh%glb_mpts,
i8) + int(1,
i8)
267 select type (ep => msh%elements(i)%e)
272 call ep%edge_id(edge, 1)
273 shared_dof = msh%is_shared(edge)
274 global_id = msh%get_global(edge)
275 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
277 if (int(edge%x(1),
i8) .ne. this%dof(1,1,1,i))
then
278 do concurrent(j = 2:xh%lx - 1)
280 this%dof(k, 1, 1, i) = edge_id + (j-2)
281 this%shared_dof(k, 1, 1, i) = shared_dof
284 do concurrent(j = 2:xh%lx - 1)
286 this%dof(k, 1, 1, i) = edge_id + (j-2)
287 this%shared_dof(k, 1, 1, i) = shared_dof
291 call ep%edge_id(edge, 3)
292 shared_dof = msh%is_shared(edge)
293 global_id = msh%get_global(edge)
294 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
295 if (int(edge%x(1),
i8) .ne. this%dof(1, 1, xh%lz, i))
then
296 do concurrent(j = 2:xh%lx - 1)
298 this%dof(k, 1, xh%lz, i) = edge_id + (j-2)
299 this%shared_dof(k, 1, xh%lz, i) = shared_dof
302 do concurrent(j = 2:xh%lx - 1)
304 this%dof(k, 1, xh%lz, i) = edge_id + (j-2)
305 this%shared_dof(k, 1, xh%lz, i) = shared_dof
309 call ep%edge_id(edge, 2)
310 shared_dof = msh%is_shared(edge)
311 global_id = msh%get_global(edge)
312 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
313 if (int(edge%x(1),
i8) .ne. this%dof(1, xh%ly, 1, i))
then
314 do concurrent(j = 2:xh%lx - 1)
316 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
317 this%shared_dof(k, xh%ly, 1, i) = shared_dof
320 do concurrent(j = 2:xh%lx - 1)
322 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
323 this%shared_dof(k, xh%ly, 1, i) = shared_dof
327 call ep%edge_id(edge, 4)
328 shared_dof = msh%is_shared(edge)
329 global_id = msh%get_global(edge)
330 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
331 if (int(edge%x(1),
i8) .ne. this%dof(1, xh%ly, xh%lz, i))
then
332 do concurrent(j = 2:xh%lx - 1)
334 this%dof(k, xh%ly, xh%lz, i) = edge_id + (j-2)
335 this%shared_dof(k, xh%ly, xh%lz, i) = shared_dof
338 do concurrent(j = 2:xh%lx - 1)
340 this%dof(k, xh%ly, xh%lz, i) = edge_id + (j-2)
341 this%shared_dof(k, xh%ly, xh%lz, i) = shared_dof
349 call ep%edge_id(edge, 5)
350 shared_dof = msh%is_shared(edge)
351 global_id = msh%get_global(edge)
352 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
353 if (int(edge%x(1),
i8) .ne. this%dof(1,1,1,i))
then
354 do concurrent(j = 2:xh%ly - 1)
356 this%dof(1, k, 1, i) = edge_id + (j-2)
357 this%shared_dof(1, k, 1, i) = shared_dof
360 do concurrent(j = 2:xh%ly - 1)
362 this%dof(1, k, 1, i) = edge_id + (j-2)
363 this%shared_dof(1, k, 1, i) = shared_dof
367 call ep%edge_id(edge, 7)
368 shared_dof = msh%is_shared(edge)
369 global_id = msh%get_global(edge)
370 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
371 if (int(edge%x(1),
i8) .ne. this%dof(1, 1, xh%lz, i))
then
372 do concurrent(j = 2:xh%ly - 1)
374 this%dof(1, k, xh%lz, i) = edge_id + (j-2)
375 this%shared_dof(1, k, xh%lz, i) = shared_dof
378 do concurrent(j = 2:xh%ly - 1)
380 this%dof(1, k, xh%lz, i) = edge_id + (j-2)
381 this%shared_dof(1, k, xh%lz, i) = shared_dof
385 call ep%edge_id(edge, 6)
386 shared_dof = msh%is_shared(edge)
387 global_id = msh%get_global(edge)
388 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
389 if (int(edge%x(1),
i8) .ne. this%dof(xh%lx, 1, 1, i))
then
390 do concurrent(j = 2:xh%ly - 1)
392 this%dof(xh%lx, k, 1, i) = edge_id + (j-2)
393 this%shared_dof(xh%lx, k, 1, i) = shared_dof
396 do concurrent(j = 2:xh%ly - 1)
398 this%dof(xh%lx, k, 1, i) = edge_id + (j-2)
399 this%shared_dof(xh%lx, k, 1, i) = shared_dof
403 call ep%edge_id(edge, 8)
404 shared_dof = msh%is_shared(edge)
405 global_id = msh%get_global(edge)
406 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
407 if (int(edge%x(1),
i8) .ne. this%dof(xh%lx, 1, xh%lz, i))
then
408 do concurrent(j = 2:xh%ly - 1)
410 this%dof(xh%lx, k, xh%lz, i) = edge_id + (j-2)
411 this%shared_dof(xh%lx, k, xh%lz, i) = shared_dof
414 do concurrent(j = 2:xh%ly - 1)
416 this%dof(xh%lx, k, xh%lz, i) = edge_id + (j-2)
417 this%shared_dof(xh%lx, k, xh%lz, i) = shared_dof
424 call ep%edge_id(edge, 9)
425 shared_dof = msh%is_shared(edge)
426 global_id = msh%get_global(edge)
427 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
428 if (int(edge%x(1),
i8) .ne. this%dof(1,1,1,i))
then
429 do concurrent(j = 2:xh%lz - 1)
431 this%dof(1, 1, k, i) = edge_id + (j-2)
432 this%shared_dof(1, 1, k, i) = shared_dof
435 do concurrent(j = 2:xh%lz - 1)
437 this%dof(1, 1, k, i) = edge_id + (j-2)
438 this%shared_dof(1, 1, k, i) = shared_dof
442 call ep%edge_id(edge, 10)
443 shared_dof = msh%is_shared(edge)
444 global_id = msh%get_global(edge)
445 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
446 if (int(edge%x(1),
i8) .ne. this%dof(xh%lx,1,1,i))
then
447 do concurrent(j = 2:xh%lz - 1)
449 this%dof(xh%lx, 1, k, i) = edge_id + (j-2)
450 this%shared_dof(xh%lx, 1, k, i) = shared_dof
453 do concurrent(j = 2:xh%lz - 1)
455 this%dof(xh%lx, 1, k, i) = edge_id + (j-2)
456 this%shared_dof(xh%lx, 1, k, i) = shared_dof
460 call ep%edge_id(edge, 11)
461 shared_dof = msh%is_shared(edge)
462 global_id = msh%get_global(edge)
463 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
464 if (int(edge%x(1),
i8) .ne. this%dof(1, xh%ly, 1, i))
then
465 do concurrent(j = 2:xh%lz - 1)
467 this%dof(1, xh%ly, k, i) = edge_id + (j-2)
468 this%shared_dof(1, xh%ly, k, i) = shared_dof
471 do concurrent(j = 2:xh%lz - 1)
473 this%dof(1, xh%ly, k, i) = edge_id + (j-2)
474 this%shared_dof(1, xh%ly, k, i) = shared_dof
478 call ep%edge_id(edge, 12)
479 shared_dof = msh%is_shared(edge)
480 global_id = msh%get_global(edge)
481 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
482 if (int(edge%x(1),
i8) .ne. this%dof(xh%lx, xh%ly, 1, i))
then
483 do concurrent(j = 2:xh%lz - 1)
485 this%dof(xh%lx, xh%ly, k, i) = edge_id + (j-2)
486 this%shared_dof(xh%lx, xh%ly, k, i) = shared_dof
489 do concurrent(j = 2:xh%lz - 1)
491 this%dof(xh%lx, xh%ly, k, i) = edge_id + (j-2)
492 this%shared_dof(xh%lx, xh%ly, k, i) = shared_dof
499 call ep%facet_id(edge, 3)
500 shared_dof = msh%is_shared(edge)
501 global_id = msh%get_global(edge)
502 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
504 if (int(edge%x(1),
i8) .ne. this%dof(1,1,1,i))
then
505 do concurrent(j = 2:xh%lx - 1)
507 this%dof(k, 1, 1, i) = edge_id + (j-2)
508 this%shared_dof(k, 1, 1, i) = shared_dof
511 do concurrent(j = 2:xh%lx - 1)
513 this%dof(k, 1, 1, i) = edge_id + (j-2)
514 this%shared_dof(k, 1, 1, i) = shared_dof
518 call ep%facet_id(edge, 4)
519 shared_dof = msh%is_shared(edge)
520 global_id = msh%get_global(edge)
521 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
522 if (int(edge%x(1),
i8) .ne. this%dof(1, xh%ly, 1, i))
then
523 do concurrent(j = 2:xh%lx - 1)
525 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
526 this%shared_dof(k, xh%ly, 1, i) = shared_dof
529 do concurrent(j = 2:xh%lx - 1)
531 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
532 this%shared_dof(k, xh%ly, 1, i) = shared_dof
539 call ep%facet_id(edge, 1)
540 shared_dof = msh%is_shared(edge)
541 global_id = msh%get_global(edge)
542 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
543 if (int(edge%x(1),
i8) .ne. this%dof(1,1,1,i))
then
544 do concurrent(j = 2:xh%ly - 1)
546 this%dof(1, k, 1, i) = edge_id + (j-2)
547 this%shared_dof(1, k, 1, i) = shared_dof
550 do concurrent(j = 2:xh%ly - 1)
552 this%dof(1, k, 1, i) = edge_id + (j-2)
553 this%shared_dof(1, k, 1, i) = shared_dof
557 call ep%facet_id(edge, 2)
558 shared_dof = msh%is_shared(edge)
559 global_id = msh%get_global(edge)
560 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
561 if (int(edge%x(1),
i8) .ne. this%dof(xh%lx,1,1,i))
then
562 do concurrent(j = 2:xh%ly - 1)
564 this%dof(xh%lx, k, 1, i) = edge_id + (j-2)
565 this%shared_dof(xh%lx, k, 1, i) = shared_dof
568 do concurrent(j = 2:xh%ly - 1)
570 this%dof(xh%lx, k, 1, i) = edge_id + (j-2)
571 this%shared_dof(xh%lx, k, 1, i) = shared_dof
583 type(
mesh_t),
pointer :: msh
588 integer(kind=i8) :: num_dofs_faces(3)
589 integer(kind=i8) :: facet_offset, facet_id
590 logical :: shared_dof
596 facet_offset = int(msh%glb_mpts,
i8) + &
597 int(msh%glb_meds,
i8) * int(xh%lx-2,
i8) + int(1,
i8)
600 num_dofs_faces(1) = int((xh%ly - 2) * (xh%lz - 2),
i8)
601 num_dofs_faces(2) = int((xh%lx - 2) * (xh%lz - 2),
i8)
602 num_dofs_faces(3) = int((xh%lx - 2) * (xh%ly - 2),
i8)
610 call msh%elements(i)%e%facet_id(face, 1)
611 call msh%elements(i)%e%facet_order(face_order, 1)
612 shared_dof = msh%is_shared(face)
613 global_id = msh%get_global(face)
614 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(1)
615 do concurrent(j = 2:(xh%ly - 1), k = 2:(xh%lz -1))
616 this%dof(1, j, k, i) = &
618 this%shared_dof(1, j, k, i) = shared_dof
621 call msh%elements(i)%e%facet_id(face, 2)
622 call msh%elements(i)%e%facet_order(face_order, 2)
623 shared_dof = msh%is_shared(face)
624 global_id = msh%get_global(face)
625 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(1)
626 do concurrent(j = 2:(xh%ly - 1), k = 2:(xh%lz -1))
627 this%dof(xh%lx, j, k, i) = &
629 this%shared_dof(xh%lx, j, k, i) = shared_dof
636 call msh%elements(i)%e%facet_id(face, 3)
637 call msh%elements(i)%e%facet_order(face_order, 3)
638 shared_dof = msh%is_shared(face)
639 global_id = msh%get_global(face)
640 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(2)
641 do concurrent(j = 2:(xh%lx - 1), k = 2:(xh%lz - 1))
642 this%dof(j, 1, k, i) = &
644 this%shared_dof(j, 1, k, i) = shared_dof
647 call msh%elements(i)%e%facet_id(face, 4)
648 call msh%elements(i)%e%facet_order(face_order, 4)
649 shared_dof = msh%is_shared(face)
650 global_id = msh%get_global(face)
651 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(2)
652 do concurrent(j = 2:(xh%lx - 1), k = 2:(xh%lz - 1))
653 this%dof(j, xh%ly, k, i) = &
655 this%shared_dof(j, xh%ly, k, i) = shared_dof
662 call msh%elements(i)%e%facet_id(face, 5)
663 call msh%elements(i)%e%facet_order(face_order, 5)
664 shared_dof = msh%is_shared(face)
665 global_id = msh%get_global(face)
666 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(3)
667 do concurrent(j = 2:(xh%lx - 1), k = 2:(xh%ly - 1))
668 this%dof(j, k, 1, i) = &
670 this%shared_dof(j, k, 1, i) = shared_dof
673 call msh%elements(i)%e%facet_id(face, 6)
674 call msh%elements(i)%e%facet_order(face_order, 6)
675 shared_dof = msh%is_shared(face)
676 global_id = msh%get_global(face)
677 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(3)
678 do concurrent(j = 2:(xh%lx - 1), k = 2:(xh%ly - 1))
679 this%dof(j, k, xh%lz, i) = &
681 this%shared_dof(j, k, xh%lz, i) = shared_dof
814 type(
mesh_t),
pointer,
intent(in) :: msh
815 type(
space_t),
intent(in) :: Xh
817 real(kind=
rp),
intent(inout) :: x(xh%lx, xh%ly, xh%lz), &
818 y(xh%lx, xh%ly, xh%lz), &
819 z(xh%lx, xh%ly, xh%lz)
820 real(kind=
rp) :: xyzb(2,2,2,3), zgml(xh%lx, 3)
821 real(kind=
rp) :: jx(xh%lx*2)
822 real(kind=
rp) :: jxt(xh%lx*2), jyt(xh%lx*2), jzt(xh%lx*2)
823 real(kind=
rp) :: w(4*xh%lx**3), tmp(xh%lx, xh%lx, xh%lx)
824 real(kind=
rp),
dimension(2),
parameter :: zlin = [-1d0, 1d0]
832 call copy(zgml(1,1), xh%zg(1,1), xh%lx)
833 call copy(zgml(1,2), xh%zg(1,2), xh%ly)
834 if (msh%gdim .gt. 2)
then
835 call copy(zgml(1,3), xh%zg(1,3), xh%lz)
842 if (msh%gdim .gt. 2)
then
847 call trsp(jx, xh%lx, jxt, 2)
849 if (msh%gdim .eq. 2)
then
853 if (msh%gdim .gt. 2)
then
854 do concurrent(j = 1:msh%gdim)
855 xyzb(1,1,1,j) =
element%pts(1)%p%x(j)
856 xyzb(2,1,1,j) =
element%pts(2)%p%x(j)
857 xyzb(1,2,1,j) =
element%pts(3)%p%x(j)
858 xyzb(2,2,1,j) =
element%pts(4)%p%x(j)
860 xyzb(1,1,2,j) =
element%pts(5)%p%x(j)
861 xyzb(2,1,2,j) =
element%pts(6)%p%x(j)
862 xyzb(1,2,2,j) =
element%pts(7)%p%x(j)
863 xyzb(2,2,2,j) =
element%pts(8)%p%x(j)
866 do concurrent(j = 1:msh%gdim)
867 xyzb(1,1,1,j) =
element%pts(1)%p%x(j)
868 xyzb(2,1,1,j) =
element%pts(2)%p%x(j)
869 xyzb(1,2,1,j) =
element%pts(3)%p%x(j)
870 xyzb(2,2,1,j) =
element%pts(4)%p%x(j)
873 if (msh%gdim .eq. 3)
then
874 call tensr3(tmp, xh%lx, xyzb(1,1,1,1), 2, jx, jyt, jzt, w)
875 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
876 call tensr3(tmp, xh%ly, xyzb(1,1,1,2), 2, jx, jyt, jzt, w)
877 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
878 call tensr3(tmp, xh%lz, xyzb(1,1,1,3), 2, jx, jyt, jzt, w)
879 call copy(z, tmp, xh%lx*xh%ly*xh%lz)
881 call tnsr2d_el(tmp, xh%lx, xyzb(1,1,1,1), 2, jx, jyt)
882 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
883 call tnsr2d_el(tmp, xh%ly, xyzb(1,1,1,2), 2, jx, jyt)
884 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
890 type(
mesh_t),
pointer,
intent(in) :: msh
891 type(
space_t),
intent(in) :: Xh
893 real(kind=
rp),
dimension(Xh%lx, Xh%ly, Xh%lz),
intent(inout) :: x, y, z
894 integer :: curve_type(12), eindx(12)
895 real(kind=
rp) :: curve_data(5,12), x3(3,3,3), y3(3,3,3), z3(3,3,3)
897 real(kind=
rp),
dimension(3),
parameter :: zquad = [-1d0, 0d0,1d0]
898 real(kind=
rp) :: zg(3)
899 real(kind=
rp),
dimension(Xh%lx, Xh%lx, Xh%lx) :: tmp
900 real(kind=
rp) :: jx(xh%lx*3)
901 real(kind=
rp) :: jxt(xh%lx*3), jyt(xh%lx*3), jzt(xh%lx*3)
902 real(kind=
rp) :: w(4*xh%lxyz,2)
903 integer :: j, k, n_edges
904 eindx = [2 , 6 , 8 , 4, &
909 if (msh%gdim .eq. 3)
then
911 call xh3%init(
gll, 3, 3, 3)
914 call xh3%init(
gll, 3, 3)
919 if (curve_type(k) .eq. 4)
then
920 x3(eindx(k),1,1) = curve_data(1,k)
921 y3(eindx(k),1,1) = curve_data(2,k)
922 z3(eindx(k),1,1) = curve_data(3,k)
928 if (msh%gdim .eq. 3)
then
933 call neko_warning(
' m deformation not supported for 2d yet')
941 if (msh%gdim .gt. 2)
then
946 call trsp(jx, xh%lx, jxt, 3)
947 if (msh%gdim .eq. 3)
then
948 call tensr3(tmp, xh%lx, x3, 3, jx, jyt, jzt, w)
949 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
950 call tensr3(tmp, xh%ly, y3, 3, jx, jyt, jzt, w)
951 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
952 call tensr3(tmp, xh%lz, z3, 3, jx, jyt, jzt, w)
953 call copy(z, tmp, xh%lx*xh%ly*xh%lz)
955 call tnsr2d_el(tmp, xh%lx, x3, 3, jx, jyt)
956 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
957 call tnsr2d_el(tmp, xh%ly, y3, 3, jx, jyt)
958 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
972 integer,
intent(in) :: n
973 real(kind=
rp),
intent(inout) :: x(n, n, n)
974 real(kind=
rp),
intent(in) :: zg(n)
975 real(kind=
rp),
intent(inout) :: e(n, n, n)
976 real(kind=
rp),
intent(inout) :: v(n, n, n)
977 integer :: gh_type, ntot, kk, jj, ii, k, j, i
978 real(kind=
xp) :: si, sj, sk, hi, hj, hk
984 do concurrent(i = 1:ntot)
988 do concurrent(i = 1:n, j = 1:n, k = 1:n, &
989 ii = 1:n:n-1, jj = 1:n:n-1, kk = 1:n:n-1)
990 si = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
991 sj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
992 sk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
993 v(i,j,k) = v(i,j,k) + si * sj* sk * x(ii, jj, kk)
996 if (gh_type .eq. 1)
then
997 do concurrent(i = 1:ntot)
1005 do concurrent(i = 1:ntot)
1011 do concurrent(i = 1:n, j = 1:n, k = 1:n, jj = 1:n:n-1, kk = 1:n:n-1)
1012 hj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
1013 hk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
1014 e(i,j,k) = e(i,j,k) + hj*hk*(x(i, jj, kk) - v(i, jj, kk))
1019 do concurrent(i = 1:n, j = 1:n, k = 1:n, ii = 1:n:n-1, kk = 1:n:n-1)
1020 hi = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
1021 hk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
1022 e(i,j,k) = e(i,j,k) + hi*hk*(x(ii, j, kk) - v(ii, j, kk))
1027 do concurrent(i = 1:n, j = 1:n, k = 1:n, ii = 1:n:n-1, jj = 1:n:n-1)
1028 hi = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
1029 hj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
1030 e(i,j,k) = e(i,j,k) + hi*hj*(x(ii, jj, k) - v(ii, jj, k))
1033 do concurrent(i = 1:ntot)
1034 e(i,1,1) = e(i,1,1) + v(i,1,1)
1037 if (gh_type .eq. 2)
then
1038 do concurrent(i = 1:ntot)
1046 do concurrent(i = 1:ntot)
1052 do concurrent(i = 1:n, j = 1:n, k = 1:n, ii = 1:n:n-1)
1053 hi = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
1054 v(i,j,k) = v(i,j,k) + hi*(x(ii,j,k)-e(ii,j,k))
1060 do concurrent(i = 1:n, j = 1:n, k = 1:n, jj = 1:n:n-1)
1061 hj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
1062 v(i,j,k) = v(i,j,k) + hj*(x(i, jj, k) - e(i, jj, k))
1068 do concurrent(i = 1:n, j = 1:n, k = 1:n, kk = 1:n:n-1)
1069 hk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
1070 v(i,j,k) = v(i,j,k) + hk*(x(i, j, kk) - e(i, j, kk))
1073 do concurrent(i = 1:ntot)
1074 v(i,1,1) = v(i,1,1) + e(i,1,1)
1146 integer,
intent(in) :: isid, gdim
1147 type(
space_t),
intent(in) :: Xh
1149 real(kind=
rp),
dimension(5),
intent(in) :: curve_data
1150 real(kind=
rp),
dimension(Xh%lx, Xh%ly, Xh%lz),
intent(inout) :: x, y, z
1151 real(kind=
rp) :: pt1x, pt1y, pt2x, pt2y, pt12x, pt12y
1152 real(kind=
rp) :: radius, dtheta, r, xys
1153 real(kind=
rp) :: theta0, xcenn, ycenn, h(xh%lx, 3, 2)
1154 real(kind=
rp) :: xcrved(xh%lx), ycrved(xh%lx), xs, ys
1155 integer :: isid1, ixt, iyt, izt, ix, itmp
1157 integer(i4),
dimension(6),
parameter :: fcyc_to_sym = [3, 2, 4, 1, 5, 6]
1159 integer(i4),
dimension(12),
parameter :: ecyc_to_sym = [1, 6, 2, 5, 3, 8, &
1160 4, 7, 9, 10, 12, 11]
1162 integer,
parameter,
dimension(2, 12) :: edge_nodes = reshape([1, 2, 3, 4, &
1163 5, 6, 7, 8, 1, 3, 2, 4, 5, 7, 6, 8, 1, 5, 2, 6, 3, 7, 4, 8], &
1171 itmp = ecyc_to_sym(isid)
1174 pt1x =
element%pts(edge_nodes(1, itmp))%p%x(1)
1175 pt1y =
element%pts(edge_nodes(1, itmp))%p%x(2)
1176 pt2x =
element%pts(edge_nodes(2, itmp))%p%x(1)
1177 pt2y =
element%pts(edge_nodes(2, itmp))%p%x(2)
1179 pt1x =
element%pts(edge_nodes(2, itmp))%p%x(1)
1180 pt1y =
element%pts(edge_nodes(2, itmp))%p%x(2)
1181 pt2x =
element%pts(edge_nodes(1, itmp))%p%x(1)
1182 pt2y =
element%pts(edge_nodes(1, itmp))%p%x(2)
1185 radius = curve_data(1)
1189 xys = sqrt(xs**2 + ys**2)
1191 if (abs(2.0 * radius) <= xys * 1.00001) &
1192 &
call neko_error(
'Radius to small for arced element surface')
1194 dtheta = abs(asin(0.5_xp*xys/radius))
1195 pt12x = (pt1x + pt2x)/2.0
1196 pt12y = (pt1y + pt2y)/2.0
1197 xcenn = pt12x - xs/xys * radius*cos(dtheta)
1198 ycenn = pt12y - ys/xys * radius*cos(dtheta)
1199 theta0 = atan2((pt12y-ycenn), (pt12x-xcenn))
1201 isid1 = mod(isid+4-1, 4)+1
1203 if (radius < 0.0) dtheta = -dtheta
1206 if (isid1 .gt. 2) ixt = xh%lx+1-ix
1208 xcrved(ixt) = xcenn + abs(radius) * cos(theta0 + r*dtheta) &
1209 - ( h(ix,1,1)*pt1x + h(ix,1,2)*pt2x )
1210 ycrved(ixt) = ycenn + abs(radius) * sin(theta0 + r*dtheta) &
1211 - ( h(ix,1,1)*pt1y + h(ix,1,2)*pt2y )
1216 isid1 = fcyc_to_sym(isid1)
1220 if (isid1 .le. 2)
then
1221 call addtnsr(x, h(1, 1, ixt), xcrved, h(1, 3, izt), &
1222 xh%lx, xh%ly, xh%lz)
1223 call addtnsr(y, h(1, 1, ixt), ycrved, h(1, 3, izt), &
1224 xh%lx, xh%ly, xh%lz)
1226 call addtnsr(x, xcrved, h(1, 2, iyt), h(1, 3, izt), &
1227 xh%lx, xh%ly, xh%lz)
1228 call addtnsr(y, ycrved, h(1, 2, iyt), h(1, 3, izt), &
1229 xh%lx, xh%ly, xh%lz)