~ubuntu-branches/debian/sid/gmsh/sid

« back to all changes in this revision

Viewing changes to Geo/GModelFactory.cpp

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2015-08-26 22:45:27 UTC
  • mfrom: (1.3.25)
  • Revision ID: package-import@ubuntu.com-20150826224527-wiqnz3dwz6ap8tty
Tags: 2.10.1+dfsg1-1
* [4c450d1] Update d/watch.
* [90ca918] Imported Upstream version 2.10.1+dfsg1. (Closes: #793245)
* [af26665] Use any-arch instead of list of archs.
* [e94c6d2] Refresh patches.
* [6ab417f] Update d/copyright.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1220
1220
 
1221
1221
/* setPeriodicPairOfFaces: set periodic given a Slave/Master pair of
1222
1222
   numFace-Edgelist */
1223
 
void OCCFactory::setPeriodicPairOfFaces(GModel *gm, int numFaceMaster, std::vector<int> EdgeListMaster,
1224
 
                                        int numFaceSlave, std::vector<int> EdgeListSlave)
 
1223
void OCCFactory::setPeriodicPairOfFaces(GModel *gm, int numFaceMaster,
 
1224
                                        std::vector<int> EdgeListMaster,
 
1225
                                        int numFaceSlave,
 
1226
                                        std::vector<int> EdgeListSlave)
1225
1227
{
1226
 
  int NEdges=EdgeListMaster.size();
1227
1228
  if (EdgeListMaster.size() != EdgeListSlave.size()){
1228
1229
    Msg::Error("Slave/Master faces don't have the same number of edges!");
1229
1230
  }
1230
 
  else{
 
1231
  else {
 
1232
 
 
1233
    std::map<int,int> edgeCounterparts;
 
1234
    std::vector<int>::iterator siter = EdgeListSlave.begin();
 
1235
    std::vector<int>::iterator miter = EdgeListMaster.begin();
 
1236
 
 
1237
    for (;siter!=EdgeListSlave.end();++siter,++miter) {
 
1238
      edgeCounterparts[*siter] = *miter;
 
1239
    }
 
1240
 
1231
1241
    Surface *s_slave = FindSurface(abs(numFaceSlave));
1232
1242
    if(s_slave){
1233
 
      GModel::current()->getGEOInternals()->periodicFaces[numFaceSlave] = numFaceMaster;
1234
 
      for (int i = 0; i < NEdges; i++){
1235
 
        GModel::current()->getGEOInternals()->periodicEdges[EdgeListSlave[i]] = EdgeListMaster[i];
1236
 
        s_slave->edgeCounterparts[EdgeListSlave[i]] = EdgeListMaster[i];
1237
 
      }
 
1243
      s_slave->master = numFaceMaster;
 
1244
      s_slave->edgeCounterparts = edgeCounterparts;
1238
1245
    }
1239
1246
    else{
1240
1247
      GFace *gf = GModel::current()->getFaceByTag(abs(numFaceSlave));
1241
 
      if(gf){
1242
 
        gf->setMeshMaster(numFaceMaster);
1243
 
        for (int i = 0; i < NEdges; i++){
1244
 
          gf->edgeCounterparts[EdgeListSlave[i]] = EdgeListMaster[i];
1245
 
          GEdge *ges = GModel::current()->getEdgeByTag(abs(EdgeListSlave[i]));
1246
 
          ges->setMeshMaster(EdgeListMaster[i]);
1247
 
        }
 
1248
      if (gf) {
 
1249
        GFace *master = GModel::current()->getFaceByTag(abs(numFaceMaster));
 
1250
        gf->setMeshMaster(master,edgeCounterparts);
1248
1251
      }
1249
1252
      else Msg::Error("Slave surface %d not found", numFaceSlave);
1250
1253
    }