ls1-MarDyn
ls1-MarDyn molecular dynamics code
|
#include <SolidHarmonicsExpansion.h>
Public Member Functions | |
SolidHarmonicsExpansion (int order, bool initializeToZero=true) | |
SolidHarmonicsExpansion (const SolidHarmonicsExpansion &rhs) | |
virtual | ~SolidHarmonicsExpansion () |
SolidHarmonicsExpansion & | operator= (SolidHarmonicsExpansion RHS) |
SolidHarmonicsExpansion & | operator+= (const SolidHarmonicsExpansion &RHS) |
SolidHarmonicsExpansion & | operator*= (double scalar) |
void | clear () |
void | evaluateLOfR (Vector3< double > r) |
void | evaluateMOfR (Vector3< double > r) |
void | convoluteLL (const SolidHarmonicsExpansion &LE1, const SolidHarmonicsExpansion &LE2) |
void | convoluteLL_Z (const SolidHarmonicsExpansion &LE1, const SolidHarmonicsExpansion &LE2) |
void | convoluteLM (const SolidHarmonicsExpansion &LE, const SolidHarmonicsExpansion &ME) |
void | convoluteLM_Z (const SolidHarmonicsExpansion &LE, const SolidHarmonicsExpansion &ME) |
void | convoluteL_ZM (const SolidHarmonicsExpansion &LE, const SolidHarmonicsExpansion &ME) |
void | scaleL (double factor) |
void | scaleM (double factor) |
void | rotatePhi (const double *CosSinPhi, int negate) |
void | convoluteWL (const WignerMatrix &W, const SolidHarmonicsExpansion &LE) |
void | convoluteWM (const WignerMatrix &W, const SolidHarmonicsExpansion &ME) |
void | clearMonopole () |
void | setAtMinusR () |
int | getOrder () const |
double & | getC (int l, int m) |
double & | get_C (unsigned l, unsigned m) |
double & | getS (int l, int m) |
double & | get_S (unsigned l, unsigned m) |
int | getNumEntries () const |
void | print () const |
void | writeValuesToMPIBuffer (double *buf, int &position) const |
void | readValuesFromMPIBuffer (double *buf, int &position) |
void | addValuesFromMPIBuffer (double *buf, int &position) |
Protected Attributes | |
int | _order |
Friends | |
void | swap (SolidHarmonicsExpansion &s1, SolidHarmonicsExpansion &s2) |
double | potentialML (const SolidHarmonicsExpansion &ME, const SolidHarmonicsExpansion &LE) |
Vector3< double > | forceGradLAndM (const SolidHarmonicsExpansion &LE, const SolidHarmonicsExpansion &ME) |
Vector3< double > | forceLAndGradM (const SolidHarmonicsExpansion &LE, const SolidHarmonicsExpansion &ME) |
Implements a multipole or local expansion in Solid Harmonics. All formulas follow the notation and code of D.C. Rapaport, "The Art of Molecular Dynamics Simulation", Chapter 13.4.
Makes use of two triangular matrices (SolidHarmonicsStorage objects) for the real and imaginary part (or (-imaginary), see formula 13.4.9 in Rapaport).
bhfmm::SolidHarmonicsExpansion::SolidHarmonicsExpansion | ( | int | order, |
bool | initializeToZero = true |
||
) |
constructor
order | order of the expansion |
initializeToZero | if true, values are set to zero |
bhfmm::SolidHarmonicsExpansion::SolidHarmonicsExpansion | ( | const SolidHarmonicsExpansion & | rhs | ) |
copy constructor
rhs |
|
virtual |
destructor
void bhfmm::SolidHarmonicsExpansion::clear | ( | ) |
clear expansion - set all entries to zero
void bhfmm::SolidHarmonicsExpansion::clearMonopole | ( | ) |
set monopole entry to zero needed for periodic boundary conditions
void bhfmm::SolidHarmonicsExpansion::convoluteL_ZM | ( | const SolidHarmonicsExpansion & | LE, |
const SolidHarmonicsExpansion & | ME | ||
) |
convolution of an L and an M expansion, where L in considered to be evaluated at a direction vector that is parallel to the z-axis. result is again an L expansion. needed for M2M
LE1 | |
LE2 |
void bhfmm::SolidHarmonicsExpansion::convoluteLL | ( | const SolidHarmonicsExpansion & | LE1, |
const SolidHarmonicsExpansion & | LE2 | ||
) |
convolution of two L-type expansions. result is again an L expansion. needed for M2M implements 13.4.38
LE1 | |
LE2 |
void bhfmm::SolidHarmonicsExpansion::convoluteLL_Z | ( | const SolidHarmonicsExpansion & | LE1, |
const SolidHarmonicsExpansion & | LE2 | ||
) |
convolution of two L-type expansions, where LE2 in considered to be evaluated at a direction vector that is parallel to the z-axis. result is again an L expansion. needed for M2M implements 13.4.38
LE1 | |
LE2 |
void bhfmm::SolidHarmonicsExpansion::convoluteLM | ( | const SolidHarmonicsExpansion & | LE, |
const SolidHarmonicsExpansion & | ME | ||
) |
convolution of an L and an M expansion result is an M expansion. needed for M2M, L2L implements 13.4.42
LE | |
ME |
void bhfmm::SolidHarmonicsExpansion::convoluteLM_Z | ( | const SolidHarmonicsExpansion & | LE, |
const SolidHarmonicsExpansion & | ME | ||
) |
convolution of an L and an M expansion, where M in considered to be evaluated at a direction vector that is parallel to the z-axis. result is again an L expansion. needed for M2L
LE1 | |
LE2 |
void bhfmm::SolidHarmonicsExpansion::evaluateLOfR | ( | Vector3< double > | r | ) |
evaluate L expansion at a given position implements 13.4.16-20
r | the position vector |
void bhfmm::SolidHarmonicsExpansion::evaluateMOfR | ( | Vector3< double > | r | ) |
evaluate M expansion at a given position implements 13.4.16-18
r | the position vector |
|
inline |
Access to C values directly. Intended to be used only for MPI communication.
l | |
m |
|
inline |
|
inline |
Access to S values directly. Intended to be used only for MPI communication.
l | |
m |
SolidHarmonicsExpansion & bhfmm::SolidHarmonicsExpansion::operator*= | ( | double | scalar | ) |
operator *= scalar multiplication
scalar |
SolidHarmonicsExpansion & bhfmm::SolidHarmonicsExpansion::operator+= | ( | const SolidHarmonicsExpansion & | RHS | ) |
operator+= entrywise addition
RHS |
SolidHarmonicsExpansion & bhfmm::SolidHarmonicsExpansion::operator= | ( | SolidHarmonicsExpansion | RHS | ) |
operator= entrywise copy
RHS |
void bhfmm::SolidHarmonicsExpansion::print | ( | ) | const |
For debugging
void bhfmm::SolidHarmonicsExpansion::scaleL | ( | double | factor | ) |
scale an L expansion to a different pseudoparticle size needed for periodic boundary conditions (coming soon)
factor | the factor by which the expansion should be scaled |
void bhfmm::SolidHarmonicsExpansion::scaleM | ( | double | factor | ) |
scale an L expansion to a different pseudoparticle size needed for periodic boundary conditions (coming soon)
factor |
void bhfmm::SolidHarmonicsExpansion::setAtMinusR | ( | ) |
given an L or M expansion, evaluated at position (R), set it to the value it would have, if evaluated at (-R) implements 13.4.6 from Rapaport.
|
inline |
write values of expansion to a double buffer for sending through MPI
buf | buffer to write to |
position | index at which next entry should be written, note that it's value is updated! |
|
friend |
the force due to a local expansion: needed for L2P implements 13.4.33-35
LE | gradient of L expansion is calculated |
ME | the M expansion |
|
friend |
the force due to a multipole expansion: needed for M2P The formula is not given in Rapaport. Took it from Perez-Jorda and Yang. "A concise redefinition of the solid spherical harmonics and its use in fast multipole methods". In: The Journal of chemical physics 104.20 (1996)
LE | L expansion |
ME | gradient of M expansion is calculated |
|
friend |
the potential due to an M and an L expansion implements 13.4.10
ME | the M expansion |
LE | the L expansion |
|
friend |
swap function for the copy and swap idiom
s1 | |
s2 |