15 std::vector<RawSimplex> simplices;
20 if (s.dimension() == dimension) {
21 simplices.emplace_back(s);
46 const std::vector<Simplex>& simplices = simplex_collection.
simplex_vector();
50 for (
const Simplex& s : simplices) {
58 const std::vector<Tuple>& tuple_vec)
62 for (
const Tuple& t : tuple_vec) {
76 assert(std::is_sorted(
begin(),
end()));
77 return std::binary_search(
begin(),
end(), simplex);
84 assert(std::is_sorted(collection_a.
begin(), collection_a.
end()));
85 assert(std::is_sorted(collection_b.
begin(), collection_b.
end()));
91 std::set_union(a.cbegin(), a.cend(), b.cbegin(), b.cend(), std::back_inserter(sc.
m_simplices));
102 const auto& a = collection_a;
103 const auto& b = collection_b;
static bool are_simplex_collections_equal(const RawSimplexCollection &collection_a, const RawSimplexCollection &collection_b)
Check if the two simplex collections are equal.
void add(const RawSimplex &simplex)
Add simplex to the collection.
std::vector< RawSimplex > m_simplices
bool contains(const RawSimplex &simplex) const
Check if simplex is contained in collection.
static RawSimplexCollection get_intersection(const RawSimplexCollection &collection_a, const RawSimplexCollection &collection_b)
Get intersection of two simplex collections.
static RawSimplexCollection get_union(const RawSimplexCollection &collection_a, const RawSimplexCollection &collection_b)
Get union of two simplex collections.
RawSimplexCollection(std::vector< RawSimplex > &&simplices={})
void sort_and_clean()
Sort simplex vector and remove duplicates.
const std::vector< RawSimplex > & simplex_vector() const
Return const reference to the RawSimplex vector.
A meshless implementation of the simplex that just stores an array of ids.
const Mesh & mesh() const
const std::vector< Simplex > & simplex_vector() const
Return const reference to the simplex vector.
void set_intersection(const std::unordered_set< int > &s1, const std::unordered_set< int > &s2, std::vector< int > &v)