1 #ifndef OMEGA_H_MIXEDMESH_HPP
2 #define OMEGA_H_MIXEDMESH_HPP
4 #include <Omega_h_adj.hpp>
5 #include <Omega_h_comm.hpp>
6 #include <Omega_h_dist.hpp>
7 #include <Omega_h_library.hpp>
8 #include <Omega_h_tag.hpp>
21 void set_library(
Library* library);
22 void set_comm(CommPtr
const& new_comm);
23 void set_dim(Int dim_in);
24 void set_verts(LO nverts_in);
25 void set_ents(Int ent_dim,
Adj down);
28 inline Int dim()
const {
29 OMEGA_H_CHECK(0 <= dim_ && dim_ <= 3);
32 inline Omega_h_Family family()
const {
return family_; }
34 void set_verts_type(LO nverts_in);
35 void set_ents(Topo_type high_type, Topo_type low_type,
Adj h2l);
36 LO nents(Topo_type ent_type)
const;
37 Int ent_dim(Topo_type ent_type)
const;
45 LO nregions_mix()
const;
46 LO nfaces_mix()
const;
47 LO nedges_mix()
const;
48 LO nverts_mix()
const;
51 void add_tag(Topo_type ent_type, std::string
const& name, Int ncomps);
53 void add_tag(Topo_type ent_type, std::string
const& name, Int ncomps,
54 Read<T> array,
bool internal =
false);
56 void set_tag(Topo_type ent_type, std::string
const& name,
Read<T> array,
57 bool internal =
false);
58 TagBase const* get_tagbase(Topo_type ent_type, std::string
const& name)
const;
60 Tag<T> const* get_tag(Topo_type ent_type, std::string
const& name)
const;
62 Read<T> get_array(Topo_type ent_type, std::string
const& name)
const;
63 void remove_tag(Topo_type ent_type, std::string
const& name);
64 bool has_tag(Topo_type ent_type, std::string
const& name)
const;
65 [[nodiscard]] Int ntags(Topo_type ent_type)
const;
66 TagBase const* get_tag(Topo_type ent_type, Int i)
const;
67 bool has_ents(Topo_type ent_type)
const;
68 bool has_adj(Topo_type from_type, Topo_type to_type)
const;
69 Adj get_adj(Topo_type from_type, Topo_type to_type)
const;
70 Adj ask_down(Topo_type from_type, Topo_type to_type);
71 LOs ask_verts_of(Topo_type ent_type);
72 Adj ask_up(Topo_type from_type, Topo_type to_type);
74 typedef std::shared_ptr<const TagBase> TagPtr;
75 typedef std::shared_ptr<const Adj> AdjPtr;
78 typedef std::vector<TagPtr> TagVector;
79 typedef TagVector::iterator TagIter;
80 typedef TagVector::const_iterator TagCIter;
81 TagIter tag_iter(Topo_type ent_type, std::string
const& name);
82 TagCIter tag_iter(Topo_type ent_type, std::string
const& name)
const;
83 void check_type(Topo_type ent_type)
const;
84 void check_type2(Topo_type ent_type)
const;
85 void add_adj(Topo_type from_type, Topo_type to_type,
Adj adj);
86 Adj derive_adj(Topo_type from_type, Topo_type to_type);
87 Adj ask_adj(Topo_type from_type, Topo_type to_type);
88 void react_to_set_tag(Topo_type ent_type, std::string
const& name);
90 Omega_h_Family family_;
94 TagVector tags_[DIMS];
95 LO nents_type_[TOPO_TYPES];
96 TagVector tags_type_[TOPO_TYPES];
97 AdjPtr adjs_type_[TOPO_TYPES][TOPO_TYPES];
100 void add_coords_mix(
Reals array);
101 Reals coords_mix()
const;
104 using TagSet = std::array<std::set<std::string>, DIMS>;
106 void get_all_type_tags(
MixedMesh* mesh, Int dim, Topo_type ent_type, TagSet* tags);
108 #define OMEGA_H_EXPL_INST_DECL(T) \
109 extern template Read<T> MixedMesh::get_array<T>( \
110 Topo_type ent_type, std::string const& name) const; \
111 extern template void MixedMesh::add_tag<T>( \
112 Topo_type ent_type, std::string const& name, Int ncomps); \
113 extern template void MixedMesh::add_tag<T>(Topo_type ent_type, \
114 std::string const& name, Int ncomps, Read<T> array, bool internal); \
115 extern template void MixedMesh::set_tag(Topo_type ent_type, \
116 std::string const& name, Read<T> array, bool internal);
117 OMEGA_H_EXPL_INST_DECL(I8)
118 OMEGA_H_EXPL_INST_DECL(I32)
119 OMEGA_H_EXPL_INST_DECL(I64)
120 OMEGA_H_EXPL_INST_DECL(Real)
121 #undef OMEGA_H_EXPL_INST_DECL
Definition: Omega_h_library.hpp:10
Definition: Omega_h_mixedMesh.hpp:17
Definition: Omega_h_array.hpp:89
Definition: Omega_h_tag.hpp:31
Definition: Omega_h_tag.hpp:53
Definition: amr_mpi_test.cpp:6
Definition: Omega_h_adj.hpp:11