ls1-MarDyn
ls1-MarDyn molecular dynamics code
Public Member Functions | Protected Attributes | Friends | List of all members
bhfmm::SolidHarmonicsExpansion Class Reference

#include <SolidHarmonicsExpansion.h>

Public Member Functions

 SolidHarmonicsExpansion (int order, bool initializeToZero=true)
 
 SolidHarmonicsExpansion (const SolidHarmonicsExpansion &rhs)
 
virtual ~SolidHarmonicsExpansion ()
 
SolidHarmonicsExpansionoperator= (SolidHarmonicsExpansion RHS)
 
SolidHarmonicsExpansionoperator+= (const SolidHarmonicsExpansion &RHS)
 
SolidHarmonicsExpansionoperator*= (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)
 

Detailed Description

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).

Constructor & Destructor Documentation

◆ SolidHarmonicsExpansion() [1/2]

bhfmm::SolidHarmonicsExpansion::SolidHarmonicsExpansion ( int  order,
bool  initializeToZero = true 
)

constructor

Parameters
orderorder of the expansion
initializeToZeroif true, values are set to zero

◆ SolidHarmonicsExpansion() [2/2]

bhfmm::SolidHarmonicsExpansion::SolidHarmonicsExpansion ( const SolidHarmonicsExpansion rhs)

copy constructor

Parameters
rhs

◆ ~SolidHarmonicsExpansion()

bhfmm::SolidHarmonicsExpansion::~SolidHarmonicsExpansion ( )
virtual

destructor

Member Function Documentation

◆ clear()

void bhfmm::SolidHarmonicsExpansion::clear ( )

clear expansion - set all entries to zero

◆ clearMonopole()

void bhfmm::SolidHarmonicsExpansion::clearMonopole ( )

set monopole entry to zero needed for periodic boundary conditions

◆ convoluteL_ZM()

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

Parameters
LE1
LE2

◆ convoluteLL()

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

Parameters
LE1
LE2

◆ convoluteLL_Z()

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

Parameters
LE1
LE2

◆ convoluteLM()

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

Parameters
LE
ME

◆ convoluteLM_Z()

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

Parameters
LE1
LE2

◆ evaluateLOfR()

void bhfmm::SolidHarmonicsExpansion::evaluateLOfR ( Vector3< double >  r)

evaluate L expansion at a given position implements 13.4.16-20

Parameters
rthe position vector

◆ evaluateMOfR()

void bhfmm::SolidHarmonicsExpansion::evaluateMOfR ( Vector3< double >  r)

evaluate M expansion at a given position implements 13.4.16-18

Parameters
rthe position vector

◆ getC()

double& bhfmm::SolidHarmonicsExpansion::getC ( int  l,
int  m 
)
inline

Access to C values directly. Intended to be used only for MPI communication.

Parameters
l
m
Returns
value at (l,m)

◆ getOrder()

int bhfmm::SolidHarmonicsExpansion::getOrder ( ) const
inline
Returns
the order of the expansion

◆ getS()

double& bhfmm::SolidHarmonicsExpansion::getS ( int  l,
int  m 
)
inline

Access to S values directly. Intended to be used only for MPI communication.

Parameters
l
m
Returns
value at (l,m)

◆ operator*=()

SolidHarmonicsExpansion & bhfmm::SolidHarmonicsExpansion::operator*= ( double  scalar)

operator *= scalar multiplication

Parameters
scalar
Returns

◆ operator+=()

SolidHarmonicsExpansion & bhfmm::SolidHarmonicsExpansion::operator+= ( const SolidHarmonicsExpansion RHS)

operator+= entrywise addition

Parameters
RHS
Returns

◆ operator=()

SolidHarmonicsExpansion & bhfmm::SolidHarmonicsExpansion::operator= ( SolidHarmonicsExpansion  RHS)

operator= entrywise copy

Parameters
RHS
Returns

◆ print()

void bhfmm::SolidHarmonicsExpansion::print ( ) const

For debugging

◆ scaleL()

void bhfmm::SolidHarmonicsExpansion::scaleL ( double  factor)

scale an L expansion to a different pseudoparticle size needed for periodic boundary conditions (coming soon)

Parameters
factorthe factor by which the expansion should be scaled

◆ scaleM()

void bhfmm::SolidHarmonicsExpansion::scaleM ( double  factor)

scale an L expansion to a different pseudoparticle size needed for periodic boundary conditions (coming soon)

Parameters
factor

◆ setAtMinusR()

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.

◆ writeValuesToMPIBuffer()

void bhfmm::SolidHarmonicsExpansion::writeValuesToMPIBuffer ( double *  buf,
int &  position 
) const
inline

write values of expansion to a double buffer for sending through MPI

Parameters
bufbuffer to write to
positionindex at which next entry should be written, note that it's value is updated!

Friends And Related Function Documentation

◆ forceGradLAndM

Vector3<double> forceGradLAndM ( const SolidHarmonicsExpansion LE,
const SolidHarmonicsExpansion ME 
)
friend

the force due to a local expansion: needed for L2P implements 13.4.33-35

Parameters
LEgradient of L expansion is calculated
MEthe M expansion
Returns
force vector

◆ forceLAndGradM

Vector3<double> forceLAndGradM ( const SolidHarmonicsExpansion LE,
const SolidHarmonicsExpansion ME 
)
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)

Parameters
LEL expansion
MEgradient of M expansion is calculated
Returns

◆ potentialML

double potentialML ( const SolidHarmonicsExpansion ME,
const SolidHarmonicsExpansion LE 
)
friend

the potential due to an M and an L expansion implements 13.4.10

See also
SolidHarmonicsExpansion
Parameters
MEthe M expansion
LEthe L expansion
Returns
potential

◆ swap

void swap ( SolidHarmonicsExpansion s1,
SolidHarmonicsExpansion s2 
)
friend

swap function for the copy and swap idiom

Parameters
s1
s2

The documentation for this class was generated from the following files: