![]() |
ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
#include <p3m.impl.hpp>
Public Types | |
| using | CoulombP3MStateClass |
Public Member Functions | |
| ~CoulombP3MImpl () override=default | |
| CoulombP3MImpl (std::unique_ptr< CoulombP3MStateClass > &&p3m_state, TuningParameters tuning_params, double prefactor) | |
| 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 () override |
| void | add_long_range_forces () override |
| Utils::Vector9d | long_range_pressure () override |
| void | charge_assign () override |
| void | assign_charge (double q, Utils::Vector3d const &real_pos, bool skip_cache) override |
| void | prepare_fft_mesh (bool reset_weights, bool zero_rs) 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< Actor< CoulombP3M > > | |
| void | bind_system (std::shared_ptr< System > const &system) |
| void | detach_system (std::shared_ptr< System > const &system) |
Public Attributes | |
| CoulombP3MStateClass & | 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) |
| Compute the k-space part of forces and energies. | |
| void | calc_influence_function_force () override |
| Calculate the optimal influence function of [24]. | |
| 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 () |
| 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_periodicity () const |
| void | sanity_checks_cell_structure () const |
| Protected Member Functions inherited from System::Leaf< Actor< CoulombP3M > > | |
| auto & | get_system () |
Protected Attributes | |
| std::shared_ptr< P3MGpuParams > | m_gpu_data = nullptr |
| Protected Attributes inherited from System::Leaf< Actor< CoulombP3M > > | |
| 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 113 of file p3m.impl.hpp.
| using CoulombP3MImpl< FloatType, Architecture, FFTConfig >::CoulombP3MStateClass |
Definition at line 116 of file p3m.impl.hpp.
|
overridedefault |
|
inline |
Definition at line 137 of file p3m.impl.hpp.
References CoulombP3M::CoulombP3M(), kokkos_handle, p3m, Coulomb::Actor< CoulombP3M >::prefactor, and Coulomb::Actor< CoulombP3M >::set_prefactor().
|
inlineoverridevirtual |
Implements CoulombP3M.
Definition at line 170 of file p3m.impl.hpp.
References p3m, and P3M_EPSILON_METALLIC.
|
inlineoverridevirtual |
Implements CoulombP3M.
Definition at line 201 of file p3m.impl.hpp.
References add_long_range_forces_gpu(), CPU, CUDA, and long_range_kernel().
|
protected |
Definition at line 1124 of file p3m.impl.definitions.hpp.
References add_long_range_forces_gpu(), CUDA, System::Leaf< Actor< CoulombP3M > >::get_system(), long_range_energy(), m_gpu_data, p3m_gpu_add_farfield_force(), Coulomb::Actor< CoulombP3M >::prefactor, and this_node.
Referenced by add_long_range_forces(), and add_long_range_forces_gpu().
|
overridevirtual |
Implements CoulombP3M.
Definition at line 444 of file p3m.impl.definitions.hpp.
References Utils::integral_parameter(), and p3m.
|
overrideprotectedvirtual |
Calculate the influence function optimized for the energy and the self energy correction.
Implements CoulombP3M.
Definition at line 182 of file p3m.impl.definitions.hpp.
References calc_influence_function_energy(), System::Leaf< Actor< CoulombP3M > >::get_system(), grid_influence_function(), influence_function_r2c(), p3m, and P3M_BRILLOUIN.
Referenced by calc_influence_function_energy(), and scaleby_box_l().
|
overrideprotectedvirtual |
Calculate the optimal influence function of [24].
(optimised for force calculations)
Each node calculates only the values for its domain in k-space.
See also: [24] eq. 8-22 (p. 275). Note the somewhat different convention for the prefactors, which is described in [12] [13].
Implements CoulombP3M.
Definition at line 165 of file p3m.impl.definitions.hpp.
References calc_influence_function_force(), System::Leaf< Actor< CoulombP3M > >::get_system(), grid_influence_function(), influence_function_r2c(), p3m, and P3M_BRILLOUIN.
Referenced by calc_influence_function_force(), and scaleby_box_l().
|
overridevirtual |
Implements CoulombP3M.
Definition at line 436 of file p3m.impl.definitions.hpp.
References System::Leaf< Actor< CoulombP3M > >::get_system(), Utils::integral_parameter(), p3m, and prepare_fft_mesh().
|
overridevirtual |
Implements CoulombP3M.
Definition at line 125 of file p3m.impl.definitions.hpp.
References comm_cart, count_charged_particles(), System::Leaf< Actor< CoulombP3M > >::get_system(), p3m, reduce_over_local_particles(), and Utils::sqr().
Referenced by count_charged_particles(), init_cpu_kernels(), and tune().
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Implements CoulombP3M.
Definition at line 152 of file p3m.impl.hpp.
References CPU, CUDA, init_cpu_kernels(), and init_gpu_kernels().
Referenced by tune().
|
protected |
Definition at line 299 of file p3m.impl.definitions.hpp.
References Utils::Vector< int, N >::broadcast(), comm_cart, communicator, count_charged_particles(), CPU, get_actor_by_type(), System::Leaf< Actor< CoulombP3M > >::get_system(), Utils::int_pow(), make_p3m_kokkos_fft_backend(), p3m, p3m_max_cao, p3m_min_cao, Utils::product(), CoulombP3M::sanity_checks(), and scaleby_box_l().
Referenced by init(), init_gpu_kernels(), and on_activation().
|
protected |
Definition at line 1145 of file p3m.impl.definitions.hpp.
References System::System::box_geo, System::System::coulomb, CUDA, System::Leaf< Actor< CoulombP3M > >::get_system(), System::System::gpu, has_actor_of_type(), Coulomb::Solver::impl, init_cpu_kernels(), BoxGeometry::length(), m_gpu_data, GpuParticleData::n_particles(), p3m, and p3m_gpu_init().
Referenced by init().
|
inlinenodiscardoverridevirtualnoexcept |
Implements CoulombP3M.
Definition at line 178 of file p3m.impl.hpp.
|
inlinenodiscardoverridevirtualnoexcept |
|
inlinenodiscardoverridevirtualnoexcept |
Implements CoulombP3M.
Definition at line 174 of file p3m.impl.hpp.
Referenced by on_activation(), and tune().
|
inlineoverridevirtual |
Implements CoulombP3M.
Definition at line 199 of file p3m.impl.hpp.
References long_range_kernel().
Referenced by add_long_range_forces_gpu().
|
protected |
Compute the k-space part of forces and energies.
Definition at line 660 of file p3m.impl.definitions.hpp.
References Utils::Vector< int, N >::broadcast(), calc_dipole_moment(), charge_assign(), comm_cart, for_each_3d_order(), System::Leaf< Actor< CoulombP3M > >::get_system(), has_actor_of_type(), Utils::integral_parameter(), kokkos_parallel_range_for(), p3m, P3M_EPSILON_METALLIC, Coulomb::Actor< CoulombP3M >::prefactor, Utils::sqr(), and this_node.
Referenced by add_long_range_forces(), and long_range_energy().
|
overridevirtual |
Calculate the long range electrostatics part of the pressure tensor. This is part \(\Pi_{\textrm{rec}, \alpha, \beta}\) eq. (2.7) in [19]. 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 591 of file p3m.impl.definitions.hpp.
References Utils::Vector< int, N >::broadcast(), charge_assign(), for_each_3d_order(), System::Leaf< Actor< CoulombP3M > >::get_system(), p3m, Coulomb::Actor< CoulombP3M >::prefactor, and Utils::sqr().
|
inlineoverridevirtual |
Implements CoulombP3M.
Definition at line 182 of file p3m.impl.hpp.
References CUDA, init_cpu_kernels(), is_tuned(), request_gpu(), CoulombP3M::sanity_checks(), and tune().
|
inlineoverridevirtual |
Implements CoulombP3M.
Definition at line 217 of file p3m.impl.hpp.
References kokkos_deep_copy(), and p3m.
Referenced by charge_assign().
|
protected |
Definition at line 1158 of file p3m.impl.definitions.hpp.
References CUDA, GpuParticleData::prop::force, System::Leaf< Actor< CoulombP3M > >::get_system(), GpuParticleData::prop::pos, and GpuParticleData::prop::q.
Referenced by on_activation().
|
overrideprotectedvirtual |
Implements CoulombP3M.
Definition at line 1109 of file p3m.impl.definitions.hpp.
References calc_influence_function_energy(), calc_influence_function_force(), comm_cart, System::Leaf< Actor< CoulombP3M > >::get_system(), p3m, and CoulombP3M::sanity_checks_boxl().
Referenced by init_cpu_kernels().
|
overridevirtual |
Implements CoulombP3M.
Definition at line 1019 of file p3m.impl.definitions.hpp.
References System::System::box_geo, count_charged_particles(), TuningAlgorithm::determine_cao_limits(), CoulombTuningAlgorithm< FloatType, Architecture, FFTConfig >::determine_mesh_limits(), TuningAlgorithm::determine_r_cut_limits(), System::Leaf< Actor< CoulombP3M > >::get_system(), init(), is_tuned(), System::System::on_coulomb_change(), p3m, Coulomb::Actor< CoulombP3M >::prefactor, CoulombTuningAlgorithm< FloatType, Architecture, FFTConfig >::setup_logger(), and TuningAlgorithm::tune().
Referenced by on_activation().
|
protected |
Definition at line 243 of file p3m.impl.hpp.
Referenced by add_long_range_forces_gpu(), and init_gpu_kernels().
| CoulombP3MStateClass& CoulombP3MImpl< FloatType, Architecture, FFTConfig >::p3m |
Coulomb P3M parameters.
Definition at line 119 of file p3m.impl.hpp.
Referenced by adapt_epsilon_elc(), assign_charge(), calc_influence_function_energy(), calc_influence_function_force(), charge_assign(), CoulombP3MImpl(), count_charged_particles(), count_charged_particles_elc(), init_cpu_kernels(), init_gpu_kernels(), long_range_kernel(), long_range_pressure(), prepare_fft_mesh(), scaleby_box_l(), and tune().