(git:aeba166)
Loading...
Searching...
No Matches
d3_poly Module Reference

Routines to efficiently handle dense polynomial in 3 variables up to a given degree. Multiplication, partial evaluation, affine transform (change of reference system), differentiation are efficiently implemented. some functions accept or return several polynomial together, these have to have all the same size, and are stored one after the other in an unique 1d array. This gives them an easy handling and even seem to be faster than the transposed layout. More...

Functions/Subroutines

subroutine, public init_d3_poly_module ()
 initialization of the cache, is called by functions in this module that use cached values
 
pure integer function, public poly_size1 (maxgrad)
 size of a polynomial in x up to the given degree
 
pure integer function, public poly_size2 (maxgrad)
 size of a polynomial in x,y up to the given degree
 
pure integer function, public poly_size3 (maxgrad)
 size of a polynomial in x,y,z up to the given degree
 
pure integer function, public grad_size3 (n)
 max grad for a polynom of the given size
 
subroutine, public poly_affine_t3t (p, m, b, pres, npoly)
 returns in the polynomials pRes the transpose of the affine transformation x -> m*x+b of p
 
subroutine, public poly_affine_t3 (p, m, b, pres, npoly)
 returns in the polynomials pRes the affine transformation x -> m*x+b of p
 
subroutine, public poly_p_eval3b (p, size_p, x, pres, size_pres, npoly, grad, xi)
 low level routine of poly_p_eval3 without checks
 
subroutine, public poly_padd_uneval3b (p, size_p, x, pres, size_pres, npoly, grad, xi)
 low level routine of poly_padd_uneval3 without checks
 
subroutine, public poly_p_eval2b (p, size_p, x, pres, size_pres, npoly, grad, xi)
 low level routine of poly_p_eval2 without checks
 
subroutine, public poly_padd_uneval2b (p, size_p, x, pres, size_pres, npoly, grad, xi)
 low level routine of poly_p_uneval2 without checks
 
subroutine, public poly_cp2k2d3 (poly_cp2k, grad, poly_d3)
 subroutine that converts from the cp2k poly format to the d3 poly format
 
subroutine, public poly_d32cp2k (poly_cp2k, grad, poly_d3)
 subroutine that converts from the d3 poly format to the cp2k poly format
 

Variables

integer, parameter, public max_grad2 = 5
 
integer, parameter, public max_grad3 = 3
 
integer, parameter, public cached_dim1 = max_grad2 + 1
 
integer, parameter, public cached_dim2 = (max_grad2 + 1)*(max_grad2 + 2)/2
 
integer, parameter, public cached_dim3 = (max_grad3 + 1)*(max_grad3 + 2)*(max_grad3 + 3)/6
 

Detailed Description

Routines to efficiently handle dense polynomial in 3 variables up to a given degree. Multiplication, partial evaluation, affine transform (change of reference system), differentiation are efficiently implemented. some functions accept or return several polynomial together, these have to have all the same size, and are stored one after the other in an unique 1d array. This gives them an easy handling and even seem to be faster than the transposed layout.

Note
not all routines have been fully optimized. original available also with a BSD style license
Author
Fawzi Mohamed

Function/Subroutine Documentation

◆ init_d3_poly_module()

subroutine, public d3_poly::init_d3_poly_module

initialization of the cache, is called by functions in this module that use cached values

Definition at line 73 of file d3_poly.F.

Here is the caller graph for this function:

◆ poly_size1()

pure integer function, public d3_poly::poly_size1 ( integer, intent(in)  maxgrad)

size of a polynomial in x up to the given degree

Parameters
maxgrad...
Returns
...

Definition at line 154 of file d3_poly.F.

Here is the caller graph for this function:

◆ poly_size2()

pure integer function, public d3_poly::poly_size2 ( integer, intent(in)  maxgrad)

size of a polynomial in x,y up to the given degree

Parameters
maxgrad...
Returns
...

Definition at line 166 of file d3_poly.F.

Here is the caller graph for this function:

◆ poly_size3()

pure integer function, public d3_poly::poly_size3 ( integer, intent(in)  maxgrad)

size of a polynomial in x,y,z up to the given degree

Parameters
maxgrad...
Returns
...

Definition at line 178 of file d3_poly.F.

Here is the caller graph for this function:

◆ grad_size3()

pure integer function, public d3_poly::grad_size3 ( integer, intent(in)  n)

max grad for a polynom of the given size

Parameters
n...
Returns
...

Definition at line 214 of file d3_poly.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ poly_affine_t3t()

subroutine, public d3_poly::poly_affine_t3t ( real(dp), dimension(:), intent(in)  p,
real(dp), dimension(3, 3), intent(in)  m,
real(dp), dimension(3), intent(in)  b,
real(dp), dimension(:), intent(out)  pres,
integer, intent(in), optional  npoly 
)

returns in the polynomials pRes the transpose of the affine transformation x -> m*x+b of p

Parameters
p...
m...
b...
pRes...
npoly...

Definition at line 854 of file d3_poly.F.

Here is the call graph for this function:

◆ poly_affine_t3()

subroutine, public d3_poly::poly_affine_t3 ( real(dp), dimension(:), intent(in)  p,
real(dp), dimension(3, 3), intent(in)  m,
real(dp), dimension(3), intent(in)  b,
real(dp), dimension(:), intent(out)  pres,
integer, intent(in), optional  npoly 
)

returns in the polynomials pRes the affine transformation x -> m*x+b of p

Parameters
p...
m...
b...
pRes...
npoly...

Definition at line 1014 of file d3_poly.F.

Here is the call graph for this function:

◆ poly_p_eval3b()

subroutine, public d3_poly::poly_p_eval3b ( real(dp), dimension(if_check(size_p, *)), intent(in)  p,
integer, intent(in)  size_p,
real(dp), intent(in)  x,
real(dp), dimension(if_check(size_pres, *)), intent(inout)  pres,
integer, intent(in)  size_pres,
integer, intent(in)  npoly,
integer, intent(in)  grad,
real(dp), dimension(if_check(grad+1, *)), intent(inout)  xi 
)

low level routine of poly_p_eval3 without checks

Parameters
p...
size_p...
x...
pRes...
size_pRes...
npoly...
grad...
xi...

Definition at line 1206 of file d3_poly.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ poly_padd_uneval3b()

subroutine, public d3_poly::poly_padd_uneval3b ( real(dp), dimension(if_check(size_p, *)), intent(inout)  p,
integer, intent(in)  size_p,
real(dp), intent(in)  x,
real(dp), dimension(if_check(size_pres, *)), intent(in)  pres,
integer, intent(in)  size_pres,
integer, intent(in)  npoly,
integer, intent(in)  grad,
real(dp), dimension(if_check(grad+1, *)), intent(inout)  xi 
)

low level routine of poly_padd_uneval3 without checks

Parameters
p...
size_p...
x...
pRes...
size_pRes...
npoly...
grad...
xi...
Note
loop should be structured differently (more contiguous pRes access)

Definition at line 1311 of file d3_poly.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ poly_p_eval2b()

subroutine, public d3_poly::poly_p_eval2b ( real(dp), dimension(if_check(size_p, *)), intent(in)  p,
integer, intent(in)  size_p,
real(dp), intent(in)  x,
real(dp), dimension(if_check(size_pres, *)), intent(inout)  pres,
integer, intent(in)  size_pres,
integer, intent(in)  npoly,
integer  grad,
real(dp), dimension(if_check(grad+1, *))  xi 
)

low level routine of poly_p_eval2 without checks

Parameters
p...
size_p...
x...
pRes...
size_pRes...
npoly...
grad...
xi...

Definition at line 1413 of file d3_poly.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ poly_padd_uneval2b()

subroutine, public d3_poly::poly_padd_uneval2b ( real(dp), dimension(if_check(size_p, *)), intent(inout)  p,
integer, intent(in)  size_p,
real(dp), intent(in)  x,
real(dp), dimension(if_check(size_pres, *)), intent(in)  pres,
integer, intent(in)  size_pres,
integer, intent(in)  npoly,
integer  grad,
real(dp), dimension(if_check(grad+1, *))  xi 
)

low level routine of poly_p_uneval2 without checks

Parameters
p...
size_p...
x...
pRes...
size_pRes...
npoly...
grad...
xi...

Definition at line 1512 of file d3_poly.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ poly_cp2k2d3()

subroutine, public d3_poly::poly_cp2k2d3 ( real(dp), dimension(:), intent(in)  poly_cp2k,
integer, intent(in)  grad,
real(dp), dimension(:), intent(out)  poly_d3 
)

subroutine that converts from the cp2k poly format to the d3 poly format

Parameters
poly_cp2k...
grad...
poly_d3...

Definition at line 1833 of file d3_poly.F.

◆ poly_d32cp2k()

subroutine, public d3_poly::poly_d32cp2k ( real(dp), dimension(:), intent(out)  poly_cp2k,
integer, intent(in)  grad,
real(dp), dimension(:), intent(in)  poly_d3 
)

subroutine that converts from the d3 poly format to the cp2k poly format

Parameters
poly_cp2k...
grad...
poly_d3...

Definition at line 1882 of file d3_poly.F.

Variable Documentation

◆ max_grad2

integer, parameter, public d3_poly::max_grad2 = 5

Definition at line 51 of file d3_poly.F.

◆ max_grad3

integer, parameter, public d3_poly::max_grad3 = 3

Definition at line 52 of file d3_poly.F.

◆ cached_dim1

integer, parameter, public d3_poly::cached_dim1 = max_grad2 + 1

Definition at line 53 of file d3_poly.F.

◆ cached_dim2

integer, parameter, public d3_poly::cached_dim2 = (max_grad2 + 1)*(max_grad2 + 2)/2

Definition at line 54 of file d3_poly.F.

◆ cached_dim3

integer, parameter, public d3_poly::cached_dim3 = (max_grad3 + 1)*(max_grad3 + 2)*(max_grad3 + 3)/6

Definition at line 55 of file d3_poly.F.