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

#include <p3m_heffte.hpp>

+ Inheritance diagram for CoulombP3MHeffte< FloatType, Architecture, FFTConfig >:
+ Collaboration diagram for CoulombP3MHeffte< FloatType, Architecture, FFTConfig >:

Public Types

using CoulombP3MStateClass = CoulombP3MState< FloatType, FFTConfig >
 

Public Member Functions

 ~CoulombP3MHeffte () override=default
 
 CoulombP3MHeffte (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 (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

CoulombP3MStateClassp3m
 Coulomb P3M parameters.
 
- Public Attributes inherited from CoulombP3M
P3MParameters constp3m_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 [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
 
- 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< Class >
autoget_system ()
 
autoget_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, class FFTConfig>
struct CoulombP3MHeffte< FloatType, Architecture, FFTConfig >

Definition at line 105 of file p3m_heffte.hpp.

Member Typedef Documentation

◆ CoulombP3MStateClass

template<typename FloatType , Arch Architecture, class FFTConfig >
using CoulombP3MHeffte< FloatType, Architecture, FFTConfig >::CoulombP3MStateClass = CoulombP3MState<FloatType, FFTConfig>

Definition at line 108 of file p3m_heffte.hpp.

Constructor & Destructor Documentation

◆ ~CoulombP3MHeffte()

template<typename FloatType , Arch Architecture, class FFTConfig >
CoulombP3MHeffte< FloatType, Architecture, FFTConfig >::~CoulombP3MHeffte ( )
overridedefault

◆ CoulombP3MHeffte()

Member Function Documentation

◆ adapt_epsilon_elc()

template<typename FloatType , Arch Architecture, class FFTConfig >
void CoulombP3MHeffte< FloatType, Architecture, FFTConfig >::adapt_epsilon_elc ( )
inlineoverridevirtual

◆ add_long_range_forces()

template<typename FloatType , Arch Architecture, class FFTConfig >
void CoulombP3MHeffte< FloatType, Architecture, FFTConfig >::add_long_range_forces ( ParticleRange const particles)
inlineoverridevirtual

◆ add_long_range_forces_gpu()

◆ assign_charge()

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

Implements CoulombP3M.

Definition at line 441 of file p3m_heffte.impl.hpp.

References stream.

◆ calc_influence_function_energy()

template<typename FloatType , Arch Architecture, class FFTConfig >
void CoulombP3MHeffte< FloatType, Architecture, FFTConfig >::calc_influence_function_energy ( )
overrideprotectedvirtual

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

Implements CoulombP3M.

Definition at line 182 of file p3m_heffte.impl.hpp.

References System::System::box_geo, grid_influence_function(), P3M_BRILLOUIN, and stream.

◆ calc_influence_function_force()

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

Definition at line 165 of file p3m_heffte.impl.hpp.

References System::System::box_geo, grid_influence_function(), P3M_BRILLOUIN, and stream.

◆ charge_assign()

template<typename FloatType , Arch Architecture, class FFTConfig >
void CoulombP3MHeffte< FloatType, Architecture, FFTConfig >::charge_assign ( ParticleRange const particles)
overridevirtual

◆ count_charged_particles()

template<typename FloatType , Arch Architecture, class FFTConfig >
void CoulombP3MHeffte< FloatType, Architecture, FFTConfig >::count_charged_particles ( )
overridevirtual

Implements CoulombP3M.

Definition at line 125 of file p3m_heffte.impl.hpp.

References comm_cart, reduce_over_local_particles(), Utils::sqr(), and stream.

◆ count_charged_particles_elc()

template<typename FloatType , Arch Architecture, class FFTConfig >
void CoulombP3MHeffte< FloatType, Architecture, FFTConfig >::count_charged_particles_elc ( std::size_t  n,
double  sum_q2,
double  square_sum_q 
)
inlineoverridevirtual

◆ init()

◆ init_cpu_kernels()

◆ init_gpu_kernels()

◆ is_double_precision()

template<typename FloatType , Arch Architecture, class FFTConfig >
bool CoulombP3MHeffte< FloatType, Architecture, FFTConfig >::is_double_precision ( ) const
inlineoverridevirtualnoexcept

Implements CoulombP3M.

Definition at line 175 of file p3m_heffte.hpp.

◆ is_gpu()

template<typename FloatType , Arch Architecture, class FFTConfig >
bool CoulombP3MHeffte< FloatType, Architecture, FFTConfig >::is_gpu ( ) const
inlineoverridevirtualnoexcept

Implements CoulombP3M.

Definition at line 172 of file p3m_heffte.hpp.

References CPU, and stream.

◆ is_tuned()

template<typename FloatType , Arch Architecture, class FFTConfig >
bool CoulombP3MHeffte< FloatType, Architecture, FFTConfig >::is_tuned ( ) const
inlineoverridevirtualnoexcept

◆ long_range_energy()

template<typename FloatType , Arch Architecture, class FFTConfig >
double CoulombP3MHeffte< FloatType, Architecture, FFTConfig >::long_range_energy ( ParticleRange const particles)
inlineoverridevirtual

◆ long_range_kernel()

◆ long_range_pressure()

template<typename FloatType , Arch Architecture, class FFTConfig >
Utils::Vector9d CoulombP3MHeffte< FloatType, Architecture, FFTConfig >::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 [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 621 of file p3m_heffte.impl.hpp.

References System::System::box_geo, Utils::Vector< T, N >::broadcast(), charge_assign(), Utils::sqr(), and stream.

◆ on_activation()

◆ prepare_fft_mesh()

◆ request_gpu()

◆ scaleby_box_l()

◆ tune()

Member Data Documentation

◆ m_gpu_data

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

Definition at line 242 of file p3m_heffte.hpp.

◆ p3m


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