Skip to content

mod_fft_potential

Lines: 823 | Visibility: private

This module calculates the potential of a smooth, periodic charge density using plane wave techniques. author: Moritz Gubler

Dependencies

Uses

module~~mod_fft_potential~~UsesGraph module~mod_fft_potential mod_fft_potential iso_c_binding iso_c_binding module~mod_fft_potential->iso_c_binding module~mod_constants mod_constants module~mod_fft_potential->module~mod_constants module~mod_fft mod_fft module~mod_fft_potential->module~mod_fft module~mod_linalg mod_linalg module~mod_fft_potential->module~mod_linalg module~mod_neighborlist_helper mod_neighborlist_helper module~mod_fft_potential->module~mod_neighborlist_helper module~mod_precision mod_precision module~mod_fft_potential->module~mod_precision module~mod_structures_helper mod_structures_helper module~mod_fft_potential->module~mod_structures_helper module~mod_throw mod_throw module~mod_fft_potential->module~mod_throw module~mod_constants->iso_c_binding module~mod_constants->module~mod_precision module~mod_fft->iso_c_binding fftw3 fftw3 module~mod_fft->fftw3 module~mod_linalg->module~mod_precision module~mod_linalg->module~mod_throw module~cublas_wrapper cublas_wrapper module~mod_linalg->module~cublas_wrapper module~mod_settings mod_settings module~mod_linalg->module~mod_settings module~mod_neighborlist_helper->module~mod_linalg module~mod_neighborlist_helper->module~mod_precision module~mod_mpi mod_mpi module~mod_neighborlist_helper->module~mod_mpi module~mod_precision->iso_c_binding iso_fortran_env iso_fortran_env module~mod_precision->iso_fortran_env module~mod_structures_helper->module~mod_linalg module~mod_structures_helper->module~mod_precision module~mod_throw->iso_c_binding module~mod_throw->module~mod_precision module~mod_throw->iso_fortran_env module~mod_io mod_io module~mod_throw->module~mod_io module~mod_throw->module~mod_mpi module~mod_sort mod_sort module~mod_throw->module~mod_sort module~cublas_wrapper->iso_c_binding module~cublas_wrapper->module~mod_settings module~mod_io->module~mod_precision module~mod_io->iso_fortran_env module~mod_optional_args mod_optional_args module~mod_io->module~mod_optional_args module~mod_mpi->module~mod_precision mpi_f08 mpi_f08 module~mod_mpi->mpi_f08 module~mod_settings->module~mod_constants module~mod_settings->module~mod_precision module~mod_settings->module~mod_throw module~mod_settings->module~mod_io module~mod_cpu_vendor mod_cpu_vendor module~mod_settings->module~mod_cpu_vendor module~mod_periodic_table mod_periodic_table module~mod_settings->module~mod_periodic_table module~mod_sort->module~mod_precision module~mod_cpu_vendor->iso_c_binding module~mod_periodic_table->module~mod_constants module~mod_periodic_table->module~mod_precision module~mod_periodic_table->module~mod_throw module~mod_periodic_table->module~mod_io module~mod_array_helpers mod_array_helpers module~mod_periodic_table->module~mod_array_helpers module~mod_array_helpers->module~mod_precision module~mod_array_helpers->module~mod_throw

Used By

