35 #include "sll_assert.h"
36 #include "sll_memory.h"
37 #include "sll_working_precision.h"
52 sll_i_transformation_func_nopass
87 sll_real64,
dimension(2, 2) :: val
90 sll_real64,
dimension(:),
optional,
intent(in) :: params
101 procedure(sll_i_transformation_func_nopass),
pointer,
nopass :: f
115 procedure(sll_i_transformation_func_nopass),
pointer,
nopass :: x1_func
117 procedure(sll_i_transformation_func_nopass),
pointer,
nopass :: x2_func
119 procedure(two_arg_message_passing_func_analyt),
pointer, pass :: jacobian_func
123 sll_real64,
dimension(:),
pointer :: params => null()
152 procedure, pass(transf) :: inverse_jacobian_matrix => &
171 sll_real64,
dimension(:, :),
pointer :: x1_node => null()
173 sll_real64,
dimension(:, :),
pointer :: x2_node => null()
175 sll_real64,
dimension(:, :),
pointer :: x1_cell => null()
177 sll_real64,
dimension(:, :),
pointer :: x2_cell => null()
179 sll_real64,
dimension(:, :),
pointer :: jacobians_n => null()
181 sll_real64,
dimension(:, :),
pointer :: jacobians_c => null()
190 procedure, pass(transf) :: init => &
215 procedure, pass(transf) :: inverse_jacobian_matrix => &
225 #ifndef DOXYGEN_SHOULD_SKIP_THIS
228 function two_arg_message_passing_func_discr(transf, eta1, eta2)
231 sll_real64 :: two_arg_message_passing_func_discr
233 sll_real64,
intent(in) :: eta1
234 sll_real64,
intent(in) :: eta2
235 end function two_arg_message_passing_func_discr
239 function two_arg_message_passing_func_analyt(transf, eta1, eta2)
242 sll_real64 :: two_arg_message_passing_func_analyt
244 sll_real64,
intent(in) :: eta1
245 sll_real64,
intent(in) :: eta2
246 end function two_arg_message_passing_func_analyt
249 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
280 character(len=*),
intent(in) :: label
282 procedure(sll_i_transformation_func_nopass) :: x1_func
283 procedure(sll_i_transformation_func_nopass) :: x2_func
284 procedure(sll_i_transformation_func_nopass) :: j11_func
285 procedure(sll_i_transformation_func_nopass) :: j12_func
286 procedure(sll_i_transformation_func_nopass) :: j21_func
287 procedure(sll_i_transformation_func_nopass) :: j22_func
288 sll_real64,
dimension(:),
intent(in) :: params
321 character(len=*),
intent(in) :: label
322 procedure(sll_i_transformation_func_nopass) :: x1_func
323 procedure(sll_i_transformation_func_nopass) :: x2_func
324 procedure(sll_i_transformation_func_nopass) :: j11_func
325 procedure(sll_i_transformation_func_nopass) :: j12_func
326 procedure(sll_i_transformation_func_nopass) :: j21_func
327 procedure(sll_i_transformation_func_nopass) :: j22_func
329 sll_real64,
dimension(:),
intent(in) :: params
332 transf%label = trim(label)
333 transf%mesh => mesh_2d
336 transf%x1_func => x1_func
337 transf%x2_func => x2_func
338 if (
size(params) > 0)
then
339 sll_allocate(transf%params(
size(params)), ierr)
340 transf%params(:) = params(:)
342 sll_clear_allocate(transf%params(1), ierr)
346 transf%j_matrix(1, 1)%f => j11_func
347 transf%j_matrix(1, 2)%f => j12_func
348 transf%j_matrix(2, 1)%f => j21_func
349 transf%j_matrix(2, 2)%f => j22_func
357 nullify (transf%x1_func)
358 nullify (transf%x2_func)
359 nullify (transf%jacobian_func)
360 nullify (transf%jacobian_matrix_function)
372 sll_real64,
intent(in) :: eta1
373 sll_real64,
intent(in) :: eta2
378 j11 = (transf%j_matrix(1, 1)%f(eta1, eta2, transf%params))
379 j12 = (transf%j_matrix(1, 2)%f(eta1, eta2, transf%params))
380 j21 = (transf%j_matrix(2, 1)%f(eta1, eta2, transf%params))
381 j22 = (transf%j_matrix(2, 2)%f(eta1, eta2, transf%params))
386 val = j11*j22 - j12*j21
395 sll_real64,
intent(in) :: eta1
396 sll_real64,
intent(in) :: eta2
401 j11 = (transf%j_matrix(1, 1)%f(eta1, eta2, transf%params))
402 j12 = (transf%j_matrix(1, 2)%f(eta1, eta2, transf%params))
403 j21 = (transf%j_matrix(2, 1)%f(eta1, eta2, transf%params))
404 j22 = (transf%j_matrix(2, 2)%f(eta1, eta2, transf%params))
418 sll_real64,
intent(in) :: eta1
419 sll_real64,
intent(in) :: eta2
420 sll_real64 :: inv_j11
421 sll_real64 :: inv_j12
422 sll_real64 :: inv_j21
423 sll_real64 :: inv_j22
424 sll_real64 :: r_jacobian
426 r_jacobian = 1.0_f64/transf%jacobian(eta1, eta2)
427 inv_j11 = (transf%j_matrix(2, 2)%f(eta1, eta2, transf%params))*r_jacobian
428 inv_j12 = -(transf%j_matrix(1, 2)%f(eta1, eta2, transf%params))*r_jacobian
429 inv_j21 = -(transf%j_matrix(2, 1)%f(eta1, eta2, transf%params))*r_jacobian
430 inv_j22 = (transf%j_matrix(1, 1)%f(eta1, eta2, transf%params))*r_jacobian
444 sll_real64,
intent(in) :: eta1
445 sll_real64,
intent(in) :: eta2
446 val = transf%x1_func(eta1, eta2, transf%params)
452 sll_real64,
intent(in) :: eta1
453 sll_real64,
intent(in) :: eta2
454 val = transf%x2_func(eta1, eta2, transf%params)
460 sll_int32,
intent(in) :: i
461 sll_int32,
intent(in) :: j
465 eta1 = transf%mesh%eta1_node(i, j)
466 eta2 = transf%mesh%eta2_node(i, j)
467 val = transf%x1_func(eta1, eta2, transf%params)
473 sll_int32,
intent(in) :: i
474 sll_int32,
intent(in) :: j
478 eta1 = transf%mesh%eta1_node(i, j)
479 eta2 = transf%mesh%eta2_node(i, j)
480 val = transf%x2_func(eta1, eta2, transf%params)
486 sll_int32,
intent(in) :: i
487 sll_int32,
intent(in) :: j
491 eta1 = transf%mesh%eta1_cell(i, j)
492 eta2 = transf%mesh%eta2_cell(i, j)
493 var = transf%x1_func(eta1, eta2, transf%params)
499 sll_int32,
intent(in) :: i
500 sll_int32,
intent(in) :: j
504 eta1 = transf%mesh%eta1_cell(i, j)
505 eta2 = transf%mesh%eta2_cell(i, j)
506 var = transf%x2_func(eta1, eta2, transf%params)
512 sll_int32,
intent(in) :: i
513 sll_int32,
intent(in) :: j
521 eta1 = transf%mesh%eta1_cell(i, j)
522 eta2 = transf%mesh%eta2_cell(i, j)
523 j11 = (transf%j_matrix(1, 1)%f(eta1, eta2, transf%params))
524 j12 = (transf%j_matrix(1, 2)%f(eta1, eta2, transf%params))
525 j21 = (transf%j_matrix(2, 1)%f(eta1, eta2, transf%params))
526 j22 = (transf%j_matrix(2, 2)%f(eta1, eta2, transf%params))
531 val = j11*j22 - j12*j21
537 sll_int32,
intent(in) :: i
538 sll_int32,
intent(in) :: j
539 sll_int32 :: num_pts_1
540 sll_int32 :: num_pts_2
548 num_pts_1 = transf%mesh%num_cells1 + 1
549 num_pts_2 = transf%mesh%num_cells2 + 1
550 sll_assert((i .ge. 1) .and. (i .le. num_pts_1))
551 sll_assert((j .ge. 1) .and. (j .le. num_pts_2))
553 eta1 = transf%mesh%eta1_cell(i, j)
554 eta2 = transf%mesh%eta2_cell(i, j)
555 j11 = (transf%j_matrix(1, 1)%f(eta1, eta2, transf%params))
556 j12 = (transf%j_matrix(1, 2)%f(eta1, eta2, transf%params))
557 j21 = (transf%j_matrix(2, 1)%f(eta1, eta2, transf%params))
558 j22 = (transf%j_matrix(2, 2)%f(eta1, eta2, transf%params))
568 sll_int32,
intent(in),
optional :: output_format
569 sll_int32 :: local_format
570 sll_real64,
dimension(:, :),
allocatable :: x1mesh
571 sll_real64,
dimension(:, :),
allocatable :: x2mesh
581 nc_eta1 = transf%mesh%num_cells1
582 nc_eta2 = transf%mesh%num_cells2
584 if (.not.
present(output_format))
then
587 local_format = output_format
590 if (.not. transf%written)
then
592 sll_allocate(x1mesh(nc_eta1 + 1, nc_eta2 + 1), ierr)
593 sll_allocate(x2mesh(nc_eta1 + 1, nc_eta2 + 1), ierr)
594 eta1 = transf%mesh%eta1_min
595 do i1 = 1, nc_eta1 + 1
596 eta2 = transf%mesh%eta2_min
597 do i2 = 1, nc_eta2 + 1
600 eta2 = eta2 + transf%mesh%delta_eta2
602 eta1 = eta1 + transf%mesh%delta_eta1
606 nc_eta1 + 1, nc_eta2 + 1, file_id, ierr)
613 sll_allocate(x1mesh(nc_eta1 + 1, nc_eta2 + 1), ierr)
614 sll_allocate(x2mesh(nc_eta1 + 1, nc_eta2 + 1), ierr)
616 do i1 = 1, nc_eta1 + 1
617 do i2 = 1, nc_eta2 + 1
624 trim(transf%label), ierr)
628 sll_allocate(x1mesh(nc_eta1 + 1, nc_eta2 + 1), ierr)
629 sll_allocate(x2mesh(nc_eta1 + 1, nc_eta2 + 1), ierr)
631 do i1 = 1, nc_eta1 + 1
632 do i2 = 1, nc_eta2 + 1
639 x1mesh, x2mesh, trim(transf%label), ierr)
642 print *,
'Not recognized format to write this mesh'
646 print *,
' Warning, you have already written the mesh '
648 transf%written = .true.
649 if (
allocated(x1mesh))
deallocate (x1mesh)
650 if (
allocated(x2mesh))
deallocate (x2mesh)
656 character(len=*),
intent(in) :: filename
658 print *,
'read_from_file_2d_analytic: not yet implemented'
660 call transf%mesh%display()
680 sll_int32,
intent(in) :: i
681 sll_int32,
intent(in) :: j
682 val = transf%x1_node(i, j)
688 sll_int32,
intent(in) :: i
689 sll_int32,
intent(in) :: j
690 val = transf%x2_node(i, j)
696 sll_int32,
intent(in) :: i
697 sll_int32,
intent(in) :: j
698 var = transf%x1_cell(i, j)
704 sll_int32,
intent(in) :: i
705 sll_int32,
intent(in) :: j
706 var = transf%x2_cell(i, j)
712 sll_real64,
intent(in) :: eta1
713 sll_real64,
intent(in) :: eta2
714 val = transf%x1_interp%interpolate_from_interpolant_value(eta1, eta2)
720 sll_real64,
intent(in) :: eta1
721 sll_real64,
intent(in) :: eta2
722 val = transf%x2_interp%interpolate_from_interpolant_value(eta1, eta2)
728 sll_real64,
intent(in) :: eta1
729 sll_real64,
intent(in) :: eta2
734 j11 = transf%x1_interp%interpolate_from_interpolant_derivative_eta1(eta1, eta2)
735 j12 = transf%x1_interp%interpolate_from_interpolant_derivative_eta2(eta1, eta2)
736 j21 = transf%x2_interp%interpolate_from_interpolant_derivative_eta1(eta1, eta2)
737 j22 = transf%x2_interp%interpolate_from_interpolant_derivative_eta2(eta1, eta2)
742 jac = j11*j22 - j12*j21
748 sll_int32,
intent(in) :: i
749 sll_int32,
intent(in) :: j
750 var = transf%jacobians_c(i, j)
756 sll_real64,
intent(in) :: eta1
757 sll_real64,
intent(in) :: eta2
762 j11 = transf%x1_interp%interpolate_from_interpolant_derivative_eta1(eta1, eta2)
763 j12 = transf%x1_interp%interpolate_from_interpolant_derivative_eta2(eta1, eta2)
764 j21 = transf%x2_interp%interpolate_from_interpolant_derivative_eta1(eta1, eta2)
765 j22 = transf%x2_interp%interpolate_from_interpolant_derivative_eta2(eta1, eta2)
779 sll_real64,
intent(in) :: eta1
780 sll_real64,
intent(in) :: eta2
781 sll_real64 :: inv_j11
782 sll_real64 :: inv_j12
783 sll_real64 :: inv_j21
784 sll_real64 :: inv_j22
786 r_jac = 1.0_f64/transf%jacobian(eta1, eta2)
787 inv_j11 = transf%x1_interp%interpolate_from_interpolant_derivative_eta1(eta1, eta2)
788 inv_j12 = transf%x1_interp%interpolate_from_interpolant_derivative_eta2(eta1, eta2)
789 inv_j21 = transf%x2_interp%interpolate_from_interpolant_derivative_eta1(eta1, eta2)
790 inv_j22 = transf%x2_interp%interpolate_from_interpolant_derivative_eta2(eta1, eta2)
807 jacobians_n_interpolator, &
817 character(len=*),
intent(in) :: label
822 sll_real64,
dimension(:, :),
intent(in),
optional :: x1_node
823 sll_real64,
dimension(:, :),
intent(in),
optional :: x2_node
824 sll_real64,
dimension(:, :),
intent(in),
optional :: jacobians_node
825 sll_real64,
dimension(:, :),
intent(in),
optional :: x1_cell
826 sll_real64,
dimension(:, :),
intent(in),
optional :: x2_cell
827 sll_real64,
dimension(:, :),
intent(in),
optional :: jacobians_cell
841 jacobians_n_interpolator, &
856 jacobians_n_interpolator, &
866 character(len=*),
intent(in) :: label
871 sll_real64,
dimension(:, :),
intent(in),
optional :: x1_node
872 sll_real64,
dimension(:, :),
intent(in),
optional :: x2_node
873 sll_real64,
dimension(:, :),
intent(in),
optional :: jacobians_node
874 sll_real64,
dimension(:, :),
intent(in),
optional :: jacobians_cell
875 sll_real64,
dimension(:, :),
intent(in),
optional :: x1_cell
876 sll_real64,
dimension(:, :),
intent(in),
optional :: x2_cell
880 sll_real64 :: eta_1_min
881 sll_real64 :: eta_2_min
882 sll_real64 :: delta_eta_1
883 sll_real64 :: delta_eta_2
884 sll_real64 :: jacobian_val
897 transf%mesh => mesh_2d
898 transf%label = trim(label)
899 x1n =
present(x1_node)
900 x2n =
present(x2_node)
901 x1c =
present(x1_cell)
902 x2c =
present(x2_cell)
903 jc =
present(jacobians_cell)
904 jn =
present(jacobians_node)
905 npts1 = mesh_2d%num_cells1 + 1
906 npts2 = mesh_2d%num_cells2 + 1
927 if ((x1n .and. (.not. x2n)) .or. &
928 ((.not. x1n) .and. x2n))
then
930 print *,
'ERROR, sll_s_coordinate_transformation_2d_discrete_init():', &
931 'for the moment, this function does not support specifying ', &
932 'transformation only with one of the node arrays x1_node or ', &
933 'x2_node. Either pass both, or none, but with the ', &
934 'corresponding interpolators having their coefficients ', &
937 call jacobians_n_interpolator%delete()
941 if (
size(x1_node, 1) .lt. npts1)
then
942 print *,
'ERROR, sll_s_coordinate_transformation_2d_discrete_init()', &
943 ' the size of the x1_node arrays is ', &
944 'inconsistent with the number of points declared, ', &
945 'in the logical mesh.'
951 if (
size(x1_node, 2) .lt. npts2)
then
952 print *,
'ERROR, sll_s_coordinate_transformation_2d_discrete_init()', &
953 ' the size of the x2_node arrays is ', &
954 'inconsistent with the number of points declared, ', &
955 'in the logical mesh.'
960 if (jn .eqv. .true.)
then
962 (
size(jacobians_node, 1) .lt. npts1 - 1) .or. &
963 (
size(jacobians_node, 2) .lt. npts2 - 1))
then
964 print *,
'ERROR, sll_s_coordinate_transformation_2d_discrete_init()', &
965 ': the size of the jacobians_node array is ', &
966 'inconsistent with the number of points declared, ', &
972 if (jc .eqv. .true.)
then
974 (
size(jacobians_cell, 1) .lt. npts1 - 1) .or. &
975 (
size(jacobians_cell, 2) .lt. npts2 - 1))
then
976 print *,
'ERROR, sll_s_coordinate_transformation_2d_discrete_init()', &
977 ': the size of the jacobians_cell arrays is ', &
978 'inconsistent with the number of points declared, ', &
984 transf%x1_interp => x1_interpolator
985 transf%x2_interp => x2_interpolator
988 sll_allocate(transf%jacobians_n(npts1, npts2), ierr)
989 sll_allocate(transf%jacobians_c(npts1 - 1, npts2 - 1), ierr)
992 sll_allocate(transf%x1_node(npts1, npts2), ierr)
993 sll_allocate(transf%x2_node(npts1, npts2), ierr)
996 sll_allocate(transf%x1_cell(npts1 - 1, npts2 - 1), ierr)
997 sll_allocate(transf%x2_cell(npts1 - 1, npts2 - 1), ierr)
1005 eta_1_min = mesh_2d%eta1_min
1006 eta_2_min = mesh_2d%eta2_min
1007 delta_eta_1 = mesh_2d%delta_eta1
1008 delta_eta_2 = mesh_2d%delta_eta2
1010 if (x1n .and. x2n)
then
1013 transf%x1_node(i, j) = x1_node(i, j)
1014 transf%x2_node(i, j) = x2_node(i, j)
1018 if (x1_interpolator%coefficients_are_set() .eqv. .false.)
then
1019 print *,
'ERROR, sll_s_coordinate_transformation_2d_discrete_init()', &
1020 ': the x1_node array was not passed and the corresponding ', &
1021 'interpolator has no initialized coefficients. Exiting...'
1024 if (x2_interpolator%coefficients_are_set() .eqv. .false.)
then
1025 print *,
'ERROR, sll_s_coordinate_transformation_2d_discrete_init()', &
1026 ': the x2_node array was not passed and the corresponding ', &
1027 'interpolator has no initialized coefficients. Exiting...'
1033 eta_2 = eta_2_min + real(j, f64)*delta_eta_2
1035 eta_1 = eta_1_min + real(i, f64)*delta_eta_1
1036 transf%x1_node(i + 1, j + 1) = &
1037 x1_interpolator%interpolate_from_interpolant_value(eta_1, eta_2)
1038 transf%x2_node(i + 1, j + 1) = &
1039 x2_interpolator%interpolate_from_interpolant_value(eta_1, eta_2)
1045 if (x1n .and. (x1_interpolator%coefficients_are_set() .eqv. .false.))
then
1046 call x1_interpolator%compute_interpolants(transf%x1_node)
1048 if (x2n .and. (x2_interpolator%coefficients_are_set() .eqv. .false.))
then
1049 call x2_interpolator%compute_interpolants(transf%x2_node)
1060 if (jn .eqv. .true.)
then
1063 transf%jacobians_n(i, j) = jacobians_node(i, j)
1069 eta_2 = eta_2_min + real(j, f64)*delta_eta_2
1071 eta_1 = eta_1_min + real(i, f64)*delta_eta_1
1072 jacobian_val = transf%jacobian(eta_1, eta_2)
1073 transf%jacobians_n(i + 1, j + 1) = jacobian_val
1079 if ((x1c .and. x2c) .eqv. .true.)
then
1080 sll_allocate(transf%x1_cell(npts1 - 1, npts2 - 1), ierr)
1081 sll_allocate(transf%x2_cell(npts1 - 1, npts2 - 1), ierr)
1084 transf%x1_cell(i, j) = x1_cell(i, j)
1085 transf%x2_cell(i, j) = x2_cell(i, j)
1090 if (jc .eqv. .true.)
then
1093 transf%jacobians_c(i, j) = jacobians_cell(i, j)
1099 eta_2 = eta_2_min + delta_eta_2*(real(j, f64) + 0.5_f64)
1103 eta_1 = eta_1_min + delta_eta_1*(real(i, f64) + 0.5_f64)
1104 transf%x1_cell(i + 1, j + 1) = transf%x1(eta_1, eta_2)
1105 transf%x2_cell(i + 1, j + 1) = transf%x2(eta_1, eta_2)
1106 transf%jacobians_c(i + 1, j + 1) = transf%jacobian(eta_1, eta_2)
1115 sll_int32,
intent(in) :: i
1116 sll_int32,
intent(in) :: j
1117 sll_int32 :: num_pts_1
1118 sll_int32 :: num_pts_2
1120 num_pts_1 = transf%mesh%num_cells1 + 1
1121 num_pts_2 = transf%mesh%num_cells2 + 1
1122 sll_assert((i .ge. 1) .and. (i .le. num_pts_1))
1123 sll_assert((j .ge. 1) .and. (j .le. num_pts_2))
1129 sll_int32,
intent(in),
optional :: output_format
1130 sll_int32 :: local_format
1131 sll_real64,
dimension(:, :),
pointer :: x1mesh
1132 sll_real64,
dimension(:, :),
pointer :: x2mesh
1138 sll_int32 :: file_id
1139 sll_int32 :: npts_eta1
1140 sll_int32 :: npts_eta2
1141 sll_real64 :: eta1_min
1142 sll_real64 :: eta2_min
1143 sll_real64 :: delta_eta1
1144 sll_real64 :: delta_eta2
1146 npts_eta1 = transf%mesh%num_cells1 + 1
1147 npts_eta2 = transf%mesh%num_cells2 + 1
1148 eta1_min = transf%mesh%eta1_min
1149 eta2_min = transf%mesh%eta1_min
1150 delta_eta1 = transf%mesh%delta_eta1
1151 delta_eta2 = transf%mesh%delta_eta2
1153 if (.not.
present(output_format))
then
1156 local_format = output_format
1159 if (.not. transf%written)
then
1162 sll_allocate(x1mesh(npts_eta1, npts_eta2), ierr)
1163 sll_allocate(x2mesh(npts_eta1, npts_eta2), ierr)
1165 do i1 = 1, npts_eta1
1167 do i2 = 1, npts_eta2
1170 eta2 = eta2 + delta_eta2
1172 eta1 = eta1 + delta_eta1
1176 npts_eta1, npts_eta2, file_id, ierr)
1183 sll_allocate(x1mesh(npts_eta1, npts_eta2), ierr)
1184 sll_allocate(x2mesh(npts_eta1, npts_eta2), ierr)
1186 do i1 = 1, npts_eta1
1187 do i2 = 1, npts_eta2
1194 trim(transf%label), ierr)
1198 sll_allocate(x1mesh(npts_eta1, npts_eta2), ierr)
1199 sll_allocate(x2mesh(npts_eta1, npts_eta2), ierr)
1201 do i1 = 1, npts_eta1
1202 do i2 = 1, npts_eta2
1209 x1mesh, x2mesh, trim(transf%label), ierr)
1213 print *,
'Not recognized format to write this mesh'
1218 print *,
' Warning, you have already written the mesh '
1221 transf%written = .true.
1227 transf%written = .false.
1228 nullify (transf%x1_node)
1229 nullify (transf%x2_node)
1230 nullify (transf%x1_cell)
1231 nullify (transf%x2_cell)
1232 nullify (transf%jacobians_n)
1233 nullify (transf%jacobians_c)
1271 character(len=*),
intent(in) :: filename
1273 character(len=256) :: filename_local
1274 sll_int32 :: io_stat
1275 sll_int32 :: input_file_id
1277 sll_int32 :: spline_deg1
1278 sll_int32 :: spline_deg2
1279 sll_int32 :: num_pts1
1280 sll_int32 :: num_pts2
1281 sll_int32 :: is_rational
1282 character(len=256) :: label
1283 sll_real64,
dimension(:),
allocatable :: knots1
1284 sll_real64,
dimension(:),
allocatable :: knots2
1285 sll_real64,
dimension(:),
allocatable :: control_pts1
1286 sll_real64,
dimension(:),
allocatable :: control_pts2
1287 sll_real64,
dimension(:),
allocatable :: weights
1288 sll_real64,
dimension(:, :),
allocatable :: control_pts1_2d
1289 sll_real64,
dimension(:, :),
allocatable :: control_pts2_2d
1290 sll_real64,
dimension(:, :),
allocatable :: weights_2d
1291 sll_real64 :: eta1_min
1292 sll_real64 :: eta1_max
1293 sll_real64 :: eta2_min
1294 sll_real64 :: eta2_max
1295 sll_int32 :: bc_left
1296 sll_int32 :: bc_right
1297 sll_int32 :: bc_bottom
1301 sll_int32 :: number_cells1, number_cells2
1302 sll_int32 :: sz_knots1, sz_knots2
1305 namelist /transf_label/ label
1306 namelist /degree/ spline_deg1, spline_deg2
1307 namelist /shape/ num_pts1, num_pts2
1308 namelist /rational/ is_rational
1309 namelist /knots_1/ knots1
1310 namelist /knots_2/ knots2
1311 namelist /control_points/ control_pts1, control_pts2
1312 namelist /pt_weights/ weights
1313 namelist /logical_mesh_2d/ number_cells1, number_cells2
1315 if (len(filename) >= 256)
then
1316 print *,
'ERROR, read_coefficients_from_file => ', &
1317 'read_from_file_discrete():', &
1318 'filenames longer than 256 characters are not allowed.'
1321 filename_local = trim(filename)
1325 if (ierr .ne. 0)
then
1326 print *,
'ERROR while trying to obtain an unique identifier for file ', &
1327 filename,
'. Called from read_coeffs_ad2d().'
1330 open (unit=input_file_id, file=filename_local, status=
"OLD", iostat=io_stat)
1331 if (io_stat .ne. 0)
then
1332 print *,
'ERROR while opening file ', filename, &
1333 '. Called from read_coeffs_ad2d().'
1337 read (input_file_id, transf_label)
1338 read (input_file_id, degree)
1339 read (input_file_id, shape)
1340 read (input_file_id, rational)
1341 sll_allocate(knots1(num_pts1 + spline_deg1 + 1), ierr)
1342 sll_allocate(knots2(num_pts2 + spline_deg2 + 1), ierr)
1343 read (input_file_id, knots_1)
1344 read (input_file_id, knots_2)
1345 sll_allocate(control_pts1(num_pts1*num_pts2), ierr)
1346 sll_allocate(control_pts2(num_pts1*num_pts2), ierr)
1347 sll_allocate(weights(num_pts1*num_pts2), ierr)
1348 sll_allocate(control_pts1_2d(num_pts1, num_pts2), ierr)
1349 sll_allocate(control_pts2_2d(num_pts1, num_pts2), ierr)
1350 sll_allocate(weights_2d(num_pts1, num_pts2), ierr)
1352 read (input_file_id, control_points)
1353 control_pts1_2d = reshape(control_pts1, (/num_pts1, num_pts2/))
1354 control_pts2_2d = reshape(control_pts2, (/num_pts1, num_pts2/))
1355 read (input_file_id, pt_weights)
1356 weights_2d = reshape(weights, (/num_pts1, num_pts2/))
1357 read (input_file_id, logical_mesh_2d)
1358 close (input_file_id)
1360 eta1_min = knots1(1)
1361 eta2_min = knots2(1)
1362 eta1_max = knots1(num_pts1 + spline_deg1 + 1)
1363 eta2_max = knots2(num_pts2 + spline_deg2 + 1)
1370 bc_left = sll_p_dirichlet
1371 bc_right = sll_p_dirichlet
1372 bc_bottom = sll_p_dirichlet
1373 bc_top = sll_p_dirichlet
1375 sz_knots1 =
size(knots1)
1376 sz_knots2 =
size(knots2)
1380 stop
"This case in no longer supported"
Write file for gnuplot to display 2d field.
Create the mtv file to plot a structured mesh (cartesian or curvilinear)
Write the field in xdmf format.
Describe different boundary conditions.
Cartesian mesh basic types.
type(sll_t_cartesian_mesh_2d) function, pointer, public sll_f_new_cartesian_mesh_2d(num_cells1, num_cells2, eta1_min, eta1_max, eta2_min, eta2_max)
allocates the memory space for a new 2D cartesian mesh on the heap, initializes it with the given arg...
Implements the functions to write data file plotable by GNUplot.
abstract data type for 2d interpolation
Implements the functions to write data file plotable by Plotmtv.
Some common numerical utilities.
subroutine, public sll_s_new_file_id(file_id, error)
Get a file unit number free before creating a file.
Module to select the kind parameter.
Implements the functions to write xdmf file plotable by VisIt.
subroutine, public sll_s_xdmf_close(file_id, error)
Close the XML file and finish to write last lines.
Base class/basic interface for 2D interpolators.