![]() |
ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
Dipolar P3M solver. More...
#include <dp3m.hpp>
Inheritance diagram for DipolarP3M:
Collaboration diagram for DipolarP3M:Public Attributes | |
| P3MParameters const & | dp3m_params |
Public Attributes inherited from Dipoles::Actor< DipolarP3M > | |
| double | prefactor |
| Magnetostatics prefactor. | |
Protected Member Functions | |
| virtual double | calc_average_self_energy_k_space () const =0 |
| Calculate self-energy in k-space. | |
| virtual void | calc_energy_correction ()=0 |
| Calculate energy correction that minimizes the error. | |
| virtual void | calc_influence_function_force ()=0 |
| Calculate the influence function for the dipolar forces and torques. | |
| virtual void | calc_influence_function_energy ()=0 |
| Calculate the influence function for the dipolar energy. | |
| virtual double | calc_surface_term (bool force_flag, bool energy_flag)=0 |
| Compute the dipolar surface terms. | |
| 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 |
| virtual void | scaleby_box_l ()=0 |
| virtual void | npt_add_virial_contribution (double virial) const =0 |
| Update the NpT virial. | |
Protected Member Functions inherited from System::Leaf< Class > | |
| auto & | get_system () |
| auto & | get_system () const |
Additional Inherited Members | |
Protected Attributes inherited from System::Leaf< Class > | |
| std::weak_ptr< System > | m_system |
|
inline |
|
virtualdefault |
Compute the k-space part of forces.
Implemented in DipolarP3MHeffte< FloatType, Architecture, FFTConfig >.
Calculate self-energy in k-space.
Implemented in DipolarP3MHeffte< FloatType, Architecture, FFTConfig >.
Calculate energy correction that minimizes the error.
This quantity is only calculated once and is cached.
Implemented in DipolarP3MHeffte< FloatType, Architecture, FFTConfig >.
Calculate the influence function for the dipolar energy.
Implemented in DipolarP3MHeffte< FloatType, Architecture, FFTConfig >.
Calculate the influence function for the dipolar forces and torques.
Implemented in DipolarP3MHeffte< FloatType, Architecture, FFTConfig >.
|
protectedpure virtual |
Compute the dipolar surface terms.
Implemented in DipolarP3MHeffte< FloatType, Architecture, FFTConfig >.
Count the number of magnetic particles and calculate the sum of the squared dipole moments.
Implemented in DipolarP3MHeffte< FloatType, Architecture, FFTConfig >.
Assign the physical dipoles using the tabulated assignment function.
Implemented in DipolarP3MHeffte< FloatType, Architecture, FFTConfig >.
Recalculate all derived parameters.
Implemented in DipolarP3MHeffte< FloatType, Architecture, FFTConfig >.
Referenced by on_cell_structure_change().
Implemented in DipolarP3MHeffte< FloatType, Architecture, FFTConfig >.
Implemented in DipolarP3MHeffte< FloatType, Architecture, FFTConfig >.
Implemented in DipolarP3MHeffte< FloatType, Architecture, FFTConfig >.
Compute the k-space part of energies.
Implemented in DipolarP3MHeffte< FloatType, Architecture, FFTConfig >.
|
pure virtual |
Compute the k-space part of the pressure tensor.
Implemented in DipolarP3MHeffte< FloatType, Architecture, FFTConfig >.
Update the NpT virial.
Implemented in DipolarP3MHeffte< FloatType, Architecture, FFTConfig >.
Implemented in DipolarP3MHeffte< FloatType, Architecture, FFTConfig >.
|
inline |
Recalculate all box-length-dependent parameters.
Definition at line 68 of file dp3m.hpp.
References scaleby_box_l().
|
inline |
Definition at line 71 of file dp3m.hpp.
References init(), and sanity_checks_cell_structure().
|
inline |
Definition at line 69 of file dp3m.hpp.
References sanity_checks_node_grid().
|
inline |
Definition at line 70 of file dp3m.hpp.
References sanity_checks_periodicity().
|
inline |
Calculate real-space contribution of dipolar pair energy.
Definition at line 205 of file dp3m.hpp.
References P3MParameters::accuracy, P3MParameters::alpha, Utils::AS_erfc_part(), dp3m_params, Dipoles::Actor< DipolarP3M >::prefactor, P3MParameters::r_cut, Utils::sqr(), and stream.
|
inline |
Calculate real-space contribution of p3m dipolar pair forces and torques.
If NPT is compiled in, update the NpT virial.
Definition at line 140 of file dp3m.hpp.
References P3MParameters::accuracy, P3MParameters::alpha, Utils::AS_erfc_part(), dp3m_params, Dipoles::Actor< DipolarP3M >::prefactor, P3MParameters::r_cut, Utils::sqr(), stream, and vector_product().
|
inline |
Definition at line 78 of file dp3m.hpp.
References sanity_checks_boxl(), sanity_checks_cell_structure(), sanity_checks_node_grid(), and sanity_checks_periodicity().
Referenced by DipolarP3MHeffte< FloatType, Architecture, FFTConfig >::on_activation().
|
protected |
Checks for correctness of the k-space cutoff.
Definition at line 1427 of file dp3m_heffte.impl.hpp.
References P3MParameters::cao_cut, dp3m_params, System::Leaf< Class >::get_system(), and stream.
Referenced by sanity_checks().
|
protected |
Definition at line 1461 of file dp3m_heffte.impl.hpp.
References communicator, System::Leaf< Class >::get_system(), HYBRID, REGULAR, and stream.
Referenced by on_cell_structure_change(), and sanity_checks().
|
protected |
Definition at line 1476 of file dp3m_heffte.impl.hpp.
References communicator, Communicator::node_grid, and stream.
Referenced by on_node_grid_change(), and sanity_checks().
|
protected |
Definition at line 1453 of file dp3m_heffte.impl.hpp.
References System::Leaf< Class >::get_system(), and stream.
Referenced by on_periodicity_change(), and sanity_checks().
Implemented in DipolarP3MHeffte< FloatType, Architecture, FFTConfig >.
Referenced by on_boxl_change().
Tune dipolar P3M parameters to desired accuracy.
The parameters mesh, cao, r_cut_iL and alpha_L are tuned to obtain the target accuracy in optimal time. These parameters are stored in the dp3m_params object.
The function utilizes the analytic expression of the error estimate for the dipolar P3M method in the paper of [11] in order to obtain the rms error in the force for a system of N randomly distributed particles in a cubic box. For the real space error, the estimate in [28] is used.
Parameter ranges if not given explicitly in the constructor:
mesh is set up such that the number of mesh points is equal to the number of magnetic dipolar particlescao explores all possible valuesalpha_L is tuned for each tuple (r_cut_iL, mesh, cao) and calculated assuming that the error contributions of real and reciprocal space should be equalAfter checking if the total error lies below the target accuracy, the time needed for one force calculation is measured. Parameters that minimize the runtime are kept.
The function is based on routines of the program HE_Q.cpp for charges written by M. Deserno.
Implemented in DipolarP3MHeffte< FloatType, Architecture, FFTConfig >.
| P3MParameters const& DipolarP3M::dp3m_params |
Definition at line 55 of file dp3m.hpp.
Referenced by pair_energy(), pair_force(), and sanity_checks_boxl().