VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
TriangularMeshStrategy.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 TriangularMeshStrategy_H
35#define TriangularMeshStrategy_H
36
37#include <vector>
38
39#include "global.h"
40
41#if defined(VF_HAS_FAST_WINDING)
43#endif
44
45class GbTriFaceMesh3D;
46
47namespace vf::gpu {
48
49class TriangularMesh;
50class GridImp;
51struct Triangle;
52
54{
55public:
58
60 {
61 this->doDiscretize(triangularMesh, grid, InnerType, OuterType);
62 }
63
66 virtual bool requiresGridFinalization() const { return true; }
67 virtual bool usesFastWindingQComputation() const { return false; }
68 virtual void appendFastWindingQSurfaces(GridImp* grid, std::vector<SPtr<GbTriFaceMesh3D>>& surfaces) const;
69 virtual void computeFastWindingQs(GridImp* grid, const std::vector<SPtr<GbTriFaceMesh3D>>& surfaces) const;
70
71private:
72 virtual void doDiscretize(TriangularMesh* triangularMesh, GridImp* grid, char InnerType, char OuterType) = 0;
73};
74
75
76
85
94
96{
97public:
101
102private:
103 void meshReverse(Triangle& triangle, GridImp* grid, char innerType);
104
105 void findInsideNodes(GridImp* grid, char innerType);
106
107 void setInsideNode(GridImp* grid, const uint &index, bool &insideNodeFound, char innerType);
108
109 void setNegativeDirBorderTo(GridImp* grid, const uint &index, char innerType);
110
111};
112
113#if defined(VF_HAS_FAST_WINDING)
120{
121public:
127 {
128 }
129
130 bool requiresGridFinalization() const override { return true; }
131 bool usesFastWindingQComputation() const override { return true; }
132 void appendFastWindingQSurfaces(GridImp* grid, std::vector<SPtr<GbTriFaceMesh3D>>& surfaces) const override;
133 void computeFastWindingQs(GridImp* grid, const std::vector<SPtr<GbTriFaceMesh3D>>& surfaces) const override;
134
135private:
136 void doDiscretize(TriangularMesh* triangularMesh, GridImp* grid, char innerType, char outerType) override;
137
138 float accuracyScale;
139 float threshold;
140 float tolerance;
141};
142#endif
143
144}
145
146#endif
147
148
virtual void doDiscretize(TriangularMesh *triangularMesh, GridImp *grid, char InnerType, char OuterType)
void doDiscretize(TriangularMesh *triangularMesh, GridImp *grid, char innerType, char outerType) override
virtual void doDiscretize(TriangularMesh *triangularMesh, GridImp *grid, char InnerType, char OuterType)
virtual void computeFastWindingQs(GridImp *grid, const std::vector< SPtr< GbTriFaceMesh3D > > &surfaces) const
virtual void appendFastWindingQSurfaces(GridImp *grid, std::vector< SPtr< GbTriFaceMesh3D > > &surfaces) const
void discretize(TriangularMesh *triangularMesh, GridImp *grid, char InnerType, char OuterType)
std::shared_ptr< T > SPtr
unsigned int uint
Definition DataTypes.h:47
constexpr float FastWindingDefaultAccuracyScale
Default fast-winding accuracy scale used in computeSolidAngle(...).
constexpr float FastWindingDefaultTolerance
Default comparison tolerance near the threshold.
constexpr float FastWindingDefaultThreshold
Default normalized threshold for solid classification.