module~~mod_fft_potential~~UsedByGraph module~mod_fft_potential mod_fft_potential module~mod_pw mod_pw module~mod_pw->module~mod_fft_potential module~mod_initialize mod_initialize module~mod_initialize->module~mod_pw module~mod_pppm mod_pppm module~mod_initialize->module~mod_pppm module~mod_pppm->module~mod_pw module~mod_predict_mode mod_predict_mode module~mod_predict_mode->module~mod_initialize module~mod_write_outfiles mod_write_outfiles module~mod_predict_mode->module~mod_write_outfiles module~mod_runner_interface_bindings mod_runner_interface_bindings module~mod_runner_interface_bindings->module~mod_initialize module~mod_train_energy_multiple_structures mod_train_energy_multiple_structures module~mod_train_energy_multiple_structures->module~mod_initialize module~mod_train_forces_multiple_structures mod_train_forces_multiple_structures module~mod_train_forces_multiple_structures->module~mod_initialize module~mod_train_forces_multiple_structures->module~mod_train_energy_multiple_structures module~mod_train_loop_4g_charges mod_train_loop_4g_charges module~mod_train_loop_4g_charges->module~mod_initialize module~mod_cost_calculator mod_cost_calculator module~mod_train_loop_4g_charges->module~mod_cost_calculator module~mod_output_files_and_cost_4g_charges mod_output_files_and_cost_4g_charges module~mod_train_loop_4g_charges->module~mod_output_files_and_cost_4g_charges module~mod_train_loop_atomic_property mod_train_loop_atomic_property module~mod_train_loop_atomic_property->module~mod_initialize module~mod_train_loop_atomic_property->module~mod_cost_calculator module~mod_output_files_and_cost mod_output_files_and_cost module~mod_train_loop_atomic_property->module~mod_output_files_and_cost module~mod_train_loop_short_range mod_train_loop_short_range module~mod_train_loop_short_range->module~mod_initialize module~mod_train_loop_short_range->module~mod_train_energy_multiple_structures module~mod_train_loop_short_range->module~mod_train_forces_multiple_structures module~mod_train_loop_short_range->module~mod_cost_calculator module~mod_train_loop_short_range->module~mod_output_files_and_cost module~mod_output_files_and_cost_4g_short_range mod_output_files_and_cost_4g_short_range module~mod_train_loop_short_range->module~mod_output_files_and_cost_4g_short_range module~mod_train_mode mod_train_mode module~mod_train_mode->module~mod_initialize module~mod_train_mode->module~mod_train_loop_4g_charges module~mod_train_mode->module~mod_train_loop_atomic_property module~mod_train_mode->module~mod_train_loop_short_range module~mod_write_outfiles_training mod_write_outfiles_training module~mod_train_mode->module~mod_write_outfiles_training module~mod_write_outfiles->module~mod_initialize program~runner RuNNer program~runner->module~mod_initialize program~runner->module~mod_predict_mode program~runner->module~mod_train_mode module~mod_lammps_interface mod_lammps_interface module~mod_lammps_interface->module~mod_runner_interface_bindings module~mod_write_outfiles_training->module~mod_write_outfiles module~mod_cost_calculator->module~mod_write_outfiles_training module~mod_output_files_and_cost->module~mod_cost_calculator module~mod_output_files_and_cost_4g_charges->module~mod_cost_calculator module~mod_output_files_and_cost_4g_short_range->module~mod_cost_calculator

Derived Types Summary

Name Description
PWPotCalculator This type calculates the potential of a smooth, periodic charge density using plane wave...

Procedures Summary

Name Type Description
pb Function Wrap index back into periodic cell Index to wrap around
to_voigt Function
from_voigt Function
from_voigt_1 Function
from_voigt_2 Function
is_initialized Function
initialize_pot_calculator Subroutine Initializes the potential calculator. Needs to be called after a change in lattice vectors....
calc_potential Subroutine brief bring charge density to grid and calculate the electrostatic potential
calc_potential_and_get_energy_and_forces Subroutine Calculate the potential and store energy, forces and de_dqi and store them in the strucure object.
calc_pw_energy Subroutine Integrates over to cell to calculate the energy after the potential has been calculated
calc_pw_forces Subroutine Get energy, forces and de_dqi and store them in the strucure object. Potential must have been...
calc_pw_stress Subroutine Calculate the stress of the charge density. Potential must already have been calculated....
transform_rho_strain Subroutine transforms strain derivatives of charge density to fourier space.
close_wrapper Subroutine
close Subroutine Close object. Needs to be called before pw_solver can be reinitialized.
calculate_grid_points Subroutine Calculates the number of gridpoints needed to sample every direction
rho_to_grid_grid Subroutine Adds the charge density of a single atom to real space grid. set calc_stress to true when the...
rho_to_grid Subroutine Adds the charge density of a single atom to real space grid. set calc_stress to true when the...
get_nearest_point Subroutine Get the indices of the neares grid point to the given position.
calc_reciprocal_weights Subroutine Store the weights of the propagator in fourier space grid to to speed up next calculation.
pw_self Subroutine Calculate self energy of plane wave potential with gaussian charges.
initialize_check Subroutine Checks if the solver is initialized and stops if the solver is not in the state provided in the argument

Derived Types Details

type PWPotCalculator

This type calculates the potential of a smooth, periodic charge density using plane wave techniques. The type stores fft plans and other quantities that can be reused when the cell vectors do not change between evaluations.

