|
CP2K 2.4 (Revision 12889)
|
This module defines the grid data type and some basic operations on it. More...
Functions | |
| subroutine, public | pw_grid_create (pw_grid, pe_group, local, error) |
| Initialize a PW grid with all defaults. | |
| LOGICAL, public | pw_grid_compare (grida, gridb) |
| Check if two pw_grids are equal. | |
| subroutine, public | get_pw_grid_info (pw_grid, id_nr, mode, vol, dvol, npts, ngpts, ngpts_cut, dr, cutoff, orthorhombic, gvectors, gsquare, error) |
| Access to information stored in the pw_grid_type. | |
| subroutine, public | set_pw_grid_info (pw_grid, grid_span, npts, bounds, cutoff, spherical, error) |
| Set some information stored in the pw_grid_type. | |
| subroutine, public | pw_grid_setup (cell, pw_grid, grid_span, cutoff, bounds, npts, spherical, odd, fft_usage, ncommensurate, icommensurate, blocked, ref_grid, rs_dims, iounit, error) |
| sets up a pw_grid | |
| subroutine | pw_grid_setup_internal (cell, pw_grid, blocked, ref_grid, rs_dims, iounit, error) |
| sets up a pw_grid, needs valid bounds as input, it is up to you to make sure of it using pw_grid_bounds_from_n | |
| subroutine, public | create_gvectors (pw_grid, cell, ecut, blocked, ref_grid, error) |
| subroutine | pw_grid_print (pw_grid, info, error) |
| Output of information on pw_grid. | |
| subroutine | pw_grid_distribute (pw_grid, yz_mask, ref_grid, blocked, rs_dims, error) |
| Distribute grids in real and Fourier Space to the processors in group. | |
| subroutine | pre_tag (pw_grid, yz_mask, ref_grid) |
| subroutine | order_mask (yz_mask, yz_index, error) |
| subroutine | pw_grid_count (h_inv, pw_grid, cutoff, yz_mask) |
| Count total number of g vectors. | |
| subroutine | pw_grid_assign (h_inv, pw_grid, cutoff, error) |
| Setup maps from 1d to 3d space. | |
| subroutine | pw_grid_set_maps (grid_span, g_hat, mapl, mapm, mapn, npts) |
| Setup maps from 1d to 3d space. | |
| subroutine | pw_grid_allocate (pw_grid, ng, bounds, error) |
| Allocate all (Pointer) Arrays in pw_grid. | |
| subroutine | pw_grid_sort (pw_grid, ref_grid, error) |
| Sort g-vectors according to length. | |
| subroutine | sort_shells (gsq, g_hat, idx, error) |
| subroutine | redist (g_hat, idx, s1, s2, error) |
| subroutine | pw_grid_remap (pw_grid, yz, error) |
| Reorder yzq and yzp arrays for parallel FFT according to FFT mapping. | |
| subroutine, public | pw_grid_change (cell, pw_grid) |
| Recalculate the g-vectors after a change of the box. | |
| subroutine, public | pw_grid_retain (pw_grid, error) |
| retains the given pw grid | |
| subroutine, public | pw_grid_release (pw_grid, error) |
| releases the given pw grid | |
Variables | |
| INTEGER | grid_tag = 0 |
| CHARACTER(len=*), parameter, private | moduleN = 'pw_grids' |
This module defines the grid data type and some basic operations on it.
if no cutoff or a negative cutoff is given, all g-vectors in the box are included (no spherical cutoff)
for a distributed setup the array in para rs_dims has to be initialized output: pw_grid
pw_grid_change : updates g-vectors after a change of the box
| subroutine,public pw_grids::create_gvectors | ( | TYPE(pw_grid_type),pointer | pw_grid, |
| TYPE(cell_type),intent(in) | cell, | ||
| REAL(KIND=dp) | ecut, | ||
| INTEGER,optional | blocked, | ||
| TYPE(pw_grid_type),intent(in),optional | ref_grid, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
Definition at line 513 of file pw_grids.f90.
References pw_grid_allocate(), pw_grid_assign(), pw_grid_count(), pw_grid_distribute(), pw_grid_remap(), and pw_grid_sort().
Here is the call graph for this function:| subroutine,public pw_grids::get_pw_grid_info | ( | TYPE(pw_grid_type),pointer | pw_grid, |
| INTEGER,intent(out),optional | id_nr, | ||
| INTEGER,intent(out),optional | mode, | ||
| REAL(dp),intent(out),optional | vol, | ||
| REAL(dp),intent(out),optional | dvol, | ||
| INTEGER,dimension(3),intent(out),optional | npts, | ||
| INTEGER(int_8),intent(out),optional | ngpts, | ||
| INTEGER(int_8),intent(out),optional | ngpts_cut, | ||
| REAL(dp),dimension(3),intent(out),optional | dr, | ||
| REAL(dp),intent(out),optional | cutoff, | ||
| LOGICAL,intent(out),optional | orthorhombic, | ||
| REAL(dp),dimension(:, :),optional,pointer | gvectors, | ||
| REAL(dp),dimension(:),optional,pointer | gsquare, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
Access to information stored in the pw_grid_type.
Definition at line 173 of file pw_grids.f90.
References error.
Referenced by xray_diffraction::calculate_rhotot_elec_gspace(), qs_dftb_coulomb::dftb_spme_evaluate(), spme::spme_evaluate(), qs_scf_post_gpw::write_mo_free_results(), and xray_diffraction::xray_diffraction_spectrum().
Here is the caller graph for this function:| subroutine pw_grids::order_mask | ( | INTEGER,dimension(:, :),intent(in) | yz_mask, |
| INTEGER,dimension(:, :),intent(out) | yz_index, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) | [private] |
Definition at line 1102 of file pw_grids.f90.
Referenced by pw_grid_distribute().
Here is the caller graph for this function:| subroutine pw_grids::pre_tag | ( | TYPE(pw_grid_type),pointer | pw_grid, |
| INTEGER,dimension(:, :),intent(inout) | yz_mask, | ||
| TYPE(pw_grid_type),intent(in) | ref_grid | ||
| ) | [private] |
Definition at line 1037 of file pw_grids.f90.
References pw_grid_types::HALFSPACE.
Referenced by pw_grid_distribute().
Here is the caller graph for this function:| subroutine pw_grids::pw_grid_allocate | ( | TYPE(pw_grid_type),intent(inout) | pw_grid, |
| INTEGER,intent(in) | ng, | ||
| INTEGER,dimension(:, :),intent(in) | bounds, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) | [private] |
Allocate all (Pointer) Arrays in pw_grid.
Definition at line 1609 of file pw_grids.f90.
References pw_grid_types::PW_MODE_DISTRIBUTED, and timings::timeset().
Referenced by create_gvectors(), and pw_grid_setup_internal().
Here is the call graph for this function:
Here is the caller graph for this function:| subroutine pw_grids::pw_grid_assign | ( | REAL(KIND=dp),dimension(3, 3) | h_inv, |
| TYPE(pw_grid_type),pointer | pw_grid, | ||
| REAL(KIND=dp),intent(in) | cutoff, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) | [private] |
Setup maps from 1d to 3d space.
Definition at line 1330 of file pw_grids.f90.
References pw_grid_types::FULLSPACE, pw_grid_types::HALFSPACE, pw_grid_set_maps(), pw_grid_types::PW_MODE_DISTRIBUTED, pw_grid_types::PW_MODE_LOCAL, termination::stop_program(), timings::timeset(), and mathconstants::twopi.
Referenced by create_gvectors(), and pw_grid_setup_internal().
Here is the call graph for this function:
Here is the caller graph for this function:| subroutine,public pw_grids::pw_grid_change | ( | TYPE(cell_type),pointer | cell, |
| TYPE(pw_grid_type),pointer | pw_grid | ||
| ) |
Recalculate the g-vectors after a change of the box.
Definition at line 2047 of file pw_grids.f90.
References kinds::dp, REAL(), and mathconstants::twopi.
Referenced by dgs::dg_grid_change(), ewald_pw_methods::ewald_pw_grid_change(), and pw_env_methods::pw_env_rebuild().
Here is the call graph for this function:
Here is the caller graph for this function:| LOGICAL,public pw_grids::pw_grid_compare | ( | TYPE(pw_grid_type),intent(in) | grida, |
| TYPE(pw_grid_type),intent(in) | gridb | ||
| ) |
Check if two pw_grids are equal.
Definition at line 150 of file pw_grids.f90.
Referenced by pw_poisson_methods::pw_poisson_solve(), pw_pool_types::pw_pool_give_back_pw(), and qs_vxc::qs_vxc_create().
Here is the caller graph for this function:| subroutine pw_grids::pw_grid_count | ( | REAL(KIND=dp),dimension(3, 3) | h_inv, |
| TYPE(pw_grid_type),pointer | pw_grid, | ||
| REAL(KIND=dp),intent(in) | cutoff, | ||
| INTEGER,dimension(:, :),intent(out) | yz_mask | ||
| ) | [private] |
Count total number of g vectors.
Definition at line 1238 of file pw_grids.f90.
References pw_grid_types::FULLSPACE, util::get_limit(), pw_grid_types::HALFSPACE, pw_grid_types::PW_MODE_DISTRIBUTED, pw_grid_types::PW_MODE_LOCAL, termination::stop_program(), and mathconstants::twopi.
Referenced by create_gvectors(), and pw_grid_setup_internal().
Here is the call graph for this function:
Here is the caller graph for this function:| subroutine,public pw_grids::pw_grid_create | ( | TYPE(pw_grid_type),pointer | pw_grid, |
| INTEGER,intent(in) | pe_group, | ||
| LOGICAL,intent(in),optional | local, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
Initialize a PW grid with all defaults.
Definition at line 77 of file pw_grids.f90.
References CPPostcondition, pw_grid_types::FULLSPACE, grid_tag, message_passing::mp_comm_dup(), pw_grid_types::PW_MODE_DISTRIBUTED, and pw_grid_types::PW_MODE_LOCAL.
Referenced by ewald_pw_types::ewald_pw_init(), library_tests::pw_fft_test(), qmmm_pw_grid::pw_grid_create_copy_no_pbc(), library_tests::rs_pw_transfer_test(), ewald_spline_util::Setup_Ewald_Spline(), and xc_derivative_set_types::xc_dset_create().
Here is the call graph for this function:
Here is the caller graph for this function:| subroutine pw_grids::pw_grid_distribute | ( | TYPE(pw_grid_type),pointer | pw_grid, |
| INTEGER,dimension(:, :),intent(inout) | yz_mask, | ||
| TYPE(pw_grid_type),intent(in),optional | ref_grid, | ||
| INTEGER,intent(in),optional | blocked, | ||
| INTEGER,dimension(2),intent(in),optional | rs_dims, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) | [private] |
Distribute grids in real and Fourier Space to the processors in group.
Definition at line 681 of file pw_grids.f90.
References util::get_limit(), pw_grid_types::HALFSPACE, message_passing::mp_cart_coords(), message_passing::mp_cart_create(), message_passing::mp_cart_rank(), message_passing::mp_dims_create(), message_passing::MPI_COMM_SELF, order_mask(), pre_tag(), pw_grid_types::PW_MODE_DISTRIBUTED, pw_grid_types::PW_MODE_LOCAL, and timings::timeset().
Referenced by create_gvectors(), and pw_grid_setup_internal().
Here is the call graph for this function:
Here is the caller graph for this function:| subroutine pw_grids::pw_grid_print | ( | TYPE(pw_grid_type),pointer | pw_grid, |
| INTEGER,intent(in) | info, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) | [private] |
Output of information on pw_grid.
Definition at line 565 of file pw_grids.f90.
References pw_grid_types::HALFSPACE, pw_grid_types::PW_MODE_LOCAL, and REAL().
Referenced by pw_grid_setup_internal().
Here is the call graph for this function:
Here is the caller graph for this function:| subroutine,public pw_grids::pw_grid_release | ( | TYPE(pw_grid_type),pointer | pw_grid, |
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
releases the given pw grid
| pw_grid | the pw grid to release |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 2133 of file pw_grids.f90.
References CPPostconditionNoFail, CPPreconditionNoFail, message_passing::mp_comm_free(), and pw_grid_types::PW_MODE_DISTRIBUTED.
Referenced by cp_ddapc_types::cp_ddapc_ewald_release(), pw_poisson_types::pw_poisson_release(), qmmm_types::qmmm_per_pot_type_dealloc(), and realspace_grid_types::rs_grid_release_descriptor().
Here is the call graph for this function:
Here is the caller graph for this function:| subroutine pw_grids::pw_grid_remap | ( | TYPE(pw_grid_type),pointer | pw_grid, |
| INTEGER,dimension(:, :),intent(out) | yz, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) | [private] |
Reorder yzq and yzp arrays for parallel FFT according to FFT mapping.
Definition at line 1970 of file pw_grids.f90.
References pw_grid_types::HALFSPACE, pw_grid_types::PW_MODE_LOCAL, and timings::timeset().
Referenced by create_gvectors(), and pw_grid_setup_internal().
Here is the call graph for this function:
Here is the caller graph for this function:| subroutine,public pw_grids::pw_grid_retain | ( | TYPE(pw_grid_type),pointer | pw_grid, |
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
retains the given pw grid
| pw_grid | the pw grid to retain |
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 2104 of file pw_grids.f90.
References CPPreconditionNoFail.
| subroutine pw_grids::pw_grid_set_maps | ( | INTEGER,intent(in) | grid_span, |
| INTEGER,dimension(:, :),intent(in) | g_hat, | ||
| TYPE(map_pn),intent(inout) | mapl, | ||
| TYPE(map_pn),intent(inout) | mapm, | ||
| TYPE(map_pn),intent(inout) | mapn, | ||
| INTEGER,dimension(:),intent(in) | npts | ||
| ) | [private] |
Setup maps from 1d to 3d space.
Definition at line 1543 of file pw_grids.f90.
References pw_grid_types::HALFSPACE.
Referenced by pw_grid_assign().
Here is the caller graph for this function:| subroutine,public pw_grids::pw_grid_setup | ( | TYPE(cell_type),intent(in) | cell, |
| TYPE(pw_grid_type),pointer | pw_grid, | ||
| INTEGER,intent(in),optional | grid_span, | ||
| REAL(KIND=dp),intent(in),optional | cutoff, | ||
| INTEGER,dimension(2, 3),intent(in),optional | bounds, | ||
| INTEGER,dimension(3),intent(in),optional | npts, | ||
| LOGICAL,intent(in),optional | spherical, | ||
| LOGICAL,intent(in),optional | odd, | ||
| LOGICAL,intent(in),optional | fft_usage, | ||
| INTEGER,intent(in),optional | ncommensurate, | ||
| INTEGER,intent(in),optional | icommensurate, | ||
| INTEGER,intent(in),optional | blocked, | ||
| TYPE(pw_grid_type),intent(in),optional | ref_grid, | ||
| INTEGER,dimension(2),intent(in),optional | rs_dims, | ||
| INTEGER,intent(in),optional | iounit, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
sets up a pw_grid
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 279 of file pw_grids.f90.
References error, pw_grid_info::pw_find_cutoff(), pw_grid_setup_internal(), set_pw_grid_info(), termination::stop_program(), and timings::timeset().
Here is the call graph for this function:| subroutine pw_grids::pw_grid_setup_internal | ( | TYPE(cell_type),intent(in) | cell, |
| TYPE(pw_grid_type),pointer | pw_grid, | ||
| INTEGER,intent(in),optional | blocked, | ||
| TYPE(pw_grid_type),intent(in),optional | ref_grid, | ||
| INTEGER,dimension(2),intent(in),optional | rs_dims, | ||
| INTEGER,intent(in),optional | iounit, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) | [private] |
sets up a pw_grid, needs valid bounds as input, it is up to you to make sure of it using pw_grid_bounds_from_n
| error | variable to control error logging, stopping,... see module cp_error_handling |
Definition at line 409 of file pw_grids.f90.
References kinds::dp, message_passing::mp_comm_compare(), pw_grid_allocate(), pw_grid_assign(), pw_grid_count(), pw_grid_distribute(), pw_grid_print(), pw_grid_remap(), pw_grid_sort(), pw_grid_types::PW_MODE_DISTRIBUTED, and REAL().
Referenced by pw_grid_setup().
Here is the call graph for this function:
Here is the caller graph for this function:| subroutine pw_grids::pw_grid_sort | ( | TYPE(pw_grid_type),intent(inout) | pw_grid, |
| TYPE(pw_grid_type),intent(in),optional | ref_grid, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) | [private] |
Sort g-vectors according to length.
Definition at line 1683 of file pw_grids.f90.
References sort_shells(), termination::stop_program(), and timings::timeset().
Referenced by create_gvectors(), and pw_grid_setup_internal().
Here is the call graph for this function:
Here is the caller graph for this function:| subroutine pw_grids::redist | ( | INTEGER,dimension(:, :),intent(in) | g_hat, |
| INTEGER,dimension(:),intent(inout) | idx, | ||
| INTEGER,intent(in) | s1, | ||
| INTEGER,intent(in) | s2, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) | [private] |
Definition at line 1917 of file pw_grids.f90.
Referenced by sort_shells().
Here is the caller graph for this function:| subroutine,public pw_grids::set_pw_grid_info | ( | TYPE(pw_grid_type),pointer | pw_grid, |
| INTEGER,intent(in),optional | grid_span, | ||
| INTEGER,dimension(3),intent(in),optional | npts, | ||
| INTEGER,dimension(2, 3),intent(in),optional | bounds, | ||
| REAL(KIND=dp),intent(in),optional | cutoff, | ||
| LOGICAL,intent(in),optional | spherical, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) |
Set some information stored in the pw_grid_type.
Definition at line 223 of file pw_grids.f90.
References CPPostcondition, and error.
Referenced by pw_grid_setup().
Here is the caller graph for this function:| subroutine pw_grids::sort_shells | ( | REAL(KIND=dp),dimension(:),intent(in) | gsq, |
| INTEGER,dimension(:, :),intent(in) | g_hat, | ||
| INTEGER,dimension(:),intent(inout) | idx, | ||
| TYPE(cp_error_type),intent(inout) | error | ||
| ) | [private] |
Definition at line 1872 of file pw_grids.f90.
References redist(), and timings::timeset().
Referenced by pw_grid_sort().
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 66 of file pw_grids.f90.
Referenced by pw_grid_create().
| CHARACTER(len=*),parameter,private pw_grids::moduleN = 'pw_grids' |
Definition at line 67 of file pw_grids.f90.
1.7.3