VM2D 1.14
Vortex methods for 2D flows simulation
Loading...
Searching...
No Matches
fmm::detail Namespace Reference

Classes

struct  anm_wrapper
 
struct  BinomNewton_wrapper
 
struct  knm_wrapper
 
struct  m2lcoef_wrapper
 

Functions

void InitMathConstants (int N)
 
double constexpr sqrtNewton (double x, double curr, double prev)
 
double constexpr constexpr_sqrt (double x)
 
void cudaCopyMathConstants ()
 
void cudaClearMathConstants ()
 

Variables

const int avx_vec_length = 4
 
const int _3d_MAX_MULTIPOLE_NUM = 18
 
const int _2d_MAX_MULTIPOLE_NUM = 9
 
constexpr BinomNewton_wrapper< 2 *_2d_MAX_MULTIPOLE_NUMbinom
 
constexpr knm_wrapper< _3d_MAX_MULTIPOLE_NUMKnm
 
constexpr anm_wrapper< _3d_MAX_MULTIPOLE_NUMAnm
 
constexpr m2lcoef_wrapper< _3d_MAX_MULTIPOLE_NUMm2lcoef
 
std::unordered_map< int, std::vector< double > > dmatrix
 
std::unordered_map< int, std::vector< std::complex< double > > > rotation_exponents
 
double * dev_dmatrix
 
int * dev_dm_map
 

Function Documentation

◆ constexpr_sqrt()

double constexpr fmm::detail::constexpr_sqrt ( double  x)
inlineconstexpr

Definition at line 51 of file special_functions.h.

52 {
53 return sqrtNewton(x, x, 0);
54 }
double constexpr sqrtNewton(double x, double curr, double prev)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cudaClearMathConstants()

void fmm::detail::cudaClearMathConstants ( )

◆ cudaCopyMathConstants()

void fmm::detail::cudaCopyMathConstants ( )

◆ InitMathConstants()

void fmm::detail::InitMathConstants ( int  N)

Definition at line 363 of file special_functions.cpp.

364{
365 for (int i = -3; i < 4; ++i)
366 for (int j = -3; j < 4; ++j)
367 for (int k = -3; k < 4; ++k) {
368 if (std::abs(i) <= 1 && std::abs(j) <= 1 && std::abs(k) <= 1)
369 continue;
370 auto rho = DecToSph(Vector3d(i, j, k));
371 auto theta = rho[1];
372 auto phi = rho[2];
373 auto key = doublehash(theta);
374 dmatrix[key] = ComputeWignerD(N, theta);
375 dmatrix[-key] = ComputeWignerD(N, -theta);
376 key = doublehash(phi);
377 rotation_exponents[key] = ComputeExp(N, phi);
378 rotation_exponents[-key] = ComputeExp(N, -phi);
379 }
380 //std::cout << dmatrix.size() << std::endl;
381}
std::unordered_map< int, std::vector< double > > dmatrix
std::unordered_map< int, std::vector< std::complex< double > > > rotation_exponents
std::vector< double > ComputeWignerD(int N, double theta)
Vector3d DecToSph(const Vector3d &vec)
std::vector< std::complex< double > > ComputeExp(int N, double phi)
int doublehash(double val)
Definition utils.h:124
Here is the call graph for this function:

◆ sqrtNewton()

double constexpr fmm::detail::sqrtNewton ( double  x,
double  curr,
double  prev 
)
inlineconstexpr

Definition at line 46 of file special_functions.h.

47 {
48 return (prev - curr) / curr < 1.e-16 && (prev - curr) / curr > -1.e-16 ? curr : sqrtNewton(x, 0.5 * (curr + x / curr), curr);
49 }
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ _2d_MAX_MULTIPOLE_NUM

const int fmm::detail::_2d_MAX_MULTIPOLE_NUM = 9

Definition at line 43 of file defs.h.

◆ _3d_MAX_MULTIPOLE_NUM

const int fmm::detail::_3d_MAX_MULTIPOLE_NUM = 18

Definition at line 42 of file defs.h.

◆ Anm

constexpr anm_wrapper<_3d_MAX_MULTIPOLE_NUM> fmm::detail::Anm
inlineconstexpr

Definition at line 116 of file special_functions.h.

◆ avx_vec_length

const int fmm::detail::avx_vec_length = 4
inline

Definition at line 13 of file avx.h.

◆ binom

constexpr BinomNewton_wrapper<2 * _2d_MAX_MULTIPOLE_NUM> fmm::detail::binom
constexpr

Definition at line 52 of file simple_math.h.

◆ dev_dm_map

int* fmm::detail::dev_dm_map
inline

Definition at line 151 of file special_functions.h.

◆ dev_dmatrix

double* fmm::detail::dev_dmatrix
inline

Definition at line 147 of file special_functions.h.

◆ dmatrix

std::unordered_map<int, std::vector<double> > fmm::detail::dmatrix
inline

Definition at line 145 of file special_functions.h.

◆ Knm

constexpr knm_wrapper<_3d_MAX_MULTIPOLE_NUM> fmm::detail::Knm
inlineconstexpr

Definition at line 85 of file special_functions.h.

◆ m2lcoef

constexpr m2lcoef_wrapper<_3d_MAX_MULTIPOLE_NUM> fmm::detail::m2lcoef
inlineconstexpr

Definition at line 138 of file special_functions.h.

◆ rotation_exponents

std::unordered_map<int, std::vector<std::complex<double> > > fmm::detail::rotation_exponents
inline

Definition at line 146 of file special_functions.h.