Components

  • nat : integer
  • nx : integer(c_int)
  • ny : integer(c_int)
  • nz : integer(c_int)
  • fft_divisor : integer
  • grid_point_per_gauss_std : real(DP)
  • precision_cut_charge : real(DP)– Number of grid points per gaussian standard deviation in charge density. Used to calculate number of grid points.
  • ompsize : integer– Atomic charge densities are cut off after charge density is smaller than this parameter.
  • rho : real(c_double)
  • potential : real(c_double)
  • d_rho_d_strain1 : real(c_double)
  • d_rho_d_strain2 : real(c_double)
  • d_rho_d_strain3 : real(c_double)
  • d_rho_d_strain4 : real(c_double)
  • d_rho_d_strain5 : real(c_double)
  • d_rho_d_strain6 : real(c_double)
  • prho : type(c_ptr)
  • prhofft : type(c_ptr)
  • ppot : type(c_ptr)
  • ps1 : type(c_ptr)
  • ps2 : type(c_ptr)
  • ps3 : type(c_ptr)
  • ps4 : type(c_ptr)
  • ps5 : type(c_ptr)
  • ps6 : type(c_ptr)
  • ppotfft : type(c_ptr)
  • psf1 : type(c_ptr)
  • psf2 : type(c_ptr)
  • psf3 : type(c_ptr)
  • psf4 : type(c_ptr)
  • psf5 : type(c_ptr)
  • psf6 : type(c_ptr)
  • pweight : type(c_ptr)
  • rho_fft : complex(C_DOUBLE_COMPLEX)
  • pot_fft : complex(C_DOUBLE_COMPLEX)
  • d_rho_d_strain_fft1 : complex(C_DOUBLE_COMPLEX)
  • d_rho_d_strain_fft2 : complex(C_DOUBLE_COMPLEX)
  • d_rho_d_strain_fft3 : complex(C_DOUBLE_COMPLEX)
  • d_rho_d_strain_fft4 : complex(C_DOUBLE_COMPLEX)
  • d_rho_d_strain_fft5 : complex(C_DOUBLE_COMPLEX)
  • d_rho_d_strain_fft6 : complex(C_DOUBLE_COMPLEX)
  • reciprocal_weight : real(DP)
  • initialized : logical
  • epot : real(DP)

Type-Bound Procedures

Name Attributes Binding
initialize public ⇒ initialize_pot_calculator
calc_reciprocal_weights private ⇒ calc_reciprocal_weights
calc_potential public ⇒ calc_potential
rho_to_grid private ⇒ rho_to_grid
rho_to_grid_grid private ⇒ rho_to_grid_grid
calculate_grid_points private ⇒ calculate_grid_points
get_nearest_point private ⇒ get_nearest_point
close public ⇒ close
calc_potential_and_get_energy_and_forces public ⇒ calc_potential_and_get_energy_and_forces
calc_forces public ⇒ calc_pw_forces
calc_pw_stress public ⇒ calc_pw_stress
transform_rho_strain public ⇒ transform_rho_strain
calc_pw_energy public ⇒ calc_pw_energy
initialize_check public ⇒ initialize_check
is_initialized public ⇒ is_initialized

Inherits

type~~pwpotcalculator~~InheritsGraph type~pwpotcalculator PWPotCalculator c_ptr c_ptr type~pwpotcalculator->c_ptr prho, prhofft, ppot, ps1, ps2, ps3, ps4, ps5, ps6, ppotfft, psf1, psf2, psf3, psf4, psf5, psf6, pweight

Inherited By

type~~pwpotcalculator~~InheritedByGraph type~pwpotcalculator PWPotCalculator type~pwcalculator PwCalculator type~pwcalculator->type~pwpotcalculator pwpot_calc, lagrange_calculator type~pppmcalculator PppmCalculator type~pppmcalculator->type~pwcalculator pw_calc

Procedure Details

function pb

function pb( &
    i, &
    max_ind &
)

Wrap index back into periodic cell Index to wrap around

Arguments

  • i : integer [in]
  • max_ind : integer [in]– Input index

Called By

proc~~pb~~CalledByGraph proc~pb mod_fft_potential::pb proc~calc_pw_forces mod_fft_potential::PWPotCalculator%calc_pw_forces proc~calc_pw_forces->proc~pb proc~rho_to_grid mod_fft_potential::PWPotCalculator%rho_to_grid proc~rho_to_grid->proc~pb proc~calc_lambda_q_derivatives mod_pw::PwCalculator%calc_lambda_q_derivatives proc~calc_lambda_q_derivatives->proc~calc_pw_forces proc~calc_potential mod_fft_potential::PWPotCalculator%calc_potential proc~calc_lambda_q_derivatives->proc~calc_potential proc~calc_potential_and_get_energy_and_forces mod_fft_potential::PWPotCalculator%calc_potential_and_get_energy_and_forces proc~calc_potential_and_get_energy_and_forces->proc~calc_pw_forces proc~calc_potential_and_get_energy_and_forces->proc~calc_potential proc~evaluate_pw_electrostatics_calculator mod_pw::PwCalculator%evaluate_pw_electrostatics_calculator proc~evaluate_pw_electrostatics_calculator->proc~calc_pw_forces proc~evaluate_pw_electrostatics_calculator->proc~calc_lambda_q_derivatives proc~evaluate_pw_electrostatics_calculator->proc~calc_potential proc~rho_to_grid_grid mod_fft_potential::PWPotCalculator%rho_to_grid_grid proc~rho_to_grid_grid->proc~rho_to_grid proc~calc_potential->proc~rho_to_grid_grid

function to_voigt

function to_voigt( &
    i, &
    j &
)

Arguments

  • i : integer [in]
  • j : integer [in]

function from_voigt

function from_voigt( &
    voigt_index &
)

Arguments

  • voigt_index : integer [in]

Called By

proc~~from_voigt~~CalledByGraph proc~from_voigt mod_fft_potential::from_voigt proc~from_voigt_1 mod_fft_potential::from_voigt_1 proc~from_voigt_1->proc~from_voigt proc~from_voigt_2 mod_fft_potential::from_voigt_2 proc~from_voigt_2->proc~from_voigt proc~calc_pw_stress mod_fft_potential::PWPotCalculator%calc_pw_stress proc~calc_pw_stress->proc~from_voigt_1 proc~calc_pw_stress->proc~from_voigt_2 proc~calc_potential_and_get_energy_and_forces mod_fft_potential::PWPotCalculator%calc_potential_and_get_energy_and_forces proc~calc_potential_and_get_energy_and_forces->proc~calc_pw_stress proc~evaluate_pw_electrostatics_calculator mod_pw::PwCalculator%evaluate_pw_electrostatics_calculator proc~evaluate_pw_electrostatics_calculator->proc~calc_pw_stress

function from_voigt_1

function from_voigt_1( &
    voigt_index &
)

Arguments

  • voigt_index : integer [in]

Called By

proc~~from_voigt_1~~CalledByGraph proc~from_voigt_1 mod_fft_potential::from_voigt_1 proc~calc_pw_stress mod_fft_potential::PWPotCalculator%calc_pw_stress proc~calc_pw_stress->proc~from_voigt_1 proc~calc_potential_and_get_energy_and_forces mod_fft_potential::PWPotCalculator%calc_potential_and_get_energy_and_forces proc~calc_potential_and_get_energy_and_forces->proc~calc_pw_stress proc~evaluate_pw_electrostatics_calculator mod_pw::PwCalculator%evaluate_pw_electrostatics_calculator proc~evaluate_pw_electrostatics_calculator->proc~calc_pw_stress

function from_voigt_2

function from_voigt_2( &
    voigt_index &
)

Arguments

  • voigt_index : integer [in]

Called By

proc~~from_voigt_2~~CalledByGraph proc~from_voigt_2 mod_fft_potential::from_voigt_2 proc~calc_pw_stress mod_fft_potential::PWPotCalculator%calc_pw_stress proc~calc_pw_stress->proc~from_voigt_2 proc~calc_potential_and_get_energy_and_forces mod_fft_potential::PWPotCalculator%calc_potential_and_get_energy_and_forces proc~calc_potential_and_get_energy_and_forces->proc~calc_pw_stress proc~evaluate_pw_electrostatics_calculator mod_pw::PwCalculator%evaluate_pw_electrostatics_calculator proc~evaluate_pw_electrostatics_calculator->proc~calc_pw_stress

function is_initialized

function is_initialized( &
    self &
)

Arguments

Called By

proc~~is_initialized~~CalledByGraph proc~is_initialized mod_fft_potential::PWPotCalculator%is_initialized proc~calc_lambda_q_derivatives mod_pw::PwCalculator%calc_lambda_q_derivatives proc~calc_lambda_q_derivatives->proc~is_initialized proc~evaluate_pw_electrostatics_calculator mod_pw::PwCalculator%evaluate_pw_electrostatics_calculator proc~evaluate_pw_electrostatics_calculator->proc~calc_lambda_q_derivatives

subroutine initialize_pot_calculator

subroutine initialize_pot_calculator( &
    self, &
    lattice, &
    nat, &
    sigma, &
    fft_divisor, &
    grid_point_per_gauss_std, &
    precision_cut_charge &
)

Initializes the potential calculator. Needs to be called after a change in lattice vectors. author: Moritz Gubler

Arguments

  • self : class(PWPotCalculator)
  • lattice : real(DP) (dim: (3,3)) [in]
  • nat : integer
  • sigma : real(DP) (dim: (nat)) [in]– Standard deviation of gaussian charge which lies on top of every atom.
  • fft_divisor : integer [in]– Number of grid points along each direction must be divisible by this number
  • grid_point_per_gauss_std : real(DP) [in]– Number of grid points per gaussian standard deviation in charge density. Used to calculate number of grid points.
  • precision_cut_charge : real(DP) [in]– Atomic charge densities are cut off after charge density is smaller than this parameter.

Called By

proc~~initialize_pot_calculator~~CalledByGraph proc~initialize_pot_calculator mod_fft_potential::PWPotCalculator%initialize_pot_calculator proc~calc_lambda_q_derivatives mod_pw::PwCalculator%calc_lambda_q_derivatives proc~calc_lambda_q_derivatives->proc~initialize_pot_calculator proc~initialize_pw_electrostatics_calculator mod_pw::PwCalculator%initialize_pw_electrostatics_calculator proc~initialize_pw_electrostatics_calculator->proc~initialize_pot_calculator proc~evaluate_pw_electrostatics_calculator mod_pw::PwCalculator%evaluate_pw_electrostatics_calculator proc~evaluate_pw_electrostatics_calculator->proc~calc_lambda_q_derivatives proc~initialize_pppm mod_pppm::PppmCalculator%initialize_pppm proc~initialize_pppm->proc~initialize_pw_electrostatics_calculator

