Wildmeshing Toolkit
Loading...
Searching...
No Matches
volume_complex.hpp
1#pragma once
2
3#include <array>
4#include <cstdint>
5#include <optional>
6#include <set>
7#include <string>
8#include <utility>
9#include <vector>
10
14
15using Vid = uint32_t;
16using Tet = std::array<Vid, 4>;
17using Tri = std::array<Vid, 3>;
18using Tets = std::vector<Tet>;
20using Faces = std::set<Tri>;
21
22Tri sorted(Tri t);
23Tet sorted(Tet t);
24bool contains(const Tet& t, Vid v);
25bool contains(const Tri& t, Vid v);
27std::array<Tri, 4> faces_of(const Tet& t);
29std::set<Tet> keys(const Tets& T);
30
32std::optional<Faces> boundary(const Tets& T);
35bool is_ball(const Tets& T);
38std::optional<std::vector<Vid>> disk_cycle(const Faces& F);
41std::optional<Tets> collapse(const Tets& T, Vid a, Vid b);
43std::vector<Tets> sides(const Tets& T, Vid c, const Faces& surf);
46std::vector<Tets> side_groups(const Tets& T, const Faces& surf);
48Faces surf_after(const Faces& surf, Vid i, Vid j);
49
54{
55 std::string kind;
56 Tets before, after;
57 Faces fixed, cap_before, cap_after;
58};
60std::optional<PairSpec> make_pair(
61 const std::string& kind,
62 const Tets& Tb,
63 const Tets& Ta,
64 const Faces& sb,
65 const Faces& sa,
66 std::string* why = nullptr);
67
70char side_class(const Tets& M, Vid i, Vid j);
72std::vector<Vid> chords(const Tets& M, Vid i, Vid j);
73
78{
79 std::vector<PairSpec> pairs;
81 std::vector<std::pair<Vid, Vid>> virtuals;
83 Tets split, collapsed;
84};
85std::optional<Decomposition> decompose_collapse(
86 const Tets& K,
87 Vid i,
88 Vid j,
89 const Faces& surf,
90 Vid first_virtual,
91 std::string* why);
92
93} // namespace wmtk::components::tracking::volume
Definition volume_complex.cpp:8
std::vector< Tets > side_groups(const Tets &T, const Faces &surf)
Definition volume_complex.cpp:223
std::set< Tet > keys(const Tets &T)
The tets as a set of sorted tets.
Definition volume_complex.cpp:41
char side_class(const Tets &M, const Vid i, const Vid j)
Definition volume_complex.cpp:333
bool is_ball(const Tets &T)
Definition volume_complex.cpp:90
std::vector< Vid > chords(const Tets &M, const Vid i, const Vid j)
The ring vertices x of side M with a triangle (i, j, x) inside it.
Definition volume_complex.cpp:308
std::optional< Tets > collapse(const Tets &T, const Vid a, const Vid b)
Definition volume_complex.cpp:185
std::set< Tri > Faces
Faces by their corners, sorted.
Definition volume_complex.hpp:20
std::array< Tri, 4 > faces_of(const Tet &t)
The four faces of a tet, each sorted.
Definition volume_complex.cpp:32
std::optional< Faces > boundary(const Tets &T)
The faces of T on one tet only; nothing if a face is on more than two.
Definition volume_complex.cpp:48
Faces surf_after(const Faces &surf, const Vid i, const Vid j)
surf after collapsing (i, j) into j.
Definition volume_complex.cpp:240
std::optional< PairSpec > make_pair(const std::string &kind, const Tets &Tb, const Tets &Ta, const Faces &sb, const Faces &sa, std::string *why)
The pair (Tb, Ta) if it is one; sb and sa are the tracked faces before and after.
Definition volume_complex.cpp:254
std::optional< std::vector< Vid > > disk_cycle(const Faces &F)
Definition volume_complex.cpp:143
Tets split
The tets after the splits (K1) and after the collapse, before the unsplits (K2).
Definition volume_complex.hpp:83
std::vector< std::pair< Vid, Vid > > virtuals
(w, x) per chord, in the order split.
Definition volume_complex.hpp:81
Definition volume_complex.hpp:54