VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
AnalyticalResultImp.cpp
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#include "AnalyticalResultImp.h"
34
35#include "../SimulationResults/SimulationResults.h"
36
41
43{
44 return l0;
45}
46
47AnalyticalResultsImp::AnalyticalResultsImp()
48{
49 calculated = false;
50}
51
53{
54 this->l0 = l0;
55 calculated = false;
56}
57
58void AnalyticalResultsImp::init(std::shared_ptr<SimulationResults> simResults)
59{
60 this->xNodes = simResults->getNumberOfXNodes();
61 this->yNodes = simResults->getNumberOfYNodes();
62 this->zNodes = simResults->getNumberOfZNodes();
64 this->timeStepLength = simResults->getTimeStepLength();
65 this->numberOfTimeSteps = simResults->getNumberOfTimeSteps();
66 this->timeStep = simResults->getTimeSteps();
67 this->time = simResults->getTime();
68 this->x = simResults->getXNodes();
69 this->y = simResults->getYNodes();
70 this->z = simResults->getZNodes();
71 this->level = simResults->getLevels();
72 this->l0 = simResults->getL0();
73
74 this->vx.resize(numberOfTimeSteps);
75 this->vy.resize(numberOfTimeSteps);
76 this->vz.resize(numberOfTimeSteps);
77 this->press.resize(numberOfTimeSteps);
78 this->rho.resize(numberOfTimeSteps);
79
80 for (int i = 0; i < numberOfTimeSteps; i++) {
81 this->vx.at(i).resize(numberOfNodes);
82 this->vy.at(i).resize(numberOfNodes);
83 this->vz.at(i).resize(numberOfNodes);
84 this->press.at(i).resize(numberOfNodes);
85 this->rho.at(i).resize(numberOfNodes);
86 }
87}
unsigned int numberOfTimeSteps
Definition ResultsImp.h:65
unsigned int timeStepLength
Definition ResultsImp.h:66
std::vector< std::vector< double > > z
Definition ResultsImp.h:72
unsigned int yNodes
Definition ResultsImp.h:67
std::vector< std::vector< double > > rho
Definition ResultsImp.h:75
std::vector< std::vector< unsigned int > > level
Definition ResultsImp.h:76
std::vector< std::vector< double > > vy
Definition ResultsImp.h:73
std::vector< std::vector< double > > y
Definition ResultsImp.h:72
unsigned int numberOfNodes
Definition ResultsImp.h:68
std::vector< int > time
Definition ResultsImp.h:71
std::vector< std::vector< double > > vz
Definition ResultsImp.h:73
std::vector< std::vector< double > > x
Definition ResultsImp.h:72
unsigned int xNodes
Definition ResultsImp.h:67
std::vector< std::vector< double > > vx
Definition ResultsImp.h:73
unsigned int zNodes
Definition ResultsImp.h:67
std::vector< std::vector< double > > press
Definition ResultsImp.h:74
std::vector< unsigned int > timeStep
Definition ResultsImp.h:70
void init(std::shared_ptr< SimulationResults > simResults)
std::shared_ptr< T > SPtr