![]() |
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 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 38 of file dipolar_direct_sum.hpp.
Definition at line 609 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 75 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 156 of file dipolar_direct_sum.cpp.
References dipole_field_at_part_cpu(), gather_particle_data(), get_n_cut(), System::Leaf< Class >::get_system(), long_range_pressure(), m_is_gpu, make_image_shifts(), n_replicas, pair_force(), Dipoles::Actor< DipolarDirectSum >::prefactor, pressure_tensor, stream, 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, stream, 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 541 of file dipolar_direct_sum.cpp.
References dipole_field(), gather_particle_data(), get_n_cut(), System::Leaf< Class >::get_system(), m_is_gpu, make_image_shifts(), n_replicas, Dipoles::Actor< DipolarDirectSum >::prefactor, and stream.
Referenced by add_long_range_forces_cpu().
|
inline |
Definition at line 58 of file dipolar_direct_sum.hpp.
|
inline |
Definition at line 43 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 66 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 322 of file dipolar_direct_sum.cpp.
References gather_particle_data(), get_n_cut(), System::Leaf< Class >::get_system(), m_is_gpu, make_image_shifts(), n_replicas, pair_potential(), Dipoles::Actor< DipolarDirectSum >::prefactor, and stream.
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, stream, and this_node.
Referenced by long_range_energy().
| Utils::Vector9d DipolarDirectSum::long_range_pressure | ( | ) | const |
Calculate the dipolar pressure tensor.
Not implemented for the GPU variant: emits a runtime warning and returns a zero tensor in that case.
This employs a parallel N-square loop over all particle pairs. The dipole-dipole force is not central (unlike Coulomb), so the pair contribution to the virial only accounts for the force, not the torque, matching the convention used by DipolarP3M.
Definition at line 420 of file dipolar_direct_sum.cpp.
References Utils::flatten(), gather_particle_data(), get_n_cut(), System::Leaf< Class >::get_system(), m_is_gpu, make_image_shifts(), n_replicas, pair_force(), Dipoles::Actor< DipolarDirectSum >::prefactor, runtimeWarningMsg, stream, and Utils::tensor_product().
Referenced by add_long_range_forces_cpu().
|
inline |
Definition at line 44 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, stream, and GpuParticleData::prop::torque.
Referenced by on_activation().
|
inline |
Definition at line 54 of file dipolar_direct_sum.hpp.
|
inline |
Definition at line 57 of file dipolar_direct_sum.hpp.
|
inline |
Definition at line 55 of file dipolar_direct_sum.hpp.
|
inline |
Definition at line 56 of file dipolar_direct_sum.hpp.
|
inline |
Definition at line 59 of file dipolar_direct_sum.hpp.
| bool DipolarDirectSum::m_is_gpu |
Definition at line 40 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(), long_range_pressure(), and on_activation().
| int DipolarDirectSum::n_replicas |
Definition at line 39 of file dipolar_direct_sum.hpp.
Referenced by add_long_range_forces_cpu(), add_long_range_forces_gpu(), DipolarDirectSum(), dipole_field_at_part_cpu(), long_range_energy_cpu(), and long_range_pressure().