VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
Triangle.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 Triangle_h
35#define Triangle_h
36
37#include <memory>
38
39#include "global.h"
41
42namespace vf::gpu {
43
44class TriangleMemento;
45
47{
51
53
57
58 void set(const Vertex &v1, const Vertex &v2, const Vertex &v3);
59 void set(int index, Vertex value);
60 Vertex get(int index);
61 void calcNormal();
62
63 void initalLayerThickness(real delta);
64
65
66 Vertex getCenterOfMass() const;
68 int isEqual(const Triangle &t2) const;
69 bool doesNormalsShowToEachOther(const Triangle &t2) const;
70 int getCommonEdge(const Triangle &t2) const;
71
72 bool contains(const Vertex& v)const;
73 int getNumberOfCommonEdge(const Triangle &t2) const;
74 int getTriangleIntersection(const Vertex &P, const Vertex &direction, Vertex &pointOnTri, real &qVal) const;
75 void print() const;
76
77 char isUnderFace(const Vertex &point) const;
78
79 bool isUnterExtendedFace(const Vertex & point, real &s) const;
80 bool isNotNextToFace(const Vertex &point) const;
81 bool isUnderAngleToNeighbors(const Vertex &point) const;
82 void getClosestPointsOnEdges(Vertex arr[], const Vertex &P) const;
85 bool isQNode(const Vertex & point, const real &s) const;
86 bool isNegativeDirectionBorder(const Vertex & point) const;
87
88 bool operator==(const Triangle &t) const;
89
92
93
94 void setMinMax(real &minX, real &maxX, real &minY, real &maxY, real &minZ, real &maxZ) const;
95};
96
97}
98
99#endif
100
std::shared_ptr< T > SPtr
float real
Definition DataTypes.h:42
unsigned int uint
Definition DataTypes.h:47
real alphaAngles[3]
Definition Triangle.h:49
int getTriangleIntersection(const Vertex &P, const Vertex &direction, Vertex &pointOnTri, real &qVal) const
Definition Triangle.cpp:290
Vertex getCenterOfMass() const
Definition Triangle.cpp:215
void getClosestPointsOnEdges(Vertex arr[], const Vertex &P) const
Definition Triangle.cpp:187
real getPerpedicularDistanceFrom(const Vertex &P) const
Definition Triangle.cpp:124
bool isUnderAngleToNeighbors(const Vertex &point) const
Definition Triangle.cpp:166
bool contains(const Vertex &v) const
Definition Triangle.cpp:269
bool operator==(const Triangle &t) const
Definition Triangle.cpp:391
int isEqual(const Triangle &t2) const
Definition Triangle.cpp:234
void initalLayerThickness(real delta)
Definition Triangle.cpp:85
void print() const
Definition Triangle.cpp:379
Vertex get(int index)
Definition Triangle.cpp:65
void set(const Vertex &v1, const Vertex &v2, const Vertex &v3)
Definition Triangle.cpp:47
bool isNegativeDirectionBorder(const Vertex &point) const
Definition Triangle.cpp:141
int getNumberOfCommonEdge(const Triangle &t2) const
Definition Triangle.cpp:275
bool isUnterExtendedFace(const Vertex &point, real &s) const
Definition Triangle.cpp:118
int getCommonEdge(const Triangle &t2) const
Definition Triangle.cpp:249
void setState(const TriangleMemento &memento)
void setMinMax(real &minX, real &maxX, real &minY, real &maxY, real &minZ, real &maxZ) const
Definition Triangle.cpp:398
real getHalfAngleBetweenToAdjacentTriangle(const Triangle &t2) const
Definition Triangle.cpp:220
bool isNotNextToFace(const Vertex &point) const
Definition Triangle.cpp:147
bool doesNormalsShowToEachOther(const Triangle &t2) const
Definition Triangle.cpp:239
char isUnderFace(const Vertex &point) const
Definition Triangle.cpp:91
Vertex getPerpedicularPointFrom(const Vertex &P) const
Definition Triangle.cpp:130
TriangleMemento getState() const
bool isQNode(const Vertex &point, const real &s) const
Definition Triangle.cpp:135