VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
BoundaryQs.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 BoundaryQs_H
34#define BoundaryQs_H
35
36#include <vector>
37#include <string>
38#include <fstream>
39#include <memory>
40
42
43namespace vf::gpu {
44
45class Parameter;
46
48{
49public:
50 BoundaryQs();
51 BoundaryQs(std::string q, bool binaer);
52 BoundaryQs(std::string q, std::shared_ptr<Parameter> para, std::string str, bool binaer);
53 ~BoundaryQs(void);
54
55public:
56 unsigned int getSize(unsigned int level);
57 unsigned int getLevel();
58
59
60private:
61 void checkFileStatus(std::string path);
62 void init();
63 void resizeVectors();
64 void resizeVectorsPerLevel(unsigned int level, std::vector<uint32_t> &vec1D_code);
65
66 void init_Binary();
67
68public:
69 void setIndexInVector(std::vector<std::vector<int>> &data, unsigned int level) const;
70 void setValuesInVector(std::vector<std::vector<std::vector<real>>> &q27, unsigned int level) const;
71 void setIndex(int *indices, unsigned int level) const;
72 void setValues(real** q27, unsigned int level) const;
73 void getQs(std::vector<std::vector<std::vector<real> > > &qs);
74 void getIndices(std::vector<std::vector<uint> > &indices);
75 //void initArray(real* ptr, unsigned int level, unsigned int column);
76 //void initIndex(int *ptr, unsigned int level);
77
78private:
79 std::vector< std::vector<std::vector<real> > >values;
80 std::vector< std::vector<unsigned int> >indices;
81
82 std::ifstream file;
83 unsigned int maxLevel;
84 std::vector<unsigned int> levelSizes;
85
86};
87
88}
89
90#endif
void setValuesInVector(std::vector< std::vector< std::vector< real > > > &q27, unsigned int level) const
unsigned int getSize(unsigned int level)
void getQs(std::vector< std::vector< std::vector< real > > > &qs)
void getIndices(std::vector< std::vector< uint > > &indices)
void setValues(real **q27, unsigned int level) const
unsigned int getLevel()
void setIndex(int *indices, unsigned int level) const
void setIndexInVector(std::vector< std::vector< int > > &data, unsigned int level) const
std::shared_ptr< T > SPtr
float real
Definition DataTypes.h:42