ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
#include <p3m.impl.hpp>
Public Member Functions | |
~CoulombP3MImpl () override=default | |
CoulombP3MImpl (std::unique_ptr< p3m_data_struct_coulomb< FloatType > > &&p3m_handle, 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 (int 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 |
Public Member Functions inherited from CoulombP3M | |
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. | |
Public Member Functions inherited from Coulomb::Actor< CoulombP3M > | |
void | set_prefactor (double new_prefactor) |
void | sanity_checks_charge_neutrality () const |
Public Member Functions inherited from System::Leaf< Class > | |
void | bind_system (std::shared_ptr< System > const &system) |
void | detach_system (std::shared_ptr< System > const &system) |
Public Attributes | |
p3m_data_struct_coulomb< FloatType > & | p3m |
Coulomb P3M parameters. | |
Public Attributes inherited from CoulombP3M | |
P3MParameters const & | p3m_params |
Public Attributes inherited from Coulomb::Actor< CoulombP3M > | |
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 [22]. | |
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 |
Protected Member Functions inherited from CoulombP3M | |
void | sanity_checks_boxl () const |
Checks for correctness of the k-space cutoff. | |
void | sanity_checks_node_grid () const |
void | sanity_checks_periodicity () const |
void | sanity_checks_cell_structure () const |
Protected Member Functions inherited from System::Leaf< Class > | |
auto & | get_system () |
auto & | get_system () const |
Protected Attributes | |
std::shared_ptr< P3MGpuParams > | m_gpu_data = nullptr |
Protected Attributes inherited from System::Leaf< Class > | |
std::weak_ptr< System > | m_system |
Additional Inherited Members | |
Static Public Attributes inherited from Coulomb::Actor< CoulombP3M > | |
static auto constexpr | charge_neutrality_tolerance_default |
Definition at line 63 of file p3m.impl.hpp.
|
overridedefault |
|
inline |
Definition at line 79 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 114 of file p3m.impl.hpp.
References CoulombP3MImpl< FloatType, Architecture >::p3m, and P3M_EPSILON_METALLIC.
|
inlineoverridevirtual |
Implements CoulombP3M.
Definition at line 147 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 915 of file p3m.cpp.
References GPU, System::System::gpu, INTEG_METHOD_NPT_ISO, 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 [22].
(optimised for force calculations)
Each node calculates only the values for its domain in k-space.
See also: [22] eq. 8-22 (p. 275). Note the somewhat different convention for the prefactors, which is described in [10] [11].
Implements CoulombP3M.
|
overridevirtual |
Implements CoulombP3M.
Definition at line 322 of file p3m.cpp.
References ParticlePropertyRange::charge_range(), and ParticlePropertyRange::pos_range().
|
overridevirtual |
Implements CoulombP3M.
Definition at line 99 of file p3m.cpp.
References System::System::cell_structure, comm_cart, and Utils::sqr().
|
inlineoverridevirtual |
Implements CoulombP3M.
Definition at line 108 of file p3m.impl.hpp.
References CoulombP3MImpl< FloatType, Architecture >::p3m.
|
inlineoverridevirtual |
Implements CoulombP3M.
Definition at line 96 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 247 of file p3m.cpp.
References Utils::Vector< T, N >::broadcast().
Referenced by CoulombP3MImpl< FloatType, Architecture >::init(), and CoulombP3MImpl< FloatType, Architecture >::on_activation().
|
protected |
Definition at line 940 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 p3m_data_struct< FloatType >::params.
Referenced by CoulombP3MImpl< FloatType, Architecture >::init().
|
inlineoverridevirtualnoexcept |
Implements CoulombP3M.
Definition at line 122 of file p3m.impl.hpp.
|
inlineoverridevirtualnoexcept |
|
inlineoverridevirtualnoexcept |
Implements CoulombP3M.
Definition at line 118 of file p3m.impl.hpp.
Referenced by CoulombP3MImpl< FloatType, Architecture >::on_activation().
|
inlineoverridevirtual |
Implements CoulombP3M.
Definition at line 143 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 453 of file p3m.cpp.
References Utils::Vector< T, N >::broadcast(), calc_dipole_moment(), charge_assign(), ParticlePropertyRange::charge_range(), comm_cart, for_each_3d(), ParticlePropertyRange::force_range(), INTEG_METHOD_NPT_ISO, npt_add_virial_contribution(), P3M_EPSILON_METALLIC, Utils::product(), 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 [17]. 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 395 of file p3m.cpp.
References System::System::box_geo, Utils::Vector< T, N >::broadcast(), charge_assign(), for_each_3d(), and Utils::sqr().
|
inlineoverridevirtual |
Implements CoulombP3M.
Definition at line 126 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 163 of file p3m.impl.hpp.
References CoulombP3MImpl< FloatType, Architecture >::p3m.
|
protected |
Definition at line 953 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 902 of file p3m.cpp.
References P3MParameters::alpha, P3MParameters::alpha_L, System::System::box_geo, p3m_data_struct< FloatType >::local_mesh, p3m_data_struct< 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 804 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(), p3m_data_struct< FloatType >::params, P3MParameters::r_cut, P3MParameters::r_cut_iL, CoulombTuningAlgorithm< FloatType, Architecture >::setup_logger(), p3m_data_struct_coulomb< FloatType >::sum_qpart, TuningAlgorithm::tune(), and P3MParameters::tuning.
Referenced by CoulombP3MImpl< FloatType, Architecture >::on_activation().
|
protected |
Definition at line 183 of file p3m.impl.hpp.
p3m_data_struct_coulomb<FloatType>& CoulombP3MImpl< FloatType, Architecture >::p3m |
Coulomb P3M parameters.
Definition at line 67 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().