VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
SimulationParameterImp.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//=======================================================================================
34
36
39
40#include <filesystem>
41
42SimulationParameterImp::SimulationParameterImp(std::string kernel, double viscosity, std::shared_ptr<BasicSimulationParameterStruct> basicSimPara, std::shared_ptr<GridInformationStruct> gridInfo)
43 : viscosity(viscosity)
44{
45 kernelConfig = KernelConfigurationImp::getNewInstance(kernel);
46
47 devices = basicSimPara->devices;
48 numberOfTimeSteps = basicSimPara->numberOfTimeSteps;
49
50 gridPath = gridInfo->gridPath;
51 lx = gridInfo->lx;
52 lz = gridInfo->lz;
53 l0 = basicSimPara->l0;
54 maxLevel = gridInfo->maxLevel;
55 numberOfGridLevels = gridInfo->numberOfGridLevels;
56}
57
59{
60 std::filesystem::path dir(filePath);
61 if (!(std::filesystem::exists(dir)))
62 std::filesystem::create_directories(dir);
63}
64
66{
67 return viscosity;
68}
69
71{
72 return gridPath;
73}
74
76{
77 return filePath;
78}
79
81{
82 return numberOfGridLevels;
83}
84
86{
87 return timeStepLength * numberOfTimeSteps;
88}
89
94
96{
97 return lx;
98}
99
101{
102 return lz;
103}
104
106{
107 return l0;
108}
109
110std::vector<unsigned int> SimulationParameterImp::getDevices()
111{
112 return devices;
113}
114
119
120std::shared_ptr<KernelConfiguration> SimulationParameterImp::getKernelConfiguration()
121{
122 return kernelConfig;
123}
static std::shared_ptr< KernelConfigurationImp > getNewInstance(std::string kernel)
std::vector< unsigned int > getDevices()
void generateFileDirectionInMyStystem(std::string filePath)
std::shared_ptr< KernelConfiguration > getKernelConfiguration()
std::shared_ptr< T > SPtr