13 #include "GmshConfig.h"
36 MFace f0(
f.getVertex(0),
f.getVertex(1), v);
37 MFace f1(
f.getVertex(1),
f.getVertex(2), v);
38 MFace f2(
f.getVertex(2),
f.getVertex(3), v);
39 MFace f3(
f.getVertex(3),
f.getVertex(0), v);
51 Msg::Info(
"Generating pyramids for hybrid mesh...");
65 for (std::size_t i = 0; i <
faces.size(); i++)
68 for (std::size_t j = 0; j < gf->
quadrangles.size(); j++)
71 if (it2 !=
_quad.end())
74 gr->
pyramids.push_back(
new MPyramid(it2->first.getVertex(0), it2->first.getVertex(1),
75 it2->first.getVertex(2), it2->first.getVertex(3), it2->second));
77 if (it2->second->onWhat()->dim() == 3)
79 Msg::Error(
"Pyramid top vertex already classified on volume %d (!= %d) - "
80 "non-manifold quad boundaries not supported yet",
81 it2->second->onWhat()->tag(), gr->
tag());
85 it2->second->setEntity(gr);
91 Msg::Info(
"Done generating %d pyramids for hybrid mesh", npyram);
116 std::set<GFace *, GEntityPtrLessThan> allFacesSet;
117 for (std::size_t i = 0; i < regions.size(); i++)
119 std::vector<GFace *>
const &
f = regions[i]->faces();
120 std::vector<GFace *>
const &f_e = regions[i]->embeddedFaces();
121 allFacesSet.insert(
f.begin(),
f.end());
122 allFacesSet.insert(f_e.begin(), f_e.end());
129 std::set<GFace *, GEntityPtrLessThan> comp;
130 for (
auto it = allFacesSet.begin(); it != allFacesSet.end(); it++)
141 std::vector<GFace *> allFaces(allFacesSet.begin(), allFacesSet.end());
144 std::set<GEdge *, GEntityPtrLessThan> allEmbEdgesSet;
145 for (std::size_t i = 0; i < regions.size(); i++)
147 std::vector<GEdge *>
const &e = regions[i]->embeddedEdges();
148 allEmbEdgesSet.insert(e.begin(), e.end());
150 std::vector<GEdge *> allEmbEdges(allEmbEdgesSet.begin(), allEmbEdgesSet.end());
154 std::set<GVertex *> allEmbVerticesSet;
155 for (std::size_t i = 0; i < regions.size(); i++)
157 std::vector<GVertex *>
const &e = regions[i]->embeddedVertices();
158 allEmbVerticesSet.insert(e.begin(), e.end());
160 std::vector<GVertex *> allEmbVertices(allEmbVerticesSet.begin(), allEmbVerticesSet.end());
168 auto itf = allFaces.begin();
169 while (itf != allFaces.end())
178 std::set<GFace *, GEntityPtrLessThan> comp;
179 for (std::size_t i = 0; i <
faces.size(); i++)
187 std::vector<GFace *> lcomp(comp.begin(), comp.end());
203 for (std::size_t i = 0; i < regions.size(); i++)
214 Msg::Info(
"Optimizing pyramids for hybrid mesh...");
218 Msg::Info(
"Done optimizing pyramids for hybrid mesh");
290 std::set<GFace *> faces_to_consider;
294 std::vector<GFace *> _faces = (*rit)->faces();
295 faces_to_consider.insert(_faces.begin(), _faces.end());
299 auto fit = faces_to_consider.begin();
300 while (fit != faces_to_consider.end())
302 for (std::size_t i = 0; i < (*fit)->getNumMeshElements(); i++)
304 MFace ff = (*fit)->getMeshElement(i)->getFace(0);
320 for (std::size_t i = 0; i < (*eit)->lines.size(); i++)
322 MVertex *p1 = (*eit)->lines[i]->getVertex(0);
323 MVertex *p2 = (*eit)->lines[i]->getVertex(1);
325 search.insert(std::pair<
MVertex *, std::pair<MLine *, GEdge *>>(
326 p, std::pair<MLine *, GEdge *>((*eit)->lines[i], *eit)));
335 MFace ff(p1, p2, p3);
336 auto it = search.find(ff);
337 if (it == search.end())
344 auto it = search.find(ff);
345 if (it == search.end())
354 for (
auto it = search.lower_bound(p); it != search.upper_bound(p); ++it)
356 MLine *l = it->second.first;
357 GEdge *ge = it->second.second;