![]() |
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, bool gpu) | |
| bool | is_gpu () const |
| void | on_activation () const |
| void | on_activation_gpu () 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 () const |
| Calculate long-range dipolar energy. | |
| void | add_long_range_forces () const |
| double | long_range_energy_cpu () const |
| Calculate the interaction potential. | |
| void | add_long_range_forces_cpu () const |
| Calculate and add the interaction forces/torques to the particles. | |
| void | long_range_energy_gpu () const |
| void | add_long_range_forces_gpu () const |
| void | dipole_field_at_part_cpu () 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 |
| bool | m_is_gpu |
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 36 of file dipolar_direct_sum.hpp.
| DipolarDirectSum::DipolarDirectSum | ( | double | prefactor, |
| int | n_replicas, | ||
| bool | gpu | ||
| ) |
Definition at line 459 of file dipolar_direct_sum.cpp.
References m_is_gpu, n_replicas, Dipoles::Actor< DipolarDirectSum >::prefactor, and Dipoles::Actor< DipolarDirectSum >::set_prefactor().
|
inline |
Definition at line 73 of file dipolar_direct_sum.hpp.
References add_long_range_forces_cpu(), add_long_range_forces_gpu(), and m_is_gpu.
| void DipolarDirectSum::add_long_range_forces_cpu | ( | ) | 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 behind 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_cpu(), ParticleForce::f, for_each_image(), gather_particle_data(), get_n_cut(), System::Leaf< Class >::get_system(), image_sum(), m_is_gpu, n_replicas, pair_force(), Dipoles::Actor< DipolarDirectSum >::prefactor, and vector_product().
Referenced by add_long_range_forces().
| void DipolarDirectSum::add_long_range_forces_gpu | ( | ) | const |
Definition at line 51 of file dipolar_direct_sum_gpu.cpp.
References DipolarDirectSum_kernel_wrapper_force(), get_simulation_box(), System::Leaf< Class >::get_system(), n_replicas, Dipoles::Actor< DipolarDirectSum >::prefactor, and this_node.
Referenced by add_long_range_forces().
| void DipolarDirectSum::dipole_field_at_part_cpu | ( | ) | 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 428 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(), m_is_gpu, n_replicas, and Dipoles::Actor< DipolarDirectSum >::prefactor.
Referenced by add_long_range_forces_cpu().
|
inline |
Definition at line 56 of file dipolar_direct_sum.hpp.
|
inline |
Definition at line 41 of file dipolar_direct_sum.hpp.
References m_is_gpu.
|
inline |
Calculate long-range dipolar energy.
The GPU implementation stores the energy on a GPU accumulator and zero is returned from this method.
Definition at line 64 of file dipolar_direct_sum.hpp.
References long_range_energy_cpu(), long_range_energy_gpu(), and m_is_gpu.
| double DipolarDirectSum::long_range_energy_cpu | ( | ) | const |
Calculate the interaction potential.
This employs a parallel N-square loop over all particle pairs.
Definition at line 387 of file dipolar_direct_sum.cpp.
References gather_particle_data(), get_n_cut(), System::Leaf< Class >::get_system(), image_sum(), m_is_gpu, n_replicas, and Dipoles::Actor< DipolarDirectSum >::prefactor.
Referenced by long_range_energy().
| void DipolarDirectSum::long_range_energy_gpu | ( | ) | const |
Definition at line 76 of file dipolar_direct_sum_gpu.cpp.
References DipolarDirectSum_kernel_wrapper_energy(), get_simulation_box(), System::Leaf< Class >::get_system(), Dipoles::Actor< DipolarDirectSum >::prefactor, and this_node.
Referenced by long_range_energy().
|
inline |
Definition at line 42 of file dipolar_direct_sum.hpp.
References m_is_gpu, and on_activation_gpu().
| void DipolarDirectSum::on_activation_gpu | ( | ) | const |
Definition at line 40 of file dipolar_direct_sum_gpu.cpp.
References GpuParticleData::prop::dip, GpuParticleData::prop::dip_fld, GpuParticleData::prop::force, System::Leaf< Class >::get_system(), GpuParticleData::prop::pos, and GpuParticleData::prop::torque.
Referenced by on_activation().
|
inline |
Definition at line 52 of file dipolar_direct_sum.hpp.
|
inline |
Definition at line 55 of file dipolar_direct_sum.hpp.
|
inline |
Definition at line 53 of file dipolar_direct_sum.hpp.
|
inline |
Definition at line 54 of file dipolar_direct_sum.hpp.
|
inline |
Definition at line 57 of file dipolar_direct_sum.hpp.
| bool DipolarDirectSum::m_is_gpu |
Definition at line 38 of file dipolar_direct_sum.hpp.
Referenced by add_long_range_forces(), add_long_range_forces_cpu(), DipolarDirectSum(), dipole_field_at_part_cpu(), is_gpu(), long_range_energy(), long_range_energy_cpu(), and on_activation().
| int DipolarDirectSum::n_replicas |
Definition at line 37 of file dipolar_direct_sum.hpp.
Referenced by add_long_range_forces_cpu(), add_long_range_forces_gpu(), DipolarDirectSum(), dipole_field_at_part_cpu(), and long_range_energy_cpu().