@@ -753,7 +753,7 @@ namespace BasisClasses
753753 double tpotx = v[6 ]*x/R - v[8 ]*y/R ;
754754 double tpoty = v[6 ]*y/R + v[8 ]*x/R ;
755755
756- return {v[0 ], v[1 ], v[2 ], v[3 ]*G , v[4 ]*G , v[5 ]*G , tpotx*G , tpoty*G , v[7 ]*G };
756+ return {v[0 ], v[1 ], v[2 ], v[3 ], v[4 ], v[5 ], tpotx, tpoty, v[7 ]};
757757 }
758758
759759 Spherical::BasisArray SphericalSL::getBasis
@@ -2053,9 +2053,9 @@ namespace BasisClasses
20532053 if (R>ortho->getRtable () or fabs (z)>ortho->getRtable ()) {
20542054 double r2 = R*R + z*z;
20552055 double r = sqrt (r2);
2056- pot0 = -totalMass/r;
2057- rpot = -totalMass*R/(r*r2 + 10.0 *std::numeric_limits<double >::min ());
2058- zpot = -totalMass*z/(r*r2 + 10.0 *std::numeric_limits<double >::min ());
2056+ pot0 = -G* totalMass/r;
2057+ rpot = -G* totalMass*R/(r*r2 + 10.0 *std::numeric_limits<double >::min ());
2058+ zpot = -G* totalMass*z/(r*r2 + 10.0 *std::numeric_limits<double >::min ());
20592059
20602060 return {den0, den1, den0+den1, pot0, pot1, pot0+pot1, rpot, zpot, ppot};
20612061 }
@@ -2158,8 +2158,8 @@ namespace BasisClasses
21582158 double r2 = R*R + z*z;
21592159 double r = sqrt (r2);
21602160
2161- rpot = -totalMass*R/(r*r2 + 10.0 *std::numeric_limits<double >::min ());
2162- zpot = -totalMass*z/(r*r2 + 10.0 *std::numeric_limits<double >::min ());
2161+ rpot = -G* totalMass*R/(r*r2 + 10.0 *std::numeric_limits<double >::min ());
2162+ zpot = -G* totalMass*z/(r*r2 + 10.0 *std::numeric_limits<double >::min ());
21632163
21642164 return {rpot, zpot, ppot};
21652165 }
@@ -2218,9 +2218,9 @@ namespace BasisClasses
22182218 }
22192219 }
22202220
2221- rpot *= -1.0 ;
2222- zpot *= -1.0 ;
2223- ppot *= -1.0 ;
2221+ rpot *= -G ;
2222+ zpot *= -G ;
2223+ ppot *= -G ;
22242224
22252225 double potx = rpot*x/R - ppot*y/R;
22262226 double poty = rpot*y/R + ppot*x/R;
@@ -2910,10 +2910,10 @@ namespace BasisClasses
29102910
29112911 den0 *= -1.0 ;
29122912 den1 *= -1.0 ;
2913- pot0 *= -1.0 ;
2914- pot1 *= -1.0 ;
2915- rpot *= -1.0 ;
2916- ppot *= -1.0 ;
2913+ pot0 *= -G ;
2914+ pot1 *= -G ;
2915+ rpot *= -G ;
2916+ ppot *= -G ;
29172917
29182918 return {den0, den1, den0+den1, pot0, pot1, pot0+pot1, rpot, zpot, ppot};
29192919 }
@@ -2977,8 +2977,8 @@ namespace BasisClasses
29772977 }
29782978 }
29792979
2980- rpot *= -1.0 ;
2981- ppot *= -1.0 ;
2980+ rpot *= -G ;
2981+ ppot *= -G ;
29822982
29832983
29842984 double potx = rpot*x/R - ppot*y/R;
@@ -3472,7 +3472,7 @@ namespace BasisClasses
34723472 }
34733473 }
34743474
3475- return {accx.real (), accy.real (), accz.real ()};
3475+ return {G* accx.real (), G* accy.real (), G* accz.real ()};
34763476 }
34773477
34783478
@@ -3483,7 +3483,7 @@ namespace BasisClasses
34833483
34843484 auto [pot, den, frcx, frcy, frcz] = eval (x, y, z);
34853485
3486- return {0 , den, den, 0 , pot, pot, frcx, frcy, frcz};
3486+ return {0 , den, den, 0 , pot*G , pot*G , frcx*G , frcy*G , frcz*G };
34873487 }
34883488
34893489 std::vector<double > Slab::cyl_eval (double R, double z, double phi)
@@ -3500,11 +3500,11 @@ namespace BasisClasses
35003500 double potp = -frcx*sin (phi) + frcy*cos (phi);
35013501 double potz = frcz;
35023502
3503- potR *= -1 ;
3504- potp *= -1 ;
3505- potz *= -1 ;
3503+ potR *= -G ;
3504+ potp *= -G ;
3505+ potz *= -G ;
35063506
3507- return {0 , den, den, 0 , pot, pot, potR, potz, potp};
3507+ return {0 , den, den, 0 , pot*G , pot*G , potR, potz, potp};
35083508 }
35093509
35103510 std::vector<double > Slab::sph_eval (double r, double costh, double phi)
@@ -3522,11 +3522,11 @@ namespace BasisClasses
35223522 double pott = frcx*cos (phi)*costh + frcy*sin (phi)*costh - frcz*sinth;
35233523 double potp = -frcx*sin (phi) + frcy*cos (phi);
35243524
3525- potr *= -1 ;
3526- pott *= -1 ;
3527- potp *= -1 ;
3525+ potr *= -G ;
3526+ pott *= -G ;
3527+ potp *= -G ;
35283528
3529- return {0 , den, den, 0 , pot, pot, potr, pott, potp};
3529+ return {0 , den, den, 0 , pot*G , pot*G , potr, pott, potp};
35303530 }
35313531
35323532
@@ -3841,7 +3841,7 @@ namespace BasisClasses
38413841 double frcy = -frc (1 ).real ();
38423842 double frcz = -frc (2 ).real ();
38433843
3844- return {0 , den1, den1, 0 , pot1, pot1, frcx, frcy, frcz};
3844+ return {0 , den1, den1, 0 , pot1*G , pot1*G , frcx*G , frcy*G , frcz*G };
38453845 }
38463846
38473847 std::vector<double > Cube::getAccel (double x, double y, double z)
@@ -3855,7 +3855,7 @@ namespace BasisClasses
38553855 // Get the basis fields
38563856 auto frc = ortho->get_force (expcoef, pos);
38573857
3858- return {-frc (0 ).real (), -frc (1 ).real (), -frc (2 ).real ()};
3858+ return {-G* frc (0 ).real (), -G* frc (1 ).real (), -G* frc (2 ).real ()};
38593859 }
38603860
38613861 std::vector<double > Cube::cyl_eval (double R, double z, double phi)
@@ -3873,7 +3873,7 @@ namespace BasisClasses
38733873 double den1 = ortho->get_dens (expcoef, pos).real ();
38743874 double pot1 = ortho->get_pot (expcoef, pos).real ();
38753875
3876- auto frc = ortho->get_force (expcoef, pos);
3876+ auto frc = ortho->get_force (expcoef, pos)*G ;
38773877
38783878 double frcx = frc (0 ).real (), frcy = frc (1 ).real (), frcz = frc (2 ).real ();
38793879
@@ -3902,7 +3902,7 @@ namespace BasisClasses
39023902
39033903 // Get the basis fields
39043904 double den1 = ortho->get_dens (expcoef, pos).real ();
3905- double pot1 = ortho->get_pot (expcoef, pos).real ();
3905+ double pot1 = ortho->get_pot (expcoef, pos).real () * G ;
39063906
39073907 auto frc = ortho->get_force (expcoef, pos);
39083908
@@ -3914,9 +3914,9 @@ namespace BasisClasses
39143914 double pott = frcx*cos (phi)*costh + frcy*sin (phi)*costh - frcz*sinth;
39153915 double potp = -frcx*sin (phi) + frcy*cos (phi);
39163916
3917- potr *= -1 ;
3918- pott *= -1 ;
3919- potp *= -1 ;
3917+ potr *= -G ;
3918+ pott *= -G ;
3919+ potp *= -G ;
39203920
39213921 return {0 , den1, den1, 0 , pot1, pot1, potr, pott, potp};
39223922 }
0 commit comments