VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
NyTest.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 NY_TEST_H
34#define NY_TEST_H
35
37
38#include <memory>
39#include <vector>
40#include <iostream>
41
42class FFTCalculator;
45
46class NyTest : public TestImp
47{
48public:
49 static std::shared_ptr<NyTest> getNewInstance(std::shared_ptr<ColorConsoleOutput> colorOutput, double viscosity, std::shared_ptr<NyTestParameterStruct> testPara, std::string dataToCalculate);
50
51 void update();
52 void addSimulation(std::shared_ptr<NumericalTestSimulation> sim, std::shared_ptr<SimulationInfo> simInfo, std::shared_ptr<NyTestPostProcessingStrategy> postProStrategy);
53
54 void evaluate();
55
56 std::string getDataToCalculate();
57 std::vector<int> getLx();
58 std::vector<double> getNy();
59 std::vector<double> getNyDiff();
61
62private:
63 NyTest(std::shared_ptr<ColorConsoleOutput> colorOutput, double viscosity, std::shared_ptr<NyTestParameterStruct> testPara, std::string dataToCalculate);
64 double calcOrderOfAccuracy(std::vector<double> data);
65 TestStatus checkTestPassed(double orderOfAccuracy);
66 bool checkNy(std::vector<double> ny);
67 std::vector<double> calcNyDiff(std::vector<double> ny);
68 std::vector<std::string> buildTestOutput();
69 std::vector<std::string> buildBasicTestOutput();
70 std::vector<std::string> buildErrorTestOutput();
71 std::vector<std::string> buildSimulationFailedTestOutput();
72
73
74 unsigned int startStepCalculation, endStepCalculation;
75 std::vector<double> lx;
76 std::vector<double> ny, nyDiff;
77 double orderOfAccuracy;
78 double minOrderOfAccuracy;
79 double viscosity;
80 std::string dataToCalculate;
81
82 std::vector<std::shared_ptr<NyTestPostProcessingStrategy> > postProStrategies;
83
84};
85#endif
86
std::shared_ptr< ColorConsoleOutput > colorOutput
Definition TestImp.h:72
std::vector< double > getNyDiff()
Definition NyTest.cpp:97
void update()
Definition NyTest.cpp:67
std::vector< int > getLx()
Definition NyTest.cpp:84
std::string getDataToCalculate()
Definition NyTest.cpp:79
void evaluate()
Definition NyTest.cpp:50
double getOrderOfAccuracyNyDiff()
Definition NyTest.cpp:102
void addSimulation(std::shared_ptr< NumericalTestSimulation > sim, std::shared_ptr< SimulationInfo > simInfo, std::shared_ptr< NyTestPostProcessingStrategy > postProStrategy)
Definition NyTest.cpp:72
static std::shared_ptr< NyTest > getNewInstance(std::shared_ptr< ColorConsoleOutput > colorOutput, double viscosity, std::shared_ptr< NyTestParameterStruct > testPara, std::string dataToCalculate)
Definition NyTest.cpp:45
std::vector< double > getNy()
Definition NyTest.cpp:92
TestStatus
Definition TestStatus.h:36
std::shared_ptr< T > SPtr