MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Dipole Class Reference

#include <Dipole.h>

+ Inheritance diagram for Dipole:

Public Member Functions

 Dipole (int p, NumericalVector<> *squaredFactorials, Vec3D location, Vec3D velocity, Mdouble strength)
 
void computeMultipoleExpansion () final
 
Vec3D getLocation ()
 
- Public Member Functions inherited from Multipole
 Multipole (int p, NumericalVector<> *squaredFactorials, Vec3D location)
 
virtual ~Multipole ()
 
NumericalVector< std::complex
< Mdouble > > 
TranslateMultipoleExpansionTo (Vec3D location)
 
NumericalVector< std::complex
< Mdouble > > 
convertMultipoleToLocal (Vec3D location)
 
void addMultipoleCoefficients (NumericalVector< std::complex< Mdouble >> multipoleExpansionCoefficients)
 Adds multipole coefficients to an existing multipole todo: remove this function; it should not be required anymore. More...
 
NumericalVector< std::complex
< Mdouble > > 
getExpansionCoefficients ()
 
void setExpansionCoefficients (NumericalVector< std::complex< Mdouble >> multipoleExpansionCoefficients)
 
NumericalVectorgetSquaredFactorials ()
 
int getP ()
 

Private Attributes

Vec3D velocity_
 
Mdouble strength_
 

Additional Inherited Members

- Protected Attributes inherited from Multipole
int p_
 
NumericalVectorsquaredFactorials_
 
Vec3D location_
 
NumericalVector< std::complex
< Mdouble > > 
multipoleExpansionCoefficients_
 

Detailed Description

Definition at line 34 of file Dipole.h.

Constructor & Destructor Documentation

Dipole::Dipole ( int  p,
NumericalVector<> *  squaredFactorials,
Vec3D  location,
Vec3D  velocity,
Mdouble  strength 
)

Definition at line 32 of file Dipole.cc.

32  :
33  Multipole(p, squaredFactorials, location),
34  velocity_(velocity),
35  strength_(strength)
36 {
37 }
Vec3D velocity_
Definition: Dipole.h:47
Mdouble strength_
Definition: Dipole.h:48
Multipole(int p, NumericalVector<> *squaredFactorials, Vec3D location)
Definition: Multipole.cc:33

Member Function Documentation

void Dipole::computeMultipoleExpansion ( )
finalvirtual

Reimplemented from Multipole.

Definition at line 39 of file Dipole.cc.

References Vec3D::getComponent(), constants::i, Multipole::multipoleExpansionCoefficients_, Multipole::p_, strength_, and velocity_.

40 {
41  size_t nTerms = (p_ + 1) * (p_ + 1);
42  NumericalVector<std::complex<Mdouble>> multipoleExpansionCoefficients(nTerms);
43 
44  //Calculate dipole coefficients for spherical harmonics
48 
49  multipoleExpansionCoefficients[1] = 1.0 / std::sqrt(2.0) * (-s1 + s2 / constants::i);
50  multipoleExpansionCoefficients[2] = s3;
51  multipoleExpansionCoefficients[3] = -1.0 / (sqrt(2.0)) * (s1 + s2 / constants::i);
52 
53  multipoleExpansionCoefficients_ = multipoleExpansionCoefficients;
54 }
Vec3D velocity_
Definition: Dipole.h:47
Mdouble strength_
Definition: Dipole.h:48
double Mdouble
Definition: GeneralDefine.h:34
const std::complex< Mdouble > i
Definition: ExtendedMath.h:50
int p_
Definition: Multipole.h:71
NumericalVector< std::complex< Mdouble > > multipoleExpansionCoefficients_
Definition: Multipole.h:74
Mdouble getComponent(int index) const
Returns the requested component of this Vec3D.
Definition: Vector.cc:194
Vec3D Dipole::getLocation ( )
inline

Definition at line 41 of file Dipole.h.

References Multipole::location_.

42  {
43  return location_;
44  }
Vec3D location_
Definition: Multipole.h:73

Member Data Documentation

Mdouble Dipole::strength_
private

Definition at line 48 of file Dipole.h.

Referenced by computeMultipoleExpansion().

Vec3D Dipole::velocity_
private

Definition at line 47 of file Dipole.h.

Referenced by computeMultipoleExpansion().


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