subroutine calc_potential

subroutine calc_potential( &
    self, &
    pos, &
    lat, &
    charges, &
    sigma, &
    calc_stress &
)

brief bring charge density to grid and calculate the electrostatic potential

Arguments

  • self : class(PWPotCalculator)
  • pos : real(DP) (dim: (3,self%nat)) [in]
  • lat : real(DP) (dim: (3,3)) [in]
  • charges : real(DP) (dim: (self%nat)) [in]
  • sigma : real(DP) (dim: (self%nat)) [in]
  • calc_stress : logical [in]– Standard deviation of gaussian charge which lies on top of every atom.

Called By

proc~~calc_potential~~CalledByGraph proc~calc_potential mod_fft_potential::PWPotCalculator%calc_potential proc~calc_lambda_q_derivatives mod_pw::PwCalculator%calc_lambda_q_derivatives proc~calc_lambda_q_derivatives->proc~calc_potential proc~calc_potential_and_get_energy_and_forces mod_fft_potential::PWPotCalculator%calc_potential_and_get_energy_and_forces proc~calc_potential_and_get_energy_and_forces->proc~calc_potential proc~evaluate_pw_electrostatics_calculator mod_pw::PwCalculator%evaluate_pw_electrostatics_calculator proc~evaluate_pw_electrostatics_calculator->proc~calc_potential proc~evaluate_pw_electrostatics_calculator->proc~calc_lambda_q_derivatives

subroutine calc_potential_and_get_energy_and_forces

subroutine calc_potential_and_get_energy_and_forces( &
    self, &
    pos, &
    lat, &
    energy, &
    forces, &
    stress, &
    de_dq, &
    charges, &
    sigma, &
    calc_stress &
)

Calculate the potential and store energy, forces and de_dqi and store them in the strucure object.

Arguments

  • self : class(PWPotCalculator)
  • pos : real(DP) (dim: (3,self%nat)) [in]
  • lat : real(DP) (dim: (3,3)) [in]
  • energy : real(DP) [out]
  • forces : real(DP) (dim: (3,self%nat)) [out]
  • stress : real(DP) (dim: (3,3)) [out]
  • de_dq : real(DP) (dim: (self%nat)) [out]
  • charges : real(DP) (dim: (self%nat)) [in]
  • sigma : real(DP) (dim: (self%nat)) [in]
  • calc_stress : logical [in]– Standard deviation of gaussian charge which lies on top of every atom.

subroutine calc_pw_energy

subroutine calc_pw_energy( &
    self, &
    lattice, &
    energy &
)

Integrates over to cell to calculate the energy after the potential has been calculated

Arguments

  • self : class(PWPotCalculator)
  • lattice : real(DP) (dim: (3,3)) [in]
  • energy : real(DP) [out]

Called By

proc~~calc_pw_energy~~CalledByGraph proc~calc_pw_energy mod_fft_potential::PWPotCalculator%calc_pw_energy proc~evaluate_pw_electrostatics_calculator mod_pw::PwCalculator%evaluate_pw_electrostatics_calculator proc~evaluate_pw_electrostatics_calculator->proc~calc_pw_energy

subroutine calc_pw_forces

subroutine calc_pw_forces( &
    self, &
    pos, &
    lattice, &
    charges, &
    sigma, &
    energy, &
    forces, &
    de_dq, &
    unscaled_forces &
)

Get energy, forces and de_dqi and store them in the strucure object. Potential must have been calculated prior to this call

Arguments

  • self : class(PWPotCalculator)
  • pos : real(DP) (dim: (3,self%nat)) [in]
  • lattice : real(DP) (dim: (3,3)) [in]
  • charges : real(DP) (dim: (self%nat)) [in]
  • sigma : real(DP) (dim: (self%nat)) [in]
  • energy : real(DP) [out]
  • forces : real(DP) (dim: (3,self%nat)) [out]
  • de_dq : real(DP) (dim: (self%nat)) [out]
  • unscaled_forces : real(DP) (dim: (3,self%nat)) [out]

Called By

proc~~calc_pw_forces~~CalledByGraph proc~calc_pw_forces mod_fft_potential::PWPotCalculator%calc_pw_forces proc~calc_lambda_q_derivatives mod_pw::PwCalculator%calc_lambda_q_derivatives proc~calc_lambda_q_derivatives->proc~calc_pw_forces proc~calc_potential_and_get_energy_and_forces mod_fft_potential::PWPotCalculator%calc_potential_and_get_energy_and_forces proc~calc_potential_and_get_energy_and_forces->proc~calc_pw_forces proc~evaluate_pw_electrostatics_calculator mod_pw::PwCalculator%evaluate_pw_electrostatics_calculator proc~evaluate_pw_electrostatics_calculator->proc~calc_pw_forces proc~evaluate_pw_electrostatics_calculator->proc~calc_lambda_q_derivatives

