From 7a72431eb9e4d80820a22e8b4e551c8ef55cf374 Mon Sep 17 00:00:00 2001 From: Dave Goodwin Date: Mon, 24 Dec 2007 16:01:51 +0000 Subject: [PATCH] *** empty log message *** --- configure | 6 +-- configure.in | 6 +-- test_problems/spectroscopy/spectratest.cpp | 61 ++++++++++++++++------ 3 files changed, 52 insertions(+), 21 deletions(-) diff --git a/configure b/configure index 45948fdab..b4bef57a9 100755 --- a/configure +++ b/configure @@ -2465,10 +2465,10 @@ fi # # DEBUG_MODE: Specify that additional code be compiled in # that allows more debug printing where available. -# default = "y" +# default = "n" # -DEBUG_MODE=${DEBUG_MODE:="y"} -CANTERA_DEBUG_MODE=1 +DEBUG_MODE=${DEBUG_MODE:="n"} +CANTERA_DEBUG_MODE=0 if test "$DEBUG_MODE" = "y" -o "$DEBUG_MODE" = "Y" ; then cat >>confdefs.h <<\_ACEOF #define DEBUG_MODE 1 diff --git a/configure.in b/configure.in index 687dfdee0..42c07c9e1 100755 --- a/configure.in +++ b/configure.in @@ -396,10 +396,10 @@ AC_SUBST(sundials_include) # # DEBUG_MODE: Specify that additional code be compiled in # that allows more debug printing where available. -# default = "y" +# default = "n" # -DEBUG_MODE=${DEBUG_MODE:="y"} -CANTERA_DEBUG_MODE=1 +DEBUG_MODE=${DEBUG_MODE:="n"} +CANTERA_DEBUG_MODE=0 if test "$DEBUG_MODE" = "y" -o "$DEBUG_MODE" = "Y" ; then AC_DEFINE(DEBUG_MODE) CANTERA_DEBUG_MODE="1" diff --git a/test_problems/spectroscopy/spectratest.cpp b/test_problems/spectroscopy/spectratest.cpp index dc997ea0b..f72244bc9 100644 --- a/test_problems/spectroscopy/spectratest.cpp +++ b/test_problems/spectroscopy/spectratest.cpp @@ -6,20 +6,51 @@ using namespace std; using namespace Cantera; int main() { - double B; - double T; - cout << "enter B, T: "; - cin >> B >> T; - Rotor* r = new Rotor(B); - double theta = wnum_to_J(B)/Boltzmann; - cout << "theta = " << theta << endl; - double pop, cpop = 0.0; - for (int j = 0; j < 50; j++) { - pop = r->population(j, T); - cpop += pop; - if (cpop > 0.999) break; - cout << j << ", " << r->energy_w(j) << ", " - << r->frequency(j, j+1) << ", " - << pop << ", " << cpop << ", " << r->partitionFunction(T) << ", " << T/theta << endl; +// double B; +// double T; +// cout << "enter B, T: "; +// cin >> B >> T; +// Rotor* r = new Rotor(B); +// double theta = wnum_to_J(B)/Boltzmann; +// cout << "theta = " << theta << endl; +// double pop, cpop = 0.0; +// for (int j = 0; j < 50; j++) { +// pop = r->population(j, T); +// cpop += pop; +// if (cpop > 0.999) break; +// cout << j << ", " << r->energy_w(j) << ", " +// << r->frequency(j, j+1) << ", " +// << pop << ", " << cpop << ", " << r->partitionFunction(T) << ", " << T/theta << endl; +// } + + // test line broading classes + double gam = 2.0; + double sigma = 10.0; + + LineBroadener* lor = new Lorentzian(gam); + LineBroadener* gaus = new Gaussian(sigma); + LineBroadener* voig = new Voigt(sigma, gam); + + double nu0 = 1000.0; + double dnu = 0.2; + double nu; + double gw = gaus->width(); + double sum = 0.0, sumg = 0.0, sumlor = 0.0; + for (int n = -1000; n < 1000; n++) { + //cout << n << endl; + nu = n*dnu; + sumg += gaus->profile(nu)*dnu; + sum += voig->profile(nu)*dnu; + sumlor += lor->profile(nu)*dnu; + try { + cout << nu << ", " << (*lor)(nu) << ", " << (*gaus)(nu) + << ", " << (*voig)(nu) << endl; + } + catch (CanteraError) { + showErrors(); + } } + cout << "Voigt area = " << sum << endl; + cout << "Gaussian area = " << sumg << endl; + cout << "Lorentzian area = " << sumlor << endl; }