From 52347655a07423b07244976c3fe6db6881d3e167 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Wed, 3 Jan 2018 17:13:25 +0100 Subject: [PATCH] On the fly --- src/MEDLoader/MEDFileField.cxx | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/MEDLoader/MEDFileField.cxx b/src/MEDLoader/MEDFileField.cxx index 811d33316..37803ad53 100644 --- a/src/MEDLoader/MEDFileField.cxx +++ b/src/MEDLoader/MEDFileField.cxx @@ -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 pfl; + if(pflName.empty()) + pfl=DataArrayInt::Range(0,pmptpd->getNumberOfVals(),1); + else + pfl=_lin_globs->getProfile(pflName)->deepCopy(); + { + MCAuto mesh3D(_lin->getMeshAtLevel(0)),mesh3DQuadratic(_quad->getMeshAtLevel(0)); + MCAuto cellIds(mesh3D->getCellIdsLyingOnNodes(pfl->begin(),pfl->end(),true)); + MCAuto mesh3DQuadraticRestricted(mesh3DQuadratic->buildPartOfMySelf(cellIds->begin(),cellIds->end(),true)); + MCAuto mesh3DQuadraticRestrictedNodeIds(mesh3DQuadraticRestricted->computeFetchedNodeIds()); + MCAuto orphansNodes; + { + MCAuto tmp1(mesh3D->buildPartOfMySelf(cellIds->begin(),cellIds->end(),true)); + MCAuto tmp2(tmp1->computeFetchedNodeIds()); + orphansNodes=pfl->buildSubstraction(tmp2); + } + mesh3DQuadraticRestrictedNodeIds->checkMonotonic(true); + MCAuto newPtsIds(mesh3DQuadraticRestrictedNodeIds->buildSubstraction(pfl)); + MCAuto allSeg3; + { + MCAuto a,b,c,d; + MCAuto seg3Tmp(mesh3DQuadraticRestricted->explodeIntoEdges(a,b,c,d)); + allSeg3=MEDCoupling1SGTUMesh::New(seg3Tmp); + } + } + } void MEDFileFieldLin2QuadVisitor::newPerMeshPerTypeEntry(const MEDFileFieldPerMeshPerTypeCommon *pmpt) -- 2.39.2