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

Constructor & Destructor Documentation

◆ Dipole()

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

Member Function Documentation

◆ computeMultipoleExpansion()

void Dipole::computeMultipoleExpansion ( )
finalvirtual

Reimplemented from Multipole.

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 }
double Mdouble
Definition: GeneralDefine.h:34
NumericalVector< std::complex< Mdouble > > multipoleExpansionCoefficients_
Definition: Multipole.h:74
int p_
Definition: Multipole.h:71
Definition: NumericalVector.h:64
Mdouble getComponent(int index) const
Returns the requested component of this Vec3D.
Definition: Vector.cc:194
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51

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

◆ getLocation()

Vec3D Dipole::getLocation ( )
inline
42  {
43  return location_;
44  }
Vec3D location_
Definition: Multipole.h:73

References Multipole::location_.

Member Data Documentation

◆ strength_

Mdouble Dipole::strength_
private

◆ velocity_

Vec3D Dipole::velocity_
private

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