Documentation for module d3_poly

Routines to efficently handle dense polynomial in 3 variables up to a given degree. Multiplication, partial evalution, 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.

source: d3_poly.F
Loading...

public Subroutines/Functions:

FUNCTION
INTEGER PURE
grad_size3 (n)
max grad for a polynom of the given size
initialization of the cache, is called by functions in this module that use cached values
SUBROUTINE
poly_affine_t3 (p, m, b, pres, npoly)
returns in the polynomials pRes the affine transformation x -> m*x+b of p
SUBROUTINE
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 that converts from the cp2k poly format to the d3 poly format
subroutine that converts from the d3 poly format to the cp2k poly format
low level routine of poly_p_uneval2 without checks
low level routine of poly_padd_uneval3 without checks
low level routine of poly_p_eval2 without checks
low level routine of poly_p_eval3 without checks
FUNCTION
INTEGER PURE
poly_size1 (maxgrad)
size of a polynomial in x up to the given degree
FUNCTION
INTEGER PURE
poly_size2 (maxgrad)
size of a polynomial in x,y up to the given degree
FUNCTION
INTEGER PURE
poly_size3 (maxgrad)
size of a polynomial in x,y,z up to the given degree

Parameters:

INTEGER
:: cached_dim1 = max_grad2+1
INTEGER
:: cached_dim2 = (max_grad2+1)*(max_grad2+2)/2
INTEGER
:: cached_dim3 = (max_grad3+1)*(max_grad3+2)*(max_grad3+3)/6
INTEGER
:: max_grad2 = 5
INTEGER
:: max_grad3 = 3

PURE FUNCTIONgrad_size3(n)

max grad for a polynom of the given size

Return Value ::
INTEGER
Arguments:
INTEGER,
INTENT(in)
:: n ...

SUBROUTINEinit_d3_poly_module()

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

SUBROUTINEpoly_affine_t3(p, m, b, pres, npoly)

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

Arguments:
REAL(dp),
INTENT(in)
:: p(:) ...
REAL(dp),
INTENT(in)
:: m(3,3) ...
REAL(dp),
INTENT(in)
:: b(3) ...
REAL(dp),
INTENT(out)
:: pres(:) ...
INTEGER,
INTENT(in),
OPTIONAL
:: npoly ...

SUBROUTINEpoly_affine_t3t(p, m, b, pres, npoly)

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

Arguments:
REAL(dp),
INTENT(in)
:: p(:) ...
REAL(dp),
INTENT(in)
:: m(3,3) ...
REAL(dp),
INTENT(in)
:: b(3) ...
REAL(dp),
INTENT(out)
:: pres(:) ...
INTEGER,
INTENT(in),
OPTIONAL
:: npoly ...

SUBROUTINEpoly_cp2k2d3(poly_cp2k, grad, poly_d3)

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

Arguments:
REAL(dp),
INTENT(in)
:: poly_cp2k(:) ...
INTEGER,
INTENT(in)
:: grad ...
REAL(dp),
INTENT(out)
:: poly_d3(:) ...

SUBROUTINEpoly_d32cp2k(poly_cp2k, grad, poly_d3)

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

Arguments:
REAL(dp),
INTENT(out)
:: poly_cp2k(:) ...
INTEGER,
INTENT(in)
:: grad ...
REAL(dp),
INTENT(in)
:: poly_d3(:) ...

SUBROUTINEpoly_padd_uneval2b(p, size_p, x, pres, size_pres, npoly, grad, xi)

low level routine of poly_p_uneval2 without checks

Arguments:
REAL(dp),
INTENT(inout)
:: p(*) ...
INTEGER,
INTENT(in)
:: size_p ...
REAL(dp),
INTENT(in)
:: x ...
REAL(dp),
INTENT(in)
:: pres(*) ...
INTEGER,
INTENT(in)
:: size_pres ...
INTEGER,
INTENT(in)
:: npoly ...
INTEGER
:: grad ...
REAL(dp)
:: xi(*) ...

SUBROUTINEpoly_padd_uneval3b(p, size_p, x, pres, size_pres, npoly, grad, xi)

low level routine of poly_padd_uneval3 without checks

Arguments:
REAL(dp),
INTENT(inout)
:: p(*) ...
INTEGER,
INTENT(in)
:: size_p ...
REAL(dp),
INTENT(in)
:: x ...
REAL(dp),
INTENT(in)
:: pres(*) ...
INTEGER,
INTENT(in)
:: size_pres ...
INTEGER,
INTENT(in)
:: npoly ...
INTEGER,
INTENT(in)
:: grad ...
REAL(dp),
INTENT(inout)
:: xi(*) ...

SUBROUTINEpoly_p_eval2b(p, size_p, x, pres, size_pres, npoly, grad, xi)

low level routine of poly_p_eval2 without checks

Arguments:
REAL(dp),
INTENT(in)
:: p(*) ...
INTEGER,
INTENT(in)
:: size_p ...
REAL(dp),
INTENT(in)
:: x ...
REAL(dp),
INTENT(inout)
:: pres(*) ...
INTEGER,
INTENT(in)
:: size_pres ...
INTEGER,
INTENT(in)
:: npoly ...
INTEGER
:: grad ...
REAL(dp)
:: xi(*) ...

SUBROUTINEpoly_p_eval3b(p, size_p, x, pres, size_pres, npoly, grad, xi)

low level routine of poly_p_eval3 without checks

Arguments:
REAL(dp),
INTENT(in)
:: p(*) ...
INTEGER,
INTENT(in)
:: size_p ...
REAL(dp),
INTENT(in)
:: x ...
REAL(dp),
INTENT(inout)
:: pres(*) ...
INTEGER,
INTENT(in)
:: size_pres ...
INTEGER,
INTENT(in)
:: npoly ...
INTEGER,
INTENT(in)
:: grad ...
REAL(dp),
INTENT(inout)
:: xi(*) ...

PURE FUNCTIONpoly_size1(maxgrad)

size of a polynomial in x up to the given degree

Return Value ::
INTEGER
Arguments:
INTEGER,
INTENT(in)
:: maxgrad ...

PURE FUNCTIONpoly_size2(maxgrad)

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

Return Value ::
INTEGER
Arguments:
INTEGER,
INTENT(in)
:: maxgrad ...

PURE FUNCTIONpoly_size3(maxgrad)

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

Return Value ::
INTEGER
Arguments:
INTEGER,
INTENT(in)
:: maxgrad ...