diff --git a/Geo/GModelIO_MSH2.cpp b/Geo/GModelIO_MSH2.cpp index e15b4dfa5e019bf279dad7a458135bdbce6b13cc..c9f0b9efb30e0687b42c61907b91c688ef9ca8a8 100644 --- a/Geo/GModelIO_MSH2.cpp +++ b/Geo/GModelIO_MSH2.cpp @@ -899,6 +899,7 @@ int GModel::_writeMSH2(const std::string &name, double version, bool binary, // get the number of vertices and index the vertices in a continuous // sequence + int numVertices = indexMeshVertices(saveAll, saveSinglePartition, renumberVertices); // get the number of elements we need to save diff --git a/Geo/MTriangle.cpp b/Geo/MTriangle.cpp index cbd3a2b3aedd90a4bc4474fa90d5f60b0cb5fa03..48cd869369dc33f13ed7d7443d08d875cf2806cf 100644 --- a/Geo/MTriangle.cpp +++ b/Geo/MTriangle.cpp @@ -277,8 +277,6 @@ void MTriangle::reorient(int rot,bool swap) { void MTriangle6::reorient(int rot, bool swap) { - Msg::Info("Reorienting triangle 6 with rot %d and swap %d", - rot,swap ? 1:0); if (rot == 0 && !swap) return; MTriangle::reorient(rot,swap); diff --git a/Mesh/HighOrder.cpp b/Mesh/HighOrder.cpp index 04a4b5999cd1e65af31feebf14d5b1ce457b9764..de7d9376db3b9a240a6de011f5ca21fb833ce041 100644 --- a/Mesh/HighOrder.cpp +++ b/Mesh/HighOrder.cpp @@ -1325,6 +1325,7 @@ static void updatePeriodicEdgesAndFaces(GModel *m) if (src != NULL && src != tgt) { + std::map<MVertex*,MVertex*> &v2v = tgt->correspondingVertices; std::map<MVertex*,MVertex*> &p2p = tgt->correspondingHOPoints; p2p.clear(); @@ -1350,8 +1351,6 @@ static void updatePeriodicEdgesAndFaces(GModel *m) for (int iVtx=0;iVtx<2;iVtx++) { MVertex* vtx = tgtLine->getVertex(iVtx); - std::map<MVertex*,MVertex*>& v2v = - vtx->onWhat()->correspondingVertices; std::map<MVertex*,MVertex*>::iterator tIter = v2v.find(vtx); if (tIter == v2v.end()) { Msg::Error("Cannot find periodic counterpart of vertex %d" @@ -1389,6 +1388,7 @@ static void updatePeriodicEdgesAndFaces(GModel *m) Msg::Info("Constructing high order periodicity for face connection %d - %d", tgt->tag(),src->tag()); + std::map<MVertex*,MVertex*> &v2v = tgt->correspondingVertices; std::map<MVertex*,MVertex*> &p2p = tgt->correspondingHOPoints; p2p.clear(); @@ -1417,10 +1417,18 @@ static void updatePeriodicEdgesAndFaces(GModel *m) std::vector<MVertex*> vtcs; for (int iVtx=0;iVtx<nbVtcs;iVtx++) { MVertex* vtx = tgtElmt->getVertex(iVtx); - GEntity* ge = vtx->onWhat(); - if (ge->meshMaster() == ge) throw; - std::map<MVertex*,MVertex*>& v2v = ge->correspondingVertices; - vtcs.push_back(v2v[vtx]); + + std::map<MVertex*,MVertex*>::iterator tIter = v2v.find(vtx); + if (tIter == v2v.end()) { + Msg::Error("Cannot find periodic counterpart of vertex %d" + " of surface %d on surface %d", + vtx->getNum(),tgt->tag(),src->tag()); + } + else vtcs.push_back(tIter->second); + // GEntity* ge = vtx->onWhat(); + // if (ge->meshMaster() == ge) throw; + // std::map<MVertex*,MVertex*>& v2v = ge->correspondingVertices; + //vtcs.push_back(v2v[vtx]); } std::map<MFace,MElement*>::iterator srcIter = srcFaces.find(MFace(vtcs));