![]() |
ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
#include "config/config.hpp"#include "magnetostatics/dipolar_direct_sum.hpp"#include "BoxGeometry.hpp"#include "cells.hpp"#include "communication.hpp"#include "errorhandling.hpp"#include "system/System.hpp"#include <utils/cartesian_product.hpp>#include <utils/math/sqr.hpp>#include <utils/mpi/iall_gatherv.hpp>#include <boost/mpi/collectives.hpp>#include <boost/mpi/communicator.hpp>#include <mpi.h>#include <algorithm>#include <cassert>#include <cmath>#include <iterator>#include <ranges>#include <stdexcept>#include <tuple>#include <utility>#include <vector>
Include dependency graph for dipolar_direct_sum.cpp:Go to the source code of this file.
Classes | |
| struct | PosMom |
| Position and dipole moment of one particle. More... | |
|
static |
Dipole field contribution from a particle with dipole moment m1 at a distance d.
| d | Distance vector. |
| m1 | Dipole moment of one particle. |
Definition at line 116 of file dipolar_direct_sum.cpp.
References stream.
Call kernel for every 3d index in a sphere around the origin.
This calls a callable for all index-triples that are within ball around the origin with radius |ncut|.
| F | Callable |
| ncut | Limits in the three directions, all non-zero elements have to be the same number. |
| f | will be called for each index triple within the limits of ncut. |
Definition at line 141 of file dipolar_direct_sum.cpp.
References Utils::cartesian_product(), Utils::Vector< T, N >::norm2(), and stream.
Referenced by DipolarDirectSum::add_long_range_forces(), and image_sum().
|
static |
Definition at line 223 of file dipolar_direct_sum.cpp.
References comm_cart, BoxGeometry::folded_position(), Utils::Mpi::iall_gatherv(), ParticleRange::size(), and stream.
Referenced by DipolarDirectSum::add_long_range_forces(), DipolarDirectSum::dipole_field_at_part(), and DipolarDirectSum::long_range_energy().
|
static |
Definition at line 263 of file dipolar_direct_sum.cpp.
References BoxGeometry::periodic().
Referenced by DipolarDirectSum::add_long_range_forces(), DipolarDirectSum::dipole_field_at_part(), and DipolarDirectSum::long_range_energy().
| T image_sum | ( | InputIterator | begin, |
| InputIterator | end, | ||
| InputIterator | it, | ||
| bool | with_replicas, | ||
| Utils::Vector3i const & | ncut, | ||
| BoxGeometry const & | box_geo, | ||
| T | init, | ||
| F | f | ||
| ) |
Sum over all pairs with periodic images.
This implements the "primed" pair sum, the sum over all pairs between one particles and all other particles, including ncut periodic replicas in each direction. Primed means that in the primary replica the self-interaction is excluded, but not with the other periodic replicas. E.g. a particle does not interact with its self, but does with its periodically shifted versions.
| begin | Iterator pointing to begin of particle range |
| end | Iterator pointing past the end of particle range |
| it | Pointer to particle that is considered |
| with_replicas | If periodic replicas are to be considered at all. If false, distances are calculated as Euclidean distances, and not using minimum image convention. |
| ncut | Number of replicas in each direction. |
| box_geo | Box geometry. |
| init | Initial value of the sum. |
| f | Binary operation mapping distance and moment of the interaction partner to the value to be summed up for this pair. |
Definition at line 199 of file dipolar_direct_sum.cpp.
References for_each_image(), BoxGeometry::get_mi_vector(), BoxGeometry::length(), and stream.
Referenced by DipolarDirectSum::add_long_range_forces(), DipolarDirectSum::dipole_field_at_part(), and DipolarDirectSum::long_range_energy().
|
static |
Pair force of two interacting dipoles.
| d | Distance vector. |
| m1 | Dipole moment of one particle. |
| m2 | Dipole moment of the other particle. |
Definition at line 62 of file dipolar_direct_sum.cpp.
References Utils::Vector< T, N >::norm2(), stream, and vector_product().
Referenced by DipolarDirectSum::add_long_range_forces(), and calc_bonded_virial_pressure_tensor().
|
static |
Pair potential for two interacting dipoles.
| d | Distance vector. |
| m1 | Dipole moment of one particle. |
| m2 | Dipole moment of the other particle. |
Definition at line 92 of file dipolar_direct_sum.cpp.
References stream.