diff --git a/targets/tests/NumericalTests/Tests/L2NormTest/L2NormTest.cpp b/targets/tests/NumericalTests/Tests/L2NormTest/L2NormTest.cpp index 376a20792b5473fd95ce81142bc998170b8bb3f4..a1bc64896280099159a81ea42b16d7b7a54a1360 100644 --- a/targets/tests/NumericalTests/Tests/L2NormTest/L2NormTest.cpp +++ b/targets/tests/NumericalTests/Tests/L2NormTest/L2NormTest.cpp @@ -1,12 +1,13 @@ #include "L2NormTest.h" +#include "Utilities/ColorConsoleOutput/ColorConsoleOutput.h" #include "Utilities\Calculator\L2NormCalculator\L2NormCalculator.h" #include "Utilities\Results\AnalyticalResults\AnalyticalResult.h" #include "Utilities\Results\SimulationResults\SimulationResults.h" -std::shared_ptr<L2NormTest> L2NormTest::getNewInstance(std::shared_ptr< AnalyticalResults> analyticalResult) +std::shared_ptr<L2NormTest> L2NormTest::getNewInstance(std::shared_ptr< AnalyticalResults> analyticalResult, std::shared_ptr< ColorConsoleOutput> colorOutput) { - return std::shared_ptr<L2NormTest>(new L2NormTest(analyticalResult)); + return std::shared_ptr<L2NormTest>(new L2NormTest(analyticalResult, colorOutput)); } void L2NormTest::update() @@ -43,7 +44,7 @@ void L2NormTest::makeConsoleOutput() } -L2NormTest::L2NormTest(std::shared_ptr< AnalyticalResults> analyticalResult) : analyticalResult(analyticalResult) +L2NormTest::L2NormTest(std::shared_ptr< AnalyticalResults> analyticalResult, std::shared_ptr< ColorConsoleOutput> colorOutput) : TestImp(colorOutput), analyticalResult(analyticalResult) { calculator = L2NormCalculator::getNewInstance(); } \ No newline at end of file diff --git a/targets/tests/NumericalTests/Tests/L2NormTest/L2NormTest.h b/targets/tests/NumericalTests/Tests/L2NormTest/L2NormTest.h index c4e54fee5b0a8da95f8053207d9b1f341ac153a6..50b053f973eb0ab8aa19c203161b48850f91db26 100644 --- a/targets/tests/NumericalTests/Tests/L2NormTest/L2NormTest.h +++ b/targets/tests/NumericalTests/Tests/L2NormTest/L2NormTest.h @@ -11,7 +11,7 @@ class AnalyticalResults; class L2NormTest : public TestImp { public: - static std::shared_ptr<L2NormTest> getNewInstance(std::shared_ptr< AnalyticalResults> analyticalResult); + static std::shared_ptr<L2NormTest> getNewInstance(std::shared_ptr< AnalyticalResults> analyticalResult, std::shared_ptr< ColorConsoleOutput> colorOutput); void update(); void addSimulation(std::shared_ptr< TestSimulation> sim, std::shared_ptr< SimulationInfo> simInfo); @@ -21,8 +21,7 @@ public: void makeConsoleOutput(); private: - L2NormTest() {}; - L2NormTest(std::shared_ptr< AnalyticalResults> analyticalResult); + L2NormTest(std::shared_ptr< AnalyticalResults> analyticalResult, std::shared_ptr< ColorConsoleOutput> colorOutput); std::shared_ptr< L2NormCalculator> calculator; std::shared_ptr< AnalyticalResults> analyticalResult; diff --git a/targets/tests/NumericalTests/Tests/PhiAndNuTest/PhiAndNuTest.cpp b/targets/tests/NumericalTests/Tests/PhiAndNuTest/PhiAndNuTest.cpp index 2df8139e344818acfb64b4f9b7525feef989ab4a..1e5369c42989459b6febad36878af0954995c9f8 100644 --- a/targets/tests/NumericalTests/Tests/PhiAndNuTest/PhiAndNuTest.cpp +++ b/targets/tests/NumericalTests/Tests/PhiAndNuTest/PhiAndNuTest.cpp @@ -1,14 +1,16 @@ #include "PhiAndNuTest.h" -#include "Utilities/ColorConsoleOutput/ColorConsoleOutputImp.h" +#include "Utilities/ColorConsoleOutput/ColorConsoleOutput.h" #include "Utilities/Results/SimulationResults/SimulationResults.h" #include "Utilities\Calculator\FFTCalculator\FFTCalculator.h" #include "Utilities\TestSimulation\TestSimulation.h" #include "Utilities\SimulationInfo\SimulationInfo.h" -std::shared_ptr<PhiAndNuTest> PhiAndNuTest::getNewInstance(std::string dataToCalculate, double minOrderOfAccuracy, double viscosity) +#include <iomanip> + +std::shared_ptr<PhiAndNuTest> PhiAndNuTest::getNewInstance(std::shared_ptr< ColorConsoleOutput> colorOutput, std::string dataToCalculate, double minOrderOfAccuracy, double viscosity) { - return std::shared_ptr<PhiAndNuTest>(new PhiAndNuTest(dataToCalculate, minOrderOfAccuracy, viscosity)); + return std::shared_ptr<PhiAndNuTest>(new PhiAndNuTest(colorOutput, dataToCalculate, minOrderOfAccuracy, viscosity)); } void PhiAndNuTest::evaluate() @@ -52,8 +54,8 @@ std::vector<bool> PhiAndNuTest::getPassedTests() void PhiAndNuTest::makeConsoleOutput() { - testOut->makeTestOutput(nuDiffTestPassed, simInfos.at(0), simInfos.at(1), "NuDiff", "NuDiff", "OrderOfAccuracy", nuDiff.at(0), nuDiff.at(1), orderOfAccuracyNuDiff); - testOut->makeTestOutput(nuDiffTestPassed, simInfos.at(0), simInfos.at(1), "PhiDiff", "PhiDiff", "OrderOfAccuracy", phiDiff.at(0), phiDiff.at(1), orderOfAccuracyPhiDiff); + colorOutput->makeTestOutput(nuDiffTestPassed, simInfos.at(0), simInfos.at(1), "NuDiff", "NuDiff", "OrderOfAccuracy", nuDiff.at(0), nuDiff.at(1), orderOfAccuracyNuDiff); + colorOutput->makeTestOutput(nuDiffTestPassed, simInfos.at(0), simInfos.at(1), "PhiDiff", "PhiDiff", "OrderOfAccuracy", phiDiff.at(0), phiDiff.at(1), orderOfAccuracyPhiDiff); } std::string PhiAndNuTest::getLogFileOutput() @@ -66,13 +68,12 @@ std::string PhiAndNuTest::getLogFileOutput() return oss.str(); } -PhiAndNuTest::PhiAndNuTest(std::string dataToCalculate, double minOrderOfAccuracy, double viscosity) : TestImp(), minOrderOfAccuracy(minOrderOfAccuracy), viscosity(viscosity), dataToCalculate(dataToCalculate) +PhiAndNuTest::PhiAndNuTest(std::shared_ptr< ColorConsoleOutput> colorOutput, std::string dataToCalculate, double minOrderOfAccuracy, double viscosity) : TestImp(colorOutput), minOrderOfAccuracy(minOrderOfAccuracy), viscosity(viscosity), dataToCalculate(dataToCalculate) { lx.resize(0); phiDiff.resize(0); nuDiff.resize(0); calculator = FFTCalculator::getNewInstance(viscosity); - testOut = ColorConsoleOutputImp::getNewInstance(); } double PhiAndNuTest::calcOrderOfAccuracy(std::vector<double> data) diff --git a/targets/tests/NumericalTests/Tests/PhiAndNuTest/PhiAndNuTest.h b/targets/tests/NumericalTests/Tests/PhiAndNuTest/PhiAndNuTest.h index 75f2decd4c3407395590040867a0f3a199f08e52..9f58914cac43a6cb560592862246af50feb976d9 100644 --- a/targets/tests/NumericalTests/Tests/PhiAndNuTest/PhiAndNuTest.h +++ b/targets/tests/NumericalTests/Tests/PhiAndNuTest/PhiAndNuTest.h @@ -7,13 +7,12 @@ #include <vector> #include <iostream> -class ColorConsoleOutput; class FFTCalculator; class PhiAndNuTest : public TestImp { public: - static std::shared_ptr<PhiAndNuTest> getNewInstance(std::string dataToCalculate, double minOrderOfAccuracy, double viscosity); + static std::shared_ptr<PhiAndNuTest> getNewInstance(std::shared_ptr< ColorConsoleOutput> colorOutput, std::string dataToCalculate, double minOrderOfAccuracy, double viscosity); void update(); void addSimulation(std::shared_ptr< TestSimulation> sim, std::shared_ptr< SimulationInfo> simInfo); @@ -23,13 +22,13 @@ public: void makeConsoleOutput(); private: - PhiAndNuTest(std::string dataToCalculate, double minOrderOfAccuracy, double viscosity); + PhiAndNuTest(std::shared_ptr< ColorConsoleOutput> colorOutput, std::string dataToCalculate, double minOrderOfAccuracy, double viscosity); double calcOrderOfAccuracy(std::vector<double> data); bool checkTestPassed(double orderOfAccuracy); std::shared_ptr< FFTCalculator> calculator; - std::shared_ptr< ColorConsoleOutput> testOut; + std::vector<double> lx; std::vector<double> phiDiff; std::vector<double> nuDiff; @@ -41,7 +40,6 @@ private: bool phiDiffTestPassed; bool nuDiffTestPassed; - std::string dataToCalculate; }; #endif diff --git a/targets/tests/NumericalTests/Utilities/ColorConsoleOutput/ColorConsoleOutput.h b/targets/tests/NumericalTests/Utilities/ColorConsoleOutput/ColorConsoleOutput.h index a8ee14667de305f4dd5519708b33369abbac0571..a7d6ea66bf6b957a7ef709ebaf5b7bd1bd2820c7 100644 --- a/targets/tests/NumericalTests/Utilities/ColorConsoleOutput/ColorConsoleOutput.h +++ b/targets/tests/NumericalTests/Utilities/ColorConsoleOutput/ColorConsoleOutput.h @@ -1,8 +1,8 @@ #ifndef COLOR_CONSOLE_OUTPUT_H #define COLOR_CONSOLE_OUTPUT_H -#include <iostream> #include <memory> +#include <sstream> class SimulationInfo; @@ -13,6 +13,8 @@ public: virtual void makeSimulationHeadOutput(std::shared_ptr< SimulationInfo> simInfo) = 0; virtual void makeFinalTestOutputHead(int numberOfPassedTests, int numberOfTests) = 0; virtual void makeFinalTestOutputFoot(int numberOfPassedTests, int numberOfTests) = 0; + private: + }; -#endif \ No newline at end of file +#endif \ No newline at end of file diff --git a/targets/tests/NumericalTests/Utilities/ColorConsoleOutput/ColorConsoleOutputImp.cpp b/targets/tests/NumericalTests/Utilities/ColorConsoleOutput/ColorConsoleOutputImp.cpp index 7c9a842383bfe543fe4dc420bb193463d303706e..31540f06351677746ce65178a1c5135043c3aef7 100644 --- a/targets/tests/NumericalTests/Utilities/ColorConsoleOutput/ColorConsoleOutputImp.cpp +++ b/targets/tests/NumericalTests/Utilities/ColorConsoleOutput/ColorConsoleOutputImp.cpp @@ -6,9 +6,12 @@ #include "Utilities\SimulationInfo\SimulationInfo.h" -std::shared_ptr<ColorConsoleOutput> ColorConsoleOutputImp::getNewInstance() +std::shared_ptr<ColorConsoleOutput> ColorConsoleOutputImp::getInstance() { - return std::shared_ptr<ColorConsoleOutput>(new ColorConsoleOutputImp()); + static std::shared_ptr<ColorConsoleOutput> uniqueInstance; + if (!uniqueInstance) + uniqueInstance = std::shared_ptr<ColorConsoleOutput>(new ColorConsoleOutputImp()); + return uniqueInstance; } void ColorConsoleOutputImp::makeTestOutput(bool testPassed, std::shared_ptr<SimulationInfo> simInfo1, std::shared_ptr<SimulationInfo> simInfo2, std::string nameWerte1, std::string nameWerte2, std::string nameWerte3, double testWert1, double testWert2, double testWert3) diff --git a/targets/tests/NumericalTests/Utilities/ColorConsoleOutput/ColorConsoleOutputImp.h b/targets/tests/NumericalTests/Utilities/ColorConsoleOutput/ColorConsoleOutputImp.h index dfa4c3f4fc8404e2d19a97309c677e9c2c4261a0..a1e9246ccba61a937fe38d1345b6043419b447f6 100644 --- a/targets/tests/NumericalTests/Utilities/ColorConsoleOutput/ColorConsoleOutputImp.h +++ b/targets/tests/NumericalTests/Utilities/ColorConsoleOutput/ColorConsoleOutputImp.h @@ -3,7 +3,7 @@ #include "ColorConsoleOutput.h" -#include <sstream> +#include <iostream> #include <gtest/gtest.h> @@ -31,7 +31,7 @@ namespace testing class ColorConsoleOutputImp : public ColorConsoleOutput { public: - static std::shared_ptr<ColorConsoleOutput> getNewInstance(); + static std::shared_ptr<ColorConsoleOutput> getInstance(); void makeTestOutput(bool testPassed, std::shared_ptr< SimulationInfo> simInfo1, std::shared_ptr<SimulationInfo> simInfo2, std::string nameWerte1, std::string nameWerte2, std::string nameWerte3, double testWert1, double testWert2, double testWert3); void makeSimulationHeadOutput(std::shared_ptr< SimulationInfo> simInfo); diff --git a/targets/tests/NumericalTests/Utilities/ConfigFileReader/ConfigFileReader.cpp b/targets/tests/NumericalTests/Utilities/ConfigFileReader/ConfigFileReader.cpp index 0a877a253ed9a68968afc3748b9e82bfe49739ad..a1fa00d6c1454d1b6ebc8cb578fd4fb5a99305d6 100644 --- a/targets/tests/NumericalTests/Utilities/ConfigFileReader/ConfigFileReader.cpp +++ b/targets/tests/NumericalTests/Utilities/ConfigFileReader/ConfigFileReader.cpp @@ -30,6 +30,8 @@ #include "Utilities/LogFileInformation/BasicSimulationInfo/BasicSimulationInfo.h" #include "Utilities\LogFileInformation\LogFileTimeInformation\LogFileTimeInformation.h" +#include "Utilities\ColorConsoleOutput\ColorConsoleOutputImp.h" + std::shared_ptr<ConfigFileReader> ConfigFileReader::getNewInstance() { return std::shared_ptr<ConfigFileReader>(new ConfigFileReader()); @@ -58,7 +60,9 @@ ConfigFileReader::ConfigFileReader() l0 = 32.0; rho0 = 1.0; - testQueue = TestQueueImp::getNewInstance(); + + colorOutput = ColorConsoleOutputImp::getInstance(); + testQueue = TestQueueImp::getNewInstance(colorOutput); } void ConfigFileReader::readConfigFile(const std::string aFilePath) @@ -167,7 +171,7 @@ std::vector< std::shared_ptr< TestSimulation>> ConfigFileReader::buildTestSimula testSim.resize(0); for (int i = 0; i < simPara.size(); i++) { - testSim.push_back(TestSimulationImp::getNewInsance(simID, simPara.at(i), simInfo.at(i))); + testSim.push_back(TestSimulationImp::getNewInsance(simID, simPara.at(i), simInfo.at(i), colorOutput)); simID++; } return testSim; @@ -252,7 +256,7 @@ std::vector< std::shared_ptr< PhiAndNuTest>> ConfigFileReader::makePhiAndNuTests for (int i = 1; i < testSim.size(); i++) { for (int j = 0; j < i; j++) { - std::shared_ptr< PhiAndNuTest> test = PhiAndNuTest::getNewInstance(dataToCalcPhiAndNuTest, minOrderOfAccuracy, viscosity); + std::shared_ptr< PhiAndNuTest> test = PhiAndNuTest::getNewInstance(colorOutput, dataToCalcPhiAndNuTest, minOrderOfAccuracy, viscosity); test->addSimulation(testSim.at(j), simInfo.at(j)); test->addSimulation(testSim.at(i), simInfo.at(i)); @@ -270,7 +274,7 @@ std::vector<std::shared_ptr<L2NormTest>> ConfigFileReader::makeL2NormTests(std:: { std::vector<std::shared_ptr<L2NormTest>> l2Tests; for (int i = 0; i < testSim.size(); i++) { - std::shared_ptr<L2NormTest> test = L2NormTest::getNewInstance(analyticalResults.at(i)); + std::shared_ptr<L2NormTest> test = L2NormTest::getNewInstance(analyticalResults.at(i), colorOutput); test->addSimulation(testSim.at(i), simInfo.at(i)); testSim.at(i)->registerSimulationObserver(test); l2Tests.push_back(test); diff --git a/targets/tests/NumericalTests/Utilities/ConfigFileReader/ConfigFileReader.h b/targets/tests/NumericalTests/Utilities/ConfigFileReader/ConfigFileReader.h index da03b2eb663d5106564945ae66db1602673df37e..9a0bf1d0263556b85cab68ceee611d79885eb12c 100644 --- a/targets/tests/NumericalTests/Utilities/ConfigFileReader/ConfigFileReader.h +++ b/targets/tests/NumericalTests/Utilities/ConfigFileReader/ConfigFileReader.h @@ -22,6 +22,7 @@ class LogFileTimeInformation; class TestLogFileInformation; class SimulationLogFileInformation; class AnalyticalResults; +class ColorConsoleOutput; class ConfigFileReader { @@ -79,10 +80,10 @@ private: std::vector< bool> sw; std::vector< std::shared_ptr< LogFileInformation> > logInfo; - - std::shared_ptr< TestQueueImp> testQueue; std::vector< std::shared_ptr< TestSimulation>> testSimulation; + std::shared_ptr< TestQueueImp> testQueue; + std::shared_ptr< ColorConsoleOutput> colorOutput; std::shared_ptr< LogFileQueueImp> logFileWriterQueue; int simID; diff --git a/targets/tests/NumericalTests/Utilities/Test/TestImp.cpp b/targets/tests/NumericalTests/Utilities/Test/TestImp.cpp index cc87445c27994ad55be308ab3b8540cb730aba72..eb6b42159f518cffdd978b256aa4da8c3439ebc0 100644 --- a/targets/tests/NumericalTests/Utilities/Test/TestImp.cpp +++ b/targets/tests/NumericalTests/Utilities/Test/TestImp.cpp @@ -33,7 +33,7 @@ std::string TestImp::getSimulationName() return simulationName; } -TestImp::TestImp() +TestImp::TestImp(std::shared_ptr<ColorConsoleOutput> colorOutput) : colorOutput(colorOutput) { simulationRun.resize(0); simulations.resize(0); diff --git a/targets/tests/NumericalTests/Utilities/Test/TestImp.h b/targets/tests/NumericalTests/Utilities/Test/TestImp.h index f4356a134c3cd56a5cb338c1944f23dac9c87707..41299075f508a2016eea5334f56c99e4ca8da236 100644 --- a/targets/tests/NumericalTests/Utilities/Test/TestImp.h +++ b/targets/tests/NumericalTests/Utilities/Test/TestImp.h @@ -8,6 +8,7 @@ class TestSimulation; class SimulationResults; class SimulationInfo; +class ColorConsoleOutput; class TestImp : public Test { @@ -23,16 +24,20 @@ public: std::string getSimulationName(); protected: - TestImp(); + TestImp(std::shared_ptr< ColorConsoleOutput> colorOutput); bool CheckAllSimulationRun(); std::vector< bool> simulationRun; + std::shared_ptr< ColorConsoleOutput> colorOutput; std::vector< std::shared_ptr< TestSimulation>> simulations; std::vector< std::shared_ptr< SimulationResults>> simResults; std::vector< std::shared_ptr< SimulationInfo>> simInfos; std::string kernelName; std::string simulationName; + +private: + TestImp() {}; }; #endif \ No newline at end of file diff --git a/targets/tests/NumericalTests/Utilities/TestQueue/TestQueueImp.cpp b/targets/tests/NumericalTests/Utilities/TestQueue/TestQueueImp.cpp index 67fe8c0af121240e56c7a450de49ab1c98a7ea95..defc66cf257e37cdc7063acae0fae5d742684815 100644 --- a/targets/tests/NumericalTests/Utilities/TestQueue/TestQueueImp.cpp +++ b/targets/tests/NumericalTests/Utilities/TestQueue/TestQueueImp.cpp @@ -1,6 +1,6 @@ #include "TestQueueImp.h" -#include "Utilities\ColorConsoleOutput\ColorConsoleOutputImp.h" +#include "Utilities\ColorConsoleOutput\ColorConsoleOutput.h" #include "Utilities\Test\Test.h" void TestQueueImp::makeFinalOutput() @@ -12,9 +12,9 @@ void TestQueueImp::makeFinalOutput() colorOutput->makeFinalTestOutputFoot(numberOfPassedTest, numberOfTests); } -std::shared_ptr<TestQueueImp> TestQueueImp::getNewInstance() +std::shared_ptr<TestQueueImp> TestQueueImp::getNewInstance(std::shared_ptr< ColorConsoleOutput> colorOutput) { - return std::shared_ptr<TestQueueImp>(new TestQueueImp()); + return std::shared_ptr<TestQueueImp>(new TestQueueImp(colorOutput)); } void TestQueueImp::addTest(std::shared_ptr<Test> test) @@ -22,10 +22,9 @@ void TestQueueImp::addTest(std::shared_ptr<Test> test) tests.push_back(test); } -TestQueueImp::TestQueueImp() +TestQueueImp::TestQueueImp(std::shared_ptr< ColorConsoleOutput> colorOutput) { tests.resize(0); - colorOutput = ColorConsoleOutputImp::getNewInstance(); } void TestQueueImp::calcNumberOfPassedTest() diff --git a/targets/tests/NumericalTests/Utilities/TestQueue/TestQueueImp.h b/targets/tests/NumericalTests/Utilities/TestQueue/TestQueueImp.h index 997590e021cca54b5d5684b435dc622d94c95473..bafb824ec3186e403ae332411d420ae3a62ff895 100644 --- a/targets/tests/NumericalTests/Utilities/TestQueue/TestQueueImp.h +++ b/targets/tests/NumericalTests/Utilities/TestQueue/TestQueueImp.h @@ -14,16 +14,16 @@ class TestQueueImp : public TestQueue public: void makeFinalOutput(); - static std::shared_ptr< TestQueueImp> getNewInstance(); + static std::shared_ptr< TestQueueImp> getNewInstance(std::shared_ptr< ColorConsoleOutput> colorOutput); void addTest(std::shared_ptr< Test> test); private: - TestQueueImp(); + TestQueueImp(std::shared_ptr< ColorConsoleOutput> colorOutput); void calcNumberOfPassedTest(); - std::vector< std::shared_ptr< Test>> tests; std::shared_ptr< ColorConsoleOutput> colorOutput; + std::vector< std::shared_ptr< Test>> tests; int numberOfPassedTest; int numberOfTests; }; diff --git a/targets/tests/NumericalTests/Utilities/TestSimulation/TestSimulationImp.cpp b/targets/tests/NumericalTests/Utilities/TestSimulation/TestSimulationImp.cpp index 2591921bcebf82eaa5ca0c0c166b122870ef89f2..7efa4735b8770ddffe621216b73858e1c07bb098 100644 --- a/targets/tests/NumericalTests/Utilities/TestSimulation/TestSimulationImp.cpp +++ b/targets/tests/NumericalTests/Utilities/TestSimulation/TestSimulationImp.cpp @@ -7,16 +7,16 @@ #include "Utilities/Results/SimulationResults/SimulationResults.h" #include "Utilities\Test\SimulationObserver.h" #include "Utilities\DataWriter\Y2dSliceToResults\Y2dSliceToResults.h" -#include "Utilities\ColorConsoleOutput\ColorConsoleOutputImp.h" +#include "Utilities\ColorConsoleOutput\ColorConsoleOutput.h" #include "Utilities\KernelConfiguration\KernelConfiguration.h" #include <sstream> #include <iomanip> -std::shared_ptr<TestSimulation> TestSimulationImp::getNewInsance(int simID, std::shared_ptr< SimulationParameter> simPara, std::shared_ptr< SimulationInfo> simInfo) +std::shared_ptr<TestSimulation> TestSimulationImp::getNewInsance(int simID, std::shared_ptr< SimulationParameter> simPara, std::shared_ptr< SimulationInfo> simInfo, std::shared_ptr< ColorConsoleOutput> colorOutput) { - return std::shared_ptr< TestSimulation>(new TestSimulationImp(simID, simPara, simInfo)); + return std::shared_ptr< TestSimulation>(new TestSimulationImp(simID, simPara, simInfo, colorOutput)); } std::shared_ptr<SimulationParameter> TestSimulationImp::getSimulationParameter() @@ -79,14 +79,13 @@ std::string TestSimulationImp::getSimulationRunTimeOutput() return oss.str(); } -TestSimulationImp::TestSimulationImp(int simID, std::shared_ptr< SimulationParameter> simPara, std::shared_ptr< SimulationInfo> simInfo) : simID(simID) +TestSimulationImp::TestSimulationImp(int simID, std::shared_ptr< SimulationParameter> simPara, std::shared_ptr< SimulationInfo> simInfo, std::shared_ptr< ColorConsoleOutput> colorOutput) : simID(simID), colorOutput(colorOutput) { this->simPara = simPara; this->simInfo = simInfo; simResults = SimulationResults::getNewInstance(simPara->getLx(), 1, simPara->getLz(), simPara->getTimeStepLength()); writeToVector = std::shared_ptr<ToVectorWriter>(new Y2dSliceToResults(simResults, simPara->getYSliceForCalculation(), simPara->getStartTimeCalculation(), simPara->getEndTime(), simPara->getTimeStepLength(), simPara->getWriteFiles(), std::shared_ptr<FileWriter>(new FileWriter()), simPara->getStartTimeDataWriter())); - colorOutput = ColorConsoleOutputImp::getNewInstance(); simObserver.resize(0); simualtionRun = false; diff --git a/targets/tests/NumericalTests/Utilities/TestSimulation/TestSimulationImp.h b/targets/tests/NumericalTests/Utilities/TestSimulation/TestSimulationImp.h index e27b3d5ef374ab9c5ac5c755710a08085d6d4ef2..c891de58273cd10b7a872a65ecdda8d15a17127d 100644 --- a/targets/tests/NumericalTests/Utilities/TestSimulation/TestSimulationImp.h +++ b/targets/tests/NumericalTests/Utilities/TestSimulation/TestSimulationImp.h @@ -13,7 +13,7 @@ class SimulationInfo; class TestSimulationImp : public TestSimulation { public: - static std::shared_ptr< TestSimulation> getNewInsance(int simID, std::shared_ptr< SimulationParameter> simPara, std::shared_ptr< SimulationInfo> simInfo); + static std::shared_ptr< TestSimulation> getNewInsance(int simID, std::shared_ptr< SimulationParameter> simPara, std::shared_ptr< SimulationInfo> simInfo, std::shared_ptr< ColorConsoleOutput> colorOutput); std::shared_ptr< SimulationParameter> getSimulationParameter(); std::shared_ptr< DataWriter> getDataWriter(); @@ -28,7 +28,7 @@ public: std::string getSimulationRunTimeOutput(); private: - TestSimulationImp(int simID, std::shared_ptr< SimulationParameter> simPara, std::shared_ptr< SimulationInfo> simInfo); + TestSimulationImp(int simID, std::shared_ptr< SimulationParameter> simPara, std::shared_ptr< SimulationInfo> simInfo, std::shared_ptr< ColorConsoleOutput> colorOutput); void notifyObserver(); double calcSimTime();