VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
SimulationResults.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 "SimulationResults.h"
34
36
37#define _USE_MATH_DEFINES
38#include <math.h>
39
40SimulationResults::SimulationResults(std::shared_ptr<SimulationParameter> simPara) : ResultsImp(simPara->getL0())
41{
42 this->xNodes = simPara->getLx();
43 this->yNodes = 1;
44 this->zNodes = simPara->getLz();
45 this->numberOfNodes = xNodes*yNodes*zNodes;
46 this->timeStepLength = simPara->getTimeStepLength();
47 this->numberOfTimeSteps = 0;
48}
49
50std::shared_ptr<SimulationResults> SimulationResults::getNewInstance(std::shared_ptr<SimulationParameter> simPara)
51{
52 return std::shared_ptr<SimulationResults>(new SimulationResults(simPara));
53}
54
55void SimulationResults::addTimeStep(unsigned int timeStep, unsigned int time, std::vector<unsigned int> level, std::vector<double> x, std::vector<double> y, std::vector<double> z, std::vector<double> vx, std::vector<double> vy, std::vector<double> vz, std::vector<double> press, std::vector<double> rho)
56{
57 this->timeStep.push_back(timeStep);
58 this->time.push_back(time);
59 this->x.push_back(x);
60 this->y.push_back(y);
61 this->z.push_back(z);
62 this->vx.push_back(vx);
63 this->vy.push_back(vy);
64 this->vz.push_back(vz);
65 this->press.push_back(press);
66 this->rho.push_back(rho);
67 this->level.push_back(level);
69}
unsigned int numberOfTimeSteps
Definition ResultsImp.h:65
std::vector< std::vector< double > > z
Definition ResultsImp.h:72
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
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
std::vector< std::vector< double > > vx
Definition ResultsImp.h:73
std::vector< std::vector< double > > press
Definition ResultsImp.h:74
std::vector< unsigned int > timeStep
Definition ResultsImp.h:70
void addTimeStep(unsigned int timeStep, unsigned int time, std::vector< unsigned int > level, std::vector< double > x, std::vector< double > y, std::vector< double > z, std::vector< double > vx, std::vector< double > vy, std::vector< double > vz, std::vector< double > press, std::vector< double > rho)
static std::shared_ptr< SimulationResults > getNewInstance(std::shared_ptr< SimulationParameter > simPara)
int getTimeStepLength()
@ z
Definition Axis.h:44
@ x
Definition Axis.h:42
@ y
Definition Axis.h:43