ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
CoulombP3MImpl< FloatType, Architecture > Struct Template Reference

#include <p3m.impl.hpp>

+ Inheritance diagram for CoulombP3MImpl< FloatType, Architecture >:
+ Collaboration diagram for CoulombP3MImpl< FloatType, Architecture >:

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< P3MGpuParamsm_gpu_data = nullptr
 
- Protected Attributes inherited from System::Leaf< Class >
std::weak_ptr< Systemm_system
 

Additional Inherited Members

- Static Public Attributes inherited from Coulomb::Actor< CoulombP3M >
static auto constexpr charge_neutrality_tolerance_default
 

Detailed Description

template<typename FloatType, Arch Architecture>
struct CoulombP3MImpl< FloatType, Architecture >

Definition at line 63 of file p3m.impl.hpp.

Constructor & Destructor Documentation

◆ ~CoulombP3MImpl()

template<typename FloatType , Arch Architecture>
CoulombP3MImpl< FloatType, Architecture >::~CoulombP3MImpl ( )
overridedefault

◆ CoulombP3MImpl()

template<typename FloatType , Arch Architecture>
CoulombP3MImpl< FloatType, Architecture >::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 
)
inline

Member Function Documentation

◆ adapt_epsilon_elc()

template<typename FloatType , Arch Architecture>
void CoulombP3MImpl< FloatType, Architecture >::adapt_epsilon_elc ( )
inlineoverridevirtual

Implements CoulombP3M.

Definition at line 114 of file p3m.impl.hpp.

References CoulombP3MImpl< FloatType, Architecture >::p3m, and P3M_EPSILON_METALLIC.

◆ add_long_range_forces()

template<typename FloatType , Arch Architecture>
void CoulombP3MImpl< FloatType, Architecture >::add_long_range_forces ( ParticleRange const &  particles)
inlineoverridevirtual

◆ add_long_range_forces_gpu()

template<typename FloatType , Arch Architecture>
void CoulombP3MImpl< FloatType, Architecture >::add_long_range_forces_gpu ( ParticleRange const &  particles)
protected

◆ assign_charge()

template<typename FloatType , Arch Architecture>
void CoulombP3MImpl< FloatType, Architecture >::assign_charge ( double  q,
Utils::Vector3d const &  real_pos,
bool  skip_cache 
)
overridevirtual

Implements CoulombP3M.

Definition at line 334 of file p3m.cpp.

◆ calc_influence_function_energy()

template<typename FloatType , Arch Architecture>
void CoulombP3MImpl< FloatType, Architecture >::calc_influence_function_energy ( )
overrideprotectedvirtual

Calculate the influence function optimized for the energy and the self energy correction.

Implements CoulombP3M.

Definition at line 139 of file p3m.cpp.

◆ calc_influence_function_force()

template<typename FloatType , Arch Architecture>
void CoulombP3MImpl< FloatType, Architecture >::calc_influence_function_force ( )
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.

Definition at line 128 of file p3m.cpp.

◆ charge_assign()

template<typename FloatType , Arch Architecture>
void CoulombP3MImpl< FloatType, Architecture >::charge_assign ( ParticleRange const &  particles)
overridevirtual

Implements CoulombP3M.

Definition at line 322 of file p3m.cpp.

References ParticlePropertyRange::charge_range(), and ParticlePropertyRange::pos_range().

◆ count_charged_particles()

template<typename FloatType , Arch Architecture>
void CoulombP3MImpl< FloatType, Architecture >::count_charged_particles ( )
overridevirtual

Implements CoulombP3M.

Definition at line 99 of file p3m.cpp.

References System::System::cell_structure, comm_cart, and Utils::sqr().

◆ count_charged_particles_elc()

template<typename FloatType , Arch Architecture>
void CoulombP3MImpl< FloatType, Architecture >::count_charged_particles_elc ( int  n,
double  sum_q2,
double  square_sum_q 
)
inlineoverridevirtual

Implements CoulombP3M.

Definition at line 108 of file p3m.impl.hpp.

References CoulombP3MImpl< FloatType, Architecture >::p3m.

◆ init()

template<typename FloatType , Arch Architecture>
void CoulombP3MImpl< FloatType, Architecture >::init ( )
inlineoverridevirtual

◆ init_cpu_kernels()

template<typename FloatType , Arch Architecture>
void CoulombP3MImpl< FloatType, Architecture >::init_cpu_kernels ( )
protected

◆ init_gpu_kernels()

◆ is_double_precision()

template<typename FloatType , Arch Architecture>
bool CoulombP3MImpl< FloatType, Architecture >::is_double_precision ( ) const
inlineoverridevirtualnoexcept

Implements CoulombP3M.

Definition at line 122 of file p3m.impl.hpp.

◆ is_gpu()

template<typename FloatType , Arch Architecture>
bool CoulombP3MImpl< FloatType, Architecture >::is_gpu ( ) const
inlineoverridevirtualnoexcept

Implements CoulombP3M.

Definition at line 119 of file p3m.impl.hpp.

References GPU.

◆ is_tuned()

template<typename FloatType , Arch Architecture>
bool CoulombP3MImpl< FloatType, Architecture >::is_tuned ( ) const
inlineoverridevirtualnoexcept

Implements CoulombP3M.

Definition at line 118 of file p3m.impl.hpp.

Referenced by CoulombP3MImpl< FloatType, Architecture >::on_activation().

◆ long_range_energy()

template<typename FloatType , Arch Architecture>
double CoulombP3MImpl< FloatType, Architecture >::long_range_energy ( ParticleRange const &  particles)
inlineoverridevirtual

◆ long_range_kernel()

◆ long_range_pressure()

template<typename FloatType , Arch Architecture>
Utils::Vector9d CoulombP3MImpl< FloatType, Architecture >::long_range_pressure ( ParticleRange const &  particles)
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().

◆ on_activation()

◆ prepare_fft_mesh()

template<typename FloatType , Arch Architecture>
void CoulombP3MImpl< FloatType, Architecture >::prepare_fft_mesh ( bool  reset_weights)
inlineoverridevirtual

Implements CoulombP3M.

Definition at line 163 of file p3m.impl.hpp.

References CoulombP3MImpl< FloatType, Architecture >::p3m.

◆ request_gpu()

template<typename FloatType , Arch Architecture>
void CoulombP3MImpl< FloatType, Architecture >::request_gpu ( ) const
protected

◆ scaleby_box_l()

template<typename FloatType , Arch Architecture>
void CoulombP3MImpl< FloatType, Architecture >::scaleby_box_l ( )
overrideprotectedvirtual

◆ tune()

Member Data Documentation

◆ m_gpu_data

template<typename FloatType , Arch Architecture>
std::shared_ptr<P3MGpuParams> CoulombP3MImpl< FloatType, Architecture >::m_gpu_data = nullptr
protected

Definition at line 183 of file p3m.impl.hpp.

◆ p3m


The documentation for this struct was generated from the following files: