VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
Cell.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//
33//=======================================================================================
34#ifndef CELL_H
35#define CELL_H
36
38
39namespace vf::gpu {
40
41struct Point
42{
43 Point() : x(0.0), y(0.0), z(0.0) {}
44 Point(real x, real y, real z) : x(x), y(y), z(z) {}
45 real x, y, z;
46};
47
48class Cell
49{
50public:
51 typedef Point* iterator;
52 typedef const Point* const_iterator;
53
55 {
56 points = new Point[size];
57 points[0] = Point(startX, startY, startZ); // 0,0,0
58 points[1] = Point(startX + delta, startY, startZ); // 1,0,0
59 points[2] = Point(startX, startY + delta, startZ); // 0,1,0
60 points[3] = Point(startX + delta, startY + delta, startZ); // 1,1,0
61
62 points[4] = Point(startX, startY, startZ + delta); // 0,0,1
63 points[5] = Point(startX + delta, startY, startZ + delta); // 1,0,1
64 points[6] = Point(startX, startY + delta, startZ + delta); // 0,1,1
65 points[7] = Point(startX + delta, startY + delta, startZ + delta); // 1,1,1
66 }
67
69 {
70 delete[] points;
71 }
72
73 iterator begin() { return &points[0]; }
74 const_iterator begin() const { return &points[0]; }
75 iterator end() { return &points[size]; }
76 const_iterator end() const { return &points[size]; }
77
78private:
79 Point* points;
80 uint size = 8;
81
82};
83
84}
85
86#endif
87
iterator begin()
Definition Cell.h:73
iterator end()
Definition Cell.h:75
const_iterator end() const
Definition Cell.h:76
const Point * const_iterator
Definition Cell.h:52
Point * iterator
Definition Cell.h:51
Cell(real startX, real startY, real startZ, real delta)
Definition Cell.h:54
const_iterator begin() const
Definition Cell.h:74
float real
Definition DataTypes.h:42
unsigned int uint
Definition DataTypes.h:47
const real startY
const real startZ
const real startX
Point(real x, real y, real z)
Definition Cell.h:44