![]() |
ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
Dipolar all with all and no replica. More...
#include <dipolar_direct_sum.hpp>
Inheritance diagram for DipolarDirectSum:
Collaboration diagram for DipolarDirectSum:Public Member Functions | |
| DipolarDirectSum (double prefactor, int n_replicas) | |
| void | on_activation () const |
| void | on_boxl_change () const |
| void | on_node_grid_change () const |
| void | on_periodicity_change () const |
| void | on_cell_structure_change () const |
| void | init () const |
| void | sanity_checks () const |
| double | long_range_energy (ParticleRange const &particles) const |
| Calculate the interaction potential. | |
| void | add_long_range_forces (ParticleRange const &particles) const |
| Calculate and add the interaction forces/torques to the particles. | |
| void | dipole_field_at_part (ParticleRange const &particles) const |
| Calculate total dipole field of each particle. | |
Public Member Functions inherited from Dipoles::Actor< DipolarDirectSum > | |
| void | set_prefactor (double new_prefactor) |
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 | |
| int | n_replicas |
Public Attributes inherited from Dipoles::Actor< DipolarDirectSum > | |
| double | prefactor |
| Magnetostatics prefactor. | |
Additional Inherited Members | |
Protected Member Functions inherited from System::Leaf< Class > | |
| auto & | get_system () |
| auto & | get_system () const |
Protected Attributes inherited from System::Leaf< Class > | |
| std::weak_ptr< System > | m_system |
Dipolar all with all and no replica.
Handling of a system of dipoles where no replicas exist. Assumes minimum image convention for those axis in which the system is periodic.
Definition at line 38 of file dipolar_direct_sum.hpp.
| DipolarDirectSum::DipolarDirectSum | ( | double | prefactor, |
| int | n_replicas | ||
| ) |
Definition at line 451 of file dipolar_direct_sum.cpp.
References n_replicas, Dipoles::Actor< DipolarDirectSum >::prefactor, and Dipoles::Actor< DipolarDirectSum >::set_prefactor().
| void DipolarDirectSum::add_long_range_forces | ( | ParticleRange const & | particles | ) | const |
Calculate and add the interaction forces/torques to the particles.
This employs a parallel N-square loop over all particle pairs. The computation the partitioned into several steps so that the communication latency can be hidden behinder some local computation:
Logically this is equivalent to the potential calculation in DipolarDirectSum::long_range_energy, which calculates a naive N-square sum, but has better performance and scaling.
Definition at line 291 of file dipolar_direct_sum.cpp.
References dipole_field_at_part(), ParticleForce::f, for_each_image(), gather_particle_data(), get_n_cut(), System::Leaf< Class >::get_system(), image_sum(), n_replicas, pair_force(), Dipoles::Actor< DipolarDirectSum >::prefactor, and vector_product().
| void DipolarDirectSum::dipole_field_at_part | ( | ParticleRange const & | particles | ) | const |
Calculate total dipole field of each particle.
This employs a parallel N-square loop over all particles. Logically this is equivalent to the potential calculation in DipolarDirectSum::long_range_energy, which calculates a naive N-square sum. The difference is summation range, and the kernel calculates the dipole field rather than the energy.
Definition at line 422 of file dipolar_direct_sum.cpp.
References Utils::Vector< T, N >::begin(), gather_particle_data(), get_n_cut(), System::Leaf< Class >::get_system(), image_sum(), n_replicas, and Dipoles::Actor< DipolarDirectSum >::prefactor.
Referenced by add_long_range_forces().
|
inline |
Definition at line 47 of file dipolar_direct_sum.hpp.
| double DipolarDirectSum::long_range_energy | ( | ParticleRange const & | particles | ) | const |
Calculate the interaction potential.
This employs a parallel N-square loop over all particle pairs.
Definition at line 384 of file dipolar_direct_sum.cpp.
References gather_particle_data(), get_n_cut(), System::Leaf< Class >::get_system(), image_sum(), n_replicas, and Dipoles::Actor< DipolarDirectSum >::prefactor.
|
inline |
Definition at line 42 of file dipolar_direct_sum.hpp.
|
inline |
Definition at line 43 of file dipolar_direct_sum.hpp.
|
inline |
Definition at line 46 of file dipolar_direct_sum.hpp.
|
inline |
Definition at line 44 of file dipolar_direct_sum.hpp.
|
inline |
Definition at line 45 of file dipolar_direct_sum.hpp.
|
inline |
Definition at line 48 of file dipolar_direct_sum.hpp.
| int DipolarDirectSum::n_replicas |
Definition at line 39 of file dipolar_direct_sum.hpp.
Referenced by add_long_range_forces(), DipolarDirectSum(), dipole_field_at_part(), and long_range_energy().