+ std::vector< const DataArrayInt * >otherPS(ps.size());
+ std::vector< const DataArray * > arr2(ps.size());
+ std::vector< MEDCouplingAutoRefCountObjectPtr<DataArray> > arr2Safe(ps.size());
+ std::vector< const DataArrayInt * > nbis(ps.size());
+ std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > nbisSafe(ps.size());
+ int jj(0);
+ for(std::vector<const MEDFileField1TSStructItem2 *>::const_iterator it2=ps.begin();it2!=ps.end();it2++,jj++)
+ {
+ int nbi((*it2)->getNbOfIntegrationPts(globs));
+ const DataArrayInt *otherPfl((*it2)->getPfl(globs));
+ const std::pair<int,int>& strtStop((*it2)->getStartStop());
+ MEDCouplingAutoRefCountObjectPtr<DataArray> ret2(vals->selectByTupleId2(strtStop.first,strtStop.second,1));
+ if(!otherPfl)
+ throw INTERP_KERNEL::Exception("MEDMeshMultiLev::constructDataArray : unexpected situation for cells 4 !");
+ arr2[jj]=ret2; arr2Safe[jj]=ret2; otherPS[jj]=otherPfl;
+ nbisSafe[jj]=DataArrayInt::New(); nbisSafe[jj]->alloc(otherPfl->getNumberOfTuples(),1); nbisSafe[jj]->fillWithValue(nbi);
+ nbis[jj]=nbisSafe[jj];
+ }
+ MEDCouplingAutoRefCountObjectPtr<DataArray> arr3(DataArray::Aggregate(arr2));
+ MEDCouplingAutoRefCountObjectPtr<DataArrayInt> otherP(DataArrayInt::Aggregate(otherPS));
+ MEDCouplingAutoRefCountObjectPtr<DataArrayInt> zenbis(DataArrayInt::Aggregate(nbis));
+ MEDCouplingAutoRefCountObjectPtr<DataArrayInt> otherPN(otherP->invertArrayN2O2O2N(getNumberOfCells(*it)));
+ MEDCouplingAutoRefCountObjectPtr<DataArrayInt> p1;
+ if(thisP)
+ p1=DataArrayInt::FindPermutationFromFirstToSecond(otherP,thisP);
+ else
+ p1=otherP->deepCpy();
+ MEDCouplingAutoRefCountObjectPtr<DataArrayInt> zenbisN(zenbis->renumber(p1->begin()));
+ zenbisN->computeOffsets2();
+ jj=0;
+ for(std::vector<const MEDFileField1TSStructItem2 *>::const_iterator it2=ps.begin();it2!=ps.end();it2++,jj++)
+ {
+ int nbi((*it2)->getNbOfIntegrationPts(globs));
+ const DataArrayInt *otherPfl((*it2)->getPfl(globs));
+ const std::pair<int,int>& strtStop((*it2)->getStartStop());
+ MEDCouplingAutoRefCountObjectPtr<DataArray> ret2(vals->selectByTupleId2(strtStop.first,strtStop.second,1));
+ //
+ MEDCouplingAutoRefCountObjectPtr<DataArrayInt> p2(otherPfl->deepCpy());
+ p2->transformWithIndArr(otherPN->begin(),otherPN->end());
+ p2->transformWithIndArr(p1->begin(),p1->end());
+ MEDCouplingAutoRefCountObjectPtr<DataArrayInt> idsN(p2->buildExplicitArrByRanges(zenbisN));
+ arr3->setPartOfValuesBase3(ret2,idsN->begin(),idsN->end(),0,nc,1);
+ }
+ arrSafe[iii]=arr3; arr[iii]=arr3;