15 #include "sll_assert.h"
16 #include "sll_memory.h"
17 #include "sll_errors.h"
18 #include "sll_working_precision.h"
58 sll_real64,
intent(in) :: xi(3)
59 sll_real64,
intent(in) :: params(:)
78 sll_real64,
dimension(:),
pointer :: params
80 logical :: flag = .false.
81 logical :: flag2d = .false.
82 logical :: flag3d = .false.
83 logical :: singular = .false.
84 logical :: inverse = .false.
88 sll_real64,
allocatable :: x1_func_dofs_pp(:,:)
89 sll_real64,
allocatable :: x2_func_dofs_pp(:,:)
90 sll_real64,
allocatable :: x3_func_dofs_pp(:,:)
92 sll_int32 :: n_cells(3)
94 sll_real64 :: volume = 1._f64
95 sll_real64 :: lx(3) = 1._f64
145 sll_real64,
intent( in ) :: xi(3)
149 sll_real64 :: xbox(3)
152 x1 = self%x1_func( xi, self%params )
164 sll_real64,
intent( in ) :: xi(3)
168 sll_real64 :: xbox(3)
171 x2 = self%x2_func( xi, self%params )
183 sll_real64,
intent( in ) :: xi(3)
187 sll_real64 :: xbox(3)
190 x3 = self%x3_func( xi, self%params )
200 function get_x( self, xi )
result(x)
202 sll_real64,
intent( in ) :: xi(3)
206 sll_real64 :: xbox(3)
209 x(1) = self%x1_func( xi, self%params )
210 x(2) = self%x2_func( xi, self%params )
211 x(3) = self%x3_func( xi, self%params )
225 sll_real64,
intent( in ) :: x(3)
228 xi(1) = self%xi1_func( x, self%params )
229 xi(2) = self%xi2_func( x, self%params )
230 xi(3) = self%xi3_func( x, self%params )
237 sll_real64,
intent( in ) :: xi(3)
243 x = self%jacob( xi, self%params )
245 y = self%jacobian_matrix( xi )
246 if( self%flag3d)
then
247 x = y(1,1) * y(2,2) * y(3,3) +&
248 y(1,2) * y(2,3) * y(3,1) +&
249 y(1,3) * y(2,1) * y(3,2) -&
250 y(1,3) * y(2,2) * y(3,1) -&
251 y(1,2) * y(2,1) * y(3,3) -&
252 y(1,1) * y(2,3) * y(3,2)
254 x = y(3,3) * ( y(1,1) * y(2,2) - y(1,2) * y(2,1) )
264 sll_real64,
intent( in ) :: xi(3)
268 sll_real64 :: xbox(3)
273 y(1,1) = self%j_matrix(1,1)%f( xi, self%params )
274 y(2,2) = self%j_matrix(2,2)%f( xi, self%params )
275 y(3,3) = self%j_matrix(3,3)%f( xi, self%params )
276 y(1,2) = self%j_matrix(1,2)%f( xi, self%params )
277 y(2,1) = self%j_matrix(2,1)%f( xi, self%params )
278 if( self%flag3d )
then
279 y(1,3) = self%j_matrix(1,3)%f( xi, self%params )
280 y(2,3) = self%j_matrix(2,3)%f( xi, self%params )
281 y(3,1) = self%j_matrix(3,1)%f( xi, self%params )
282 y(3,2) = self%j_matrix(3,2)%f( xi, self%params )
291 if( self%flag3d )
then
305 sll_real64,
intent( in ) :: xi(3)
309 w = self%jacobian_matrix(xi)
327 sll_real64,
intent( in ) :: xi(3)
332 w = self%jacobian_matrix(xi)
334 if( self%flag3d )
then
335 y(1,1) = w(2,2) * w(3,3) - w(2,3) * w(3,2)
336 y(1,2) = w(1,3) * w(3,2) - w(1,2) * w(3,3)
337 y(1,3) = w(1,2) * w(2,3) - w(1,3) * w(2,2)
338 y(2,1) = w(2,3) * w(3,1) - w(2,1) * w(3,3)
339 y(2,2) = w(1,1) * w(3,3) - w(1,3) * w(3,1)
340 y(2,3) = w(1,3) * w(2,1) - w(1,1) * w(2,3)
341 y(3,1) = w(2,1) * w(3,2) - w(2,2) * w(3,1)
342 y(3,2) = w(1,2) * w(3,1) - w(1,1) * w(3,2)
343 y(3,3) = w(1,1) * w(2,2) - w(1,2) * w(2,1)
345 y = y/(w(1,1) * w(2,2) * w(3,3) +&
346 w(1,2) * w(2,3) * w(3,1) +&
347 w(1,3) * w(2,1) * w(3,2) -&
348 w(1,3) * w(2,2) * w(3,1) -&
349 w(1,2) * w(2,1) * w(3,3) -&
350 w(1,1) * w(2,3) * w(3,2) )
355 y(1,1) = w(2,2) /( w(1,1) * w(2,2) - w(1,2) * w(2,1) )
356 y(1,2) = - w(1,2) /( w(1,1) * w(2,2) - w(1,2) * w(2,1) )
357 y(2,1) = - w(2,1) /( w(1,1) * w(2,2) - w(1,2) * w(2,1) )
358 y(2,2) = w(1,1) /( w(1,1) * w(2,2) - w(1,2) * w(2,1) )
359 y(3,3) = 1._f64/w(3,3)
368 sll_real64,
intent( in ) :: xi(3)
373 w=self%jacobian_matrix_inverse(xi)
391 sll_real64,
intent( in ) :: xi(3)
395 y=self%jacobian_matrix( xi )
396 g(1,1) = y(1,1)**2+y(2,1)**2+y(3,1)**2
397 g(1,2) = y(1,1)*y(1,2)+y(2,1)*y(2,2)+y(3,1)*y(3,2)
398 g(1,3) = y(1,1)*y(1,3)+y(2,1)*y(2,3)+y(3,1)*y(3,3)
400 g(2,2) = y(1,2)**2+y(2,2)**2+y(3,2)**2
401 g(2,3) = y(1,2)*y(1,3)+y(2,2)*y(2,3)+y(3,2)*y(3,3)
404 g(3,3) = y(1,3)**2+y(2,3)**2+y(3,3)**2
412 sll_real64,
intent( in ) :: xi(3)
413 sll_int32,
intent( in ) :: component1, component2
417 w = self%jacobian_matrix(xi)
419 g = w(1,component1)*w(1,component2)+&
420 w(2,component1)*w(2,component2)+&
421 w(3,component1)*w(3,component2)
429 sll_real64,
intent( in ) :: xi(3)
433 y=self%jacobian_matrix_inverse_transposed(xi)
434 g(1,1) = y(1,1)**2+y(2,1)**2+y(3,1)**2
435 g(1,2) = y(1,1)*y(1,2)+y(2,1)*y(2,2)+y(3,1)*y(3,2)
436 g(1,3) = y(1,1)*y(1,3)+y(2,1)*y(2,3)+y(3,1)*y(3,3)
438 g(2,2) = y(1,2)**2+y(2,2)**2+y(3,2)**2
439 g(2,3) = y(1,2)*y(1,3)+y(2,2)*y(2,3)+y(3,2)*y(3,3)
442 g(3,3) = y(1,3)**2+y(2,3)**2+y(3,3)**2
450 sll_real64,
intent( in ) :: xi(3)
451 sll_int32,
intent( in ) :: component1, component2
455 y = self%jacobian_matrix_inverse(xi)
456 g = y(component1,1)*y(component2,1)+&
457 y(component1,2)*y(component2,2)+&
458 y(component1,3)*y(component2,3)
466 sll_real64,
intent( in ) :: xi(3)
467 sll_int32,
intent( in ) :: component1, component2
472 y = self%jacobian_matrix(xi)
474 if( self%flag3d)
then
475 g = (y(1,component1)*y(1,component2)+&
476 y(2,component1)*y(2,component2)+&
477 y(3,component1)*y(3,component2) )/ (y(1,1) * y(2,2) * y(3,3) +&
478 y(1,2) * y(2,3) * y(3,1) +&
479 y(1,3) * y(2,1) * y(3,2) -&
480 y(1,3) * y(2,2) * y(3,1) -&
481 y(1,2) * y(2,1) * y(3,3) -&
482 y(1,1) * y(2,3) * y(3,2))
484 g = (y(1,component1)*y(1,component2)+&
485 y(2,component1)*y(2,component2)+&
486 y(3,component1)*y(3,component2) )/ (y(3,3) * ( y(1,1) * y(2,2) - y(1,2) * y(2,1) ) )
495 sll_real64,
intent( in ) :: xi(3)
496 sll_int32,
intent( in ) :: component1, component2
499 sll_real64 :: w(3,3), y(3,3)
503 y = self%jacobian_matrix_inverse(xi)
504 w(1,1) = self%jacobian(xi)
505 g = (y(component1,1)*y(component2,1)+&
506 y(component1,2)*y(component2,2)+&
507 y(component1,3)*y(component2,3)) * w(1,1)
526 subroutine init( self, params, x1_func, x2_func, x3_func, jac11, jac12, jac13, jac21, jac22, jac23, jac31, jac32, jac33, jacob, xi1_func, xi2_func, xi3_func, flag2d, flag3d, n_cells, deg, Lx, volume )
528 sll_real64,
dimension(:),
intent( in ) :: params
545 logical,
optional :: flag2d
546 logical,
optional :: flag3d
547 sll_int32,
optional :: n_cells(3)
548 sll_int32,
optional :: deg(3)
549 sll_real64,
optional :: lx(3)
550 sll_real64,
optional :: volume
553 sll_real64,
allocatable :: x1_func_dofs(:)
554 sll_real64,
allocatable :: x2_func_dofs(:)
555 sll_real64,
allocatable :: x3_func_dofs(:)
559 sll_real64,
allocatable :: rhs(:,:)
560 sll_real64,
allocatable :: tk(:,:), xk(:,:)
561 sll_int32 :: ntotal0, n_dofs0(3), ntotal1, n_dofs1(3)
565 sll_allocate(self%j_matrix(1:3,1:3), ierr)
566 sll_allocate(self%params(1:
size(params)),ierr)
568 self%x1_func => x1_func
569 self%x2_func => x2_func
570 self%x3_func => x3_func
572 if(
present(xi1_func) .and.
present(xi2_func) .and.
present(xi3_func) )
then
573 self%xi1_func => xi1_func
574 self%xi2_func => xi2_func
575 self%xi3_func => xi3_func
577 self%inverse = .true.
579 if(
present(jac11) .and.
present(jacob))
then
580 self%j_matrix(1,1)%f => jac11
581 self%j_matrix(1,2)%f => jac12
582 self%j_matrix(1,3)%f => jac13
583 self%j_matrix(2,1)%f => jac21
584 self%j_matrix(2,2)%f => jac22
585 self%j_matrix(2,3)%f => jac23
586 self%j_matrix(3,1)%f => jac31
587 self%j_matrix(3,2)%f => jac32
588 self%j_matrix(3,3)%f => jac33
593 if(params(1) == 0._f64)
then
594 self%singular = .true.
595 print*,
'Error: singular mapping not yet implemented'
599 if(
present(flag2d) )
then
603 if(
present(flag3d) )
then
608 if(
present(lx) )
then
612 if(
present(volume) )
then
616 if(
present(n_cells) .and.
present(deg) )
then
617 self%n_cells = n_cells
622 n_dofs0 = self%n_cells
623 n_dofs0(1) = self%n_cells(1)+self%deg(1)
624 n_dofs0(3) = self%n_cells(3)+self%deg(3)
626 n_dofs1(1) = self%n_cells(1)+deg1(1)
627 ntotal0 = product(n_dofs0)
628 ntotal1 = product(n_dofs1)
631 allocate( x1_func_dofs(1:ntotal0) )
632 allocate( x2_func_dofs(1:ntotal0) )
633 allocate( x3_func_dofs(1:ntotal0) )
634 allocate( self%x1_func_dofs_pp(1:product(self%deg+1), product(self%n_cells)) )
635 allocate( self%x2_func_dofs_pp(1:product(self%deg+1), product(self%n_cells)) )
636 allocate( self%x3_func_dofs_pp(1:product(self%deg+1), product(self%n_cells)) )
637 x1_func_dofs = 0._f64
638 x2_func_dofs = 0._f64
639 x3_func_dofs = 0._f64
640 self%x1_func_dofs_pp = 0._f64
641 self%x2_func_dofs_pp = 0._f64
642 self%x3_func_dofs_pp = 0._f64
644 allocate( tk(maxval(self%n_cells)+2*maxval(self%deg)+1, 3) )
645 allocate( xk(maxval(n_dofs0), 3) )
646 allocate( rhs(1:ntotal0, 3) )
654 tk(1:self%deg(1),1) = 0._f64
655 do i = 1, self%n_cells(1)+1
656 tk(self%deg(1)+i,1) = real(i-1,f64)/real(self%n_cells(1),f64)
658 tk(self%n_cells(1)+self%deg(1)+2:self%n_cells(1)+2*self%deg(1)+1,1) = 1._f64
660 tk(1:self%deg(3),3) = 0._f64
661 do i = 1, self%n_cells(3)+1
662 tk(self%deg(3)+i,3) = real(i-1,f64)/real(self%n_cells(3),f64)
664 tk(self%n_cells(3)+self%deg(3)+2:self%n_cells(3)+2*self%deg(3)+1,3) = 1._f64
668 do i = 1, self%n_cells(j)
669 tk(self%deg(j)+i,j) = real(i-1,f64)/real(self%n_cells(j),f64)
671 do i = 1, self%deg(j)
672 tk(i,j) = tk(self%n_cells(j)+i,j)-1._f64
673 tk(self%n_cells(j)+self%deg(j)+i,j) = tk(self%deg(j)+i,j) + 1._f64
680 xk(i,1) = sum(tk(1+i:i+self%deg(1),1))/real(self%deg(1),f64)
684 xk(i,3) = sum(tk(1+i:i+self%deg(3),3))/real(self%deg(3),f64)
689 if( modulo(real(self%deg(j),f64),2._f64) == 0._f64)
then
690 xk(1:n_dofs0(j),j) = 0.5_f64*(tk(self%deg(j)+1:self%deg(j)+self%n_cells(j),j)+tk(self%deg(j)+2:self%deg(j)+1+self%n_cells(j),j))
692 xk(1:n_dofs0(j),j) = tk(self%deg(j)+1:self%deg(j)+self%n_cells(j),j)
702 call matrix_solver(j)%create( matrix(j) )
703 matrix_solver(j)%atol = 1d-13
707 call kron_solver%create( linear_solver_a=matrix_solver(1), &
708 linear_solver_b=matrix_solver(2), &
709 linear_solver_c=matrix_solver(3) )
716 rhs( i + (j-1)*n_dofs0(1) + (k-1)*n_dofs0(1)*n_dofs0(2), 1 ) = x1_func( [xk(i,1), xk(j,2), xk(k,3)], params )
717 rhs( i + (j-1)*n_dofs0(1) + (k-1)*n_dofs0(1)*n_dofs0(2), 2 ) = x2_func( [xk(i,1), xk(j,2), xk(k,3)], params )
718 rhs( i + (j-1)*n_dofs0(1) + (k-1)*n_dofs0(1)*n_dofs0(2), 3 ) = x3_func( [xk(i,1), xk(j,2), xk(k,3)], params )
723 call kron_solver%solve( rhs(:,1), x1_func_dofs)
724 call kron_solver%solve( rhs(:,2), x2_func_dofs)
725 call kron_solver%solve( rhs(:,3), x3_func_dofs)
740 character(len=*),
intent( in ) :: filename
742 sll_int32 :: input_file
745 sll_real64 :: params(12)
746 character(len=256) :: mapping_case
747 sll_int32 :: n_cells(3) = 3
748 sll_int32 :: deg(3) = 1
749 sll_real64 :: vol = 1._f64
750 sll_real64 :: lx(3) = 1._f64
751 namelist /trafo/ nparams, params, mapping_case, n_cells, deg
754 open(newunit = input_file, file=trim(filename), iostat=io_stat)
755 if (io_stat /= 0)
then
756 print*,
'init_mapping() failed to open file ', filename
760 read(input_file, trafo)
764 select case(trim(mapping_case))
765 case(
"cylindrical_sqrt" )
766 lx(1:2) = 2._f64*(params(2)-params(1))
768 vol =
sll_p_pi * (params(2)-params(1))**2 * params(3)
774 case(
"cylindrical_sqrt_discrete" )
775 lx(1:2) = 2._f64*(params(2)-params(1))
777 vol =
sll_p_pi * (params(2)-params(1))**2 * params(3)
779 n_cells=n_cells, deg=deg, lx=lx, volume=vol )
780 case(
"cylindrical_sqrt_inverse" )
781 lx(1:2) = 2._f64*(params(2)-params(1))
783 vol =
sll_p_pi * (params(2)-params(1))**2 * params(3)
791 case(
"cylindrical_sqrt_discrete_inverse" )
792 lx(1:2) = 2._f64*(params(2)-params(1))
794 vol =
sll_p_pi * (params(2)-params(1))**2 * params(3)
797 n_cells=n_cells, deg=deg, lx=lx, volume=vol )
798 case(
"cylindrical" )
799 lx(1:2) = 2._f64*(params(2)-params(1))
801 vol =
sll_p_pi * (params(2)-params(1))**2 * params(3)
808 case(
"cylindrical_discrete" )
809 lx(1:2) = 2._f64*(params(2)-params(1))
811 vol =
sll_p_pi * (params(2)-params(1))**2 * params(3)
813 flag2d = .true., n_cells=n_cells, deg=deg, lx=lx, volume=vol )
814 case(
"cylindrical_inverse" )
815 lx(1:2) = 2._f64*(params(2)-params(1))
817 vol =
sll_p_pi * (params(2)-params(1))**2 * params(3)
825 case(
"cylindrical_discrete_inverse" )
826 lx(1:2) = 2._f64*(params(2)-params(1))
828 vol =
sll_p_pi * (params(2)-params(1))**2 * params(3)
831 n_cells=n_cells, deg=deg, lx=lx, volume=vol )
833 vol = 4._f64/3._f64 *
sll_p_pi * (params(2)-params(1))**3
840 lx(1) = 3.1_f64*params(2)
841 lx(1) = 2.4_f64*params(2)
843 vol =
sll_p_pi * 7.44_f64* params(2)**2 * params(3)
849 case(
"parallelogram" )
851 vol = product(params(1:3))
859 vol = product(params(1:3))
867 vol = product(params(1:3))
873 case(
"colella_discrete" )
875 vol = product(params(1:3))
877 flag2d = .true., n_cells=n_cells, deg=deg, lx=lx, volume=vol )
880 vol = product(params(1:3))
886 case(
"orthogonal_discrete" )
887 vol = product(params(1:3))
889 n_cells=n_cells, deg=deg, lx=lx, volume=vol)
892 vol = product(params(1:3))
898 case(
"polynomial_discrete" )
900 vol = product(params(1:3))
902 n_cells=n_cells, deg=deg, lx=lx, volume=vol)
905 vol = product(params(1:3))
911 case(
"scaling_discrete")
913 vol = product(params(1:3))
915 n_cells=n_cells, deg=deg, lx=lx, volume=vol)
917 print*,
'error init_mapping: mapping name not implemented'
928 self%x1_func => null()
929 self%x2_func => null()
930 self%x3_func => null()
931 DEALLOCATE(self%j_matrix)
932 DEALLOCATE(self%params)
939 sll_int32,
intent( in ) :: n_cells
940 sll_int32,
intent( in ) :: deg
941 sll_real64,
intent( in ) :: xk(:)
945 sll_int32 :: row, column, ind, i
946 sll_int32 :: box, n_nnz, n_dofs
949 n_dofs = n_cells + deg
950 n_nnz = n_dofs*(deg+1)
952 call matrix%create( n_rows=n_dofs, n_cols=n_dofs, n_nnz=n_nnz )
955 matrix%arr_ia(row) = matrix%arr_ia(row-1) + deg+1
959 do row = 1, floor(0.5_f64*real(deg,f64))
961 matrix%arr_ja(ind) = column
966 do column = row, row+deg
967 matrix%arr_ja(ind) = column
971 do row = 1, ceiling(0.5_f64*real(deg,f64))
972 do column = n_cells, n_dofs
973 matrix%arr_ja(ind) = column
977 matrix%arr_a = 0.0_f64
978 sll_assert( ind == matrix%n_nnz+1 )
982 xi = xk(row)*real(n_cells,f64)
983 box = floor( xi ) + 1
984 xi = xi - real(box-1, f64)
985 if( box == n_cells + 1 )
then
995 else if(box >= n_cells-deg+2)
then
1007 sll_assert( ind == matrix%n_nnz+1 )
1014 sll_int32,
intent( in ) :: n_cells
1015 sll_int32,
intent( in ) :: deg
1019 sll_int32 :: row, column, ind, i
1021 sll_real64 :: xi, val(1:deg+1)
1023 n_nnz = n_cells*(deg+1)
1025 call matrix%create( n_rows=n_cells, n_cols=n_cells, n_nnz=n_nnz )
1027 do row = 2, n_cells+1
1028 matrix%arr_ia(row) = matrix%arr_ia(row-1) + deg+1
1034 matrix%arr_ja(ind) = column
1037 do column = n_cells+row-deg, n_cells
1038 matrix%arr_ja(ind) = column
1043 do row = deg+1, n_cells
1044 do column = row-deg, row
1045 matrix%arr_ja(ind) = column
1052 matrix%arr_a = 0.0_f64
1053 sll_assert( ind == matrix%n_nnz+1 )
1055 if( modulo(real(deg,f64),2._f64) == 0._f64)
then
1067 do i = deg+2-row, deg+1
1068 matrix%arr_a(1,ind) = val(i)
1072 matrix%arr_a(1,ind) = val(i)
1077 do row = deg+1, n_cells
1078 matrix%arr_a(1,ind:ind+deg) = val
1082 sll_assert( ind == matrix%n_nnz+1 )
1090 sll_real64,
intent( in ) :: position(3)
1091 sll_real64,
intent( out ) :: xi(3)
1092 sll_int32,
intent( out ) :: box(3)
1094 xi = position * real(self%n_cells,f64)
1095 box = floor( xi ) + 1
1096 xi = xi - real(box-1, f64)
1098 if( box(1) == self%n_cells(1) + 1 )
then
1099 if( xi(1) == 0._f64)
then
1101 box(1) = self%n_cells(1)
1103 print*,
'box, x, xbox', box, position(1), xi(1)
1104 sll_error(
'convert_x_to_xbox',
'box1 value to high' )
1106 else if( box(1) == 0 )
then
1107 print*,
'box, x, xbox', box, position(1), xi(1)
1108 sll_error(
'convert_x_to_xbox',
'box1 value to low' )
1111 if( box(2) == self%n_cells(2) + 1 )
then
1112 if( xi(2) == 0._f64)
then
1114 box(2) = self%n_cells(2)
1116 print*,
'box, x, xbox', box, position(2), xi(2)
1117 sll_error(
'convert_x_to_xbox',
'box2 value to high' )
1119 else if( box(2) == 0 )
then
1120 print*,
'box, x, xbox', box, position(2), xi(2)
1121 sll_error(
'convert_x_to_xbox',
'box2 value to low' )
1125 if( box(3) == self%n_cells(3) + 1 )
then
1126 if( xi(3) == 0._f64)
then
1128 box(3) = self%n_cells(3)
1130 print*,
'box, x, xbox', box, position(3), xi(3)
1131 sll_error(
'convert_x_to_xbox',
'box3 value to high' )
1133 else if( box(3) == 0 )
then
1134 print*,
'box, x, xbox', box, position(3), xi(3)
1135 sll_error(
'convert_x_to_xbox',
'box3 value to low' )
abstract interface for mapping functions
Fortran module where set some physical and mathematical constants.
real(kind=f64), parameter, public sll_p_pi
module for a linear operator of kronecker solver
module for kronecker linear solver
module for a sequential gmres
Module interfaces for coordinate transformation.
real(kind=f64) function, dimension(3) get_xi(self, x)
Compute the logical coordinate vector Xi.
subroutine free(self)
Finalize the coordinate transformation.
real(kind=f64) function, dimension(3, 3) jacobian_matrix_inverse(self, xi)
Compute the entries of the inverse Jacobi matrix.
real(kind=f64) function, dimension(3, 3) jacobian_matrix(self, xi)
Compute the entries of the Jacobi matrix.
real(kind=f64) function metric_inverse_single(self, xi, component1, component2)
Compute a single entriy of the inverse metric.
subroutine init(self, params, x1_func, x2_func, x3_func, jac11, jac12, jac13, jac21, jac22, jac23, jac31, jac32, jac33, jacob, xi1_func, xi2_func, xi3_func, flag2d, flag3d, n_cells, deg, Lx, volume)
Initialize the coordinate transformation.
real(kind=f64) function, dimension(3) get_x(self, xi)
Compute all three components of X.
real(kind=f64) function metric_single(self, xi, component1, component2)
Compute a single entriy of the metric.
real(kind=f64) function jacobian(self, xi)
Compute the determinant of the Jacobi matrix.
real(kind=f64) function, dimension(3, 3) jacobian_matrix_inverse_transposed(self, xi)
Compute the entries of the transposed inverse Jacobi matrix.
real(kind=f64) function get_x3(self, xi)
Compute x3.
subroutine calculate_interpolation_matrix_1d_periodic(n_cells, deg, spline, matrix)
Helper function for spline mapping.
real(kind=f64) function metric_inverse_single_jacobian(self, xi, component1, component2)
Compute a single entriy of the inverse metric multiplied by the jacobian.
real(kind=f64) function get_x1(self, xi)
Compute x1.
real(kind=f64) function, dimension(3, 3) metric(self, xi)
Compute the entries of the metric.
subroutine init_from_file(self, filename)
Initialize the coordinate transformation from nml file.
real(kind=f64) function get_x2(self, xi)
Compute x2.
subroutine convert_x_to_xbox(self, position, xi, box)
Helper function to compute xbox.
real(kind=f64) function, dimension(3, 3) metric_inverse(self, xi)
Compute the entries of the inverse metric.
subroutine calculate_interpolation_matrix_1d(n_cells, deg, xk, spline, matrix)
Helper function for spline mapping.
real(kind=f64) function metric_single_jacobian(self, xi, component1, component2)
Compute a single entriy of the metric divided by the jacobian.
real(kind=f64) function, dimension(3, 3) jacobian_matrix_transposed(self, xi)
Compute the entries of the transposed Jacobi matrix.
module for Compressed Sparse Row Matrix (CSR)
subroutine, public sll_s_spline_pp_b_to_pp_3d_clamped_2full(self, n_cells, b_coeffs, pp_coeffs)
Convert 3d spline in B form to spline in pp form for clamped spline.
subroutine, public sll_s_spline_pp_init_3d(self, degree, n_cells, boundary)
Initialize sll_t_spline_pp_3d object.
real(kind=f64) function, public sll_f_spline_pp_horner_3d(degree, pp_coeffs, x, indices, n_cells)
Perform a 3d hornerschema on the pp_coeffs at the indices.
real(kind=f64) function, public sll_f_spline_pp_horner_3d_d1(degree, pp_coeffs, x, indices, n_cells)
Perform a 3d hornerschema on the pp_coeffs at the indices.
real(kind=f64) function, public sll_f_spline_pp_horner_1d(degree, pp_coeffs, x, index)
Perform a 1d hornerschema on the pp_coeffs at index.
real(kind=f64) function, public sll_f_spline_pp_horner_3d_d3(degree, pp_coeffs, x, indices, n_cells)
Perform a 3d hornerschema on the pp_coeffs at the indices.
real(kind=f64) function, public sll_f_spline_pp_horner_3d_d2(degree, pp_coeffs, x, indices, n_cells)
Perform a 3d hornerschema on the pp_coeffs at the indices.
Module to select the kind parameter.
class for a linear operator
class for the kronecker linear solver
class for a sequential gmres linear solver
type collecting functions for analytical coordinate mapping
arbitrary degree 1d spline
arbitrary degree 3d spline