Wildmeshing Toolkit
EdgeOperationData.hpp
Go to the documentation of this file.
1 #pragma once
2 #include <array>
3 #include <memory>
4 #include <variant>
5 #include <vector>
6 #include <wmtk/Tuple.hpp>
8 
9 namespace wmtk {
10 class Mesh;
11 }
12 namespace wmtk::operations {
13 
14 namespace internal {
15 class SplitAlternateFacetData;
16 class CollapseAlternateFacetData;
17 } // namespace internal
18 
20 {
21 public:
29 
31  std::array<int64_t, 2> m_spine_vids; // two endpoints of the edge
32 
33 
34  std::vector<std::vector<Tuple>> split_boundary_complex;
35 
36  // for multimesh we need to know which global ids are modified to trigger
37  // for every simplex dimension (We have 3 in trimesh):
38  // a list of [simplex index, {all versions of that simplex}]
39  std::vector<std::vector<std::tuple<int64_t, std::vector<Tuple>>>>
41 
42  std::vector<std::vector<int64_t>> global_ids_to_update;
43 
44  // std::unique_ptr<internal::SplitAlternateFacetData> m_split_data;
45  // std::unique_ptr<internal::CollapseAlternateFacetData> m_collapse_data;
46  std::variant<
47  std::unique_ptr<internal::SplitAlternateFacetData>,
48  std::unique_ptr<internal::CollapseAlternateFacetData>>
50 
51 
52  void set_split();
53  void set_collapse();
54 
55 
60 
61 protected:
66 
67 protected:
68  static Tuple tuple_from_id(const Mesh& m, const PrimitiveType type, const int64_t gid);
69  static simplex::Simplex
70  simplex_from_id(const Mesh& m, const PrimitiveType type, const int64_t gid);
71  static std::vector<int64_t>
72  request_simplex_indices(Mesh& mesh, const PrimitiveType type, int64_t count);
73 };
74 } // namespace wmtk::operations
EdgeOperationData & operator=(EdgeOperationData &&)
const internal::SplitAlternateFacetData & const_split_facet_data() const
Returns facet data held if the edge operation was a split - throws if data does not exist.
std::vector< std::vector< int64_t > > global_ids_to_update
internal::SplitAlternateFacetData & split_facet_data()
Returns facet data held if the edge operation was a split - throws if data does not exist.
static Tuple tuple_from_id(const Mesh &m, const PrimitiveType type, const int64_t gid)
std::array< int64_t, 2 > m_spine_vids
std::vector< std::vector< std::tuple< int64_t, std::vector< Tuple > > > > global_ids_to_potential_tuples
std::variant< std::unique_ptr< internal::SplitAlternateFacetData >, std::unique_ptr< internal::CollapseAlternateFacetData > > m_op_data
EdgeOperationData(EdgeOperationData &&)
static std::vector< int64_t > request_simplex_indices(Mesh &mesh, const PrimitiveType type, int64_t count)
static simplex::Simplex simplex_from_id(const Mesh &m, const PrimitiveType type, const int64_t gid)
internal::CollapseAlternateFacetData & collapse_facet_data()
Returns facet data held if the edge operation was a collapse- throws if data does not exist.
const internal::CollapseAlternateFacetData & const_collapse_facet_data() const
Returns facet data held if the edge operation was a collapse- throws if data does not exist.
std::vector< std::vector< Tuple > > split_boundary_complex
Definition: Accessor.hpp:6