VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
NumericalTestFactoryImp.h
Go to the documentation of this file.
1//=======================================================================================
2// ____ ____ __ ______ __________ __ __ __ __
3// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
4// \ \ | | | | | |_) | | | | | | | / \ | |
5// \ \ | | | | | _ / | | | | | | / /\ \ | |
6// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
7// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
8// \ \ | | ________________________________________________________________
9// \ \ | | | ______________________________________________________________|
10// \ \| | | | __ __ __ __ ______ _______
11// \ | | |_____ | | | | | | | | | _ \ / _____)
12// \ | | _____| | | | | | | | | | | \ \ \_______
13// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
14// \ _____| |__| |________| \_______/ |__| |______/ (_______/
15//
16// This file is part of VirtualFluids. VirtualFluids is free software: you can
17// redistribute it and/or modify it under the terms of the GNU General Public
18// License as published by the Free Software Foundation, either version 3 of
19// the License, or (at your option) any later version.
20//
21// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
22// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
23// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24// for more details.
25//
26// SPDX-License-Identifier: GPL-3.0-or-later
27// SPDX-FileCopyrightText: Copyright © VirtualFluids Project contributors, see AUTHORS.md in root folder
28//
32//=======================================================================================
33#ifndef NUMERICAL_TEST_FACTORY_IMP_H
34#define NUMERICAL_TEST_FACTORY_IMP_H
35
37
38struct ConfigDataStruct;
48struct TestStruct;
53
54
59class L2NormTest;
64class LogFileQueueImp;
65class LogFileWriter;
66class PhiTest;
68class NyTest;
70class SimulationInfo;
74class TestQueueImp;
75class TestSimulation;
78
80{
81public:
82 static std::shared_ptr<NumericalTestFactoryImp> getNewInstance(std::shared_ptr<ConfigDataStruct> configFileData);
83
84 std::vector<std::shared_ptr<TestSimulation> > getTestSimulations();
85 std::shared_ptr<TestQueue> getTestQueue();
86 std::shared_ptr<LogFileQueue> getLogFileQueue();
87
88private:
90 NumericalTestFactoryImp(std::shared_ptr<ConfigDataStruct> configFileData);
91
92 void init(std::shared_ptr<ConfigDataStruct> configFileData);
93
94 std::shared_ptr<NumericalTestStruct> makeNumericalTestStruct(std::shared_ptr<ConfigDataStruct> configFileData, std::shared_ptr<SimulationDataStruct> simDataStruct, std::string kernel, double viscosity, int basicTimeStepLength);
95 void addNumericalTestStruct(std::shared_ptr<NumericalTestStruct> numericalTestStruct);
96
97 std::shared_ptr<SimulationDataStruct> makeTaylorGreenUxSimulationData(std::string kernel, double viscosity, std::shared_ptr<TaylorGreenVortexUxParameterStruct> simParaStruct, std::vector<std::shared_ptr<GridInformationStruct> > gridInfoStruct);
98 std::shared_ptr<SimulationDataStruct> makeTaylorGreenUzSimulationData(std::string kernel, double viscosity, std::shared_ptr<TaylorGreenVortexUzParameterStruct> simParaStruct, std::vector<std::shared_ptr<GridInformationStruct> > gridInfoStruct);
99 std::shared_ptr<SimulationDataStruct> makeShearWaveSimulationData(std::string kernel, double viscosity, std::shared_ptr<ShearWaveParameterStruct> simParaStruct, std::vector<std::shared_ptr<GridInformationStruct> > gridInfoStruct);
100
101 std::vector<std::shared_ptr<TestSimulationImp> > makeTestSimulations(std::vector<std::shared_ptr<TestSimulationDataStruct> > testSimDataStruct, std::shared_ptr<VectorWriterInformationStruct> vectorWriterInfo, unsigned int ySliceForCalculation);
102
103 std::shared_ptr<TestStruct> makePhiTestsStructs(std::shared_ptr<PhiTestParameterStruct> testParameter, std::vector<std::shared_ptr<TestSimulationImp> > testSimumlations, double viscosity);
104 std::shared_ptr<TestStruct> makeNyTestsStructs(std::shared_ptr<NyTestParameterStruct> testParameter, std::vector<std::shared_ptr<TestSimulationImp> > testSimumlations, double viscosity);
105 std::shared_ptr<TestStruct> makeL2NormTestsStructs(std::shared_ptr<L2NormTestParameterStruct> testParameter, std::vector<std::shared_ptr<TestSimulationImp> > testSimumlations);
106 std::shared_ptr<TestStruct> makeL2NormTestsBetweenKernelsStructs(std::shared_ptr<L2NormTestBetweenKernelsParameterStruct> testPara, std::vector<std::shared_ptr<TestSimulationImp> > testSim, std::string kernel);
107
108 std::vector<std::shared_ptr<PhiTest> > makePhiTests(std::shared_ptr<PhiTestParameterStruct> testParameter, std::vector<std::shared_ptr<TestSimulationImp> > testSim, std::vector<std::shared_ptr<PhiTestPostProcessingStrategy> > phiAndNuPostProStrategy, double viscosity, std::string dataToCalculate);
109 std::vector<std::shared_ptr<NyTest> > makeNyTests(std::shared_ptr<NyTestParameterStruct> testParameter, std::vector<std::shared_ptr<TestSimulationImp> > testSim, std::vector<std::shared_ptr<NyTestPostProcessingStrategy> > phiAndNuPostProStrategy, double viscosity, std::string dataToCalculate);
110 std::vector<std::shared_ptr<L2NormTest> > makeL2NormTests(std::vector<std::shared_ptr<TestSimulationImp> > testSim, std::vector<std::shared_ptr<L2NormPostProcessingStrategy> > postProStrategy, std::shared_ptr<L2NormTestParameterStruct> testParameter);
111 std::vector<std::vector<std::shared_ptr<L2NormTestBetweenKernels> > > makeL2NormTestsBetweenKernels(std::shared_ptr<L2NormTestBetweenKernelsParameterStruct> testPara, std::vector<std::shared_ptr<TestSimulationImp> > testSim, std::vector<std::shared_ptr<L2NormBetweenKernelPostProcessingStrategy> > postProcessingStrategies);
112 std::vector<std::shared_ptr<L2NormTestBetweenKernels> > linkL2NormTestsBetweenKernels(std::shared_ptr<L2NormTestBetweenKernelsParameterStruct> testPara, std::vector<std::shared_ptr<TestSimulationImp> > testSim, std::vector<std::shared_ptr<L2NormBetweenKernelPostProcessingStrategy> > postProcessingStrategies);
113
114 std::shared_ptr<LogFileWriter> 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);
115
116 void initTestStruct(std::shared_ptr<TestStruct> testStruct, std::shared_ptr<NumericalTestStruct> numericalTestStruct, std::vector<std::shared_ptr<TestLogFileInformation> > &testLogFileInfo, std::shared_ptr<BasicTestLogFileInformation> basicTestLogFileInfo);
117
118 std::vector<std::shared_ptr<TestSimulation> > myTestSimulations;
119 std::shared_ptr<TestQueueImp> myTestQueue;
120 std::shared_ptr<LogFileQueueImp> myLogFileWriterQueue;
121 std::vector<std::vector<std::shared_ptr<L2NormTestBetweenKernels> > > l2NormTestsBetweenKernels;
122 std::shared_ptr<ColorConsoleOutput> colorOutput;
123 std::shared_ptr<AnalyticalResults2DToVTKWriter> anaResultWriter;
124 std::shared_ptr<L2NormCalculatorFactory> l2NormCalculatorFactory;
125
126 int simID;
127 int numberOfSimulations;
128 // int simPerKernel, numberOfTestGroupsBetweenKernels, numberOfTestsForOneSimulation, numberOfTestsBetweenKernels;
129 // int posBasicSimulationForL2Test, posDivergentSimulationForL2Test;
130};
131#endif
132
std::shared_ptr< TestQueue > getTestQueue()
static std::shared_ptr< NumericalTestFactoryImp > getNewInstance(std::shared_ptr< ConfigDataStruct > configFileData)
std::shared_ptr< LogFileQueue > getLogFileQueue()
std::vector< std::shared_ptr< TestSimulation > > getTestSimulations()
std::shared_ptr< T > SPtr