From: geay Date: Wed, 12 Mar 2014 07:25:21 +0000 (+0100) Subject: feedback from first MEDReader users. Management of cartesian mesh only MED file.... X-Git-Tag: V7_3_1rc2^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f2893dd89b156fc941db385c8725ab5fd6e173b4;p=modules%2Fparavis.git feedback from first MEDReader users. Management of cartesian mesh only MED file. bug correction of 1st field not having the max number of time steps. --- diff --git a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx index a6c603c2..5b5a2893 100644 --- a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx +++ b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx @@ -1311,44 +1311,57 @@ void MEDFileFieldRepresentationTree::AppendFieldFromMeshes(const ParaMEDMEM::MED for(int i=0;igetNumberOfMeshes();i++) { MEDFileMesh *mm(ms->getMeshAtPos(i)); - MEDFileUMesh *mmu(dynamic_cast(mm)); - if(!mmu) - continue; std::vector levs(mm->getNonEmptyLevels()); ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr f1tsMultiLev(ParaMEDMEM::MEDFileField1TS::New()); - for(std::vector::const_iterator it=levs.begin();it!=levs.end();it++) - { - std::vector gts(mmu->getGeoTypesAtLevel(*it)); - for(std::vector::const_iterator gt=gts.begin();gt!=gts.end();gt++) - { - ParaMEDMEM::MEDCouplingMesh *m(mmu->getDirectUndergroundSingleGeoTypeMesh(*gt)); - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr f(ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS)); - f->setMesh(m); - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr arr(ParaMEDMEM::DataArrayDouble::New()); arr->alloc(f->getNumberOfTuplesExpected()); - arr->setInfoOnComponent(0,std::string(COMPO_STR_TO_LOCATE_MESH_DA)); - arr->iota(); - f->setArray(arr); - f->setName(mm->getName()); - f1tsMultiLev->setFieldNoProfileSBT(f); - } - } - if(levs.empty()) - { - std::vector levsExt(mm->getNonEmptyLevelsExt()); - if(levsExt.size()==levs.size()+1) - { - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr m(mm->getGenMeshAtLevel(1)); - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr f(ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_NODES)); - f->setMesh(m); - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr arr(ParaMEDMEM::DataArrayDouble::New()); arr->alloc(m->getNumberOfNodes()); - arr->setInfoOnComponent(0,std::string(COMPO_STR_TO_LOCATE_MESH_DA)); - arr->iota(); f->setArray(arr); - f->setName(mm->getName()); - f1tsMultiLev->setFieldNoProfileSBT(f); - } - else - continue; - } + MEDFileUMesh *mmu(dynamic_cast(mm)); + if(mmu) + { + for(std::vector::const_iterator it=levs.begin();it!=levs.end();it++) + { + std::vector gts(mmu->getGeoTypesAtLevel(*it)); + for(std::vector::const_iterator gt=gts.begin();gt!=gts.end();gt++) + { + ParaMEDMEM::MEDCouplingMesh *m(mmu->getDirectUndergroundSingleGeoTypeMesh(*gt)); + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr f(ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS)); + f->setMesh(m); + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr arr(ParaMEDMEM::DataArrayDouble::New()); arr->alloc(f->getNumberOfTuplesExpected()); + arr->setInfoOnComponent(0,std::string(COMPO_STR_TO_LOCATE_MESH_DA)); + arr->iota(); + f->setArray(arr); + f->setName(mm->getName()); + f1tsMultiLev->setFieldNoProfileSBT(f); + } + } + if(levs.empty()) + { + std::vector levsExt(mm->getNonEmptyLevelsExt()); + if(levsExt.size()==levs.size()+1) + { + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr m(mm->getGenMeshAtLevel(1)); + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr f(ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_NODES)); + f->setMesh(m); + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr arr(ParaMEDMEM::DataArrayDouble::New()); arr->alloc(m->getNumberOfNodes()); + arr->setInfoOnComponent(0,std::string(COMPO_STR_TO_LOCATE_MESH_DA)); + arr->iota(); f->setArray(arr); + f->setName(mm->getName()); + f1tsMultiLev->setFieldNoProfileSBT(f); + } + else + continue; + } + } + else + { + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr m(mm->getGenMeshAtLevel(0)); + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr f(ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS)); + f->setMesh(m); + ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr arr(ParaMEDMEM::DataArrayDouble::New()); arr->alloc(f->getNumberOfTuplesExpected()); + arr->setInfoOnComponent(0,std::string(COMPO_STR_TO_LOCATE_MESH_DA)); + arr->iota(); + f->setArray(arr); + f->setName(mm->getName()); + f1tsMultiLev->setFieldNoProfileSBT(f); + } // ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr fmtsMultiLev(ParaMEDMEM::MEDFileFieldMultiTS::New()); fmtsMultiLev->pushBackTimeStep(f1tsMultiLev); diff --git a/src/Plugins/MEDReader/ParaViewPlugin/pqMEDReaderPanel.cxx b/src/Plugins/MEDReader/ParaViewPlugin/pqMEDReaderPanel.cxx index ed70bd52..17d7bb46 100644 --- a/src/Plugins/MEDReader/ParaViewPlugin/pqMEDReaderPanel.cxx +++ b/src/Plugins/MEDReader/ParaViewPlugin/pqMEDReaderPanel.cxx @@ -464,12 +464,9 @@ int pqMEDReaderPanel::getMaxNumberOfTS() const int ret(0); for(std::vector::const_iterator it=_all_lev4.begin();it!=_all_lev4.end();it++) { - if((*it)->property("checked").toInt()) - { - QTreeWidgetItem *obj((*it)->QTreeWidgetItem::parent()->QTreeWidgetItem::parent()->QTreeWidgetItem::parent()); - pqTreeWidgetItemObject *objC(dynamic_cast(obj)); - ret=std::max(ret,objC->property("NbOfTS").toInt()); - } + QTreeWidgetItem *obj((*it)->QTreeWidgetItem::parent()->QTreeWidgetItem::parent()->QTreeWidgetItem::parent()); + pqTreeWidgetItemObject *objC(dynamic_cast(obj)); + ret=std::max(ret,objC->property("NbOfTS").toInt()); } return ret; } diff --git a/src/Plugins/MEDReader/TODO.txt b/src/Plugins/MEDReader/TODO.txt index d4916438..193cada4 100644 --- a/src/Plugins/MEDReader/TODO.txt +++ b/src/Plugins/MEDReader/TODO.txt @@ -13,7 +13,6 @@ UC : ForMEDReader16.med, then extractgroup, then return to MEDReader properties Known bug : ----------- -- Extract cell type + Extract Group Warning for users : ------------------- @@ -49,3 +48,11 @@ when in STANDALONE mode. 0 - protect ExtractGroup against throw 0 - protect ExctractCellType against throw + +0 - Extract cell type + Extract Group + +0 - bug client side when the field having the max number of TS is not first. + +0 - ELGA arrays choice of GaussPoints filter + +0 - Manage file containing only cartesian meshes. \ No newline at end of file