subroutine calc_pw_stress

subroutine calc_pw_stress( &
    self, &
    lattice, &
    tot_stress &
)

Calculate the stress of the charge density. Potential must already have been calculated. calc_stress must have been set to true when the charge density was calculated

Arguments

  • self : class(PWPotCalculator)
  • lattice : real(dp) (dim: (3,3)) [in]
  • tot_stress : real(dp) (dim: (3,3))

Called By

proc~~calc_pw_stress~~CalledByGraph proc~calc_pw_stress mod_fft_potential::PWPotCalculator%calc_pw_stress proc~calc_potential_and_get_energy_and_forces mod_fft_potential::PWPotCalculator%calc_potential_and_get_energy_and_forces proc~calc_potential_and_get_energy_and_forces->proc~calc_pw_stress proc~evaluate_pw_electrostatics_calculator mod_pw::PwCalculator%evaluate_pw_electrostatics_calculator proc~evaluate_pw_electrostatics_calculator->proc~calc_pw_stress

subroutine transform_rho_strain

subroutine transform_rho_strain( &
    self &
)

transforms strain derivatives of charge density to fourier space.

Arguments

Called By

proc~~transform_rho_strain~~CalledByGraph proc~transform_rho_strain mod_fft_potential::PWPotCalculator%transform_rho_strain proc~calc_lambda_q_derivatives mod_pw::PwCalculator%calc_lambda_q_derivatives proc~calc_lambda_q_derivatives->proc~transform_rho_strain proc~calc_pw_stress mod_fft_potential::PWPotCalculator%calc_pw_stress proc~calc_pw_stress->proc~transform_rho_strain proc~calc_potential_and_get_energy_and_forces mod_fft_potential::PWPotCalculator%calc_potential_and_get_energy_and_forces proc~calc_potential_and_get_energy_and_forces->proc~calc_pw_stress proc~evaluate_pw_electrostatics_calculator mod_pw::PwCalculator%evaluate_pw_electrostatics_calculator proc~evaluate_pw_electrostatics_calculator->proc~calc_lambda_q_derivatives proc~evaluate_pw_electrostatics_calculator->proc~calc_pw_stress

subroutine close_wrapper

subroutine close_wrapper( &
    self &
)

Arguments


subroutine close

subroutine close( &
    self &
)

Close object. Needs to be called before pw_solver can be reinitialized.

Arguments


subroutine calculate_grid_points

subroutine calculate_grid_points( &
    self, &
    sigma, &
    nx, &
    ny, &
    nz, &
    lattice &
)

Calculates the number of gridpoints needed to sample every direction

Arguments

  • self : class(PWPotCalculator)
  • sigma : real(DP) (dim: (self%nat)) [in]
  • nx : integer [out]– Standard deviation of gaussian charge which lies on top of every atom.
  • ny : integer [out]– Number of points along first lattice vetor.
  • nz : integer [out]– Number of points along second lattice vetor.
  • lattice : real(DP) (dim: (3,3)) [in]– Number of points along third lattice vetor.

Called By

proc~~calculate_grid_points~~CalledByGraph proc~calculate_grid_points mod_fft_potential::PWPotCalculator%calculate_grid_points proc~initialize_pot_calculator mod_fft_potential::PWPotCalculator%initialize_pot_calculator proc~initialize_pot_calculator->proc~calculate_grid_points proc~calc_lambda_q_derivatives mod_pw::PwCalculator%calc_lambda_q_derivatives proc~calc_lambda_q_derivatives->proc~initialize_pot_calculator proc~initialize_pw_electrostatics_calculator mod_pw::PwCalculator%initialize_pw_electrostatics_calculator proc~initialize_pw_electrostatics_calculator->proc~initialize_pot_calculator proc~evaluate_pw_electrostatics_calculator mod_pw::PwCalculator%evaluate_pw_electrostatics_calculator proc~evaluate_pw_electrostatics_calculator->proc~calc_lambda_q_derivatives proc~initialize_pppm mod_pppm::PppmCalculator%initialize_pppm proc~initialize_pppm->proc~initialize_pw_electrostatics_calculator

subroutine rho_to_grid_grid

subroutine rho_to_grid_grid( &
    self, &
    pos, &
    lat, &
    charges, &
    sigma, &
    calc_stress &
)

Adds the charge density of a single atom to real space grid. set calc_stress to true when the stress needs to be evaluated after the poisson is solved

