Changeset 1218 in Sophya for trunk/SophyaLib/Samba/lambdaBuilder.cc
- Timestamp:
- Oct 3, 2000, 2:14:14 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/Samba/lambdaBuilder.cc
r729 r1218 1 1 #include "lambdaBuilder.h" 2 2 #include "nbconst.h" 3 4 5 /*! 6 \class SOPHYA::Legendre 7 generate Legendre polynomials : use in two steps : 8 9 a) instanciate Legendre(\f$x\f$, \f$lmax\f$) ; \f$x\f$ is the value for wich Legendre polynomials will be required (usually equal to \f$\cos \theta\f$) and \f$lmax\f$ is the MAXIMUM value of the order of polynomials wich will be required in the following code (all polynomials, from \f$l=0 to lmax\f$, are computed once for all by an iterative formula). 10 11 b) get the value of Legendre polynomial for a particular value of \f$l\f$ by calling the method getPl. 12 13 */ 3 14 4 15 … … 12 23 array_init(lmax); 13 24 } 25 26 /*! \fn void SOPHYA::Legendre::array_init(int_4 lmax) 27 28 compute all \f$P_l(x,l_{max})\f$ for \f$l=1,l_{max}\f$ 29 */ 14 30 void Legendre::array_init(int_4 lmax) 15 31 { … … 28 44 TVector<r_8>* LambdaLMBuilder::normal_l_ = NULL; 29 45 46 47 48 /*! \class SOPHYA::LambdaLMBuilder 49 50 51 This class generate the coefficients : 52 \f[ 53 \lambda_l^m=\sqrt{\frac{2l+1}{4\pi}\frac{(l-m)!}{(l+m)!}} 54 P_l^m(\cos{\theta}) 55 \f] 56 where \f$P_l^m\f$ are the associated Legendre polynomials. The above coefficients contain the theta-dependance of spheric harmonics : 57 \f[ 58 Y_{lm}(\cos{\theta})=\lambda_l^m(\cos{\theta}) e^{im\phi}. 59 \f] 60 61 Each object has a fixed theta (radians), and maximum l and m to be calculated 62 (lmax and mmax). 63 use the class in two steps : 64 a) instanciate LambdaLMBuilder(\f$\theta\f$, \f$lmax\f$, \f$mmax\f$) ; \f$lmax\f$ and \f$mmax\f$ are MAXIMUM values for which \f$\lambda_l^m\f$ will be required in the following code (all coefficients, from \f$l=0 to lmax\f$, are computed once for all by an iterative formula). 65 b) get the values of coefficients for particular values of \f$l\f$ and \f$m\f$ by calling the method lamlm. 66 */ 67 68 30 69 LambdaLMBuilder::LambdaLMBuilder(r_8 theta,int_4 lmax, int_4 mmax) 31 70 { … … 84 123 85 124 125 /*! \fn void SOPHYA::LambdaLMBuilder::updateArrayRecurrence(int_4 lmax) 126 127 compute a static array of coefficients independant from theta (common to all instances of the LambdaBuilder Class 128 */ 86 129 void LambdaLMBuilder::updateArrayRecurrence(int_4 lmax) 87 130 { … … 98 141 } 99 142 100 143 /*! \fn void SOPHYA::LambdaLMBuilder::updateArrayLamNorm() 144 145 compute static arrays of coefficients independant from theta (common to all instances of the derived classes 146 */ 101 147 void LambdaLMBuilder::updateArrayLamNorm() 102 148 { … … 119 165 120 166 167 /*! \class SOPHYA::LambdaWXBuilder 168 169 This class generates the coefficients : 170 \f[ 171 _{w}\lambda_l^m=-2\sqrt{\frac{2(l-2)!}{(l+2)!}\frac{(2l+1)}{4\pi}\frac{(l-m)!}{(l+m)!}} G^+_{lm} 172 \f] 173 \f[ 174 _{x}\lambda_l^m=-2\sqrt{\frac{2(l-2)!}{(l+2)!}\frac{(2l+1)}{4\pi}\frac{(l-m)!}{(l+m)!}}G^-_{lm} 175 \f] 176 where 177 \f[G^+_{lm}(\cos{\theta})=-\left( \frac{l-m^2}{\sin^2{\theta}}+\frac{1}{2}l\left(l-1\right)\right)P_l^m(\cos{\theta})+\left(l+m\right)\frac{\cos{\theta}}{\sin^2{\theta}}P^m_{l-1}(\cos{\theta}) 178 \f] 179 and 180 \f[G^-_{lm}(\cos{\theta})=\frac{m}{\sin^2{\theta}}\left(\left(l-1\right)\cos{\theta}P^m_l(\cos{\theta})-\left(l+m\right)P^m_{l-1}(\cos{\theta})\right) 181 \f] 182 \f$P_l^m\f$ are the associated Legendre polynomials. 183 184 The coefficients express the theta-dependance of the \f$W_{lm}(\cos{\theta})\f$ and \f$X_{lm}(\cos{\theta})\f$ functions : 185 \f[W_{lm}(\cos{\theta}) = \sqrt{\frac{(l+2)!}{2(l-2)!}}_w\lambda_l^m(\cos{\theta})e^{im\phi} 186 \f] 187 \f[X_{lm}(\cos{\theta}) = -i\sqrt{\frac{(l+2)!}{2(l-2)!}}_x\lambda_l^m(\cos{\theta})e^{im\phi} 188 \f] 189 where \f$W_{lm}(\cos{\theta})\f$ and \f$X_{lm}(\cos{\theta})\f$ are defined as : 190 191 \f[ 192 W_{lm}(\cos{\theta})=-\frac{1}{2}\sqrt{\frac{(l+2)!}{(l-2)!}}\left( 193 _{+2}Y_l^m(\cos{\theta})+_{-2}Y_l^m(\cos{\theta})\right) 194 \f] 195 \f[X_{lm}(\cos{\theta})=-\frac{i}{2}\sqrt{\frac{(l+2)!}{(l-2)!}}\left( 196 _{+2}Y_l^m(\cos{\theta})-_{-2}Y_l^m(\cos{\theta})\right) 197 \f] 198 199 */ 121 200 122 201 … … 173 252 } 174 253 254 /*! \class SOPHYA::LambdaPMBuilder 255 256 This class generates the coefficients 257 \f[ 258 _{\pm}\lambda_l^m=2\sqrt{\frac{(l-2)!}{(l+2)!}\frac{(2l+1)}{4\pi}\frac{(l-m)!}{(l+m)!}}\left( G^+_{lm} \mp G^-_{lm}\right) 259 \f] 260 where 261 \f[G^+_{lm}(\cos{\theta})=-\left( \frac{l-m^2}{\sin^2{\theta}}+\frac{1}{2}l\left(l-1\right)\right)P_l^m(\cos{\theta})+\left(l+m\right)\frac{\cos{\theta}}{\sin^2{\theta}}P^m_{l-1}(\cos{\theta}) 262 \f] 263 and 264 \f[G^-_{lm}(\cos{\theta})=\frac{m}{\sin^2{\theta}}\left(\left(l-1\right)\cos{\theta}P^m_l(\cos{\theta})-\left(l+m\right)P^m_{l-1}(\cos{\theta})\right) 265 \f] 266 and \f$P_l^m\f$ are the associated Legendre polynomials. 267 The coefficients express the theta-dependance of the spin-2 spherical harmonics : 268 \f[_{\pm2}Y_l^m(\cos{\theta})=_\pm\lambda_l^m(\cos{\theta})e^{im\phi} 269 \f] 270 */ 175 271 176 272 LambdaPMBuilder::LambdaPMBuilder(r_8 theta, int_4 lmax, int_4 mmax) : LambdaLMBuilder(theta, lmax, mmax)
Note:
See TracChangeset
for help on using the changeset viewer.