Commit 85bc1058 authored by Christof Metzger-Kraus's avatar Christof Metzger-Kraus
Browse files

cleaning up Gauss distribution unit test; improve SilenceTest class to print output if tests fail

parent b8847846
......@@ -5,13 +5,13 @@
# It can be found at:
# http://amas.web.psi.ch/tools/GSL/index.html
#
# GTEST_INCLUDE_DIR - where to find gtest/gtest.h
# GTEST_INCLUDE_DIRS - where to find gtest/gtest.h
# GTEST_LIBRARY - libgtest.a path
# GTEST_MAIN_LIBRARY - libgtest_main.a path
# GTEST_FOUND - do not attempt to use if "no" or undefined.
FIND_PATH(GTEST_INCLUDE_DIR gtest/gtest.h
HINTS $ENV{GTEST_INCLUDE_PATH} $ENV{GTEST_INCLUDE_DIR} $ENV{GTEST_PREFIX}/include $ENV{GTEST_ROOT}/include ${PROJECT_SOURCE_DIR}/tests/tools/gtest/include
FIND_PATH(GTEST_INCLUDE_DIRS gtest/gtest.h
HINTS $ENV{GTEST_INCLUDE_PATH} $ENV{GTEST_INCLUDE_DIRS} $ENV{GTEST_PREFIX}/include $ENV{GTEST_ROOT}/include ${PROJECT_SOURCE_DIR}/tests/tools/gtest/include
PATHS ENV CPP_INCLUDE_PATH
)
......@@ -30,19 +30,17 @@ set( GTEST_BOTH_LIBRARIES
${GTEST_LIBRARY_MAIN}
)
IF(GTEST_INCLUDE_DIR AND GTEST_LIBRARY)
IF(GTEST_INCLUDE_DIRS AND GTEST_LIBRARY)
SET( GTEST_FOUND "YES" )
ENDIF(GTEST_INCLUDE_DIR AND GTEST_LIBRARY)
ENDIF(GTEST_INCLUDE_DIRS AND GTEST_LIBRARY)
IF (GTEST_FOUND)
IF (NOT GTEST_FIND_QUIETLY)
MESSAGE(STATUS "Found gtest libraries: ${GTEST_BOTH_LIBRARIES}")
MESSAGE(STATUS "Found gtest include dir: ${GTEST_INCLUDE_DIR}")
MESSAGE(STATUS "Found gtest include dir: ${GTEST_INCLUDE_DIRS}")
ENDIF (NOT GTEST_FIND_QUIETLY)
ELSE (GTEST_FOUND)
IF (GTest_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find GTEST!")
ENDIF (GTest_FIND_REQUIRED)
ENDIF (GTEST_FOUND)
ENDIF (GTEST_FOUND)
\ No newline at end of file
This diff is collapsed.
......@@ -79,6 +79,154 @@ namespace InputMomentumUnitsT
};
}
namespace Attrib
{
namespace Distribution
{
enum AttributesT {
TYPE,
DISTRIBUTION,
FNAME,
WRITETOFILE,
WEIGHT,
INPUTMOUNITS,
EMITTED,
EMISSIONSTEPS,
EMISSIONMODEL,
EKIN,
ELASER,
W,
FE,
CATHTEMP,
NBIN,
XMULT,
YMULT,
ZMULT,
TMULT,
PXMULT,
PYMULT,
PZMULT,
OFFSETX,
OFFSETY,
OFFSETZ,
OFFSETT,
OFFSETPX,
OFFSETPY,
OFFSETPZ,
SIGMAX,
SIGMAY,
SIGMAR,
SIGMAZ,
SIGMAT,
TPULSEFWHM,
TRISE,
TFALL,
SIGMAPX,
SIGMAPY,
SIGMAPZ,
MX,
MY,
MZ,
MT,
CUTOFFX,
CUTOFFY,
CUTOFFR,
CUTOFFLONG,
CUTOFFPX,
CUTOFFPY,
CUTOFFPZ,
FTOSCAMPLITUDE,
FTOSCPERIODS,
R, // the correlation matrix (a la transport)
CORRX,
CORRY,
CORRZ,
CORRT,
R51,
R52,
R61,
R62,
LASERPROFFN,
IMAGENAME,
INTENSITYCUT,
FLIPX,
FLIPY,
ROTATE90,
ROTATE180,
ROTATE270,
NPDARKCUR,
INWARDMARGIN,
EINITHR,
FNA,
FNB,
FNY,
FNVYZERO,
FNVYSECOND,
FNPHIW,
FNBETA,
FNFIELDTHR,
FNMAXEMI,
SECONDARYFLAG,
NEMISSIONMODE,
VSEYZERO, // sey_0 in Vaughn's model.
VEZERO, // Energy related to sey_0 in Vaughan's model.
VSEYMAX, // sey max in Vaughan's model.
VEMAX, // Emax in Vaughan's model.
VKENERGY, // Fitting parameter denotes the roughness of
// surface for impact energy in Vaughn's model.
VKTHETA, // Fitting parameter denotes the roughness of
// surface for impact angle in Vaughn's model.
VVTHERMAL, // Thermal velocity of Maxwellian distribution
// of secondaries in Vaughan's model.
VW,
SURFMATERIAL, // Add material type, currently 0 for copper
// and 1 for stainless steel.
EX, // below is for the matched distribution
EY,
ET,
MAGSYM, // number of sector magnets
LINE,
FMAPFN,
FMTYPE, // field map type used in matched gauss distribution
RESIDUUM,
MAXSTEPSCO,
MAXSTEPSSI,
ORDERMAPS,
E2,
RGUESS,
ID1, // special particle that the user can set
ID2, // special particle that the user can set
SCALABLE,
SIZE
};
}
namespace Legacy
{
namespace Distribution
{
enum LegacyAttributesT {
// DESCRIPTION OF THE DISTRIBUTION:
DEBIN = Attrib::Distribution::SIZE,
SBIN,
SIGMAPT,
CUTOFF,
T,
PT,
// ALPHAX,
// ALPHAY,
// BETAX,
// BETAY,
// DX,
// DDX,
// DY,
// DDY,
SIZE
};
}
}
}
/*
* Class Distribution
*
......@@ -209,6 +357,8 @@ private:
#ifdef WITH_UNIT_TESTS
FRIEND_TEST(GaussTest, FullSigmaTest1);
FRIEND_TEST(GaussTest, FullSigmaTest2);
FRIEND_TEST(BinomialTest, FullSigmaTest1);
FRIEND_TEST(BinomialTest, FullSigmaTest2);
#endif
Distribution(const std::string &name, Distribution *parent);
......@@ -217,9 +367,7 @@ private:
Distribution(const Distribution &);
void operator=(const Distribution &);
// void printSigma(SigmaGenerator<double,unsigned int>::matrix_type& M, Inform& out);
void addDistributions();
void applyEmissionModel(double lowEnergyLimit, double &px, double &py, double &pz, std::vector<double> &additionalRNs);
void applyEmissModelAstra(double &px, double &py, double &pz, std::vector<double> &additionalRNs);
......
......@@ -41,7 +41,7 @@ LINK_DIRECTORIES( ${GTEST_LIB_DIR}
${Boost_LIBRARIES}
)
INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIR}
INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}
${IPPL_INCLUDE_DIR}
${H5Hut_INCLUDE_DIR}
......@@ -53,7 +53,7 @@ INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIR}
${Trilinos_TPL_INCLUDE_DIRS}
${IPPL_SOURCE_DIRS}
${CCSE_INCLUDE_DIRS}
${GTEST_INCLUDE_DIR}
${GTEST_INCLUDE_DIRS}
)
# Check to see if cmake finds the test files
......@@ -62,4 +62,4 @@ INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIR}
# Build the test exe. We don't do an install on the unit test exe as it is
# assumed that this is internal to opal
ADD_EXECUTABLE(${TEST_EXE} ${TEST_SRCS}) # the opal and classic sources are not needed again if we link agains libOPAL and libCLASSIC!
TARGET_LINK_LIBRARIES(${TEST_EXE} OPALib ${OPAL_LIBS} ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES} ${CCSE_LIBRARIES} -lgfortran ${OTHER_CMAKE_EXE_LINKER_FLAGS} ${GTEST_BOTH_LIBRARIES} -lpthread)
TARGET_LINK_LIBRARIES(${TEST_EXE} OPALib ${OPAL_LIBS} ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES} ${CCSE_LIBRARIES} -lgfortran ${OTHER_CMAKE_EXE_LINKER_FLAGS} ${GTEST_BOTH_LIBRARIES} -lpthread)
\ No newline at end of file
......@@ -4,7 +4,14 @@
#include "Utility/Inform.h" // ippl
extern Inform* gmsg;
Inform* gmsg;
class NewLineAdder: public ::testing::EmptyTestEventListener {
virtual void OnTestPartResult(const ::testing::TestPartResult &test_part_result) {
if (test_part_result.failed())
printf("\n");
}
};
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
......@@ -13,8 +20,13 @@ int main(int argc, char **argv) {
return 1;
}
MPI_Init(&argc, &argv);
::testing::TestEventListeners &listeners =
::testing::UnitTest::GetInstance()->listeners();
listeners.Append(new NewLineAdder);
int test_out = RUN_ALL_TESTS();
MPI_Finalize();
return test_out;
}
}
\ No newline at end of file
#include "gtest/gtest.h"
#include "Distribution/Distribution.h"
#include "Attributes/Attributes.h"
#include "Physics/Physics.h"
#include "opal_test_utilities/SilenceTest.h"
#include "gsl/gsl_statistics_double.h"
TEST(BinomialTest, FullSigmaTest1) {
OpalTestUtilities::SilenceTest silencer(true);
const double expectedR11 = 1.978;
const double expectedR22 = 0.7998;
const double expectedR33 = 2.498;
const double expectedR44 = 0.6212;
const double expectedR55 = 1.537;
const double expectedR66 = 0.9457;
const double expectedR21 = -0.40993;
const double expectedR43 = 0.77208;
const double expectedR65 = 0.12051;
const double expectedR51 = 0.14935;
const double expectedR52 = 0.59095;
const double expectedR61 = 0.72795;
const double expectedR62 = -0.3550;
std::vector<double> expectedR({expectedR21, 0, 0, expectedR51, expectedR61, \
/* */ 0, 0, expectedR52, expectedR62, \
/* */ expectedR43, 0, 0, \
/* */0, 0, \
/* */expectedR65});
Distribution dist;
Attributes::setString(dist.itsAttr[Attrib::Distribution::TYPE], "BINOMIAL");
Attributes::setReal(dist.itsAttr[Attrib::Distribution::SIGMAX], expectedR11 * 1e-3);
Attributes::setReal(dist.itsAttr[Attrib::Distribution::SIGMAPX], expectedR22);
Attributes::setReal(dist.itsAttr[Attrib::Distribution::SIGMAY], expectedR33 * 1e-3);
Attributes::setReal(dist.itsAttr[Attrib::Distribution::SIGMAPY], expectedR44);
Attributes::setReal(dist.itsAttr[Attrib::Distribution::SIGMAZ], expectedR55 * 1e-3);
Attributes::setReal(dist.itsAttr[Attrib::Distribution::SIGMAPZ], expectedR66);
Attributes::setReal(dist.itsAttr[Attrib::Distribution::MX], 999999999.9);
Attributes::setReal(dist.itsAttr[Attrib::Distribution::MY], 999999999.9);
Attributes::setReal(dist.itsAttr[Attrib::Distribution::MZ], 999999999.9);
Attributes::setRealArray(dist.itsAttr[Attrib::Distribution::R], expectedR);
Attributes::setBool(dist.itsAttr[Attrib::Distribution::EMITTED], false);
dist.setDistType();
dist.checkIfEmitted();
size_t numParticles = 1000000;
dist.create(numParticles, Physics::m_p);
double R11 = sqrt(gsl_stats_variance(&(dist.xDist_m[0]), 1, dist.xDist_m.size())) * 1e3;
double R22 = sqrt(gsl_stats_variance(&(dist.pxDist_m[0]), 1, dist.pxDist_m.size()));
double R33 = sqrt(gsl_stats_variance(&(dist.yDist_m[0]), 1, dist.yDist_m.size())) * 1e3;
double R44 = sqrt(gsl_stats_variance(&(dist.pyDist_m[0]), 1, dist.pyDist_m.size()));
double R55 = sqrt(gsl_stats_variance(&(dist.tOrZDist_m[0]), 1, dist.tOrZDist_m.size())) * 1e3;
double R66 = sqrt(gsl_stats_variance(&(dist.pzDist_m[0]), 1, dist.pzDist_m.size()));
double R21 = (gsl_stats_covariance(&(dist.xDist_m[0]), 1, &(dist.pxDist_m[0]), 1, dist.xDist_m.size()) * 1e3 /
(expectedR11 * expectedR22));
double R51 = (gsl_stats_covariance(&(dist.xDist_m[0]), 1, &(dist.tOrZDist_m[0]), 1, dist.xDist_m.size()) * 1e6 /
(expectedR11 * expectedR55));
double R52 = (gsl_stats_covariance(&(dist.pxDist_m[0]), 1, &(dist.tOrZDist_m[0]), 1, dist.pxDist_m.size()) * 1e3 /
(expectedR22 * expectedR55));
double R61 = (gsl_stats_covariance(&(dist.xDist_m[0]), 1, &(dist.pzDist_m[0]), 1, dist.xDist_m.size()) * 1e3 /
(expectedR11 * expectedR66));
double R62 = (gsl_stats_covariance(&(dist.pxDist_m[0]), 1, &(dist.pzDist_m[0]), 1, dist.pxDist_m.size()) /
(expectedR22 * expectedR66));
EXPECT_NEAR(expectedR11, R11, 0.05 * std::abs(expectedR11));
EXPECT_NEAR(expectedR22, R22, 0.05 * std::abs(expectedR22));
EXPECT_NEAR(expectedR33, R33, 0.05 * std::abs(expectedR33));
EXPECT_NEAR(expectedR44, R44, 0.05 * std::abs(expectedR44));
EXPECT_NEAR(expectedR55, R55, 0.05 * std::abs(expectedR55));
EXPECT_NEAR(expectedR66, R66, 0.05 * std::abs(expectedR66));
EXPECT_NEAR(expectedR21, R21, 0.1 * std::abs(expectedR21));
EXPECT_NEAR(expectedR51, R51, 0.1 * std::abs(expectedR51));
EXPECT_NEAR(expectedR52, R52, 0.1 * std::abs(expectedR52));
EXPECT_NEAR(expectedR61, R61, 0.1 * std::abs(expectedR61));
EXPECT_NEAR(expectedR62, R62, 0.1 * std::abs(expectedR62));
}
TEST(BinomialTest, FullSigmaTest2) {
OpalTestUtilities::SilenceTest silencer(true);
const double expectedR11 = 1.978;
const double expectedR22 = 0.7998;
const double expectedR33 = 2.498;
const double expectedR44 = 0.6212;
const double expectedR55 = 1.537;
const double expectedR66 = 0.9457;
const double expectedR21 = -0.40993;
const double expectedR43 = 0.77208;
const double expectedR65 = 0.12051;
const double expectedR51 = 0.14935;
const double expectedR52 = 0.59095;
const double expectedR61 = 0.72795;
const double expectedR62 = -0.3550;
Distribution dist;
Attributes::setString(dist.itsAttr[Attrib::Distribution::TYPE], "GAUSS");
Attributes::setReal(dist.itsAttr[Attrib::Distribution::SIGMAX], expectedR11 * 1e-3);
Attributes::setReal(dist.itsAttr[Attrib::Distribution::SIGMAPX], expectedR22);
Attributes::setReal(dist.itsAttr[Attrib::Distribution::SIGMAY], expectedR33 * 1e-3);
Attributes::setReal(dist.itsAttr[Attrib::Distribution::SIGMAPY], expectedR44);
Attributes::setReal(dist.itsAttr[Attrib::Distribution::SIGMAZ], expectedR55 * 1e-3);
Attributes::setReal(dist.itsAttr[Attrib::Distribution::SIGMAPZ], expectedR66);
Attributes::setReal(dist.itsAttr[Attrib::Distribution::CORRX], expectedR21);
Attributes::setReal(dist.itsAttr[Attrib::Distribution::CORRY], expectedR43);
Attributes::setReal(dist.itsAttr[Attrib::Distribution::CORRZ], expectedR65);
Attributes::setReal(dist.itsAttr[Attrib::Distribution::R51], expectedR51);
Attributes::setReal(dist.itsAttr[Attrib::Distribution::R61], expectedR61);
Attributes::setReal(dist.itsAttr[Attrib::Distribution::R52], expectedR52);
Attributes::setReal(dist.itsAttr[Attrib::Distribution::R62], expectedR62);
Attributes::setBool(dist.itsAttr[Attrib::Distribution::EMITTED], false);
dist.setDistType();
dist.checkIfEmitted();
size_t numParticles = 1000000;
dist.create(numParticles, Physics::m_p);
double R11 = sqrt(gsl_stats_variance(&(dist.xDist_m[0]), 1, dist.xDist_m.size())) * 1e3;
double R22 = sqrt(gsl_stats_variance(&(dist.pxDist_m[0]), 1, dist.pxDist_m.size()));
double R33 = sqrt(gsl_stats_variance(&(dist.yDist_m[0]), 1, dist.yDist_m.size())) * 1e3;
double R44 = sqrt(gsl_stats_variance(&(dist.pyDist_m[0]), 1, dist.pyDist_m.size()));
double R55 = sqrt(gsl_stats_variance(&(dist.tOrZDist_m[0]), 1, dist.tOrZDist_m.size())) * 1e3;
double R66 = sqrt(gsl_stats_variance(&(dist.pzDist_m[0]), 1, dist.pzDist_m.size()));
double R21 = (gsl_stats_covariance(&(dist.xDist_m[0]), 1, &(dist.pxDist_m[0]), 1, dist.xDist_m.size()) * 1e3 /
(expectedR11 * expectedR22));
double R51 = (gsl_stats_covariance(&(dist.xDist_m[0]), 1, &(dist.tOrZDist_m[0]), 1, dist.xDist_m.size()) * 1e6 /
(expectedR11 * expectedR55));
double R52 = (gsl_stats_covariance(&(dist.pxDist_m[0]), 1, &(dist.tOrZDist_m[0]), 1, dist.pxDist_m.size()) * 1e3 /
(expectedR22 * expectedR55));
double R61 = (gsl_stats_covariance(&(dist.xDist_m[0]), 1, &(dist.pzDist_m[0]), 1, dist.xDist_m.size()) * 1e3 /
(expectedR11 * expectedR66));
double R62 = (gsl_stats_covariance(&(dist.pxDist_m[0]), 1, &(dist.pzDist_m[0]), 1, dist.pxDist_m.size()) /
(expectedR22 * expectedR66));
EXPECT_NEAR(expectedR11, R11, 0.05 * std::abs(expectedR11));
EXPECT_NEAR(expectedR22, R22, 0.05 * std::abs(expectedR22));
EXPECT_NEAR(expectedR33, R33, 0.05 * std::abs(expectedR33));
EXPECT_NEAR(expectedR44, R44, 0.05 * std::abs(expectedR44));
EXPECT_NEAR(expectedR55, R55, 0.05 * std::abs(expectedR55));
EXPECT_NEAR(expectedR66, R66, 0.05 * std::abs(expectedR66));
EXPECT_NEAR(expectedR21, R21, 0.1 * std::abs(expectedR21));
EXPECT_NEAR(expectedR51, R51, 0.1 * std::abs(expectedR51));
EXPECT_NEAR(expectedR52, R52, 0.1 * std::abs(expectedR52));
EXPECT_NEAR(expectedR61, R61, 0.1 * std::abs(expectedR61));
EXPECT_NEAR(expectedR62, R62, 0.1 * std::abs(expectedR62));
}
\ No newline at end of file
set (_SRCS
BinomialTest.cpp
GaussTest.cpp
)
......
#include "gtest/gtest.h"
#include "opal.h"
Ippl *ippl;
Inform *gmsg;
#include "AbstractObjects/OpalData.h"
#include "OpalConfigure/Configure.h"
#include "Utilities/OpalException.h"
#include "Distribution/Distribution.h"
#include "OpalParser/OpalParser.h"
#include "Parser/FileStream.h"
#include "Attributes/Attributes.h"
#include "Physics/Physics.h"
#include "opal_test_utilities/SilenceTest.h"
#include "gsl/gsl_statistics_double.h"
#include <cstdio>
#include <iostream>
#include <fstream>
#include <string>
#include <cstring>
#include <sstream>
TEST(GaussTest, FullSigmaTest1) {
OpalTestUtilities::SilenceTest silencer(false);
char inputFileName[] = "GaussDistributionTest.in";
std::string input = "OPTION, ECHO=FALSE;\n"
"OPTION, CZERO=FALSE;\n"
"TITLE, STRING=\"gauss distribution unit test\";\n"
"DIST1: DISTRIBUTION, TYPE = \"GAUSS\", \n"
"SIGMAX = 1.978e-3, SIGMAY = 2.498e-3, SIGMAZ = 1.537e-3, \n"
"SIGMAPX = 0.7998, SIGMAPY = 0.6212, SIGMAPZ = 0.9457, \n"
"R = {-0.40993, 0, 0, 0.14935, 0.72795, 0, 0, 0.59095, -0.3550, 0.77208, 0, 0, 0, 0, 0.12051}, \n"
"EKIN = 0.63, \n"
"EMITTED = FALSE;\n";
int narg = 7;
char exe_name[] = "opal_unit_tests";
char commlib[] = "--nocomminit";
char info[] = "--info";
char info0[] = "0";
char warn[] = "--warn";
char warn0[] = "0";
char **arg = new char*[7];
arg[0] = exe_name;
arg[1] = inputFileName;
arg[2] = commlib;
arg[3] = info;
arg[4] = info0;
arg[5] = warn;
arg[6] = warn0;
if (!ippl)
ippl = new Ippl(narg, arg, Ippl::KEEP, MPI_COMM_WORLD);
gmsg = new Inform("OPAL ");
std::ofstream inputFile(inputFileName);
inputFile << input << std::endl;
inputFile.close();
OpalData *OPAL = OpalData::getInstance();
Configure::configure();
OPAL->storeInputFn(inputFileName);
FileStream *is = 0;
try {
is = new FileStream(inputFileName);
} catch(...) {
is = 0;
throw new OpalException("FullSigmaTest", "Could not read string");
}
OpalParser *parser = new OpalParser();
if (is) {
try {
parser->run(is);
} catch (...) {
throw new OpalException("FullSigmaTest", "Could not parse input");
}
}
Object *distObj;
try {
distObj = OPAL->find("DIST1");
} catch(...) {
distObj = 0;
throw new OpalException("FullSigmaTest", "Could not find distribution");
}
if (distObj) {
Distribution *dist = dynamic_cast<Distribution*>(distObj);
dist->setDistType();
dist->checkIfEmitted();
size_t numParticles = 1000000;
dist->create(numParticles, Physics::m_p);
double R11 = gsl_stats_variance(&(dist->xDist_m[0]), 1, dist->xDist_m.size()) * 1e6;
double R21 = gsl_stats_covariance(&(dist->xDist_m[0]), 1, &(dist->pxDist_m[0]), 1, dist->xDist_m.size()) * 1e3;
double R22 = gsl_stats_variance(&(dist->pxDist_m[0]), 1, dist->pxDist_m.size());
double R51 = gsl_stats_covariance(&(dist->xDist_m[0]), 1, &(dist->tOrZDist_m[0]), 1, dist->xDist_m.size()) * 1e6;
double R52 = gsl_stats_covariance(&(dist->pxDist_m[0]), 1, &(dist->tOrZDist_m[0]), 1, dist->pxDist_m.size()) * 1e3;
double R61 = gsl_stats_covariance(&(dist->xDist_m[0]), 1, &(dist->pzDist_m[0]), 1, dist->xDist_m.size()) * 1e3;
double R62 = gsl_stats_covariance(&(dist->pxDist_m[0]), 1, &(dist->pzDist_m[0]), 1, dist->pxDist_m.size());
const double expectedR11 = 3.914;
const double expectedR21 = -0.6486;
const double expectedR22 = 0.6396;
const double expectedR51 = 0.4542;
const double expectedR52 = 0.7265;
const double expectedR61 = 1.362;
const double expectedR62 = -0.2685;
EXPECT_LT(std::abs(expectedR11 - R11), 0.05 * expectedR11);
EXPECT_LT(std::abs(expectedR21 - R21), -0.05 * expectedR21);
EXPECT_LT(std::abs(expectedR22 - R22), 0.05 * expectedR22);
EXPECT_LT(std::abs(expectedR51 - R51), 0.05 * expectedR51);
EXPECT_LT(std::abs(expectedR52 - R52), 0.05 * expectedR52);
EXPECT_LT(std::abs(expectedR61 - R61), 0.05 * expectedR61);
EXPECT_LT(std::abs(expectedR62 - R62), -0.05 * expectedR62);
}
OpalData::deleteInstance();
delete parser;
delete gmsg;
// delete ippl;
delete[] arg;
std::remove(inputFileName);
const double expectedR11 = 1.978;
const double expectedR22 = 0.7998;
const double expectedR33 = 2.498;
const double expectedR44 = 0.6212;
const double expectedR55 = 1.537;
const double expectedR66 = 0.9457;
const double expectedR21 = -0.40993;
const double expectedR43 = 0.77208;
const double expectedR65 = 0.12051;
const double expectedR51 = 0.14935;
const double expectedR52 = 0.59095;
const double expectedR61 = 0.72795;
const double expectedR62 = -0.3550;
std::vector<double> expectedR({expectedR21, 0, 0, expectedR51, expectedR61, \
/* */ 0, 0, expectedR52, expectedR62, \
/* */ expectedR43, 0, 0, \