Arguments

  • self : class(PWPotCalculator)
  • pos : real(DP) (dim: (3,self%nat)) [in]
  • lat : real(DP) (dim: (3,3)) [in]
  • charges : real(DP) (dim: (self%nat)) [in]
  • sigma : real(DP) (dim: (self%nat)) [in]
  • calc_stress : logical [in]– Standard deviation of gaussian charge which lies on top

Called By

proc~~rho_to_grid_grid~~CalledByGraph proc~rho_to_grid_grid mod_fft_potential::PWPotCalculator%rho_to_grid_grid proc~calc_potential mod_fft_potential::PWPotCalculator%calc_potential proc~calc_potential->proc~rho_to_grid_grid proc~calc_lambda_q_derivatives mod_pw::PwCalculator%calc_lambda_q_derivatives proc~calc_lambda_q_derivatives->proc~calc_potential proc~calc_potential_and_get_energy_and_forces mod_fft_potential::PWPotCalculator%calc_potential_and_get_energy_and_forces proc~calc_potential_and_get_energy_and_forces->proc~calc_potential proc~evaluate_pw_electrostatics_calculator mod_pw::PwCalculator%evaluate_pw_electrostatics_calculator proc~evaluate_pw_electrostatics_calculator->proc~calc_potential proc~evaluate_pw_electrostatics_calculator->proc~calc_lambda_q_derivatives

subroutine rho_to_grid

subroutine rho_to_grid( &
    self, &
    pos, &
    lat, &
    charges, &
    sigma, &
    calc_stress &
)

Adds the charge density of a single atom to real space grid. set calc_stress to true when the stress needs to be evaluated after the poisson is solved

Arguments

  • self : class(PWPotCalculator)
  • pos : real(DP) (dim: (3,self%nat)) [in]
  • lat : real(DP) (dim: (3,3)) [in]
  • charges : real(DP) (dim: (self%nat)) [in]
  • sigma : real(DP) (dim: (self%nat)) [in]
  • calc_stress : logical [in]– Standard deviation of gaussian charge which lies on top

Called By

proc~~rho_to_grid~~CalledByGraph proc~rho_to_grid mod_fft_potential::PWPotCalculator%rho_to_grid proc~rho_to_grid_grid mod_fft_potential::PWPotCalculator%rho_to_grid_grid proc~rho_to_grid_grid->proc~rho_to_grid proc~calc_potential mod_fft_potential::PWPotCalculator%calc_potential proc~calc_potential->proc~rho_to_grid_grid proc~calc_lambda_q_derivatives mod_pw::PwCalculator%calc_lambda_q_derivatives proc~calc_lambda_q_derivatives->proc~calc_potential proc~calc_potential_and_get_energy_and_forces mod_fft_potential::PWPotCalculator%calc_potential_and_get_energy_and_forces proc~calc_potential_and_get_energy_and_forces->proc~calc_potential proc~evaluate_pw_electrostatics_calculator mod_pw::PwCalculator%evaluate_pw_electrostatics_calculator proc~evaluate_pw_electrostatics_calculator->proc~calc_potential proc~evaluate_pw_electrostatics_calculator->proc~calc_lambda_q_derivatives

subroutine get_nearest_point

subroutine get_nearest_point( &
    self, &
    pos, &
    inv_lat, &
    i, &
    j, &
    k &
)

Get the indices of the neares grid point to the given position.

Arguments

  • self : class(PWPotCalculator)
  • pos : real(DP) (dim: (3)) [in]
  • inv_lat : real(DP) (dim: (3,3)) [in]– Input positions
  • i : integer [out]– Inverse of lattice vectors. Stored consistent to structure object.
  • j : integer [out]– Index of nearest grid point along first direction
  • k : integer [out]– Index of nearest grid point along second direction

Called By

proc~~get_nearest_point~~CalledByGraph proc~get_nearest_point mod_fft_potential::PWPotCalculator%get_nearest_point proc~calc_pw_forces mod_fft_potential::PWPotCalculator%calc_pw_forces proc~calc_pw_forces->proc~get_nearest_point proc~rho_to_grid mod_fft_potential::PWPotCalculator%rho_to_grid proc~rho_to_grid->proc~get_nearest_point proc~rho_to_grid_grid mod_fft_potential::PWPotCalculator%rho_to_grid_grid proc~rho_to_grid_grid->proc~get_nearest_point proc~rho_to_grid_grid->proc~rho_to_grid proc~calc_lambda_q_derivatives mod_pw::PwCalculator%calc_lambda_q_derivatives proc~calc_lambda_q_derivatives->proc~calc_pw_forces proc~calc_potential mod_fft_potential::PWPotCalculator%calc_potential proc~calc_lambda_q_derivatives->proc~calc_potential proc~calc_potential->proc~rho_to_grid_grid proc~calc_potential_and_get_energy_and_forces mod_fft_potential::PWPotCalculator%calc_potential_and_get_energy_and_forces proc~calc_potential_and_get_energy_and_forces->proc~calc_pw_forces proc~calc_potential_and_get_energy_and_forces->proc~calc_potential proc~evaluate_pw_electrostatics_calculator mod_pw::PwCalculator%evaluate_pw_electrostatics_calculator proc~evaluate_pw_electrostatics_calculator->proc~calc_pw_forces proc~evaluate_pw_electrostatics_calculator->proc~calc_lambda_q_derivatives proc~evaluate_pw_electrostatics_calculator->proc~calc_potential

