![]() |
ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
#include <p3m.impl.hpp>
Public Member Functions | |
~CoulombP3MImpl () override=default | |
CoulombP3MImpl (std::unique_ptr< CoulombP3MState< FloatType > > &&p3m_state, double prefactor, int tune_timings, bool tune_verbose, decltype(tune_limits) tune_limits, bool check_complex_residuals) | |
void | init () override |
void | tune () override |
void | count_charged_particles () override |
void | count_charged_particles_elc (std::size_t n, double sum_q2, double square_sum_q) override |
void | adapt_epsilon_elc () override |
bool | is_tuned () const noexcept override |
bool | is_gpu () const noexcept override |
bool | is_double_precision () const noexcept override |
void | on_activation () override |
double | long_range_energy (ParticleRange const &particles) override |
void | add_long_range_forces (ParticleRange const &particles) override |
Utils::Vector9d | long_range_pressure (ParticleRange const &particles) override |
void | charge_assign (ParticleRange const &particles) override |
void | assign_charge (double q, Utils::Vector3d const &real_pos, bool skip_cache) override |
void | prepare_fft_mesh (bool reset_weights) override |
![]() | |
CoulombP3M (P3MParameters const &p3m_params) | |
virtual | ~CoulombP3M ()=default |
void | on_boxl_change () |
Recalculate all box-length-dependent parameters. | |
void | on_node_grid_change () const |
void | on_periodicity_change () const |
void | on_cell_structure_change () |
void | sanity_checks () const |
Utils::Vector3d | pair_force (double q1q2, Utils::Vector3d const &d, double dist) const |
Calculate real-space contribution of p3m Coulomb pair forces. | |
double | pair_energy (double q1q2, double dist) const |
Calculate real-space contribution of Coulomb pair energy. | |
![]() | |
void | set_prefactor (double new_prefactor) |
void | sanity_checks_charge_neutrality () const |
![]() | |
void | bind_system (std::shared_ptr< System > const &system) |
void | detach_system (std::shared_ptr< System > const &system) |
Public Attributes | |
CoulombP3MState< FloatType > & | p3m |
Coulomb P3M parameters. | |
![]() | |
P3MParameters const & | p3m_params |
![]() | |
double | prefactor |
Electrostatics prefactor. | |
double | charge_neutrality_tolerance |
Relative tolerance for the charge excess during neutrality checks. | |
Protected Member Functions | |
double | long_range_kernel (bool force_flag, bool energy_flag, ParticleRange const &particles) |
Compute the k-space part of forces and energies. | |
void | calc_influence_function_force () override |
Calculate the optimal influence function of [23]. | |
void | calc_influence_function_energy () override |
Calculate the influence function optimized for the energy and the self energy correction. | |
void | scaleby_box_l () override |
void | init_cpu_kernels () |
void | init_gpu_kernels () |
void | add_long_range_forces_gpu (ParticleRange const &particles) |
void | request_gpu () const |
![]() | |
void | sanity_checks_boxl () const |
Checks for correctness of the k-space cutoff. | |
void | sanity_checks_periodicity () const |
void | sanity_checks_cell_structure () const |
![]() | |
auto & | get_system () |
auto & | get_system () const |
Protected Attributes | |
std::shared_ptr< P3MGpuParams > | m_gpu_data = nullptr |
![]() | |
std::weak_ptr< System > | m_system |
Additional Inherited Members | |
![]() | |
static auto constexpr | charge_neutrality_tolerance_default |
Definition at line 80 of file p3m.impl.hpp.
|
overridedefault |
|
inline |
Definition at line 104 of file p3m.impl.hpp.
References CoulombP3MImpl< FloatType, Architecture >::p3m, Coulomb::Actor< CoulombP3M >::prefactor, and Coulomb::Actor< CoulombP3M >::set_prefactor().
|
inlineoverridevirtual |
Implements CoulombP3M.
Definition at line 139 of file p3m.impl.hpp.
References CoulombP3MImpl< FloatType, Architecture >::p3m, and P3M_EPSILON_METALLIC.
|
inlineoverridevirtual |
Implements CoulombP3M.
Definition at line 172 of file p3m.impl.hpp.
References CoulombP3MImpl< FloatType, Architecture >::add_long_range_forces_gpu(), CPU, GPU, and CoulombP3MImpl< FloatType, Architecture >::long_range_kernel().
|
protected |
Definition at line 1017 of file p3m.cpp.
References GPU, System::System::gpu, INTEG_METHOD_NPT_ISO, System::System::npt_add_virial_contribution(), p3m_gpu_add_farfield_force(), System::System::propagation, and this_node.
Referenced by CoulombP3MImpl< FloatType, Architecture >::add_long_range_forces().
|
overridevirtual |
Implements CoulombP3M.
|
overrideprotectedvirtual |
Calculate the influence function optimized for the energy and the self energy correction.
Implements CoulombP3M.
|
overrideprotectedvirtual |
Calculate the optimal influence function of [23].
(optimised for force calculations)
Each node calculates only the values for its domain in k-space.
See also: [23] eq. 8-22 (p. 275). Note the somewhat different convention for the prefactors, which is described in [11] [12].
Implements CoulombP3M.
|
overridevirtual |
Implements CoulombP3M.
Definition at line 380 of file p3m.cpp.
References ParticlePropertyRange::charge_range(), and ParticlePropertyRange::pos_range().
|
overridevirtual |
Implements CoulombP3M.
Definition at line 144 of file p3m.cpp.
References System::System::cell_structure, comm_cart, and Utils::sqr().
|
inlineoverridevirtual |
Implements CoulombP3M.
Definition at line 133 of file p3m.impl.hpp.
References CoulombP3MImpl< FloatType, Architecture >::p3m.
|
inlineoverridevirtual |
Implements CoulombP3M.
Definition at line 121 of file p3m.impl.hpp.
References CPU, GPU, CoulombP3MImpl< FloatType, Architecture >::init_cpu_kernels(), and CoulombP3MImpl< FloatType, Architecture >::init_gpu_kernels().
|
protected |
Definition at line 293 of file p3m.cpp.
References Utils::Vector< T, N >::broadcast(), comm_cart, communicator, and get_size_from_shape().
Referenced by CoulombP3MImpl< FloatType, Architecture >::init(), and CoulombP3MImpl< FloatType, Architecture >::on_activation().
|
protected |
Definition at line 1041 of file p3m.cpp.
References P3MParameters::alpha, System::System::box_geo, P3MParameters::cao, System::System::coulomb, GPU, System::System::gpu, Coulomb::Solver::impl, P3MParameters::mesh, GpuParticleData::n_particles(), p3m_gpu_init(), and P3MStateCommon< FloatType >::params.
Referenced by CoulombP3MImpl< FloatType, Architecture >::init().
|
inlineoverridevirtualnoexcept |
Implements CoulombP3M.
Definition at line 147 of file p3m.impl.hpp.
|
inlineoverridevirtualnoexcept |
|
inlineoverridevirtualnoexcept |
Implements CoulombP3M.
Definition at line 143 of file p3m.impl.hpp.
Referenced by CoulombP3MImpl< FloatType, Architecture >::on_activation().
|
inlineoverridevirtual |
Implements CoulombP3M.
Definition at line 168 of file p3m.impl.hpp.
References CoulombP3MImpl< FloatType, Architecture >::long_range_kernel().
|
protected |
Compute the k-space part of forces and energies.
Definition at line 588 of file p3m.cpp.
References Utils::Vector< T, N >::broadcast(), calc_dipole_moment(), charge_assign(), ParticlePropertyRange::charge_range(), Utils::COLUMN_MAJOR, comm_cart, complex_norm2(), for_each_3d(), ParticlePropertyRange::force_range(), Utils::get_linear_index(), INTEG_METHOD_NPT_ISO, System::System::npt_add_virial_contribution(), P3M_EPSILON_METALLIC, Utils::sqr(), this_node, and ParticlePropertyRange::unfolded_pos_range().
Referenced by CoulombP3MImpl< FloatType, Architecture >::add_long_range_forces(), and CoulombP3MImpl< FloatType, Architecture >::long_range_energy().
|
overridevirtual |
Calculate the long range electrostatics part of the pressure tensor. This is part \Pi_{\textrm{dir}, \alpha, \beta} eq. (2.6) in [18]. The part \Pi_{\textrm{corr}, \alpha, \beta} eq. (2.8) is not present here since M is the empty set in our simulations.
Implements CoulombP3M.
Definition at line 535 of file p3m.cpp.
References System::System::box_geo, Utils::Vector< T, N >::broadcast(), charge_assign(), Utils::COLUMN_MAJOR, complex_norm2(), for_each_3d(), Utils::get_linear_index(), and Utils::sqr().
|
inlineoverridevirtual |
Implements CoulombP3M.
Definition at line 151 of file p3m.impl.hpp.
References GPU, CoulombP3MImpl< FloatType, Architecture >::init_cpu_kernels(), CoulombP3MImpl< FloatType, Architecture >::is_tuned(), CoulombP3MImpl< FloatType, Architecture >::request_gpu(), CoulombP3M::sanity_checks(), and CoulombP3MImpl< FloatType, Architecture >::tune().
|
inlineoverridevirtual |
Implements CoulombP3M.
Definition at line 188 of file p3m.impl.hpp.
References CoulombP3MImpl< FloatType, Architecture >::p3m, and Utils::product().
|
protected |
Definition at line 1054 of file p3m.cpp.
References GpuParticleData::enable_property(), GpuParticleData::prop::force, GPU, System::System::gpu, GpuParticleData::prop::pos, and GpuParticleData::prop::q.
Referenced by CoulombP3MImpl< FloatType, Architecture >::on_activation().
|
overrideprotectedvirtual |
Implements CoulombP3M.
Definition at line 1003 of file p3m.cpp.
References P3MParameters::alpha, P3MParameters::alpha_L, System::System::box_geo, comm_cart, CoulombP3MState< FloatType >::halo_comm, P3MStateCommon< FloatType >::local_mesh, P3MStateCommon< FloatType >::params, P3MParameters::r_cut, P3MParameters::r_cut_iL, P3MParameters::recalc_a_ai_cao_cut(), and P3MLocalMesh::recalc_ld_pos().
|
overridevirtual |
Implements CoulombP3M.
Definition at line 913 of file p3m.cpp.
References P3MParameters::alpha, P3MParameters::alpha_L, System::System::box_geo, TuningAlgorithm::determine_cao_limits(), CoulombTuningAlgorithm< FloatType, Architecture >::determine_mesh_limits(), TuningAlgorithm::determine_r_cut_limits(), System::System::on_coulomb_change(), P3MStateCommon< FloatType >::params, P3MParameters::r_cut, P3MParameters::r_cut_iL, CoulombTuningAlgorithm< FloatType, Architecture >::setup_logger(), CoulombP3MState< FloatType >::sum_qpart, TuningAlgorithm::tune(), and P3MParameters::tuning.
Referenced by CoulombP3MImpl< FloatType, Architecture >::on_activation().
|
protected |
Definition at line 207 of file p3m.impl.hpp.
CoulombP3MState<FloatType>& CoulombP3MImpl< FloatType, Architecture >::p3m |
Coulomb P3M parameters.
Definition at line 84 of file p3m.impl.hpp.
Referenced by CoulombP3MImpl< FloatType, Architecture >::adapt_epsilon_elc(), CoulombP3MImpl< FloatType, Architecture >::CoulombP3MImpl(), CoulombP3MImpl< FloatType, Architecture >::count_charged_particles_elc(), and CoulombP3MImpl< FloatType, Architecture >::prepare_fft_mesh().