VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
BoundaryValues.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 BoundaryValues_H
34#define BoundaryValues_H
35
36#include <string>
37#include <vector>
38#include <fstream>
39#include <memory>
40
42
43namespace vf::gpu {
44
45class Parameter;
46
48{
49private:
50 std::string boundaryCondition;
51 bool procNeighbor;
52
53 std::vector< std::vector<std::vector<real> > >values;
54 std::vector< std::vector<uint> >indices;
55 std::vector<uint> levelSizes;
56
57 std::ifstream file;
58 uint maxLevel;
59
60public:
61 BoundaryValues(std::string path);
62 BoundaryValues(std::string path, std::shared_ptr<Parameter> para, std::string str);
63 BoundaryValues(int neighbor, std::shared_ptr<Parameter> para, std::string sor, std::string dir);
65
66 uint getLevel();
67 uint getSize(uint level);
68 std::string getBoundaryCondition();
69 void setBoundarys(std::vector<std::vector<std::vector<real> > > &qs) const;
70 void setValues(real* velo, uint level, uint column) const;
71 void initIndex(uint *ptr, uint level);
72
73 void setProcNeighbor(bool pN);
74 bool getProcNeighbor();
75
76 void setPressValues(real *RhoBC, int* kN, int level) const;
77 void setVelocityValues(real *vx, real *vy, real *vz, int level) const;
78 void setOutflowValues(real *RhoBC, int* kN, int level) const;
79
80private:
81 void init();
82 int getNumberOfColumns();
83 void initalVectors(uint maxColumn);
84 void readData(uint level, int index, uint maxColumn);
85 void resizeVectorsPerLevel(uint level, uint maxColumn);
86 void skipLine();
87 void readLevelSize(uint level);
88 void initalVectorsWithSingleZero();
89 void readNumberOfLevels();
90 void readBC();
91 void resizeVectors();
92
93
94};
95
96}
97
98#endif
99
void setValues(real *velo, uint level, uint column) const
void setVelocityValues(real *vx, real *vy, real *vz, int level) const
void setOutflowValues(real *RhoBC, int *kN, int level) const
void initIndex(uint *ptr, uint level)
void setBoundarys(std::vector< std::vector< std::vector< real > > > &qs) const
std::string getBoundaryCondition()
void setPressValues(real *RhoBC, int *kN, int level) const
std::shared_ptr< T > SPtr
float real
Definition DataTypes.h:42
unsigned int uint
Definition DataTypes.h:47