From 7382ba4473357f944c3c507c8747cd4c0c812010 Mon Sep 17 00:00:00 2001 From: ageay Date: Mon, 22 Jul 2013 11:11:19 +0000 Subject: [PATCH] On the highway to MEDReader --- src/MEDLoader/MEDFileField.hxx | 2 +- src/MEDLoader/MEDFileFieldOverView.cxx | 32 +++++++++++++------------- src/MEDLoader/MEDFileFieldOverView.hxx | 18 +++++++-------- src/MEDLoader/MEDFileMesh.cxx | 4 ++-- src/MEDLoader/MEDFileMesh.hxx | 8 +++---- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/MEDLoader/MEDFileField.hxx b/src/MEDLoader/MEDFileField.hxx index 66393419a..a4b312eb4 100644 --- a/src/MEDLoader/MEDFileField.hxx +++ b/src/MEDLoader/MEDFileField.hxx @@ -418,7 +418,7 @@ namespace ParaMEDMEM // void appendProfile(DataArrayInt *pfl) throw(INTERP_KERNEL::Exception); void appendLoc(const char *locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector& refCoo, const std::vector& gsCoo, const std::vector& w) throw(INTERP_KERNEL::Exception); - public: + protected: MEDFileFieldGlobs *contentNotNull() throw(INTERP_KERNEL::Exception); const MEDFileFieldGlobs *contentNotNull() const throw(INTERP_KERNEL::Exception); protected: diff --git a/src/MEDLoader/MEDFileFieldOverView.cxx b/src/MEDLoader/MEDFileFieldOverView.cxx index 379556249..ceb1cf05c 100644 --- a/src/MEDLoader/MEDFileFieldOverView.cxx +++ b/src/MEDLoader/MEDFileFieldOverView.cxx @@ -113,20 +113,20 @@ MEDFileField1TSStructItem2::MEDFileField1TSStructItem2(INTERP_KERNEL::Normalized _pfl->setName(c.c_str()); } -void MEDFileField1TSStructItem2::checkWithMeshStructForCells(const MEDFileMeshStruct *mst, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception) +void MEDFileField1TSStructItem2::checkWithMeshStructForCells(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs) throw(INTERP_KERNEL::Exception) { int nbOfEnt=mst->getNumberOfElemsOfGeoType(_geo_type); checkInRange(nbOfEnt,1,globs); } -void MEDFileField1TSStructItem2::checkWithMeshStructForGaussNE(const MEDFileMeshStruct *mst, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception) +void MEDFileField1TSStructItem2::checkWithMeshStructForGaussNE(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs) throw(INTERP_KERNEL::Exception) { int nbOfEnt=mst->getNumberOfElemsOfGeoType(_geo_type); const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(_geo_type); checkInRange(nbOfEnt,(int)cm.getNumberOfNodes(),globs); } -void MEDFileField1TSStructItem2::checkWithMeshStructForGaussPT(const MEDFileMeshStruct *mst, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception) +void MEDFileField1TSStructItem2::checkWithMeshStructForGaussPT(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs) throw(INTERP_KERNEL::Exception) { if(!globs) throw INTERP_KERNEL::Exception("MEDFileField1TSStructItem2::checkWithMeshStructForGaussPT : no globals specified !"); @@ -159,7 +159,7 @@ const DataArrayInt *MEDFileField1TSStructItem2::getPfl(const MEDFileFieldGlobsRe * \param [in] nbOfEntity - number of entity that can be either cells or nodes. Not other possiblity. * \param [in] nip - number of integration points. 1 for ON_CELLS and NO_NODES */ -void MEDFileField1TSStructItem2::checkInRange(int nbOfEntity, int nip, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception) +void MEDFileField1TSStructItem2::checkInRange(int nbOfEntity, int nip, const MEDFileFieldGlobsReal *globs) throw(INTERP_KERNEL::Exception) { _nb_of_entity=nbOfEntity; if(_pfl->getName().empty()) @@ -208,7 +208,7 @@ bool MEDFileField1TSStructItem2::isNodeSupportEqual(const MEDFileField1TSStructI /*! * \a objs must be non empty. \a objs should contain items having same geometric type. */ -MEDFileField1TSStructItem2 MEDFileField1TSStructItem2::BuildAggregationOf(const std::vector& objs, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception) +MEDFileField1TSStructItem2 MEDFileField1TSStructItem2::BuildAggregationOf(const std::vector& objs, const MEDFileFieldGlobsReal *globs) throw(INTERP_KERNEL::Exception) { if(objs.empty()) throw INTERP_KERNEL::Exception("MEDFileField1TSStructItem2::BuildAggregationOf : empty input !"); @@ -271,7 +271,7 @@ MEDFileField1TSStructItem::MEDFileField1TSStructItem(TypeOfField a, const std::v { } -void MEDFileField1TSStructItem::checkWithMeshStruct(const MEDFileMeshStruct *mst, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception) +void MEDFileField1TSStructItem::checkWithMeshStruct(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs) throw(INTERP_KERNEL::Exception) { switch(_type) { @@ -359,7 +359,7 @@ private: INTERP_KERNEL::NormalizedCellType _geo_type; }; -MEDFileField1TSStructItem MEDFileField1TSStructItem::simplifyMeOnCellEntity(const MEDFileFieldGlobs *globs) const throw(INTERP_KERNEL::Exception) +MEDFileField1TSStructItem MEDFileField1TSStructItem::simplifyMeOnCellEntity(const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception) { if(!isEntityCell()) throw INTERP_KERNEL::Exception("MEDFileField1TSStructItem::simplifyMeOnCellEntity : must be on ON_CELLS, ON_GAUSS_NE or ON_GAUSS_PT !"); @@ -397,7 +397,7 @@ MEDFileField1TSStructItem MEDFileField1TSStructItem::simplifyMeOnCellEntity(cons /*! * \a this is expected to be ON_CELLS and simplified. */ -bool MEDFileField1TSStructItem::isCompatibleWithNodesDiscr(const MEDFileField1TSStructItem& other, const MEDFileMeshStruct *meshSt, const MEDFileFieldGlobs *globs) const throw(INTERP_KERNEL::Exception) +bool MEDFileField1TSStructItem::isCompatibleWithNodesDiscr(const MEDFileField1TSStructItem& other, const MEDFileMeshStruct *meshSt, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception) { if(other._type!=ON_NODES) throw INTERP_KERNEL::Exception("MEDFileField1TSStructItem::isCompatibleWithNodesDiscr : other must be on nodes !"); @@ -503,7 +503,7 @@ MEDFileField1TSStruct::MEDFileField1TSStruct(const MEDFileAnyTypeField1TS *ref, _already_checked.push_back(BuildItemFrom(ref,mst)); } -void MEDFileField1TSStruct::checkWithMeshStruct(MEDFileMeshStruct *mst, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception) +void MEDFileField1TSStruct::checkWithMeshStruct(MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs) throw(INTERP_KERNEL::Exception) { if(_already_checked.empty()) throw INTERP_KERNEL::Exception("MEDFileField1TSStruct::checkWithMeshStruct : not correctly initialized !"); @@ -531,7 +531,7 @@ bool MEDFileField1TSStruct::isSupportSameAs(const MEDFileAnyTypeField1TS *other, MEDFileField1TSStructItem b(BuildItemFrom(other,meshSt)); if(!_already_checked[0].isEntityCell() || !b.isEntityCell()) throw INTERP_KERNEL::Exception("MEDFileField1TSStruct::isSupportSameAs : only available on cell entities !"); - MEDFileField1TSStructItem other1(b.simplifyMeOnCellEntity(other->contentNotNull())); + MEDFileField1TSStructItem other1(b.simplifyMeOnCellEntity(other)); int found=-1,i=0; for(std::vector::const_iterator it=_already_checked.begin();it!=_already_checked.end();it++,i++) if((*it).isComputed()) @@ -539,7 +539,7 @@ bool MEDFileField1TSStruct::isSupportSameAs(const MEDFileAnyTypeField1TS *other, bool ret(false); if(found==-1) { - MEDFileField1TSStructItem this1(_already_checked[0].simplifyMeOnCellEntity(other->contentNotNull())); + MEDFileField1TSStructItem this1(_already_checked[0].simplifyMeOnCellEntity(other)); ret=this1.isCellSupportEqual(other1,other); if(ret) _already_checked.push_back(this1); @@ -566,13 +566,13 @@ bool MEDFileField1TSStruct::isCompatibleWithNodesDiscr(const MEDFileAnyTypeField bool ret(false); if(found==-1) { - MEDFileField1TSStructItem this1(_already_checked[0].simplifyMeOnCellEntity(other->contentNotNull())); - ret=this1.isCompatibleWithNodesDiscr(other1,meshSt,other->contentNotNull()); + MEDFileField1TSStructItem this1(_already_checked[0].simplifyMeOnCellEntity(other)); + ret=this1.isCompatibleWithNodesDiscr(other1,meshSt,other); if(ret) _already_checked.push_back(this1); } else - ret=_already_checked[found].isCompatibleWithNodesDiscr(other1,meshSt,other->contentNotNull()); + ret=_already_checked[found].isCompatibleWithNodesDiscr(other1,meshSt,other); if(ret) _already_checked.push_back(other1); return ret; @@ -619,7 +619,7 @@ MEDFileField1TSStructItem MEDFileField1TSStruct::BuildItemFrom(const MEDFileAnyT } } MEDFileField1TSStructItem ret(atype,anItems); - ret.checkWithMeshStruct(meshSt,ref->contentNotNull()); + ret.checkWithMeshStruct(meshSt,ref); return ret; } @@ -728,7 +728,7 @@ MEDFileFastCellSupportComparator::MEDFileFastCellSupportComparator(const MEDFile { MEDCouplingAutoRefCountObjectPtr elt=ref->getTimeStepAtPos(i); _f1ts_cmps[i]=MEDFileField1TSStruct::New(elt,_mesh_comp); - _f1ts_cmps[i]->checkWithMeshStruct(_mesh_comp,elt->contentNotNull()); + _f1ts_cmps[i]->checkWithMeshStruct(_mesh_comp,elt); } } diff --git a/src/MEDLoader/MEDFileFieldOverView.hxx b/src/MEDLoader/MEDFileFieldOverView.hxx index 1a3f2714e..994076a20 100644 --- a/src/MEDLoader/MEDFileFieldOverView.hxx +++ b/src/MEDLoader/MEDFileFieldOverView.hxx @@ -123,9 +123,9 @@ namespace ParaMEDMEM public: MEDFileField1TSStructItem2(); MEDFileField1TSStructItem2(INTERP_KERNEL::NormalizedCellType a, const std::pair& b, const std::string& pfl, const std::string& loc); - void checkWithMeshStructForCells(const MEDFileMeshStruct *mst, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception); - void checkWithMeshStructForGaussNE(const MEDFileMeshStruct *mst, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception); - void checkWithMeshStructForGaussPT(const MEDFileMeshStruct *mst, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception); + void checkWithMeshStructForCells(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs) throw(INTERP_KERNEL::Exception); + void checkWithMeshStructForGaussNE(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs) throw(INTERP_KERNEL::Exception); + void checkWithMeshStructForGaussPT(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs) throw(INTERP_KERNEL::Exception); // std::size_t getHeapMemorySize() const; // @@ -133,11 +133,11 @@ namespace ParaMEDMEM INTERP_KERNEL::NormalizedCellType getGeo() const { return _geo_type; } std::string getPflName() const; //! warning this method also set _nb_of_entity attribute ! - void checkInRange(int nbOfEntity, int nip, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception); + void checkInRange(int nbOfEntity, int nip, const MEDFileFieldGlobsReal *globs) throw(INTERP_KERNEL::Exception); bool operator==(const MEDFileField1TSStructItem2& other) const throw(INTERP_KERNEL::Exception); bool isCellSupportEqual(const MEDFileField1TSStructItem2& other, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception); bool isNodeSupportEqual(const MEDFileField1TSStructItem2& other, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception); - static MEDFileField1TSStructItem2 BuildAggregationOf(const std::vector& objs, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception); + static MEDFileField1TSStructItem2 BuildAggregationOf(const std::vector& objs, const MEDFileFieldGlobsReal *globs) throw(INTERP_KERNEL::Exception); public: static const char NEWLY_CREATED_PFL_NAME[]; private: @@ -152,7 +152,7 @@ namespace ParaMEDMEM { public: MEDFileField1TSStructItem(TypeOfField a, const std::vector< MEDFileField1TSStructItem2 >& b); - void checkWithMeshStruct(const MEDFileMeshStruct *mst, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception); + void checkWithMeshStruct(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs) throw(INTERP_KERNEL::Exception); bool operator==(const MEDFileField1TSStructItem& other) const throw(INTERP_KERNEL::Exception); std::size_t getHeapMemorySize() const; bool isEntityCell() const; @@ -163,8 +163,8 @@ namespace ParaMEDMEM // bool isCellSupportEqual(const MEDFileField1TSStructItem& other, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception); bool isNodeSupportEqual(const MEDFileField1TSStructItem& other, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception); - MEDFileField1TSStructItem simplifyMeOnCellEntity(const MEDFileFieldGlobs *globs) const throw(INTERP_KERNEL::Exception); - bool isCompatibleWithNodesDiscr(const MEDFileField1TSStructItem& other, const MEDFileMeshStruct *meshSt, const MEDFileFieldGlobs *globs) const throw(INTERP_KERNEL::Exception); + MEDFileField1TSStructItem simplifyMeOnCellEntity(const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception); + bool isCompatibleWithNodesDiscr(const MEDFileField1TSStructItem& other, const MEDFileMeshStruct *meshSt, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception); bool isFullyOnOneLev(const MEDFileMeshStruct *meshSt, int& theFirstLevFull) const throw(INTERP_KERNEL::Exception); MEDMeshMultiLev *buildFromScratchDataSetSupportOnCells(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception); private: @@ -177,7 +177,7 @@ namespace ParaMEDMEM { public: static MEDFileField1TSStruct *New(const MEDFileAnyTypeField1TS *ref, MEDFileMeshStruct *mst) throw(INTERP_KERNEL::Exception); - void checkWithMeshStruct(MEDFileMeshStruct *mst, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception); + void checkWithMeshStruct(MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs) throw(INTERP_KERNEL::Exception); std::size_t getHeapMemorySize() const; bool isEqualConsideringThePast(const MEDFileAnyTypeField1TS *other, const MEDFileMeshStruct *mst) const throw(INTERP_KERNEL::Exception); bool isSupportSameAs(const MEDFileAnyTypeField1TS *other, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception); diff --git a/src/MEDLoader/MEDFileMesh.cxx b/src/MEDLoader/MEDFileMesh.cxx index 08fdeff0f..569c46e9c 100644 --- a/src/MEDLoader/MEDFileMesh.cxx +++ b/src/MEDLoader/MEDFileMesh.cxx @@ -2618,7 +2618,7 @@ int MEDFileUMesh::getNumberOfNodes() const throw(INTERP_KERNEL::Exception) return coo->getNumberOfTuples(); } -void MEDFileUMesh::whichAreNodesFetched(const MEDFileField1TSStructItem& st, const MEDFileFieldGlobs *globs, std::vector& nodesFetched) const throw(INTERP_KERNEL::Exception) +void MEDFileUMesh::whichAreNodesFetched(const MEDFileField1TSStructItem& st, const MEDFileFieldGlobsReal *globs, std::vector& nodesFetched) const throw(INTERP_KERNEL::Exception) { std::size_t sz(st.getNumberOfItems()); int mdim(getMeshDimension()); @@ -4372,7 +4372,7 @@ int MEDFileStructuredMesh::getNumberOfNodes() const throw(INTERP_KERNEL::Excepti return cmesh->getNumberOfNodes(); } -void MEDFileStructuredMesh::whichAreNodesFetched(const MEDFileField1TSStructItem& st, const MEDFileFieldGlobs *globs, std::vector& nodesFetched) const throw(INTERP_KERNEL::Exception) +void MEDFileStructuredMesh::whichAreNodesFetched(const MEDFileField1TSStructItem& st, const MEDFileFieldGlobsReal *globs, std::vector& nodesFetched) const throw(INTERP_KERNEL::Exception) { if(st.getNumberOfItems()!=1) throw INTERP_KERNEL::Exception("MEDFileStructuredMesh::whichAreNodesFetched : The sturture of field is not lying on single geo type ! it is not managed yet for structured mesh !"); diff --git a/src/MEDLoader/MEDFileMesh.hxx b/src/MEDLoader/MEDFileMesh.hxx index 2df119a3c..b0b77289a 100644 --- a/src/MEDLoader/MEDFileMesh.hxx +++ b/src/MEDLoader/MEDFileMesh.hxx @@ -31,7 +31,7 @@ namespace ParaMEDMEM { - class MEDFileFieldGlobs; + class MEDFileFieldGlobsReal; class MEDFileField1TSStructItem; class MEDLOADER_EXPORT MEDFileMesh : public RefCountObject, public MEDFileWritable @@ -73,7 +73,7 @@ namespace ParaMEDMEM virtual void write(med_idt fid) const throw(INTERP_KERNEL::Exception); virtual int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception) = 0; virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception) = 0; - virtual void whichAreNodesFetched(const MEDFileField1TSStructItem& st, const MEDFileFieldGlobs *globs, std::vector& nodesFetched) const throw(INTERP_KERNEL::Exception) = 0; + virtual void whichAreNodesFetched(const MEDFileField1TSStructItem& st, const MEDFileFieldGlobsReal *globs, std::vector& nodesFetched) const throw(INTERP_KERNEL::Exception) = 0; // bool areFamsEqual(const MEDFileMesh *other, std::string& what) const; bool areGrpsEqual(const MEDFileMesh *other, std::string& what) const; @@ -211,7 +211,7 @@ namespace ParaMEDMEM const DataArrayInt *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception); const DataArrayAsciiChar *getNameFieldAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception); int getNumberOfNodes() const throw(INTERP_KERNEL::Exception); - void whichAreNodesFetched(const MEDFileField1TSStructItem& st, const MEDFileFieldGlobs *globs, std::vector& nodesFetched) const throw(INTERP_KERNEL::Exception); + void whichAreNodesFetched(const MEDFileField1TSStructItem& st, const MEDFileFieldGlobsReal *globs, std::vector& nodesFetched) const throw(INTERP_KERNEL::Exception); std::vector getNonEmptyLevels() const; std::vector getNonEmptyLevelsExt() const; std::vector getFamArrNonEmptyLevelsExt() const; @@ -308,7 +308,7 @@ namespace ParaMEDMEM MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception); int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception); int getNumberOfNodes() const throw(INTERP_KERNEL::Exception); - void whichAreNodesFetched(const MEDFileField1TSStructItem& st, const MEDFileFieldGlobs *globs, std::vector& nodesFetched) const throw(INTERP_KERNEL::Exception); + void whichAreNodesFetched(const MEDFileField1TSStructItem& st, const MEDFileFieldGlobsReal *globs, std::vector& nodesFetched) const throw(INTERP_KERNEL::Exception); // tools bool unPolyze(std::vector& oldCode, std::vector& newCode, DataArrayInt *& o2nRenumCell) throw(INTERP_KERNEL::Exception); protected: -- 2.39.2