omega_h
Reliable mesh adaptation
Omega_h_refine_topology.hpp
1 #ifndef OMEGA_H_REFINE_TOPOLOGY_HPP
2 #define OMEGA_H_REFINE_TOPOLOGY_HPP
3 
4 #include <Omega_h_array.hpp>
5 #include <Omega_h_scalar.hpp>
6 
7 namespace Omega_h {
8 
9 class Mesh;
10 
11 void refine_domains_to_pairs(Mesh* mesh, Int dim, LOs keys2edges,
12  LOs keys2midverts, LOs old_verts2new_verts, LOs& keys2pairs,
13  LOs& pair_verts2verts);
14 
15 void refine_domains_to_cuts(Mesh* mesh, Int dim, LOs keys2edges,
16  LOs keys2midverts, LOs old_verts2new_verts, LOs& keys2cuts,
17  LOs& cut_verts2verts);
18 
19 void combine_pairs_and_cuts(Int ent_dim, LOs keys2cuts, LOs keys2pairs,
20  LOs cut_verts2verts, LOs pair_verts2verts, LOs& keys2prods,
21  LOs& prod_verts2verts);
22 
23 void refine_products(Mesh* mesh, Int ent_dim, LOs keys2edges, LOs keys2midverts,
24  LOs old_verts2new_verts, LOs& keys2prods, LOs& prod_verts2verts);
25 
26 /* as it happens, the triangle-of-tet-to-vertices template
27  specifies all triangles curling outward
28  (such that implicit face derivation orients all surface
29  faces outward), while the tet-to-vertices convention
30  has the bottom face curling inward for consistency
31  with Gmsh, PUMI, Simmetrix, etc.
32  rather than break either of those two compatibilities,
33  we will remember to flip the triangle here to get
34  the right orientation for new tets */
35 template <Int dim>
36 struct FlipNewElem;
37 template <>
38 struct FlipNewElem<2> {
39  template <typename T>
40  OMEGA_H_INLINE static void flip(T ev[]) {
41  (void)ev;
42  }
43 };
44 template <>
45 struct FlipNewElem<3> {
46  template <typename T>
47  OMEGA_H_INLINE static void flip(T ev[]) {
48  swap2(ev[1], ev[2]);
49  }
50 };
51 template <Int dim, typename T>
52 OMEGA_H_INLINE void flip_new_elem(T ev[]) {
54 }
55 template <typename T>
56 OMEGA_H_INLINE void flip_new_elem(Int dim, T ev[]) {
57  if (dim == 3) swap2(ev[1], ev[2]);
58 }
59 
60 } // end namespace Omega_h
61 
62 #endif
Definition: amr_mpi_test.cpp:6
Definition: Omega_h_refine_topology.hpp:36