Page MenuHomec4science

main.cpp
No OneTemporary

File Metadata

Created
Sun, Feb 23, 08:37

main.cpp

#include "Config.hpp"
#include "testSuite.hpp"
int main(int argc, char* argv[]) {
// // Force test
// string inputString = "Test";
//
// if (inputString == "Test") {
// numIntTests();
// return 0;
// }
// // Recover config file name
string configFileName = "";
if (argv[1] == nullptr) {
configFileName = "defaultConfig.init";
} else {
string inputString = argv[1];
std::cout << inputString << std::endl;
if (inputString == "Test") {
numIntTests();
return 0;
} else {
configFileName = inputString;
}
}
// Load the configuration
Config config = Config(configFileName);
// Recover integrator and integrate depending on the case dimensions
double Ih;
if (config.isOneD()) {
AbstractOneDIntegrator* integrator = config.getIntegrator1D();
Ih = integrator->Integral();
} else {
AbstractTwoDIntegrator* integrator = config.getIntegrator2D();
Ih = integrator->Integral();
}
//
std::cout << "Integral value : " << Ih << std::endl;
return 0;
}

Event Timeline