VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
TriangleRefinement.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 TriangleRefinement_h
35#define TriangleRefinement_h
36
37#include <vector>
38
39#include "global.h"
40
42
43namespace vf::gpu {
44
45struct Triangle;
46struct Vertex;
47struct IntegerPtr2D;
48
50{
51public:
52 TriangleRefinement(std::vector<Triangle> *triangles);
54
55 void refine(int iTriangle);
57
58 void refineUntilMinDistance(double d_min);
60 void redoubleTriangles();
61
62 static Vertex getHalfVertex(const Vertex &v, const Vertex &w);
63
64private:
65 std::vector<Triangle> *triangles;
66 IntegerPtr2D indices;
67
68 int findIndexFromTriangleWithLongestEdge(double *d);
69 std::vector<Vertex> getVertexArray(int iTriangle);
70 Vertex getNewhalfVertexFromTrianglesEdge(std::vector<Vertex> v, int edge);
71 void sortNeighborIndices();
72 void createTwoTriangles(std::vector<Vertex> v, int edge, Vertex newEdge);
73 void eraseOldTrianglesFromVector(int iTriangle, int indexNeighbor);
74 int findCommonEdgeFromTriangles(int indexNeighbor, int iTriangle);
75
76public:
79};
80
81}
82
83#endif
84
static int getEdgeWithLongestDistance(Triangle &t)
static Vertex getHalfVertex(const Vertex &v, const Vertex &w)
static real getLongestEdgeDistance(Triangle &t)
void refineUntilcountTriangle(int countTri)
void refineUntilMinDistance(double d_min)
std::shared_ptr< T > SPtr
float real
Definition DataTypes.h:42