VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
GbHalfSpace3D.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 GBHALFSPACE3D_H
35#define GBHALFSPACE3D_H
36
37#include <iostream>
38#include <sstream>
39
41
45
46#include <PointerDefinitions.h>
47
48/*=========================================================================*/
49/* GbHalfSpace3D */
50/* */
56{
57public:
59
61
63
64 GbHalfSpace3D(const double &p1x, const double &p1y, const double &p1z, const double &p2x, const double &p2y,
65 const double &p2z, const double &p3x, const double &p3y, const double &p3z);
66 GbHalfSpace3D(const double &p1x, const double &p1y, const double &p1z, const double &nx, const double &ny,
67 const double &nz);
68
69 /*=======================================================*/
70 std::string getTypeID() { return "GbHalfSpace3D"; }
71 /*=============================================*/
72 bool ptInside(const double &x, const double &y, const double &z)
73 {
74 return ub_math::greaterEqual(normalX * x + normalY * y + normalZ * z, this->d);
75 }
76 /*=============================================*/
78 {
79 // GbVector3D X(PointX->x1, PointX->x2, PointX->x3 );
80 // return ub_math::greaterEqual(this->Normal.Dot(X), this->d);
81 return ub_math::greaterEqual(normalX * pointX->x1 + normalY * pointX->x2 + normalZ * pointX->x3, this->d);
82 }
83 /*=============================================*/
85 {
86 // return ub_math::greaterEqual(this->Normal.Dot(X), this->d);
87 return ub_math::greaterEqual(normalX * x[0] + normalY * x[1] + normalZ * x[2], this->d);
88 }
89 /*=============================================*/
90 double getDistance(const double &x1p, const double &x2p, const double &x3p)
91 {
92 return (normalX * x1p + normalY * x2p + normalZ * x3p) - this->d;
93 }
94
95 const double &getNormalX() { return this->normalX; }
96 const double &getNormalY() { return this->normalY; }
97 const double &getNormalZ() { return this->normalZ; }
98 const double &getD() { return this->d; }
99
100private:
101 // GbVector3D Normal;
102 double normalX;
103 double normalY;
104 double normalZ;
105 double d;
106};
107/*=========================================================================*/
108
109#endif // GBHALFSPACE3D_H
110
const double & getNormalY()
const double & getD()
double getDistance(const double &x1p, const double &x2p, const double &x3p)
bool ptInside(GbPoint3D *pointX)
const double & getNormalX()
bool ptInside(const double &x, const double &y, const double &z)
bool ptInside(GbVector3D &x)
std::string getTypeID()
const double & getNormalZ()
This Class provides basic 3D point objects.
Definition GbPoint3D.h:49
This Class provides basic 3D triangle objects.
This Class provides basic 3D vector objects.
Definition GbVector3D.h:47
std::shared_ptr< T > SPtr
@ z
Definition Axis.h:44
@ x
Definition Axis.h:42
@ y
Definition Axis.h:43
const uint ny
const uint nz
const uint nx
bool greaterEqual(const T1 &value, const T2 &reference)
Definition UbMath.h:223