subroutine calc_reciprocal_weights

subroutine calc_reciprocal_weights( &
    self, &
    rec_lat &
)

Store the weights of the propagator in fourier space grid to to speed up next calculation.

Arguments

Called By

proc~~calc_reciprocal_weights~~CalledByGraph proc~calc_reciprocal_weights mod_fft_potential::PWPotCalculator%calc_reciprocal_weights proc~calc_potential mod_fft_potential::PWPotCalculator%calc_potential proc~calc_potential->proc~calc_reciprocal_weights proc~calc_lambda_q_derivatives mod_pw::PwCalculator%calc_lambda_q_derivatives proc~calc_lambda_q_derivatives->proc~calc_potential proc~calc_potential_and_get_energy_and_forces mod_fft_potential::PWPotCalculator%calc_potential_and_get_energy_and_forces proc~calc_potential_and_get_energy_and_forces->proc~calc_potential proc~evaluate_pw_electrostatics_calculator mod_pw::PwCalculator%evaluate_pw_electrostatics_calculator proc~evaluate_pw_electrostatics_calculator->proc~calc_potential proc~evaluate_pw_electrostatics_calculator->proc~calc_lambda_q_derivatives

subroutine pw_self

subroutine pw_self( &
    nat, &
    charges, &
    sigma, &
    energy &
)

Calculate self energy of plane wave potential with gaussian charges.

Arguments

  • nat : integer [in]
  • charges : real(DP) (dim: (nat)) [in]
  • sigma : real(DP) (dim: (nat)) [in]
  • energy : real(DP) [out]

subroutine initialize_check

subroutine initialize_check( &
    self, &
    should_be_initialized &
)

Checks if the solver is initialized and stops if the solver is not in the state provided in the argument

Arguments

Called By

proc~~initialize_check~~CalledByGraph proc~initialize_check mod_fft_potential::PWPotCalculator%initialize_check proc~calc_potential mod_fft_potential::PWPotCalculator%calc_potential proc~calc_potential->proc~initialize_check proc~calc_potential_and_get_energy_and_forces mod_fft_potential::PWPotCalculator%calc_potential_and_get_energy_and_forces proc~calc_potential_and_get_energy_and_forces->proc~initialize_check proc~calc_potential_and_get_energy_and_forces->proc~calc_potential proc~calc_pw_forces mod_fft_potential::PWPotCalculator%calc_pw_forces proc~calc_potential_and_get_energy_and_forces->proc~calc_pw_forces proc~calc_pw_stress mod_fft_potential::PWPotCalculator%calc_pw_stress proc~calc_potential_and_get_energy_and_forces->proc~calc_pw_stress proc~calc_pw_energy mod_fft_potential::PWPotCalculator%calc_pw_energy proc~calc_pw_energy->proc~initialize_check proc~calc_pw_forces->proc~initialize_check proc~calc_pw_stress->proc~initialize_check proc~initialize_pot_calculator mod_fft_potential::PWPotCalculator%initialize_pot_calculator proc~initialize_pot_calculator->proc~initialize_check proc~calc_lambda_q_derivatives mod_pw::PwCalculator%calc_lambda_q_derivatives proc~calc_lambda_q_derivatives->proc~calc_potential proc~calc_lambda_q_derivatives->proc~calc_pw_forces proc~calc_lambda_q_derivatives->proc~initialize_pot_calculator proc~evaluate_pw_electrostatics_calculator mod_pw::PwCalculator%evaluate_pw_electrostatics_calculator proc~evaluate_pw_electrostatics_calculator->proc~calc_potential proc~evaluate_pw_electrostatics_calculator->proc~calc_pw_energy proc~evaluate_pw_electrostatics_calculator->proc~calc_pw_forces proc~evaluate_pw_electrostatics_calculator->proc~calc_pw_stress proc~evaluate_pw_electrostatics_calculator->proc~calc_lambda_q_derivatives proc~initialize_pw_electrostatics_calculator mod_pw::PwCalculator%initialize_pw_electrostatics_calculator proc~initialize_pw_electrostatics_calculator->proc~initialize_pot_calculator proc~initialize_pppm mod_pppm::PppmCalculator%initialize_pppm proc~initialize_pppm->proc~initialize_pw_electrostatics_calculator