SphericalMonomials

class SphericalMonomials : public SphericalBase

Public Functions

SphericalMonomials(unsigned L_degree)

Sets up class for monomial basis on sphere up to degree L. The basis then consists of N = L.

Parameters
  • L_degree: maximum degree of spherical harmonics basis, 0 <= L <= 1000 (upper bound due to numerical stability)

SphericalMonomials(unsigned L_degree, unsigned short spatialDim)

Sets up class for monomial basis on sphere up to degree L. The basis then consists of N = L.

Parameters
  • L_degree: maximum degree of spherical harmonics basis, 0 <= L <= 1000 (upper bound due to numerical stability)

  • spatialDim: spatial dimensioniality of the simulation

Vector ComputeSphericalBasis(double my, double phi, double r = 1.0) override

Computes all N = L² +2L basis functions at point (my, phi)

Return

vector of basis functions at point (my, phi) with size N = L² +2L

Parameters
  • my: cos(theta) - spherical coordinate, -1 <= x <= 1

  • phi: spherical coordinate, 0 <= phi <= 2*pi

  • r: radius of sphere, default is 1, i.e. unit sphere

Vector ComputeSphericalBasisKarthesian(double x, double y, double z) override

Computes all N = L² +2L basis functions at point (x, y, z) on the unit sphere.

Return

vector of basis functions at point (x,y,z) with size N = L² +2L

Parameters
  • x: = coordinates on sphere

  • y: = coordinates on sphere

  • z: = coordinates on sphere

unsigned GetBasisSize() override

Computes the length of the basis vector for a given max degree and spatial dimension dim. len of a single oder: (degree + _spatialDim -1) over (degree)

Return

lenght of whole basis

unsigned GetCurrDegreeSize(unsigned currDegreeL) override

Computes the amount of lin. independent monomials of degree currDegreeL and spatial dimension dim. len of a single oder: (currDegreeL + _spatialDim -1) over (currDegreeL)

Return

lenght of a single dimension

Parameters
  • currDegreeL: = degree of polynomials that are counted

unsigned GetGlobalIndexBasis(int l_degree, int k_order) override

Computes global index of basis vector depending on order k and degree l.

Parameters
  • l_degree: degree of polynomials l = 0,1,2,3,…

  • k_order: order of element of degree l. 0 <=k <=GetCurrDegreeSize(l)

Private Functions

unsigned Factorial(unsigned n)

Function to compute factorial of n (n!) in recursive manner.

double Omega_x(double my, double phi, double r = 1.0)

Function to compute first component of spherical unit vector Omega_x = r* sqrt(1-my*my)*cos(phi)

Return

first component of spherical unit vector

double Omega_y(double my, double phi, double r = 1.0)

Function to compute first component of spherical unit vector Omega_x = r* sqrt(1-my*my)*sin(phi)

Return

first component of spherical unit vector

double Omega_z(double my, double r = 1.0)

Function to compute first component of spherical unit vector Omega_z = r* my.

Return

first component of spherical unit vector

double Power(double basis, unsigned exponent)

Helper Function to compute basis^exponent.

Vector ComputeSphericalBasis1D(double my, double r = 1.0)

Helper to compute the basis in 1D, 2D or 3D, depending on choice of _spatialDim.

Only Z achsis of the 3D case

Vector ComputeSphericalBasis2D(double my, double phi, double r = 1.0)

Only X and Y achsis of the 3D case.

Private Members

Vector _YBasis

spherical monomial basis function vector of degree 0 <= l <= L length : COmputed with ComputeBasisSize