6 #ifndef __MESH_PROJECTION_DATA_OPERATORS_HPP__
7 #define __MESH_PROJECTION_DATA_OPERATORS_HPP__
37 OpRunParent(boost::shared_ptr<ForcesAndSourcesCore> parent_ele_ptr,
39 boost::shared_ptr<ForcesAndSourcesCore> this_ele_ptr,
41 Sev sev = Sev::noisy);
82 boost::shared_ptr<ForcesAndSourcesCore> parent_ele_ptr,
86 Sev sev = Sev::noisy);
102 boost::shared_ptr<ForcesAndSourcesCore> parent_ele_ptr,
106 Sev sev = Sev::noisy);
109 const bool error_if_no_base =
false);
157 std::vector<EntityHandle> &adjacency) {
160 static_assert(DIM >= 0 && DIM <= 3,
"DIM is out of scope");
167 auto th_parent_handle = basic_entity_data_ptr->th_RefParentHandle;
168 auto th_bit_level = basic_entity_data_ptr->th_RefBitLevel;
170 std::vector<EntityHandle> parents;
181 adjacency.insert(adjacency.end(),
adjTmp.begin(),
adjTmp.end());
183 std::sort(adjacency.begin(), adjacency.end());
184 auto it = std::unique(adjacency.begin(), adjacency.end());
185 adjacency.resize(std::distance(adjacency.begin(), it));
187 for (
auto e : adjacency) {
189 if (side_table.find(e) == side_table.end())
191 .insert(boost::shared_ptr<SideNumber>(
new SideNumber(e, -1, 0, 0)));
203 auto check = [](
auto &b,
auto &
m,
auto &
bit) {
204 return ((
bit & b).any()) && ((
bit &
m) ==
bit);
208 CHKERR moab.tag_get_data(th_bit_level, &fe, 1, &bit_fe);
219 std::vector<EntityHandle> &parents) {
223 CHKERR moab.tag_get_data(th_parent_handle, &fe, 1, &fe_parent);
227 CHKERR moab.tag_get_data(th_bit_level, &fe_parent, 1, &bit_parent);
229 if ((fe_parent != 0) && (fe_parent != fe) &&
230 (parent_type == back_type)) {
231 parents.push_back(fe_parent);
232 CHKERR get_parent(parents.back(), parents);
238 CHKERR get_parent(fe, parents);
245 std::vector<EntityHandle> &parents,
246 std::vector<EntityHandle> &adjacency) {
251 for (
int i = 0;
i != parents.size(); ++
i)
252 CHKERR moab.get_connectivity(&*parents.begin(), parents.size(),
255 if constexpr (DIM >= 1)
256 for (
auto fe_ent : parents)
257 CHKERR moab.get_adjacencies(&fe_ent, 1, 1,
false, adjacency,
258 moab::Interface::UNION);
260 if constexpr (DIM == 2)
261 for (
auto fe_ent : parents)
262 CHKERR moab.get_adjacencies(&fe_ent, 1, 2,
false, adjacency,
263 moab::Interface::UNION);
265 for (
auto fe_ent : parents)
266 adjacency.push_back(fe_ent);
270 "this field is not implemented for face finite element");
273 if (adjacency.size()) {
274 std::sort(adjacency.begin(), adjacency.end());
275 auto it = std::unique(adjacency.begin(), adjacency.end());
276 adjacency.resize(std::distance(adjacency.begin(), it));
285 std::vector<EntityHandle> &adjacency) {
287 if constexpr (DIM == 3)
289 if constexpr (DIM == 2)
291 else if constexpr (DIM == 1)
293 else if constexpr (DIM == 0)
321 bit_ent, bit_ent_mask) {}
338 std::vector<EntityHandle> &adjacency) {
346 const auto fe_ent = fe.
getEnt();
348 CHKERR moab.get_adjacencies(&fe_ent, 1, DIM + 1,
false,
351 std::vector<EntityHandle> parents;
355 auto th_parent_handle = basic_entity_data_ptr->th_RefParentHandle;
356 auto th_bit_level = basic_entity_data_ptr->th_RefBitLevel;
370 std::sort(adjacency.begin(), adjacency.end());
371 auto it = std::unique(adjacency.begin(), adjacency.end());
372 adjacency.resize(std::distance(adjacency.begin(), it));
374 for (
auto e : adjacency) {
376 if (side_table.find(e) == side_table.end())
379 boost::shared_ptr<SideNumber>(
new SideNumber(e, -1, 0, 0)));
392 #endif //__MESH_PROJECTION_DATA_OPERATORS_HPP__