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,
1226
std::vector<int> EdgeListSlave)
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!");
1233
std::map<int,int> edgeCounterparts;
1234
std::vector<int>::iterator siter = EdgeListSlave.begin();
1235
std::vector<int>::iterator miter = EdgeListMaster.begin();
1237
for (;siter!=EdgeListSlave.end();++siter,++miter) {
1238
edgeCounterparts[*siter] = *miter;
1231
1241
Surface *s_slave = FindSurface(abs(numFaceSlave));
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];
1243
s_slave->master = numFaceMaster;
1244
s_slave->edgeCounterparts = edgeCounterparts;
1240
1247
GFace *gf = GModel::current()->getFaceByTag(abs(numFaceSlave));
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]);
1249
GFace *master = GModel::current()->getFaceByTag(abs(numFaceMaster));
1250
gf->setMeshMaster(master,edgeCounterparts);
1249
1252
else Msg::Error("Slave surface %d not found", numFaceSlave);