VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
Cylinder.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
35
36#ifndef CYLINDER_H
37#define CYLINDER_H
38
39#include <map>
40
43
44#include "geometries/Object.h"
45
46namespace vf::gpu {
47
48class Cylinder : public Object
49{
50public:
51
52 Cylinder(double centerX, double centerY, double centerZ, double radius, double height, Axis rotationalAxis);
53 Cylinder(std::array<double, 3> center, double radius, double height, Axis axis);
54 Cylinder(std::array<double, 3> minOfAxis, std::array<double, 3> maxOfAxis, double radius);
55
56 SPtr<Object> clone() const override;
57
58 double getX1Centroid() const override;
59 double getX1Minimum() const override;
60 double getX1Maximum() const override;
61 double getX2Centroid() const override;
62 double getX2Minimum() const override;
63 double getX2Maximum() const override;
64 double getX3Centroid() const override;
65 double getX3Minimum() const override;
66 double getX3Maximum() const override;
67
68 double getRadius() const;
69 double getHeight() const;
70 Axis getRotationalAxis() const;
71
72 bool isPointInObject(const double &x1, const double &x2, const double &x3, const double &minOffset,
73 const double &maxOffset) override;
74 void changeSizeByDelta(double delta) override;
75
76private:
77 double getCentroidCoordinate(Axis coordinateDirection) const;
78 double getMinimunCoordinate(Axis coordinateDirection) const;
79 double getMaximumCoordinate(Axis coordinateDirection) const;
80
81 static std::array<double, 3> calculateCenter(const std::array<double, 3>& minOfAxis, const std::array<double, 3>& maxOfAxis);
82
83 bool isInCircle(double delta1, double delta2, double offset) const;
84
85 Axis rotationalAxis;
86 const std::array<double, 3> center;
87
88 double radius;
89 double height;
90};
91
92}
93
94#endif
double getX1Centroid() const override
Definition Cylinder.cpp:105
double getHeight() const
Definition Cylinder.cpp:155
double getRadius() const
Definition Cylinder.cpp:150
double getX2Maximum() const override
Definition Cylinder.cpp:130
void changeSizeByDelta(double delta) override
Definition Cylinder.cpp:196
double getX2Minimum() const override
Definition Cylinder.cpp:125
bool isPointInObject(const double &x1, const double &x2, const double &x3, const double &minOffset, const double &maxOffset) override
Definition Cylinder.cpp:170
double getX1Minimum() const override
Definition Cylinder.cpp:110
double getX1Maximum() const override
Definition Cylinder.cpp:115
Axis getRotationalAxis() const
Definition Cylinder.cpp:160
double getX2Centroid() const override
Definition Cylinder.cpp:120
SPtr< Object > clone() const override
Definition Cylinder.cpp:81
double getX3Minimum() const override
Definition Cylinder.cpp:140
double getX3Maximum() const override
Definition Cylinder.cpp:145
double getX3Centroid() const override
Definition Cylinder.cpp:135
std::shared_ptr< T > SPtr
Axis
Definition Axis.h:41
Definition Axis.h:48