This merge skips some of the source tree rearrangement from the autotools branch, so the autotools build system is not presently working. Conflicts: Cantera/cxx/include/kinetics.h Cantera/cxx/include/zerodim.h Cantera/cxx/src/Cantera.h Cantera/cxx/src/importPhase.cpp Cantera/cxx/src/importPhase.h Cantera/cxx/src/thermo.h Cantera/cxx/src/transport.h Cantera/ext/f2c_libs/arith.hwin32 Cantera/ext/f2c_libs/arithchk.c Cantera/ext/f2c_libs/ftell64_.c Cantera/ext/f2c_libs/pow_qq.c Cantera/ext/f2c_libs/qbitbits.c Cantera/ext/f2c_libs/qbitshft.c Cantera/ext/f2c_math/mkl_cblas.h Cantera/ext/f2c_recipes/Makefile.in Cantera/ext/f2c_recipes/simp1.c Cantera/ext/f2c_recipes/simp2.c Cantera/ext/f2c_recipes/simp3.c Cantera/ext/f2c_recipes/simplx.c Cantera/ext/f2c_recipes/splie2.c Cantera/ext/f2c_recipes/splin2.c Cantera/ext/f2c_recipes/spline.c Cantera/ext/f2c_recipes/splint.c Cantera/ext/recipes/Makefile.in Cantera/ext/recipes/simp1.f Cantera/ext/recipes/simp2.f Cantera/ext/recipes/simp3.f Cantera/ext/recipes/simplx.f Cantera/ext/recipes/splie2.f Cantera/ext/recipes/splin2.f Cantera/ext/recipes/spline.f Cantera/ext/recipes/splint.f Cantera/ext/tpx/CMakeLists.txt Cantera/ext/tpx/ideal.cpp Cantera/ext/tpx/lkw.cpp Cantera/ext/tpx/lkw.h Cantera/src/base/config.h.in Cantera/src/converters/ck2ctml.cpp Cantera/src/converters/ck2ctml.h Cantera/src/numerics/NonlinearSolver.cpp Cantera/src/numerics/ctlapack.h Cantera/src/numerics/sort.cpp ChangeLog License.rtf docs/install_examples/cygwin_gcc344_f2c_numeric.sh docs/install_examples/linux.64_sierra_gcc444_python264_numpy docs/install_examples/linux_rhel5_64_gcc424_dbg_python264_numpy docs/install_examples/sol10_64bit_CC57_py24_numarray examples/cxx/flame1.cpp ext/f2c_libs/arithchk.c ext/f2c_libs/arithchk/arithchk.c ext/math/gmres.h test_problems/ChemEquil_gri_pairs/runtest test_problems/ChemEquil_ionizedGas/runtest test_problems/ChemEquil_red1/basopt_red1.cpp test_problems/VCSnonideal/NaCl_equil/Makefile.in test_problems/VPsilane_test/runtest test_problems/cathermo/DH_graph_1/runtest test_problems/cathermo/DH_graph_NM/runtest test_problems/cathermo/DH_graph_Pitzer/runtest test_problems/cathermo/DH_graph_acommon/runtest test_problems/cathermo/DH_graph_bdotak/runtest test_problems/cathermo/HMW_dupl_test/runtest test_problems/cathermo/HMW_graph_GvI/HMW_graph_GvI.cpp test_problems/cathermo/HMW_graph_GvT/HMW_graph_GvT.cpp test_problems/cathermo/VPissp/runtest test_problems/cathermo/ims/runtest test_problems/cathermo/issp/runtest test_problems/cathermo/stoichSubSSTP/runtest test_problems/cathermo/testIAPWS/runtest test_problems/cathermo/testIAPWSPres/runtest test_problems/cathermo/testIAPWSTripP/runtest test_problems/cathermo/testWaterPDSS/runtest test_problems/cathermo/testWaterTP/runtest test_problems/cathermo/wtWater/runtest test_problems/cxx_ex/equil_example1.cpp test_problems/cxx_ex/examples.cpp test_problems/cxx_ex/kinetics_example1.cpp test_problems/cxx_ex/kinetics_example2.cpp test_problems/cxx_ex/kinetics_example3.cpp test_problems/cxx_ex/rxnpath_example1.cpp test_problems/cxx_ex/transport_example1.cpp test_problems/cxx_ex/transport_example2.cpp test_problems/mixGasTransport/runtest test_problems/nasa9_reader/runtest test_problems/negATest/runtest test_problems/printUtilUnitTest/runtest test_problems/pureFluidTest/runtest test_problems/rankine_democxx/runtest test_problems/silane_equil/runtest test_problems/surfSolverTest/runtest test_problems/surfSolverTest/runtest2 test_problems/surfkin/runtest tools/testtools/Makefile.in
78 lines
1.7 KiB
C++
78 lines
1.7 KiB
C++
|
|
#include "Cantera.h"
|
|
#include "spectra.h"
|
|
#include "kernel/Nuclei.h"
|
|
#include <iostream>
|
|
using namespace std;
|
|
using namespace Cantera;
|
|
|
|
int main() {
|
|
|
|
Nucleus* a = HydrogenNucleus();
|
|
Nucleus* b = HydrogenNucleus();
|
|
if (*a == *b) {
|
|
cout << "a and b and indistinguishable" << endl;
|
|
}
|
|
else
|
|
{
|
|
cout << "\nwhy are a and b not indistinguishable?\n";
|
|
return 1;
|
|
}
|
|
|
|
// test line broading classes
|
|
double gam = 2.0e0;
|
|
double sigma = 5.0;
|
|
|
|
LineBroadener* lor = new Lorentzian(gam);
|
|
LineBroadener* gaus = new Gaussian(sigma);
|
|
Voigt* voig = new Voigt(sigma, gam);
|
|
//voig->testv();
|
|
|
|
double dnu = 0.1;
|
|
double nu;
|
|
double sum = 0.0, sumg = 0.0, sumlor = 0.0;
|
|
for (int n = -2000; n < 2000; n++) {
|
|
//cout << n << endl;
|
|
nu = n*dnu;
|
|
sumg += gaus->profile(nu)*dnu;
|
|
sum += voig->profile(nu)*dnu;
|
|
sumlor += lor->profile(nu)*dnu;
|
|
//cout << nu << ", " << (*lor)(nu) << ", " << (*gaus)(nu)
|
|
// << ", " << (*voig)(nu) << endl;
|
|
}
|
|
|
|
/* old output
|
|
cout << "Voigt area = " << sum << endl;
|
|
cout << "Gaussian area = " << sumg << endl;
|
|
cout << "Lorentzian area = " << sumlor << endl;
|
|
*/
|
|
|
|
// 'blessed' output:
|
|
// Voigt area = 0.99363
|
|
// Gaussian area = 1
|
|
// Lorentzian area = 0.993634
|
|
|
|
// guessing a sane tolerance
|
|
double TOL = .0001;
|
|
|
|
if(abs(sum-.99363) > TOL)
|
|
{
|
|
cout << "\nVOIGT AREA REGRESSION TEST FAILURE\n";
|
|
return 1;
|
|
}
|
|
|
|
if(abs(sumg-1.0) > TOL)
|
|
{
|
|
cout << "\nGAUSSIAN AREA REGRESSION TEST FAILURE\n";
|
|
return 1;
|
|
}
|
|
if(abs(sumlor-.993634) > TOL)
|
|
{
|
|
cout << "\nLORENTZIAN AREA REGRESSION TEST FAILURE\n";
|
|
return 1;
|
|
}
|
|
|
|
// steady as she goes
|
|
return 0;
|
|
|
|
}
|