100NumericalTestFactoryImp::NumericalTestFactoryImp(std::shared_ptr<ConfigDataStruct>
configFileData)
107 l2NormTestsBetweenKernels.resize(0);
113 return myTestSimulations;
123 return myLogFileWriterQueue;
126void NumericalTestFactoryImp::init(std::shared_ptr<ConfigDataStruct>
configFileData)
133 for (
size_t k = 0; k <
configFileData->taylorGreenVortexUxParameter.size(); k++) {
141 for (
size_t k = 0; k <
configFileData->taylorGreenVortexUzParameter.size(); k++) {
149 for (
size_t k = 0; k <
configFileData->shearWaveParameter.size(); k++) {
162std::shared_ptr<NumericalTestStruct> NumericalTestFactoryImp::makeNumericalTestStruct(std::shared_ptr<ConfigDataStruct>
configFileData, std::shared_ptr<SimulationDataStruct>
simDataStruct, std::string kernel,
double viscosity,
int basicTimeStepLength)
183 std::vector<std::shared_ptr<SimulationInfo> > simInfo;
185 simInfo.push_back(
simDataStruct->testSimData.at(
i)->simInformation);
193void NumericalTestFactoryImp::addNumericalTestStruct(std::shared_ptr<NumericalTestStruct>
numericalTestStruct)
204std::shared_ptr<SimulationDataStruct> NumericalTestFactoryImp::makeTaylorGreenUxSimulationData(std::string kernel,
double viscosity, std::shared_ptr<TaylorGreenVortexUxParameterStruct>
simParaStruct, std::vector<std::shared_ptr<GridInformationStruct> >
gridInfoStruct)
227std::shared_ptr<SimulationDataStruct> NumericalTestFactoryImp::makeTaylorGreenUzSimulationData(std::string kernel,
double viscosity, std::shared_ptr<TaylorGreenVortexUzParameterStruct>
simParaStruct, std::vector<std::shared_ptr<GridInformationStruct> >
gridInfoStruct)
249std::shared_ptr<SimulationDataStruct> NumericalTestFactoryImp::makeShearWaveSimulationData(std::string kernel,
double viscosity, std::shared_ptr<ShearWaveParameterStruct>
simParaStruct, std::vector<std::shared_ptr<GridInformationStruct> >
gridInfoStruct)
271std::vector<std::shared_ptr<TestSimulationImp> > NumericalTestFactoryImp::makeTestSimulations(std::vector<std::shared_ptr<TestSimulationDataStruct> >
testSimDataStruct, std::shared_ptr<VectorWriterInformationStruct> vectorWriterInfo,
unsigned int ySliceForCalculation)
273 std::vector<std::shared_ptr<TestSimulationImp> > testSimulations;
289 testSimulations.push_back(
testSim);
292 return testSimulations;
295std::shared_ptr<TestStruct> NumericalTestFactoryImp::makePhiTestsStructs(std::shared_ptr<PhiTestParameterStruct>
testParameter, std::vector<std::shared_ptr<TestSimulationImp>>
testSimumlations,
double viscosity)
319std::vector<std::shared_ptr<PhiTest>> NumericalTestFactoryImp::makePhiTests(std::shared_ptr<PhiTestParameterStruct>
testParameter, std::vector<std::shared_ptr<TestSimulationImp>>
testSim, std::vector<std::shared_ptr<PhiTestPostProcessingStrategy>>
phiPostProStrategy,
double viscosity, std::string dataToCalculate)
321 std::vector<std::shared_ptr<PhiTest> >
phiTests;
323 for (
size_t j = 0;
j <
i;
j++) {
337std::shared_ptr<TestStruct> NumericalTestFactoryImp::makeNyTestsStructs(std::shared_ptr<NyTestParameterStruct>
testParameter, std::vector<std::shared_ptr<TestSimulationImp>>
testSimumlations,
double viscosity)
361std::vector<std::shared_ptr<NyTest>> NumericalTestFactoryImp::makeNyTests(std::shared_ptr<NyTestParameterStruct>
testParameter, std::vector<std::shared_ptr<TestSimulationImp>>
testSim, std::vector<std::shared_ptr<NyTestPostProcessingStrategy>>
nuPostProStrategy,
double viscosity, std::string dataToCalculate)
363 std::vector<std::shared_ptr<NyTest> >
nyTests;
365 for (
size_t j = 0;
j <
i;
j++) {
379std::shared_ptr<TestStruct> NumericalTestFactoryImp::makeL2NormTestsStructs(std::shared_ptr<L2NormTestParameterStruct>
testParameter, std::vector<std::shared_ptr<TestSimulationImp> >
testSimumlations)
391 for(
size_t i = 0;
i < tests.size();
i++)
399std::vector<std::shared_ptr<L2NormTest> > NumericalTestFactoryImp::makeL2NormTests(std::vector<std::shared_ptr<TestSimulationImp> >
testSim, std::vector<std::shared_ptr<L2NormPostProcessingStrategy> >
postProStrategy, std::shared_ptr<L2NormTestParameterStruct>
testParameter)
401 std::vector<std::shared_ptr<L2NormTest> >
l2Tests;
402 for (
size_t k = 0; k <
testParameter->normalizeData.size(); k++) {
404 for (
size_t j = 0;
j <
testSim.at(
i)->getDataToCalcTests().size();
j++) {
415std::shared_ptr<TestStruct> NumericalTestFactoryImp::makeL2NormTestsBetweenKernelsStructs(std::shared_ptr<L2NormTestBetweenKernelsParameterStruct>
testPara, std::vector<std::shared_ptr<TestSimulationImp> >
testSim, std::string kernelName)
418 testStruct->testName =
"L2NormTestBetweenKernel";
420 if (
testPara->basicTestParameter->runTest) {
426 if (kernelName ==
testPara->basicKernel) {
429 if (l2NormTestsBetweenKernels.size() == 0) {
430 l2NormTestsBetweenKernels = tests;
433 for (
size_t i = 0;
i < tests.size();
i++)
434 for (
size_t j = 0;
j < tests.at(
i).size();
j++)
435 l2NormTestsBetweenKernels.at(
i).push_back(tests.at(
i).at(
j));
440 for (
size_t i = 0;
i < tests.size();
i++)
448std::vector<std::vector<std::shared_ptr<L2NormTestBetweenKernels> > > NumericalTestFactoryImp::makeL2NormTestsBetweenKernels(std::shared_ptr<L2NormTestBetweenKernelsParameterStruct>
testPara, std::vector<std::shared_ptr<TestSimulationImp> >
testSim, std::vector<std::shared_ptr<L2NormBetweenKernelPostProcessingStrategy> >
postProcessingStrategies)
450 std::vector<std::vector<std::shared_ptr<L2NormTestBetweenKernels> > >
testsForAllKernels;
454 for (
size_t l = 0;
l <
testPara->kernelsToTest.size() - 1;
l++) {
455 for (
size_t k = 0; k <
testSim.size(); k++) {
456 for(
size_t j = 0;
j <
testSim.at(k)->getDataToCalcTests().size();
j++){
457 for (
size_t m = 0;
m <
testPara->normalizeData.size();
m++) {
458 for (
size_t i = 0;
i <
testPara->timeSteps.size();
i++) {
474std::vector<std::shared_ptr<L2NormTestBetweenKernels> > NumericalTestFactoryImp::linkL2NormTestsBetweenKernels(std::shared_ptr<L2NormTestBetweenKernelsParameterStruct>
testPara, std::vector<std::shared_ptr<TestSimulationImp> >
testSim, std::vector<std::shared_ptr<L2NormBetweenKernelPostProcessingStrategy> >
postProcessingStrategies)
476 std::vector<std::shared_ptr<L2NormTestBetweenKernels> > tests;
479 if (l2NormTestsBetweenKernels.at(0).size() == 0)
480 l2NormTestsBetweenKernels.erase(l2NormTestsBetweenKernels.begin());
482 for (
size_t k = 0; k <
testSim.size(); k++) {
483 for (
size_t j = 0;
j <
testSim.at(k)->getDataToCalcTests().size();
j++) {
484 for (
size_t m = 0;
m <
testPara->normalizeData.size();
m++) {
485 for (
size_t i = 0;
i <
testPara->timeSteps.size();
i++) {
486 std::shared_ptr<L2NormTestBetweenKernels>
aTest = l2NormTestsBetweenKernels.at(0).at(0);
487 l2NormTestsBetweenKernels.at(0).erase(l2NormTestsBetweenKernels.at(0).begin());
490 tests.push_back(
aTest);
511std::shared_ptr<LogFileWriter> NumericalTestFactoryImp::makeLogFileWriter(std::vector<std::shared_ptr<TestLogFileInformation> >
testLogFiles, std::shared_ptr<SimulationLogFileInformation> simLogInfo, std::vector<std::shared_ptr<SimulationInfo> > simInfo, std::string kernel,
double viscosity,
int basicTimeStepLength, std::shared_ptr<LogFileParameterStruct> logFilePara, std::shared_ptr<BasicTestLogFileInformation>
basicTestLogFileInfo)
520 return logFileWriter;
static std::shared_ptr< PhiTestLogFileInformation > getNewInstance(std::shared_ptr< PhiTestParameterStruct > testPara)
static std::shared_ptr< ColorConsoleOutput > getInstance()
static std::shared_ptr< LogFileWriterImp > getNewInstance(std::shared_ptr< LogFileHead > logFileHead, std::shared_ptr< BasicSimulationInfo > basicSimInfo, std::shared_ptr< BasicTestLogFileInformation > basicTestInfo, std::vector< std::shared_ptr< TestLogFileInformation > > testLogFiles, std::shared_ptr< LogFileTimeInformation > logFileTimeInfo, std::shared_ptr< SimulationLogFileInformation > simLogInfo, std::string kernel, double viscosity)
static std::shared_ptr< Y2dSliceToResults > getNewInstance(std::shared_ptr< VectorWriterInformationStruct > vectorWriterInfo, unsigned int timeStepLength, std::shared_ptr< SimulationResults > simResults, unsigned int ySliceForCalculation)
static std::shared_ptr< TimeImp > getNewInstance()
static std::shared_ptr< LogFileInformationTaylorGreenUz > getNewInstance(std::shared_ptr< TaylorGreenVortexUzParameterStruct > simParaStruct, std::vector< std::shared_ptr< GridInformationStruct > > gridInfoStruct)
static std::shared_ptr< PhiTest > getNewInstance(std::shared_ptr< ColorConsoleOutput > colorOutput, double viscosity, std::shared_ptr< PhiTestParameterStruct > testPara, std::string dataToCalculate)
static std::shared_ptr< InitialConditionTaylorGreenUz > getNewInstance(std::shared_ptr< TaylorGreenVortexUzParameterStruct > simParaStruct, std::shared_ptr< GridInformationStruct > gridInfoStruct)
static std::shared_ptr< AnalyticalResults2DToVTKWriterImp > getInstance(bool writeAnalyticalResults)
std::shared_ptr< TestQueue > getTestQueue()
static std::shared_ptr< L2NormBetweenKernelPostProcessingStrategy > getNewInstance(std::shared_ptr< SimulationResults > simResult, std::shared_ptr< AnalyticalResults > analyticalResult, std::shared_ptr< L2NormTestBetweenKernelsParameterStruct > testPara, std::shared_ptr< L2NormCalculatorFactory > factory, std::vector< std::string > dataToCalcTests)
static std::shared_ptr< ShearWaveInformation > getNewInstance(std::shared_ptr< ShearWaveParameterStruct > simParaStruct, std::vector< std::shared_ptr< GridInformationStruct > > gridInfoStruct)
static std::shared_ptr< NumericalTestFactoryImp > getNewInstance(std::shared_ptr< ConfigDataStruct > configFileData)
static std::shared_ptr< L2NormInformation > getNewInstance(std::vector< std::shared_ptr< L2NormTest > > tests, std::shared_ptr< L2NormTestParameterStruct > testParameter, std::vector< std::string > dataToCalcTests)
static std::shared_ptr< InitialConditionShearWave > getNewInstance(std::shared_ptr< ShearWaveParameterStruct > simParaStruct, std::shared_ptr< GridInformationStruct > gridInfoStruct)
static std::shared_ptr< SimulationInfoTaylorGreenUz > getNewInstance(int simID, std::string kernel, double viscosity, std::shared_ptr< TaylorGreenVortexUzParameterStruct > simParaStruct, std::shared_ptr< GridInformationStruct > gridInfoStruct, int numberOfSimulations)
static std::shared_ptr< SimulationParameter > getNewInstance(std::string kernel, double viscosity, std::shared_ptr< TaylorGreenVortexUxParameterStruct > tgvParameterStruct, std::shared_ptr< GridInformationStruct > gridInfo)
static std::shared_ptr< InitialConditionTaylorGreenUx > getNewInstance(std::shared_ptr< TaylorGreenVortexUxParameterStruct > simParaStruct, std::shared_ptr< GridInformationStruct > gridInfoStruct)
static std::shared_ptr< LogFileTimeInformation > getNewInstance(std::vector< std::shared_ptr< SimulationInfo > > simInfo, bool fileWriting)
static std::shared_ptr< SimulationResults > getNewInstance(std::shared_ptr< SimulationParameter > simPara)
static std::shared_ptr< TestQueueImp > getNewInstance(std::shared_ptr< ColorConsoleOutput > colorOutput)
static std::shared_ptr< PhiTestPostProcessingStrategy > getNewInstance(std::shared_ptr< SimulationResults > simResult, std::shared_ptr< AnalyticalResults > analyticalResult, std::shared_ptr< PhiTestParameterStruct > testPara, std::vector< std::string > dataToCalcTests)
static std::shared_ptr< BasicTestLogFileInformation > getNewInstance()
static std::shared_ptr< AnalyticalResults > getNewInstance(double viscosity, std::shared_ptr< TaylorGreenVortexUzParameterStruct > simParaStruct)
static std::shared_ptr< L2NormTest > getNewInstance(std::shared_ptr< ColorConsoleOutput > colorOutput, std::shared_ptr< L2NormTestParameterStruct > testParameter, std::string dataToCalculate, double maxL2NormDiff, std::string normalizeData)
std::shared_ptr< LogFileQueue > getLogFileQueue()
static std::shared_ptr< LogFileHead > getNewInstance(std::vector< int > devices)
static std::shared_ptr< L2NormPostProcessingStrategy > getNewInstance(std::shared_ptr< SimulationResults > simResult, std::shared_ptr< AnalyticalResults > analyticalResult, std::shared_ptr< L2NormTestParameterStruct > testPara, std::shared_ptr< L2NormCalculatorFactory > factory, std::vector< std::string > dataToCalcTests)
static std::shared_ptr< AnalyticalResults > getNewInstance(double viscosity, std::shared_ptr< ShearWaveParameterStruct > simParaStruct)
static std::shared_ptr< BasicSimulationInfo > getNewInstance(int numberOfTimeSteps, double viscosity, int basicTimeStepLength, std::string kernel)
static std::shared_ptr< L2NormCalculatorFactory > getInstance()
static std::shared_ptr< AnalyticalResults > getNewInstance(double viscosity, std::shared_ptr< TaylorGreenVortexUxParameterStruct > simParaStruct)
static std::shared_ptr< L2NormBetweenKernelsInformation > getNewInstance(std::vector< std::shared_ptr< L2NormTestBetweenKernels > > tests, std::shared_ptr< L2NormTestBetweenKernelsParameterStruct > testPara, std::vector< std::string > dataToCalcTests)
static std::shared_ptr< L2NormTestBetweenKernels > getNewInstance(std::shared_ptr< ColorConsoleOutput > colorOutput, std::string dataToCalculate, unsigned int timeStep, std::string normalizeWith, std::shared_ptr< L2NormCalculatorFactory > factory)
static std::shared_ptr< NyTest > getNewInstance(std::shared_ptr< ColorConsoleOutput > colorOutput, double viscosity, std::shared_ptr< NyTestParameterStruct > testPara, std::string dataToCalculate)
static std::shared_ptr< ShearWaveSimulationInfo > getNewInstance(int simID, std::string kernel, double viscosity, std::shared_ptr< ShearWaveParameterStruct > simParaStruct, std::shared_ptr< GridInformationStruct > gridInfoStruct, int numberOfSimulations)
static std::shared_ptr< LogFileInformationTaylorGreenUx > getNewInstance(std::shared_ptr< TaylorGreenVortexUxParameterStruct > simParaStruct, std::vector< std::shared_ptr< GridInformationStruct > > gridInfoStruct)
static std::shared_ptr< SimulationParameterTaylorGreenUz > getNewInstance(std::string kernel, double viscosity, std::shared_ptr< TaylorGreenVortexUzParameterStruct > tgvParameterStruct, std::shared_ptr< GridInformationStruct > gridInfo)
static std::shared_ptr< SimulationInfoTaylorGreenUx > getNewInstance(int simID, std::string kernel, double viscosity, std::shared_ptr< TaylorGreenVortexUxParameterStruct > simParaStruct, std::shared_ptr< GridInformationStruct > gridInfoStruct, int numberOfSimulations)
static std::shared_ptr< NyTestPostProcessingStrategy > getNewInstance(std::shared_ptr< SimulationResults > simResult, std::shared_ptr< AnalyticalResults > analyticalResult, std::shared_ptr< NyTestParameterStruct > testPara, std::vector< std::string > dataToCalcTests)
static std::shared_ptr< SimulationParameter > getNewInstance(std::string kernel, double viscosity, std::shared_ptr< ShearWaveParameterStruct > parameterStruct, std::shared_ptr< GridInformationStruct > gridInfo)
static std::shared_ptr< LogFileQueueImp > getNewInstance(std::string basicLogFilePath)
static std::shared_ptr< NyTestLogFileInformation > getNewInstance(std::shared_ptr< NyTestParameterStruct > testPara)
std::vector< std::shared_ptr< TestSimulation > > getTestSimulations()
std::shared_ptr< T > SPtr
const std::function< void()> makeVirtualFluidSimulation(std::shared_ptr< Parameter > para, std::shared_ptr< InitialCondition > condition, std::shared_ptr< DataWriter > dataWriter)
std::shared_ptr< Parameter > makeParameter(std::shared_ptr< SimulationParameter > simPara)