Permalink
Browse files

Some additional debugging. (Mainly generate extra output).

  • Loading branch information...
1 parent ce93f5e commit b67a110929802a5c97e16b9a9300e5aad16df225 Martijn Wehrens committed Mar 13, 2012
Showing with 34 additions and 5 deletions.
  1. +30 −4 GreensFunction2DRadAbs.cpp
  2. +3 −1 GreensFunction2DRadAbs.hpp
  3. +1 −0 greens_functions.cpp
View
@@ -110,12 +110,14 @@ void GreensFunction2DRadAbs::clearAlphaTable() const
const Real
GreensFunction2DRadAbs::f_alpha0( const Real alpha ) const
{
+
const Real a( this->geta() );
const Real sigma( getSigma() );
const Real h( this->geth() );
const Real s_An( sigma * alpha );
const Real a_An( a * alpha );
-// const Real h_s( h * sigma);
+ // Needed? TODO
+ const Real h_s( h * sigma);
const double J0_s_An (gsl_sf_bessel_J0(s_An));
const double J1_s_An (gsl_sf_bessel_J1(s_An));
@@ -125,15 +127,24 @@ GreensFunction2DRadAbs::f_alpha0( const Real alpha ) const
const double Y1_s_An (gsl_sf_bessel_Y1(s_An));
const double Y0_a_An (gsl_sf_bessel_Y0(a_An));
-// const double rho1 ( ( (h_s * J0_s_An) + (s_An * J1_s_An) ) * Y0_a_An );
+// const double rho1 ( ( (h_s * J0_s_An) + (s_An * J1_s_An) ) * Y0_a_An );
// const double rho2 ( ( (h_s * Y0_s_An) + (s_An * Y1_s_An) ) * J0_a_An );
// return (rho1 - rho2);
+
//
// Sigma can be divided out, roots will remain same:
-
+// TODO, WILL THEY? ????? YUP
const double rho1 ( ( (h * J0_s_An) + (alpha * J1_s_An) ) * Y0_a_An );
const double rho2 ( ( (h * Y0_s_An) + (alpha * Y1_s_An) ) * J0_a_An );
+
+// std::cerr << "Term 1 (" << (h * J0_s_An) ;
+// std::cerr << ") plus term 2 (" << (alpha * J1_s_An) << ").\n" ;
+
+// std::cerr << "ALT 1 (" << (h_s * J0_s_An) ;
+// std::cerr << ") plus ALT 2 (" << (s_An * J1_s_An) << ").\n" ;
+
return rho1 - rho2;
+
}
@@ -513,7 +524,8 @@ GreensFunction2DRadAbs::getAlphaRoot0( const Real low, // root lies between low
EPSILON/L_TYPICAL, EPSILON, "GreensFunction2DRadAbs::getAlphaRoot0" ) );
gsl_root_fsolver_free( solver );
- return alpha;
+ const Real sigma(getSigma());
+ return alpha;
}
// This function calls the GSL root finder, for roots for which n > 0. (n = 0 is
@@ -1637,6 +1649,20 @@ Real GreensFunction2DRadAbs::givePDFR( const Real r, const Real t ) const
return PDF;
}
+void GreensFunction2DRadAbs::dumpRoots( int n )
+{
+// return this->alphaTable[n];
+ std::cout << "Roots are: {";
+
+ const int size( alphaTable.size() );
+ RealVector& alphaTable( this->alphaTable[n] );
+
+ for (int i = 0; i < size; i++) {
+ std::cout << alphaTable[i] << ",";
+ }
+ std::cout << "}.\n";
+}
+
// It is used by the drawTheta method
// It uses the p_nTable for it to speed things up
/*
@@ -57,7 +57,7 @@ class GreensFunction2DRadAbs
// Left boundary of 1st search interval 1st root
static const Real SCAN_START = 0.001;
// Length of the scanning interval relative to estimated interval
- static const Real FRACTION_SCAN_INTERVAL = .5;
+ static const Real FRACTION_SCAN_INTERVAL = .5; // TODO CHANGED THIS FROM .5 to .2
// Other paramters
// After CONVERGENCE_ASSUMED subsequent roots that lay within +/-
@@ -194,6 +194,8 @@ class GreensFunction2DRadAbs
const Real t ) const;
Real givePDFR( const Real r, const Real t ) const;
+
+ void dumpRoots( int n );
protected:
View
@@ -158,6 +158,7 @@ BOOST_PYTHON_MODULE( _greens_functions )
// DEBUG: TODO REMOVE?
.def( "givePDFR", &GreensFunction2DRadAbs::givePDFR )
.def( "givePDFTheta", &GreensFunction2DRadAbs::givePDFTheta )
+ .def( "dumpRoots", &GreensFunction2DRadAbs::dumpRoots )
;
class_<GreensFunction3DSym>("GreensFunction3DSym", init<Real>())

0 comments on commit b67a110

Please sign in to comment.