From d76af27a963735723eb1077b5dd2bd07752e62dd Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Wed, 30 Mar 2016 18:43:56 +0000 Subject: [PATCH] fix regression in periodic lines (missing abs()) --- Geo/GModelIO_GEO.cpp | 41 +++++++++++++++++++++++------------------ doc/VERSIONS.txt | 5 +++-- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/Geo/GModelIO_GEO.cpp b/Geo/GModelIO_GEO.cpp index e6f7f9645f..401cbc13e8 100644 --- a/Geo/GModelIO_GEO.cpp +++ b/Geo/GModelIO_GEO.cpp @@ -144,7 +144,7 @@ int GModel::importGEOInternals() if(Tree_Nbr(_geo_internals->Curves)) { List_T *curves = Tree2List(_geo_internals->Curves); - // generate all curves except compounds + // generate all curves except compounds for(int i = 0; i < List_Nbr(curves); i++){ Curve *c; @@ -153,7 +153,7 @@ int GModel::importGEOInternals() GEdge *e = getEdgeByTag(c->Num); if(!e && c->Typ == MSH_SEGM_COMPOUND){ Msg::Debug("Postpone creation of compound edge %d" - "until all others have been created",c->Num); + "until all others have been created", c->Num); // std::vector<GEdge*> comp; // for(unsigned int j = 0; j < c->compound.size(); j++){ // GEdge *ge = getEdgeByTag(c->compound[j]); @@ -189,7 +189,7 @@ int GModel::importGEOInternals() } } } - + // now generate the compound curves for(int i = 0; i < List_Nbr(curves); i++){ @@ -314,7 +314,8 @@ int GModel::importGEOInternals() add(f); } else{ - if(s->Typ == MSH_SURF_PLAN) f->computeMeanPlane(); // recompute in case geom has changed + if(s->Typ == MSH_SURF_PLAN) + f->computeMeanPlane(); // recompute in case geom has changed f->resetMeshAttributes(); } if(!s->Visible) f->setVisibility(0); @@ -387,38 +388,42 @@ int GModel::importGEOInternals() int iTarget = peIter->first; GEO_Internals::MasterEdge& me = peIter->second; int iSource = me.tag; - GEdge* target = getEdgeByTag(iTarget); + GEdge* target = getEdgeByTag(abs(iTarget)); GEdge* source = getEdgeByTag(abs(iSource)); - if (!target) + if(!target) Msg::Error("Unknown target line for periodic connection from %d to %d", iTarget, iSource); - if (!source) + if(!source) Msg::Error("Unknown source line for periodic connection from %d to %d", iTarget, iSource); - if (me.affineTransform.size()==16) - target->setMeshMaster(source,me.affineTransform); - else - target->setMeshMaster(source,me.tag > 0 ? 1 : -1); + if(target && source){ + if(me.affineTransform.size() == 16) + target->setMeshMaster(source, me.affineTransform); + else + target->setMeshMaster(source, me.tag > 0 ? 1 : -1); + } } std::map<int,GEO_Internals::MasterFace>::iterator pfIter = _geo_internals->periodicFaces.begin(); - for (;pfIter!=_geo_internals->periodicFaces.end();++pfIter) { + for (; pfIter != _geo_internals->periodicFaces.end(); ++pfIter) { int iTarget = pfIter->first; GEO_Internals::MasterFace& mf = pfIter->second; int iSource = mf.tag; GFace* target = getFaceByTag(iTarget); GFace* source = getFaceByTag(iSource); - if (!target) + if(!target) Msg::Error("Unknown target surface for periodic connection from %d to %d", iTarget, iSource); - if (!source) + if(!source) Msg::Error("Unknown source surface for periodic connection from %d to %d", iTarget, iSource); - if (mf.affineTransform.size()==16) - target->setMeshMaster(source,mf.affineTransform); - else - target->setMeshMaster(source,mf.edgeCounterparts); + if(target && source){ + if(mf.affineTransform.size() == 16) + target->setMeshMaster(source,mf.affineTransform); + else + target->setMeshMaster(source,mf.edgeCounterparts); + } } Msg::Debug("Gmsh model (GModel) imported:"); diff --git a/doc/VERSIONS.txt b/doc/VERSIONS.txt index fc75089a8d..317b0d93e4 100644 --- a/doc/VERSIONS.txt +++ b/doc/VERSIONS.txt @@ -1,5 +1,6 @@ -2.13.0: new ONELAB 1.2 protocol with suppport for lists; new boundary recovery -code; better adaptive visualization of quads and hexahedra; minor fixes. +2.13.0: new ONELAB 1.2 protocol with native support for lists; new 3D boundary +recovery code; better adaptive visualization of quads and hexahedra; minor +fixes. 2.12.0 (March 5, 2016): improved interactive definition of physical groups and handling of ONELAB clients; improved full quad algorithm; added support for list -- GitLab