Wildmeshing Toolkit
Loading...
Searching...
No Matches
TetmeshElements.h
1// This file is part of TetWild, a software for generating tetrahedral meshes.
2//
3// Copyright (C) 2018 Yixin Hu <yixin.hu@nyu.edu>
4//
5// This Source Code Form is subject to the terms of the Mozilla Public License
6// v. 2.0. If a copy of the MPL was not distributed with this file, You can
7// obtain one at http://mozilla.org/MPL/2.0/.
8//
9// Created by yihu on 8/22/17.
10//
11
12#ifndef NEW_GTET_TETMESHELEMENTS_H
13#define NEW_GTET_TETMESHELEMENTS_H
14
15#include <unordered_set>
16#include <wmtk/Types.hpp>
17#include "State.h"
18
19namespace wmtk::components::tetwild::orig {
20
22{
23public:
24 Vector3r pos; // todo: how to remove it?
25
28 std::unordered_set<int> on_edge; // fixed points can be on more than one edges
29 std::unordered_set<int> on_face;
30 bool is_on_surface = false;
31
33 std::unordered_set<int> conn_tets;
34
36 Vector3d posf;
37 bool is_rounded = false;
38
39 void round() { posf = to_double(pos); }
40
42 bool is_on_bbox = false;
43
45 bool is_on_boundary = false;
46
47 // for adaptive refinement
48 double adaptive_scale = 1.0;
49
50 TetVertex() = default;
51
52 TetVertex(const Vector3r& p) { pos = p; }
53
54 void printInfo() const;
55
56 bool is_locked = false;
57 bool is_inside = false;
58};
59
61{
62public:
63 double slim_energy = 0;
64 double volume = 0;
65
66 TetQuality() = default;
67
68 bool isBetterThan(const TetQuality& tq, const State& state)
69 {
70 return slim_energy < tq.slim_energy;
71 }
72
73 bool isBetterOrEqualThan(const TetQuality& tq, const State& state)
74 {
75 return slim_energy <= tq.slim_energy;
76 }
77};
78
79} // namespace wmtk::components::tetwild::orig
80
81#endif // NEW_GTET_TETMESHELEMENTS_H
Definition TetmeshElements.h:61
Definition TetmeshElements.h:22
int on_fixed_vertex
for surface conforming
Definition TetmeshElements.h:27
Vector3d posf
for hybrid rationals
Definition TetmeshElements.h:36
bool is_on_bbox
for bbox
Definition TetmeshElements.h:42
std::unordered_set< int > conn_tets
for local operations
Definition TetmeshElements.h:33
bool is_on_boundary
for boundary
Definition TetmeshElements.h:45