1 #ifndef OMEGA_H_ADJ_HPP
2 #define OMEGA_H_ADJ_HPP
4 #include <Omega_h_few.hpp>
5 #include <Omega_h_graph.hpp>
6 #include <Omega_h_matrix.hpp>
7 #include <Omega_h_vector.hpp>
12 OMEGA_H_INLINE
Adj() {}
16 :
Graph(a2ab_, ab2b_), codes(codes_) {}
25 : parent_idx(parent_idx_), codes(codes_) {}
33 :
Graph(a2ab_, ab2b_), codes(codes_) {}
37 void find_matches(Omega_h_Family
const family, Int
const dim,
LOs const av2v,
40 void find_matches(Topo_type
const ent_type,
LOs const av2v,
43 Adj reflect_down(
LOs const hv2v,
LOs const lv2v,
Adj const v2l,
44 Omega_h_Family
const family, Int
const high_dim, Int
const low_dim);
46 Adj reflect_down(
LOs const hv2v,
LOs const lv2v,
Adj const v2l,
47 Topo_type
const high_type, Topo_type
const low_type);
49 Adj unmap_adjacency(
LOs const a2b,
Adj const b2c);
54 Adj invert_adj(
Adj const down, Int
const nlows_per_high, LO
const nlows,
55 Int
const high_dim, Int
const low_dim);
57 Adj invert_adj(
Adj const down, Int
const nlows_per_high, LO
const nlows,
58 Topo_type high_type, Topo_type low_type);
60 Children invert_parents(
Parents const children2parents, Int
const parent_dim,
61 Int
const nparent_dim_ents);
66 LOs form_uses(
LOs const hv2v, Omega_h_Family
const family, Int
const high_dim,
69 LOs form_uses(
LOs const hv2v, Topo_type
const high_type, Topo_type
const low_type);
71 LOs find_unique(
LOs const hv2v, Omega_h_Family
const family, Int
const high_dim,
79 LOs find_unique(
LOs const hv2v, Topo_type
const high_type, Topo_type
const low_type);
87 Int
const deg,
LOs const canon,
LOs const e_sorted2e);
100 template <
typename T>
101 void find_matches_ex(Int
const deg,
LOs const a2fv,
Read<T> const av2v,
103 bool const allow_duplicates =
false);
107 Adj reflect_down(
LOs const hv2v,
LOs const lv2v, Omega_h_Family
const family,
108 LO
const nv, Int
const high_dim, Int
const low_dim);
110 Adj transit(
Adj const h2m,
Adj const m2l, Omega_h_Family
const family,
111 Int
const high_dim, Int
const low_dim);
113 Adj transit(
Adj const h2m,
Adj const m2l, Topo_type
const high_type,
114 Topo_type
const low_type, Topo_type
const mid_type);
116 Graph verts_across_edges(
Adj const e2v,
Adj const v2e);
117 Graph edges_across_tris(
Adj const f2e,
Adj const e2f);
118 Graph edges_across_tets(
Adj const r2e,
Adj const e2r);
119 Graph elements_across_sides(Int
const dim,
Adj const elems2sides,
120 Adj const sides2elems,
Read<I8> const side_is_exposed);
125 for (Int i = 0; i < nhhl; ++i) {
126 auto hl = h * nhhl + i;
133 OMEGA_H_DEVICE Few<LO, neev> gather_verts(LOs
const& ev2v, Int e) {
134 return gather_down<neev>(ev2v, e);
137 template <Int neev,
typename T>
138 OMEGA_H_DEVICE Few<T, neev> gather_values(Read<T>
const& a, Few<LO, neev> v) {
140 for (Int i = 0; i < neev; ++i) x[i] = a[v[i]];
145 OMEGA_H_DEVICE Vector<neev> gather_scalars(
146 Read<Real>
const& a, Few<LO, neev> v) {
148 for (Int i = 0; i < neev; ++i) x[i] = a[v[i]];
152 template <Int neev, Int dim>
153 OMEGA_H_DEVICE Matrix<dim, neev> gather_vectors(
154 Reals
const& a, Few<LO, neev> v) {
156 for (Int i = 0; i < neev; ++i) x[i] = get_vector<dim>(a, v[i]);
160 template <Int neev, Int dim>
161 OMEGA_H_DEVICE Few<Matrix<dim, dim>, neev> gather_symms(
162 Reals
const& a, Few<LO, neev> v) {
163 Few<Matrix<dim, dim>, neev> x;
164 for (Int i = 0; i < neev; ++i) x[i] = get_symm<dim>(a, v[i]);
168 #define INST_DECL(T) \
169 extern template Read<I8> get_codes_to_canonical(Int deg, Read<T> ev2v); \
170 extern template void find_matches_ex(Int deg, LOs a2fv, Read<T> av2v, \
171 Read<T> bv2v, Adj v2b, Write<LO>* a2b_out, Write<I8>* codes_out, bool);
Definition: Omega_h_few.hpp:61
Definition: amr_mpi_test.cpp:6
Definition: Omega_h_adj.hpp:11
Definition: Omega_h_adj.hpp:30
directed graph (as defined by graph theory) in compressed row format
Definition: Omega_h_graph.hpp:22
Definition: Omega_h_adj.hpp:22