]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
On the fly
authorAnthony Geay <anthony.geay@edf.fr>
Wed, 3 Jan 2018 16:13:25 +0000 (17:13 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Wed, 3 Jan 2018 16:13:25 +0000 (17:13 +0100)
src/MEDLoader/MEDFileField.cxx

index 811d33316d7e922bf245181a6fcd013ee65460b9..37803ad5342abebd69186caf8bc246e38f740a5e 100644 (file)
@@ -641,7 +641,34 @@ void MEDFileFieldLin2QuadVisitor::newPerMeshPerTypePerDisc(const MEDFileFieldPer
   if(pmptpd->getType()!=ON_NODES)
     return;// Only node-fields need care
   MEDFileAnyTypeField1TSWithoutSDA *ct(_cur_f1ts->contentNotNullBase());
-  MEDFileFieldPerMeshPerTypePerDisc *pmtd(ct->getLeafGivenMeshAndTypeAndLocId(_lin->getName(),_gt,pmptpd->getLocId()));
+  MEDFileFieldPerMeshPerTypePerDisc *pmtdToModify(ct->getLeafGivenMeshAndTypeAndLocId(_lin->getName(),_gt,pmptpd->getLocId()));
+  std::string pflName(pmptpd->getProfile());
+  MCAuto<DataArrayInt> pfl;
+  if(pflName.empty())
+    pfl=DataArrayInt::Range(0,pmptpd->getNumberOfVals(),1);
+  else
+    pfl=_lin_globs->getProfile(pflName)->deepCopy();
+  {
+     MCAuto<MEDCouplingUMesh> mesh3D(_lin->getMeshAtLevel(0)),mesh3DQuadratic(_quad->getMeshAtLevel(0));
+     MCAuto<DataArrayInt> cellIds(mesh3D->getCellIdsLyingOnNodes(pfl->begin(),pfl->end(),true));
+     MCAuto<MEDCouplingUMesh> mesh3DQuadraticRestricted(mesh3DQuadratic->buildPartOfMySelf(cellIds->begin(),cellIds->end(),true));
+     MCAuto<DataArrayInt> mesh3DQuadraticRestrictedNodeIds(mesh3DQuadraticRestricted->computeFetchedNodeIds());
+     MCAuto<DataArrayInt> orphansNodes;
+     {
+       MCAuto<MEDCouplingUMesh> tmp1(mesh3D->buildPartOfMySelf(cellIds->begin(),cellIds->end(),true));
+       MCAuto<DataArrayInt> tmp2(tmp1->computeFetchedNodeIds());
+       orphansNodes=pfl->buildSubstraction(tmp2);
+     }
+     mesh3DQuadraticRestrictedNodeIds->checkMonotonic(true);
+     MCAuto<DataArrayInt> newPtsIds(mesh3DQuadraticRestrictedNodeIds->buildSubstraction(pfl));
+     MCAuto<MEDCoupling1SGTUMesh> allSeg3;
+     {
+       MCAuto<DataArrayInt> a,b,c,d;
+       MCAuto<MEDCouplingUMesh> seg3Tmp(mesh3DQuadraticRestricted->explodeIntoEdges(a,b,c,d));
+       allSeg3=MEDCoupling1SGTUMesh::New(seg3Tmp);
+     }
+  }
+
 }
 
 void MEDFileFieldLin2QuadVisitor::newPerMeshPerTypeEntry(const MEDFileFieldPerMeshPerTypeCommon *pmpt)