![]() |
ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
#include <dp3m_heffte.hpp>
Inheritance diagram for DipolarP3MHeffte< FloatType, Architecture, FFTConfig >:
Collaboration diagram for DipolarP3MHeffte< FloatType, Architecture, FFTConfig >:Public Types | |
| using | DipolarP3MStateClass = DipolarP3MState< FloatType, FFTConfig > |
Public Attributes | |
| DipolarP3MStateClass & | dp3m |
| Dipolar P3M parameters. | |
Public Attributes inherited from DipolarP3M | |
| P3MParameters const & | dp3m_params |
Public Attributes inherited from Dipoles::Actor< DipolarP3M > | |
| double | prefactor |
| Magnetostatics prefactor. | |
Protected Member Functions | |
| double | long_range_kernel (bool force_flag, bool energy_flag) |
| Compute the k-space part of forces and energies. | |
| double | calc_average_self_energy_k_space () const override |
| void | calc_energy_correction () override |
| void | calc_influence_function_force () override |
| void | calc_influence_function_energy () override |
| double | calc_surface_term (bool force_flag, bool energy_flag) override |
| void | init_cpu_kernels () |
| void | scaleby_box_l () override |
| void | npt_add_virial_contribution (double virial) const override |
Protected Member Functions inherited from DipolarP3M | |
| 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 |
Additional Inherited Members | |
Protected Attributes inherited from System::Leaf< Class > | |
| std::weak_ptr< System > | m_system |
Definition at line 166 of file dp3m_heffte.hpp.
| using DipolarP3MHeffte< FloatType, Architecture, FFTConfig >::DipolarP3MStateClass = DipolarP3MState<FloatType, FFTConfig> |
Definition at line 173 of file dp3m_heffte.hpp.
|
overridedefault |
|
inline |
Definition at line 186 of file dp3m_heffte.hpp.
References Utils::Vector< T, N >::broadcast(), DipolarP3MHeffte< FloatType, Architecture, FFTConfig >::dp3m, DipolarP3MState< FloatType, FFTConfig >::init_labels(), P3MParameters::mesh, P3MStateCommon< FloatType, Architecture >::params, Dipoles::Actor< DipolarP3M >::prefactor, Dipoles::Actor< DipolarP3M >::set_prefactor(), stream, TuningParameters::timings, and P3MParameters::tuning.
|
inlineoverridevirtual |
Implements DipolarP3M.
Definition at line 229 of file dp3m_heffte.hpp.
References CPU, DipolarP3MHeffte< FloatType, Architecture, FFTConfig >::long_range_kernel(), and stream.
|
overrideprotectedvirtual |
Implements DipolarP3M.
Definition at line 133 of file dp3m_heffte.impl.hpp.
References System::System::box_geo, comm_cart, and stream.
|
overrideprotectedvirtual |
Implements DipolarP3M.
Definition at line 1504 of file dp3m_heffte.impl.hpp.
References P3MParameters::alpha_L, System::System::box_geo, DipolarP3MState< FloatType, FFTConfig >::energy_correction, P3MStateCommon< FloatType, Architecture >::params, stream, and DipolarP3MState< FloatType, FFTConfig >::sum_mu2.
|
overrideprotectedvirtual |
Implements DipolarP3M.
Definition at line 1102 of file dp3m_heffte.impl.hpp.
References System::System::box_geo, grid_influence_function_dipolar(), P3M_BRILLOUIN, and stream.
|
overrideprotectedvirtual |
Implements DipolarP3M.
Definition at line 1077 of file dp3m_heffte.impl.hpp.
References System::System::box_geo, grid_influence_function_dipolar(), P3M_BRILLOUIN, and stream.
|
overrideprotectedvirtual |
Implements DipolarP3M.
Definition at line 1003 of file dp3m_heffte.impl.hpp.
References comm_cart, ParticleRange::size(), and stream.
|
overridevirtual |
Implements DipolarP3M.
Definition at line 101 of file dp3m_heffte.impl.hpp.
References System::System::cell_structure, comm_cart, and stream.
|
overridevirtual |
Implements DipolarP3M.
Definition at line 232 of file dp3m_heffte.impl.hpp.
|
inlineoverridevirtual |
Implements DipolarP3M.
Definition at line 204 of file dp3m_heffte.hpp.
References CPU, DipolarP3MHeffte< FloatType, Architecture, FFTConfig >::init_cpu_kernels(), and stream.
|
protected |
Definition at line 147 of file dp3m_heffte.impl.hpp.
References Utils::Vector< T, N >::broadcast(), comm_cart, communicator, count_magnetic_particles(), Communicator::node_grid, p3m_max_cao, p3m_min_cao, and stream.
Referenced by DipolarP3MHeffte< FloatType, Architecture, FFTConfig >::init().
|
inlineoverridevirtualnoexcept |
Implements DipolarP3M.
Definition at line 216 of file dp3m_heffte.hpp.
|
inlineoverridevirtualnoexcept |
|
inlineoverridevirtualnoexcept |
Implements DipolarP3M.
Definition at line 212 of file dp3m_heffte.hpp.
|
inlineoverridevirtual |
Implements DipolarP3M.
Definition at line 225 of file dp3m_heffte.hpp.
References DipolarP3MHeffte< FloatType, Architecture, FFTConfig >::long_range_kernel().
|
protected |
Compute the k-space part of forces and energies.
Definition at line 489 of file dp3m_heffte.impl.hpp.
References Utils::Vector< T, N >::broadcast(), comm_cart, extract_block_into(), for_each_3d(), Utils::integral_parameter(), p3m_max_cao, p3m_min_cao, pad_with_zeros_discard_imag_into(), Utils::product(), Utils::ROW_MAJOR, Utils::sqr(), stream, and this_node.
Referenced by DipolarP3MHeffte< FloatType, Architecture, FFTConfig >::add_long_range_forces(), and DipolarP3MHeffte< FloatType, Architecture, FFTConfig >::long_range_energy().
|
overridevirtual |
Reciprocal-space virial for the dipolar Ewald/P3M sum.
Obtained via the same Nose-Klein strain-derivative method used for the Coulomb case ([19] eq. (2.7), \(\Pi_{\textrm{rec}, \alpha, \beta}\)), applied to the dipolar structure factor \(Q(\vec k) = \vec M(\vec k)\cdot\vec k\) with \(\vec M(\vec k) = \sum_j \vec \mu_j \exp(i\vec k\cdot\vec r_j)\). Unlike the charge structure factor, \(Q(\vec k)\) depends on \(\vec k\) explicitly (not only through the phase factor), which produces an extra cross term beyond the charge-case \(k_a k_b\) envelope. This cross term is generally asymmetric in \((a,b)\): its symmetric half, \(k_a\Re[M_b Q^*] + k_b\Re[M_a Q^*]\), is the dipole-dipole reciprocal-space pressure tensor eq. (46) in [2] (their \(\vec h\), \(\kappa\) correspond to \(\vec k\), \(\alpha\) here), which only ever reports that symmetrized form. The remaining antisymmetric half is not in that reference – it is the reciprocal-space image of the same dipole-dipole torque that already makes the real-space virial asymmetric (see DipolarDirectSum::long_range_pressure and DipolarP3M::pair_force), derived here by differentiating the reciprocal energy directly (via the strain parametrization \(H(\varepsilon)=LI+\varepsilon E_{ab}\)) instead of presupposing a symmetric result.
Care is needed with the index convention: probing the strain component \(\varepsilon_{ab}\) (i.e. \(H(\varepsilon)=LI+\varepsilon E_{ab}\)) yields \(-\partial U/\partial\varepsilon_{ab} = r_b F_a\) for a pair separation \(\vec r\) and force \(\vec F\) – the transpose of the \(r_a F_b\) (d (x) f) convention used by the real-space term and by DipolarDirectSum::long_range_pressure. Concretely, differentiating \(Q(\vec k)=\vec k\cdot\vec M\) gives a cross-term contribution to \(-\partial U/\partial\varepsilon_{ab}\) proportional to \(k_a\Re[M_bQ^*]\); to match the \(r_aF_b\) convention, this must be stored as the \((b,a)\) tensor component, i.e. \(\Pi_{ab}\) gets cross term \(2k_b\Re[M_aQ^*]\) (indices swapped relative to the strain probe that produced it).
Implements DipolarP3M.
Definition at line 391 of file dp3m_heffte.impl.hpp.
References Utils::Vector< T, N >::broadcast(), for_each_3d(), Utils::product(), Utils::sqr(), and stream.
|
overrideprotectedvirtual |
Implements DipolarP3M.
Definition at line 1516 of file dp3m_heffte.impl.hpp.
References System::System::npt_add_virial_contribution(), and stream.
|
inlineoverridevirtual |
Implements DipolarP3M.
Definition at line 220 of file dp3m_heffte.hpp.
References DipolarP3M::sanity_checks(), and DipolarP3MHeffte< FloatType, Architecture, FFTConfig >::tune().
|
overrideprotectedvirtual |
Implements DipolarP3M.
Definition at line 1485 of file dp3m_heffte.impl.hpp.
References P3MParameters::alpha, P3MParameters::alpha_L, System::System::box_geo, comm_cart, DipolarP3MState< FloatType, FFTConfig >::energy_correction, DipolarP3MState< FloatType, FFTConfig >::halo_comm, DipolarP3MState< FloatType, FFTConfig >::heffte, P3MStateCommon< FloatType, Architecture >::local_mesh, P3MStateCommon< FloatType, Architecture >::params, P3MParameters::r_cut, P3MParameters::r_cut_iL, P3MParameters::recalc_a_ai_cao_cut(), P3MLocalMesh::recalc_ld_pos(), and DipolarP3MState< FloatType, FFTConfig >::world_size.
|
overridevirtual |
Implements DipolarP3M.
Definition at line 1249 of file dp3m_heffte.impl.hpp.
References P3MParameters::alpha, P3MParameters::alpha_L, count_magnetic_particles(), P3MStateCommon< FloatType, Architecture >::params, P3MParameters::r_cut, P3MParameters::r_cut_iL, stream, DipolarP3MState< FloatType, FFTConfig >::sum_dip_part, and P3MParameters::tuning.
Referenced by DipolarP3MHeffte< FloatType, Architecture, FFTConfig >::on_activation().
| DipolarP3MStateClass& DipolarP3MHeffte< FloatType, Architecture, FFTConfig >::dp3m |
Dipolar P3M parameters.
Definition at line 175 of file dp3m_heffte.hpp.
Referenced by DipolarP3MHeffte< FloatType, Architecture, FFTConfig >::DipolarP3MHeffte().