239 type(
mesh_t),
pointer :: msh
243 integer(kind=i8) :: num_dofs_edges(3)
244 integer(kind=i8) :: edge_id, edge_offset
245 logical :: shared_dof
251 num_dofs_edges(1) = int(xh%lx - 2,
i8)
252 num_dofs_edges(2) = int(xh%ly - 2,
i8)
253 num_dofs_edges(3) = int(xh%lz - 2,
i8)
254 edge_offset = int(msh%glb_mpts,
i8) + int(1,
i8)
259 select type (ep => msh%elements(i)%e)
264 shared_dof = msh%is_shared_edge(i, 1)
265 global_id = msh%get_global_edge(i, 1)
266 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
268 if (this%dof(1,1,1,i) .gt. this%dof(xh%lx, 1, 1, i))
then
269 do concurrent(j = 2:xh%lx - 1)
271 this%dof(k, 1, 1, i) = edge_id + (j-2)
272 this%shared_dof(k, 1, 1, i) = shared_dof
275 do concurrent(j = 2:xh%lx - 1)
277 this%dof(k, 1, 1, i) = edge_id + (j-2)
278 this%shared_dof(k, 1, 1, i) = shared_dof
282 shared_dof = msh%is_shared_edge(i, 3)
283 global_id = msh%get_global_edge(i, 3)
284 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
285 if (this%dof(1, 1, xh%lz, i) .gt. this%dof(xh%lx, 1, xh%lz, i))
then
286 do concurrent(j = 2:xh%lx - 1)
288 this%dof(k, 1, xh%lz, i) = edge_id + (j-2)
289 this%shared_dof(k, 1, xh%lz, i) = shared_dof
292 do concurrent(j = 2:xh%lx - 1)
294 this%dof(k, 1, xh%lz, i) = edge_id + (j-2)
295 this%shared_dof(k, 1, xh%lz, i) = shared_dof
299 shared_dof = msh%is_shared_edge(i, 2)
300 global_id = msh%get_global_edge(i, 2)
301 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
302 if (this%dof(1, xh%ly, 1, i) .gt. this%dof(xh%lx, xh%ly, 1, i))
then
303 do concurrent(j = 2:xh%lx - 1)
305 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
306 this%shared_dof(k, xh%ly, 1, i) = shared_dof
309 do concurrent(j = 2:xh%lx - 1)
311 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
312 this%shared_dof(k, xh%ly, 1, i) = shared_dof
316 shared_dof = msh%is_shared_edge(i, 4)
317 global_id = msh%get_global_edge(i, 4)
318 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
319 if (this%dof(1, xh%ly, xh%lz, i) .gt. &
320 this%dof(xh%lx, xh%ly, xh%lz, i))
then
321 do concurrent(j = 2:xh%lx - 1)
323 this%dof(k, xh%ly, xh%lz, i) = edge_id + (j-2)
324 this%shared_dof(k, xh%ly, xh%lz, i) = shared_dof
327 do concurrent(j = 2:xh%lx - 1)
329 this%dof(k, xh%ly, xh%lz, i) = edge_id + (j-2)
330 this%shared_dof(k, xh%ly, xh%lz, i) = shared_dof
338 shared_dof = msh%is_shared_edge(i, 5)
339 global_id = msh%get_global_edge(i, 5)
340 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
341 if (this%dof(1,1,1,i) .gt. this%dof(1, xh%ly, 1, i))
then
342 do concurrent(j = 2:xh%ly - 1)
344 this%dof(1, k, 1, i) = edge_id + (j-2)
345 this%shared_dof(1, k, 1, i) = shared_dof
348 do concurrent(j = 2:xh%ly - 1)
350 this%dof(1, k, 1, i) = edge_id + (j-2)
351 this%shared_dof(1, k, 1, i) = shared_dof
355 shared_dof = msh%is_shared_edge(i, 7)
356 global_id = msh%get_global_edge(i, 7)
357 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
358 if (this%dof(1, 1, xh%lz, i) .gt. this%dof(1, xh%ly, xh%lz, i))
then
359 do concurrent(j = 2:xh%ly - 1)
361 this%dof(1, k, xh%lz, i) = edge_id + (j-2)
362 this%shared_dof(1, k, xh%lz, i) = shared_dof
365 do concurrent(j = 2:xh%ly - 1)
367 this%dof(1, k, xh%lz, i) = edge_id + (j-2)
368 this%shared_dof(1, k, xh%lz, i) = shared_dof
372 shared_dof = msh%is_shared_edge(i, 6)
373 global_id = msh%get_global_edge(i, 6)
374 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
375 if (this%dof(xh%lx, 1, 1, i) .gt. this%dof(xh%lx, xh%ly, 1, i))
then
376 do concurrent(j = 2:xh%ly - 1)
378 this%dof(xh%lx, k, 1, i) = edge_id + (j-2)
379 this%shared_dof(xh%lx, k, 1, i) = shared_dof
382 do concurrent(j = 2:xh%ly - 1)
384 this%dof(xh%lx, k, 1, i) = edge_id + (j-2)
385 this%shared_dof(xh%lx, k, 1, i) = shared_dof
389 shared_dof = msh%is_shared_edge(i, 8)
390 global_id = msh%get_global_edge(i, 8)
391 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
392 if (this%dof(xh%lx, 1, xh%lz, i) .gt. &
393 this%dof(xh%lx, xh%ly, xh%lz, i))
then
394 do concurrent(j = 2:xh%ly - 1)
396 this%dof(xh%lx, k, xh%lz, i) = edge_id + (j-2)
397 this%shared_dof(xh%lx, k, xh%lz, i) = shared_dof
400 do concurrent(j = 2:xh%ly - 1)
402 this%dof(xh%lx, k, xh%lz, i) = edge_id + (j-2)
403 this%shared_dof(xh%lx, k, xh%lz, i) = shared_dof
410 shared_dof = msh%is_shared_edge(i, 9)
411 global_id = msh%get_global_edge(i, 9)
412 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
413 if (this%dof(1,1,1,i) .gt. this%dof(1, 1, xh%lz, i))
then
414 do concurrent(j = 2:xh%lz - 1)
416 this%dof(1, 1, k, i) = edge_id + (j-2)
417 this%shared_dof(1, 1, k, i) = shared_dof
420 do concurrent(j = 2:xh%lz - 1)
422 this%dof(1, 1, k, i) = edge_id + (j-2)
423 this%shared_dof(1, 1, k, i) = shared_dof
427 shared_dof = msh%is_shared_edge(i, 10)
428 global_id = msh%get_global_edge(i, 10)
429 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
430 if (this%dof(xh%lx,1,1,i) .gt. this%dof(xh%lx, 1, xh%lz, i))
then
431 do concurrent(j = 2:xh%lz - 1)
433 this%dof(xh%lx, 1, k, i) = edge_id + (j-2)
434 this%shared_dof(xh%lx, 1, k, i) = shared_dof
437 do concurrent(j = 2:xh%lz - 1)
439 this%dof(xh%lx, 1, k, i) = edge_id + (j-2)
440 this%shared_dof(xh%lx, 1, k, i) = shared_dof
444 shared_dof = msh%is_shared_edge(i, 11)
445 global_id = msh%get_global_edge(i, 11)
446 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
447 if (this%dof(1, xh%ly, 1, i) .gt. this%dof(1, xh%ly, xh%lz, i))
then
448 do concurrent(j = 2:xh%lz - 1)
450 this%dof(1, xh%ly, k, i) = edge_id + (j-2)
451 this%shared_dof(1, xh%ly, k, i) = shared_dof
454 do concurrent(j = 2:xh%lz - 1)
456 this%dof(1, xh%ly, k, i) = edge_id + (j-2)
457 this%shared_dof(1, xh%ly, k, i) = shared_dof
461 shared_dof = msh%is_shared_edge(i, 12)
462 global_id = msh%get_global_edge(i, 12)
463 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(3)
464 if (this%dof(xh%lx, xh%ly, 1, i) .gt. &
465 this%dof(xh%lx, xh%ly, xh%lz, i))
then
466 do concurrent(j = 2:xh%lz - 1)
468 this%dof(xh%lx, xh%ly, k, i) = edge_id + (j-2)
469 this%shared_dof(xh%lx, xh%ly, k, i) = shared_dof
472 do concurrent(j = 2:xh%lz - 1)
474 this%dof(xh%lx, xh%ly, k, i) = edge_id + (j-2)
475 this%shared_dof(xh%lx, xh%ly, k, i) = shared_dof
482 shared_dof = msh%is_shared_edge(i, 3)
483 global_id = msh%get_global_edge(i, 3)
484 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
486 if (this%dof(1,1,1,i) .gt. this%dof(xh%lx, 1, 1, i))
then
487 do concurrent(j = 2:xh%lx - 1)
489 this%dof(k, 1, 1, i) = edge_id + (j-2)
490 this%shared_dof(k, 1, 1, i) = shared_dof
493 do concurrent(j = 2:xh%lx - 1)
495 this%dof(k, 1, 1, i) = edge_id + (j-2)
496 this%shared_dof(k, 1, 1, i) = shared_dof
500 shared_dof = msh%is_shared_edge(i, 4)
501 global_id = msh%get_global_edge(i, 4)
502 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(1)
503 if (this%dof(1, xh%ly, 1, i) .gt. this%dof(xh%lx, xh%ly, 1, i))
then
504 do concurrent(j = 2:xh%lx - 1)
506 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
507 this%shared_dof(k, xh%ly, 1, i) = shared_dof
510 do concurrent(j = 2:xh%lx - 1)
512 this%dof(k, xh%ly, 1, i) = edge_id + (j-2)
513 this%shared_dof(k, xh%ly, 1, i) = shared_dof
520 shared_dof = msh%is_shared_edge(i, 1)
521 global_id = msh%get_global_edge(i, 1)
522 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
523 if (this%dof(1,1,1,i) .gt. this%dof(1, xh%ly, 1, i))
then
524 do concurrent(j = 2:xh%ly - 1)
526 this%dof(1, k, 1, i) = edge_id + (j-2)
527 this%shared_dof(1, k, 1, i) = shared_dof
530 do concurrent(j = 2:xh%ly - 1)
532 this%dof(1, k, 1, i) = edge_id + (j-2)
533 this%shared_dof(1, k, 1, i) = shared_dof
537 shared_dof = msh%is_shared_edge(i, 2)
538 global_id = msh%get_global_edge(i, 2)
539 edge_id = edge_offset + int((global_id - 1),
i8) * num_dofs_edges(2)
540 if (this%dof(xh%lx,1,1,i) .gt. this%dof(xh%lx, xh%ly, 1, i))
then
541 do concurrent(j = 2:xh%ly - 1)
543 this%dof(xh%lx, k, 1, i) = edge_id + (j-2)
544 this%shared_dof(xh%lx, k, 1, i) = shared_dof
547 do concurrent(j = 2:xh%ly - 1)
549 this%dof(xh%lx, k, 1, i) = edge_id + (j-2)
550 this%shared_dof(xh%lx, k, 1, i) = shared_dof
562 type(
mesh_t),
pointer :: msh
567 integer(kind=i8) :: num_dofs_faces(3)
568 integer(kind=i8) :: facet_offset, facet_id
569 logical :: shared_dof
575 facet_offset = int(msh%glb_mpts,
i8) + &
576 int(msh%glb_meds,
i8) * int(xh%lx-2,
i8) + int(1,
i8)
579 num_dofs_faces(1) = int((xh%ly - 2) * (xh%lz - 2),
i8)
580 num_dofs_faces(2) = int((xh%lx - 2) * (xh%lz - 2),
i8)
581 num_dofs_faces(3) = int((xh%lx - 2) * (xh%ly - 2),
i8)
589 call msh%elements(i)%e%facet_id(face, 1)
590 call msh%elements(i)%e%facet_order(face_order, 1)
591 shared_dof = msh%is_shared_facet(i, 1)
592 global_id = msh%get_global_facet(i, 1)
593 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(1)
597 facet_id, j, k, xh%lz, xh%ly)
598 this%shared_dof(1, j, k, i) = shared_dof
602 call msh%elements(i)%e%facet_id(face, 2)
603 call msh%elements(i)%e%facet_order(face_order, 2)
604 shared_dof = msh%is_shared_facet(i, 2)
605 global_id = msh%get_global_facet(i, 2)
606 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(1)
610 facet_id, j, k, xh%lz, xh%ly)
611 this%shared_dof(xh%lx, j, k, i) = shared_dof
619 call msh%elements(i)%e%facet_id(face, 3)
620 call msh%elements(i)%e%facet_order(face_order, 3)
621 shared_dof = msh%is_shared_facet(i, 3)
622 global_id = msh%get_global_facet(i, 3)
623 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(2)
627 facet_id, k, j, xh%lz, xh%lx)
628 this%shared_dof(j, 1, k, i) = shared_dof
632 call msh%elements(i)%e%facet_id(face, 4)
633 call msh%elements(i)%e%facet_order(face_order, 4)
634 shared_dof = msh%is_shared_facet(i, 4)
635 global_id = msh%get_global_facet(i, 4)
636 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(2)
640 facet_id, k, j, xh%lz, xh%lx)
641 this%shared_dof(j, xh%ly, k, i) = shared_dof
649 call msh%elements(i)%e%facet_id(face, 5)
650 call msh%elements(i)%e%facet_order(face_order, 5)
651 shared_dof = msh%is_shared_facet(i, 5)
652 global_id = msh%get_global_facet(i, 5)
653 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(3)
657 facet_id, k, j, xh%ly, xh%lx)
658 this%shared_dof(j, k, 1, i) = shared_dof
662 call msh%elements(i)%e%facet_id(face, 6)
663 call msh%elements(i)%e%facet_order(face_order, 6)
664 shared_dof = msh%is_shared_facet(i, 6)
665 global_id = msh%get_global_facet(i, 6)
666 facet_id = facet_offset + int((global_id - 1),
i8) * num_dofs_faces(3)
670 facet_id, k, j, xh%lz, xh%lx)
671 this%shared_dof(j, k, xh%lz, i) = shared_dof
809 type(
mesh_t),
pointer,
intent(in) :: msh
810 type(
space_t),
intent(in) :: Xh
812 real(kind=
rp),
intent(inout) :: x(xh%lx, xh%ly, xh%lz), &
813 y(xh%lx, xh%ly, xh%lz), &
814 z(xh%lx, xh%ly, xh%lz)
815 real(kind=
rp) :: xyzb(2,2,2,3), zgml(xh%lx, 3)
816 real(kind=
rp) :: jx(xh%lx*2)
817 real(kind=
rp) :: jxt(xh%lx*2), jyt(xh%lx*2), jzt(xh%lx*2)
818 real(kind=
rp) :: w(4*xh%lx**3), tmp(xh%lx, xh%lx, xh%lx)
819 real(kind=
rp),
dimension(2),
parameter :: zlin = [-1d0, 1d0]
827 call copy(zgml(1,1), xh%zg(1,1), xh%lx)
828 call copy(zgml(1,2), xh%zg(1,2), xh%ly)
829 if (msh%gdim .gt. 2)
then
830 call copy(zgml(1,3), xh%zg(1,3), xh%lz)
837 if (msh%gdim .gt. 2)
then
842 call trsp(jx, xh%lx, jxt, 2)
844 if (msh%gdim .eq. 2)
then
848 if (msh%gdim .gt. 2)
then
849 do concurrent(j = 1:msh%gdim)
850 xyzb(1,1,1,j) =
element%pts(1)%p%x(j)
851 xyzb(2,1,1,j) =
element%pts(2)%p%x(j)
852 xyzb(1,2,1,j) =
element%pts(3)%p%x(j)
853 xyzb(2,2,1,j) =
element%pts(4)%p%x(j)
855 xyzb(1,1,2,j) =
element%pts(5)%p%x(j)
856 xyzb(2,1,2,j) =
element%pts(6)%p%x(j)
857 xyzb(1,2,2,j) =
element%pts(7)%p%x(j)
858 xyzb(2,2,2,j) =
element%pts(8)%p%x(j)
861 do concurrent(j = 1:msh%gdim)
862 xyzb(1,1,1,j) =
element%pts(1)%p%x(j)
863 xyzb(2,1,1,j) =
element%pts(2)%p%x(j)
864 xyzb(1,2,1,j) =
element%pts(3)%p%x(j)
865 xyzb(2,2,1,j) =
element%pts(4)%p%x(j)
868 if (msh%gdim .eq. 3)
then
869 call tensr3(tmp, xh%lx, xyzb(1,1,1,1), 2, jx, jyt, jzt, w)
870 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
871 call tensr3(tmp, xh%ly, xyzb(1,1,1,2), 2, jx, jyt, jzt, w)
872 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
873 call tensr3(tmp, xh%lz, xyzb(1,1,1,3), 2, jx, jyt, jzt, w)
874 call copy(z, tmp, xh%lx*xh%ly*xh%lz)
876 call tnsr2d_el(tmp, xh%lx, xyzb(1,1,1,1), 2, jx, jyt)
877 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
878 call tnsr2d_el(tmp, xh%ly, xyzb(1,1,1,2), 2, jx, jyt)
879 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
885 type(
mesh_t),
pointer,
intent(in) :: msh
886 type(
space_t),
intent(in) :: Xh
888 real(kind=
rp),
dimension(Xh%lx, Xh%ly, Xh%lz),
intent(inout) :: x, y, z
889 integer :: curve_type(12), eindx(12)
890 real(kind=
rp) :: curve_data(5,12), x3(3,3,3), y3(3,3,3), z3(3,3,3)
892 real(kind=
rp),
dimension(3),
parameter :: zquad = [-1d0, 0d0,1d0]
893 real(kind=
rp) :: zg(3)
894 real(kind=
rp),
dimension(Xh%lx, Xh%lx, Xh%lx) :: tmp
895 real(kind=
rp) :: jx(xh%lx*3)
896 real(kind=
rp) :: jxt(xh%lx*3), jyt(xh%lx*3), jzt(xh%lx*3)
897 real(kind=
rp) :: w(4*xh%lxyz,2)
898 integer :: j, k, n_edges
899 eindx = [2 , 6 , 8 , 4, &
904 if (msh%gdim .eq. 3)
then
906 call xh3%init(
gll, 3, 3, 3)
909 call xh3%init(
gll, 3, 3)
914 if (curve_type(k) .eq. 4)
then
915 x3(eindx(k),1,1) = curve_data(1,k)
916 y3(eindx(k),1,1) = curve_data(2,k)
917 z3(eindx(k),1,1) = curve_data(3,k)
923 if (msh%gdim .eq. 3)
then
928 call neko_warning(
' m deformation not supported for 2d yet')
936 if (msh%gdim .gt. 2)
then
941 call trsp(jx, xh%lx, jxt, 3)
942 if (msh%gdim .eq. 3)
then
943 call tensr3(tmp, xh%lx, x3, 3, jx, jyt, jzt, w)
944 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
945 call tensr3(tmp, xh%ly, y3, 3, jx, jyt, jzt, w)
946 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
947 call tensr3(tmp, xh%lz, z3, 3, jx, jyt, jzt, w)
948 call copy(z, tmp, xh%lx*xh%ly*xh%lz)
950 call tnsr2d_el(tmp, xh%lx, x3, 3, jx, jyt)
951 call copy(x, tmp, xh%lx*xh%ly*xh%lz)
952 call tnsr2d_el(tmp, xh%ly, y3, 3, jx, jyt)
953 call copy(y, tmp, xh%lx*xh%ly*xh%lz)
967 integer,
intent(in) :: n
968 real(kind=
rp),
intent(inout) :: x(n, n, n)
969 real(kind=
rp),
intent(in) :: zg(n)
970 real(kind=
rp),
intent(inout) :: e(n, n, n)
971 real(kind=
rp),
intent(inout) :: v(n, n, n)
972 integer :: gh_type, ntot, kk, jj, ii, k, j, i
973 real(kind=
xp) :: si, sj, sk, hi, hj, hk
979 do concurrent(i = 1:ntot)
983 do concurrent(i = 1:n, j = 1:n, k = 1:n, &
984 ii = 1:n:n-1, jj = 1:n:n-1, kk = 1:n:n-1)
985 si = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
986 sj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
987 sk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
988 v(i,j,k) = v(i,j,k) + si * sj* sk * x(ii, jj, kk)
991 if (gh_type .eq. 1)
then
992 do concurrent(i = 1:ntot)
1000 do concurrent(i = 1:ntot)
1006 do concurrent(i = 1:n, j = 1:n, k = 1:n, jj = 1:n:n-1, kk = 1:n:n-1)
1007 hj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
1008 hk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
1009 e(i,j,k) = e(i,j,k) + hj*hk*(x(i, jj, kk) - v(i, jj, kk))
1014 do concurrent(i = 1:n, j = 1:n, k = 1:n, ii = 1:n:n-1, kk = 1:n:n-1)
1015 hi = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
1016 hk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
1017 e(i,j,k) = e(i,j,k) + hi*hk*(x(ii, j, kk) - v(ii, j, kk))
1022 do concurrent(i = 1:n, j = 1:n, k = 1:n, ii = 1:n:n-1, jj = 1:n:n-1)
1023 hi = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
1024 hj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
1025 e(i,j,k) = e(i,j,k) + hi*hj*(x(ii, jj, k) - v(ii, jj, k))
1028 do concurrent(i = 1:ntot)
1029 e(i,1,1) = e(i,1,1) + v(i,1,1)
1032 if (gh_type .eq. 2)
then
1033 do concurrent(i = 1:ntot)
1041 do concurrent(i = 1:ntot)
1047 do concurrent(i = 1:n, j = 1:n, k = 1:n, ii = 1:n:n-1)
1048 hi = 0.5_xp*((n-ii)*(1-zg(i))+(ii-1)*(1+zg(i)))/(n-1)
1049 v(i,j,k) = v(i,j,k) + hi*(x(ii,j,k)-e(ii,j,k))
1055 do concurrent(i = 1:n, j = 1:n, k = 1:n, jj = 1:n:n-1)
1056 hj = 0.5_xp*((n-jj)*(1-zg(j))+(jj-1)*(1+zg(j)))/(n-1)
1057 v(i,j,k) = v(i,j,k) + hj*(x(i, jj, k) - e(i, jj, k))
1063 do concurrent(i = 1:n, j = 1:n, k = 1:n, kk = 1:n:n-1)
1064 hk = 0.5_xp*((n-kk)*(1-zg(k))+(kk-1)*(1+zg(k)))/(n-1)
1065 v(i,j,k) = v(i,j,k) + hk*(x(i, j, kk) - e(i, j, kk))
1068 do concurrent(i = 1:ntot)
1069 v(i,1,1) = v(i,1,1) + e(i,1,1)
1141 integer,
intent(in) :: isid, gdim
1142 type(
space_t),
intent(in) :: Xh
1144 real(kind=
rp),
dimension(5),
intent(in) :: curve_data
1145 real(kind=
rp),
dimension(Xh%lx, Xh%ly, Xh%lz),
intent(inout) :: x, y, z
1146 real(kind=
rp) :: pt1x, pt1y, pt2x, pt2y, pt12x, pt12y
1147 real(kind=
rp) :: radius, dtheta, r, xys
1148 real(kind=
rp) :: theta0, xcenn, ycenn, h(xh%lx, 3, 2)
1149 real(kind=
rp) :: xcrved(xh%lx), ycrved(xh%lx), xs, ys
1150 integer :: isid1, ixt, iyt, izt, ix, itmp
1152 integer(i4),
dimension(6),
parameter :: fcyc_to_sym = [3, 2, 4, 1, 5, 6]
1154 integer(i4),
dimension(12),
parameter :: ecyc_to_sym = [1, 6, 2, 5, 3, 8, &
1155 4, 7, 9, 10, 12, 11]
1157 integer,
parameter,
dimension(2, 12) :: edge_nodes = reshape([1, 2, 3, 4, &
1158 5, 6, 7, 8, 1, 3, 2, 4, 5, 7, 6, 8, 1, 5, 2, 6, 3, 7, 4, 8], &
1166 itmp = ecyc_to_sym(isid)
1169 pt1x =
element%pts(edge_nodes(1, itmp))%p%x(1)
1170 pt1y =
element%pts(edge_nodes(1, itmp))%p%x(2)
1171 pt2x =
element%pts(edge_nodes(2, itmp))%p%x(1)
1172 pt2y =
element%pts(edge_nodes(2, itmp))%p%x(2)
1174 pt1x =
element%pts(edge_nodes(2, itmp))%p%x(1)
1175 pt1y =
element%pts(edge_nodes(2, itmp))%p%x(2)
1176 pt2x =
element%pts(edge_nodes(1, itmp))%p%x(1)
1177 pt2y =
element%pts(edge_nodes(1, itmp))%p%x(2)
1180 radius = curve_data(1)
1184 xys = sqrt(xs**2 + ys**2)
1186 if (abs(2.0 * radius) <= xys * 1.00001) &
1187 &
call neko_error(
'Radius to small for arced element surface')
1189 dtheta = abs(asin(0.5_xp*xys/radius))
1190 pt12x = (pt1x + pt2x)/2.0
1191 pt12y = (pt1y + pt2y)/2.0
1192 xcenn = pt12x - xs/xys * radius*cos(dtheta)
1193 ycenn = pt12y - ys/xys * radius*cos(dtheta)
1194 theta0 = atan2((pt12y-ycenn), (pt12x-xcenn))
1196 isid1 = mod(isid+4-1, 4)+1
1198 if (radius < 0.0) dtheta = -dtheta
1201 if (isid1 .gt. 2) ixt = xh%lx+1-ix
1203 xcrved(ixt) = xcenn + abs(radius) * cos(theta0 + r*dtheta) &
1204 - ( h(ix,1,1)*pt1x + h(ix,1,2)*pt2x )
1205 ycrved(ixt) = ycenn + abs(radius) * sin(theta0 + r*dtheta) &
1206 - ( h(ix,1,1)*pt1y + h(ix,1,2)*pt2y )
1211 isid1 = fcyc_to_sym(isid1)
1215 if (isid1 .le. 2)
then
1216 call addtnsr(x, h(1, 1, ixt), xcrved, h(1, 3, izt), &
1217 xh%lx, xh%ly, xh%lz)
1218 call addtnsr(y, h(1, 1, ixt), ycrved, h(1, 3, izt), &
1219 xh%lx, xh%ly, xh%lz)
1221 call addtnsr(x, xcrved, h(1, 2, iyt), h(1, 3, izt), &
1222 xh%lx, xh%ly, xh%lz)
1223 call addtnsr(y, ycrved, h(1, 2, iyt), h(1, 3, izt), &
1224 xh%lx, xh%ly, xh%lz)