X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FMEDFileFieldInternal.hxx;h=e2270e5ddc88fbb5754e33fb9060147a419c84f4;hb=1b746b38f3cdeae6654a9501f37fde5e56e59288;hp=afa3dc9da497c8c9556bdc963100e7b27522b4cb;hpb=22a4bd76f2e2c06917d391a07efa1aa293b35177;p=tools%2Fmedcoupling.git diff --git a/src/MEDLoader/MEDFileFieldInternal.hxx b/src/MEDLoader/MEDFileFieldInternal.hxx index afa3dc9da..e2270e5dd 100644 --- a/src/MEDLoader/MEDFileFieldInternal.hxx +++ b/src/MEDLoader/MEDFileFieldInternal.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D +// Copyright (C) 2007-2024 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -85,6 +85,7 @@ namespace MEDCoupling MEDLOADER_EXPORT void simpleRepr(std::ostream& oss) const; MEDLOADER_EXPORT std::string getName() const { return _name; } MEDLOADER_EXPORT void setName(const std::string& name); + std::string getClassName() const override { return std::string("MEDFileFieldLoc"); } static MEDFileFieldLoc *New(med_idt fid, const std::string& locName); static MEDFileFieldLoc *New(med_idt fid, int i, const MEDFileEntities *entities); static MEDFileFieldLoc *New(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector& refCoo, const std::vector& gsCoo, const std::vector& w); @@ -133,20 +134,21 @@ namespace MEDCoupling { public: static MEDFileFieldPerMeshPerTypePerDisc *NewOnRead(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, int profileIt, const PartDefinition *pd); - static MEDFileFieldPerMeshPerTypePerDisc *New(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, int locId); + static MEDFileFieldPerMeshPerTypePerDisc *New(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, mcIdType locId); static MEDFileFieldPerMeshPerTypePerDisc *New(const MEDFileFieldPerMeshPerTypePerDisc& other); + std::string getClassName() const override { return std::string("MEDFileFieldPerMeshPerTypePerDisc"); } std::size_t getHeapMemorySizeWithoutChildren() const; std::vector getDirectChildrenWithNull() const; MEDFileFieldPerMeshPerTypePerDisc *deepCopy(MEDFileFieldPerMeshPerTypeCommon *father) const; - void assignFieldNoProfile(int& start, int offset, int nbOfCells, const MEDCouplingFieldTemplate *field, const DataArray *arrr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc); - void assignFieldProfile(bool isPflAlone, int& start, const DataArrayInt *multiTypePfl, const DataArrayInt *idsInPfl, DataArrayInt *locIds, int nbOfEltsInWholeMesh, const MEDCouplingFieldTemplate *field, const DataArray *arrr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc); - void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldTemplate *field, const DataArray *arrr, MEDFileFieldGlobsReal& glob); - void getCoarseData(TypeOfField& type, std::pair& dad, std::string& pfl, std::string& loc) const; + void assignFieldNoProfile(mcIdType& start, mcIdType offset, mcIdType nbOfCells, const MEDCouplingFieldTemplate *field, const DataArray *arrr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc); + void assignFieldProfile(bool isPflAlone, mcIdType& start, const DataArrayIdType *multiTypePfl, const DataArrayIdType *idsInPfl, DataArrayIdType *locIds, mcIdType nbOfEltsInWholeMesh, const MEDCouplingFieldTemplate *field, const DataArray *arrr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc); + void assignNodeFieldNoProfile(mcIdType& start, const MEDCouplingFieldTemplate *field, const DataArray *arrr, MEDFileFieldGlobsReal& glob); + void getCoarseData(TypeOfField& type, std::pair& dad, std::string& pfl, std::string& loc) const; void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const; const MEDFileFieldPerMeshPerTypeCommon *getFather() const; - void loadOnlyStructureOfDataRecursively(med_idt fid, int& start, const MEDFileFieldNameScope& nasc); + void loadOnlyStructureOfDataRecursively(med_idt fid, mcIdType& start, const MEDFileFieldNameScope& nasc); void loadBigArray(med_idt fid, const MEDFileFieldNameScope& nasc); - void setNewStart(int newValueOfStart); + void setNewStart(mcIdType newValueOfStart); int getIteration() const; int getOrder() const; double getTime() const; @@ -156,12 +158,14 @@ namespace MEDCoupling void fillTypesOfFieldAvailable(std::set& types) const; void setType(TypeOfField newType); INTERP_KERNEL::NormalizedCellType getGeoType() const; - int getNumberOfComponents() const; - int getNumberOfTuples() const; - int getStart() const { return _start; } - int getEnd() const { return _end; } - void setEnd(int endd) { _end=endd; } - int getNumberOfVals() const { return _nval; } + INTERP_KERNEL::NormalizedCellType getGeoTypeStatic() const; + std::size_t getNumberOfComponents() const; + mcIdType getNumberOfTuples() const; + mcIdType getStart() const { return _start; } + mcIdType getEnd() const { return _end; } + void setEnd(mcIdType endd) { _end=endd; } + mcIdType getNumberOfVals() const { return _nval; } + void incrementNbOfVals(mcIdType deltaNbVal); DataArray *getOrCreateAndGetArray(); const DataArray *getOrCreateAndGetArray() const; const std::vector& getInfo() const; @@ -169,29 +173,29 @@ namespace MEDCoupling void setProfile(const std::string& newPflName); std::string getLocalization() const; void setLocalization(const std::string& newLocName); - int getLocId() const { return _loc_id; } - void setLocId(int newId) const { _loc_id=newId; } + mcIdType getLocId() const { return _loc_id; } + void setLocId(mcIdType newId) const { _loc_id=newId; } void setFather(MEDFileFieldPerMeshPerTypeCommon *newFather) { _father=newFather; } void changePflsRefsNamesGen(const std::vector< std::pair, std::string > >& mapOfModif); void changeLocsRefsNamesGen(const std::vector< std::pair, std::string > >& mapOfModif); - void getFieldAtLevel(TypeOfField type, const MEDFileFieldGlobsReal *glob, std::vector< std::pair >& dads, std::vector& pfls, std::vector& locs, + void getFieldAtLevel(TypeOfField type, const MEDFileFieldGlobsReal *glob, std::vector< std::pair >& dads, std::vector& pfls, std::vector& locs, std::vector& geoTypes) const; - void fillValues(int discId, int& startEntryId, std::vector< std::pair,std::pair > >& entries) const; - int fillEltIdsFromCode(int offset, const std::vector& codeOfMesh, const MEDFileFieldGlobsReal& glob, int *ptToFill) const; - int fillTupleIds(int *ptToFill) const; - static int ConvertType(TypeOfField type, int locId); + void fillValues(int discId, mcIdType& startEntryId, std::vector< std::pair,std::pair > >& entries) const; + mcIdType fillEltIdsFromCode(mcIdType offset, const std::vector& codeOfMesh, const MEDFileFieldGlobsReal& glob, mcIdType *ptToFill) const; + mcIdType fillTupleIds(mcIdType *ptToFill) const; + static int ConvertType(TypeOfField type, mcIdType locId); static std::vector< std::vector< const MEDFileFieldPerMeshPerTypePerDisc *> > SplitPerDiscretization(const std::vector< const MEDFileFieldPerMeshPerTypePerDisc *>& entries); - static bool RenumberChunks(int offset, const std::vector< const MEDFileFieldPerMeshPerTypePerDisc *>& entriesOnSameDisc, - const DataArrayInt *explicitIdsInMesh, const std::vector& newCode, + static bool RenumberChunks(mcIdType offset, const std::vector< const MEDFileFieldPerMeshPerTypePerDisc *>& entriesOnSameDisc, + const DataArrayIdType *explicitIdsInMesh, const std::vector& newCode, MEDFileFieldGlobsReal& glob, DataArrayDouble *arr, std::vector< MCAuto >& result); - static MEDFileFieldPerMeshPerTypePerDisc *NewObjectOnSameDiscThanPool(TypeOfField typeF, INTERP_KERNEL::NormalizedCellType geoType, DataArrayInt *idsOfMeshElt, - bool isPfl, int nbi, int offset, std::list< const MEDFileFieldPerMeshPerTypePerDisc *>& entriesOnSameDisc, + static MEDFileFieldPerMeshPerTypePerDisc *NewObjectOnSameDiscThanPool(TypeOfField typeF, INTERP_KERNEL::NormalizedCellType geoType, DataArrayIdType *idsOfMeshElt, + bool isPfl, mcIdType nbi, mcIdType offset, std::list< const MEDFileFieldPerMeshPerTypePerDisc *>& entriesOnSameDisc, MEDFileFieldGlobsReal& glob, bool ¬InExisting); - static MCAuto Aggregate(int &start, const std::vector >& pms, const std::vector< std::vector< std::pair > >& dts, TypeOfField tof, MEDFileFieldPerMeshPerType *father, std::vector > >& extractInfo); + static MCAuto Aggregate(mcIdType &start, const std::vector >& pms, const std::vector< std::vector< std::pair > >& dts, TypeOfField tof, MEDFileFieldPerMeshPerType *father, std::vector > >& extractInfo); MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type):_type(type),_father(fath),_start(-1),_end(-1),_nval(-1),_loc_id(-5),_profile_it(-1) { } private: - MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, int profileIt, const PartDefinition *pd); - MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, int profileIt, const std::string& dummy); + MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, mcIdType profileIt, const PartDefinition *pd); + MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, mcIdType profileIt, const std::string& dummy); MEDFileFieldPerMeshPerTypePerDisc(const MEDFileFieldPerMeshPerTypePerDisc& other); MEDFileFieldPerMeshPerTypePerDisc(); private: @@ -199,18 +203,18 @@ namespace MEDCoupling private: TypeOfField _type; MEDFileFieldPerMeshPerTypeCommon *_father; - int _start; - int _end; + mcIdType _start; + mcIdType _end; //! _nval is different than end-start in case of ON_GAUSS_PT and ON_GAUSS_NE ! (_nval=(_end-_start)/nbi) - int _nval; + mcIdType _nval; std::string _profile; std::string _localization; //! only on assignment -3 : ON_NODES, -2 : ON_CELLS, -1 : ON_GAUSS_NE, 0..* : ON_GAUSS_PT - mutable int _loc_id; - mutable int _profile_it; + mutable mcIdType _loc_id; + mutable mcIdType _profile_it; MCAuto _pd; public: - mutable int _tmp_work1; + mutable mcIdType _tmp_work1; }; class MEDFileFieldVisitor; @@ -219,25 +223,26 @@ namespace MEDCoupling class MEDFileFieldPerMeshPerTypeCommon : public RefCountObject, public MEDFileWritable { public: + std::string getClassName() const override { return std::string("MEDFileFieldPerMeshPerTypeCommon"); } std::size_t getHeapMemorySizeWithoutChildren() const; std::vector getDirectChildrenWithNull() const; - void assignFieldNoProfile(int& start, int offset, int nbOfCells, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc); - void assignFieldProfile(bool isPflAlone, int& start, const DataArrayInt *multiTypePfl, const DataArrayInt *idsInPfl, DataArrayInt *locIds, int nbOfEltsInWholeMesh, const MEDCouplingFieldTemplate *field, const DataArray *arr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc); - void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob); - void assignNodeFieldProfile(int& start, const DataArrayInt *pfl, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc); + void assignFieldNoProfile(mcIdType& start, mcIdType offset, mcIdType nbOfCells, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc); + void assignFieldProfile(bool isPflAlone, mcIdType& start, const DataArrayIdType *multiTypePfl, const DataArrayIdType *idsInPfl, DataArrayIdType *locIds, mcIdType nbOfEltsInWholeMesh, const MEDCouplingFieldTemplate *field, const DataArray *arr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc); + void assignNodeFieldNoProfile(mcIdType& start, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob); + void assignNodeFieldProfile(mcIdType& start, const DataArrayIdType *pfl, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc); const MEDFileFieldPerMesh *getFather() const; - void loadOnlyStructureOfDataRecursively(med_idt fid, int &start, const MEDFileFieldNameScope& nasc); + void loadOnlyStructureOfDataRecursively(med_idt fid, mcIdType &start, const MEDFileFieldNameScope& nasc); void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc); void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const; bool isUniqueLevel(int& dim) const; void fillTypesOfFieldAvailable(std::set& types) const; - void fillFieldSplitedByType(std::vector< std::pair >& dads, std::vector& types, std::vector& pfls, std::vector& locs) const; + void fillFieldSplitedByType(std::vector< std::pair >& dads, std::vector& types, std::vector& pfls, std::vector& locs) const; int getIteration() const; int getOrder() const; double getTime() const; std::string getMeshName() const; - void getSizes(int& globalSz, int& nbOfEntries) const; - int getNumberOfComponents() const; + void getSizes(mcIdType& globalSz, mcIdType& nbOfEntries) const; + std::size_t getNumberOfComponents() const; bool presenceOfMultiDiscPerGeoType() const; void pushDiscretization(MEDFileFieldPerMeshPerTypePerDisc *disc); DataArray *getOrCreateAndGetArray(); @@ -249,13 +254,14 @@ namespace MEDCoupling std::vector getLocsReallyUsedMulti() const; void changePflsRefsNamesGen(const std::vector< std::pair, std::string > >& mapOfModif); void changeLocsRefsNamesGen(const std::vector< std::pair, std::string > >& mapOfModif); - MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenLocId(int locId); - const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenLocId(int locId) const; - int getNumberOfLoc() const { return _field_pm_pt_pd.size(); } - void fillValues(int& startEntryId, std::vector< std::pair,std::pair > >& entries) const; + MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenLocId(mcIdType locId); + const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenLocId(mcIdType locId) const; + int getNumberOfLoc() const { return (int)_field_pm_pt_pd.size(); } + int locIdOfLeaf(const MEDFileFieldPerMeshPerTypePerDisc *leaf) const; + void fillValues(mcIdType& startEntryId, std::vector< std::pair,std::pair > >& entries) const; void setLeaves(const std::vector< MCAuto< MEDFileFieldPerMeshPerTypePerDisc > >& leaves); - bool keepOnlySpatialDiscretization(TypeOfField tof, int &globalNum, std::vector< std::pair >& its); - bool keepOnlyGaussDiscretization(std::size_t idOfDisc, int &globalNum, std::vector< std::pair >& its); + bool keepOnlySpatialDiscretization(TypeOfField tof, mcIdType &globalNum, std::vector< std::pair >& its); + bool keepOnlyGaussDiscretization(std::size_t idOfDisc, mcIdType &globalNum, std::vector< std::pair >& its); static med_entity_type ConvertIntoMEDFileType(TypeOfField ikType, INTERP_KERNEL::NormalizedCellType ikGeoType, med_geometry_type& medfGeoType); MEDFileFieldPerMeshPerTypeCommon(MEDFileFieldPerMesh *father):_father(father) { } void setFather(MEDFileFieldPerMesh *father); @@ -264,17 +270,18 @@ namespace MEDCoupling virtual ~MEDFileFieldPerMeshPerTypeCommon(); virtual void getDimension(int& dim) const = 0; virtual INTERP_KERNEL::NormalizedCellType getGeoType() const = 0; + virtual INTERP_KERNEL::NormalizedCellType getGeoTypeStatic() const = 0; virtual void entriesForMEDfile(TypeOfField mct, med_geometry_type& gt, med_entity_type& ent) const = 0; virtual void simpleRepr(int bkOffset, std::ostream& oss, int id) const = 0; virtual std::string getGeoTypeRepr() const = 0; virtual MEDFileFieldPerMeshPerTypeCommon *deepCopy(MEDFileFieldPerMesh *father) const = 0; - virtual void getFieldAtLevel(int meshDim, TypeOfField type, const MEDFileFieldGlobsReal *glob, std::vector< std::pair >& dads, std::vector& pfls, std::vector& locs, std::vector& geoTypes) const = 0; + virtual void getFieldAtLevel(int meshDim, TypeOfField type, const MEDFileFieldGlobsReal *glob, std::vector< std::pair >& dads, std::vector& pfls, std::vector& locs, std::vector& geoTypes) const = 0; protected: void deepCopyElements(); - std::vector addNewEntryIfNecessary(const MEDCouplingFieldTemplate *field, int offset, int nbOfCells); - std::vector addNewEntryIfNecessaryGauss(const MEDCouplingFieldTemplate *field, int offset, int nbOfCells); - std::vector addNewEntryIfNecessary(const MEDCouplingFieldTemplate *field, const DataArrayInt *subCells); - std::vector addNewEntryIfNecessaryGauss(const MEDCouplingFieldTemplate *field, const DataArrayInt *subCells); + std::vector addNewEntryIfNecessary(const MEDCouplingFieldTemplate *field, mcIdType offset, mcIdType nbOfCells); + std::vector addNewEntryIfNecessaryGauss(const MEDCouplingFieldTemplate *field, mcIdType offset, mcIdType nbOfCells); + std::vector addNewEntryIfNecessary(const MEDCouplingFieldTemplate *field, const DataArrayIdType *subCells); + std::vector addNewEntryIfNecessaryGauss(const MEDCouplingFieldTemplate *field, const DataArrayIdType *subCells); private: MEDFileFieldPerMesh *_father; protected: @@ -284,17 +291,19 @@ namespace MEDCoupling class MEDFileFieldPerMeshPerType : public MEDFileFieldPerMeshPerTypeCommon { public: + std::string getClassName() const override { return std::string("MEDFileFieldPerMeshPerType"); } static MEDFileFieldPerMeshPerType *New(MEDFileFieldPerMesh *fath, INTERP_KERNEL::NormalizedCellType geoType); static MEDFileFieldPerMeshPerType *NewOnRead(med_idt fid, MEDFileFieldPerMesh *fath, TypeOfField type, INTERP_KERNEL::NormalizedCellType geoType, const MEDFileFieldNameScope& nasc, const PartDefinition *pd); - static MCAuto Aggregate(int &start, const std::vector< std::pair >& pms, const std::vector< std::vector< std::pair > >& dts, INTERP_KERNEL::NormalizedCellType gt, MEDFileFieldPerMesh *father, std::vector > >& extractInfo); + static MCAuto Aggregate(mcIdType &start, const std::vector< std::pair >& pms, const std::vector< std::vector< std::pair > >& dts, INTERP_KERNEL::NormalizedCellType gt, MEDFileFieldPerMesh *father, std::vector > >& extractInfo); public:// overload of abstract methods void getDimension(int& dim) const; - INTERP_KERNEL::NormalizedCellType getGeoType() const; + INTERP_KERNEL::NormalizedCellType getGeoType() const override; + INTERP_KERNEL::NormalizedCellType getGeoTypeStatic() const override; void entriesForMEDfile(TypeOfField mct, med_geometry_type& gt, med_entity_type& ent) const; void simpleRepr(int bkOffset, std::ostream& oss, int id) const; std::string getGeoTypeRepr() const; MEDFileFieldPerMeshPerType *deepCopy(MEDFileFieldPerMesh *father) const; - void getFieldAtLevel(int meshDim, TypeOfField type, const MEDFileFieldGlobsReal *glob, std::vector< std::pair >& dads, std::vector& pfls, std::vector& locs, std::vector& geoTypes) const; + void getFieldAtLevel(int meshDim, TypeOfField type, const MEDFileFieldGlobsReal *glob, std::vector< std::pair >& dads, std::vector& pfls, std::vector& locs, std::vector& geoTypes) const; private: MEDFileFieldPerMeshPerType(med_idt fid, MEDFileFieldPerMesh *fath, TypeOfField type, INTERP_KERNEL::NormalizedCellType geoType, const MEDFileFieldNameScope& nasc, const PartDefinition *pd); MEDFileFieldPerMeshPerType(MEDFileFieldPerMesh *father, INTERP_KERNEL::NormalizedCellType gt); @@ -306,16 +315,18 @@ namespace MEDCoupling { public: static MEDFileFieldPerMeshPerTypeDyn *NewOnRead(med_idt fid, MEDFileFieldPerMesh *fath, const MEDFileEntities *entities, int idGT, const MEDFileFieldNameScope& nasc); + std::string getClassName() const override { return std::string("MEDFileFieldPerMeshPerTypeDyn"); } int getDynGT() const; std::string getModelName() const; public: void getDimension(int& dim) const; - INTERP_KERNEL::NormalizedCellType getGeoType() const; + INTERP_KERNEL::NormalizedCellType getGeoType() const override; + INTERP_KERNEL::NormalizedCellType getGeoTypeStatic() const override; void entriesForMEDfile(TypeOfField mct, med_geometry_type& gt, med_entity_type& ent) const; void simpleRepr(int bkOffset, std::ostream& oss, int id) const; std::string getGeoTypeRepr() const; MEDFileFieldPerMeshPerTypeDyn *deepCopy(MEDFileFieldPerMesh *father) const; - void getFieldAtLevel(int meshDim, TypeOfField type, const MEDFileFieldGlobsReal *glob, std::vector< std::pair >& dads, std::vector& pfls, std::vector& locs, std::vector& geoTypes) const; + void getFieldAtLevel(int meshDim, TypeOfField type, const MEDFileFieldGlobsReal *glob, std::vector< std::pair >& dads, std::vector& pfls, std::vector& locs, std::vector& geoTypes) const; private: MEDFileFieldPerMeshPerTypeDyn(med_idt fid, MEDFileFieldPerMesh *fath, const MEDFileStructureElement *se, const MEDFileFieldNameScope& nasc); private: @@ -331,20 +342,22 @@ namespace MEDCoupling public: static MEDFileFieldPerMesh *New(MEDFileAnyTypeField1TSWithoutSDA *fath, const MEDCouplingMesh *mesh); static MEDFileFieldPerMesh *NewOnRead(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc, const MEDFileMesh *mm, const MEDFileEntities *entities); + static MEDFileFieldPerMesh *NewOnRead(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc, const PartDefinition *pd, const MEDFileEntities *entities); + std::string getClassName() const override { return std::string("MEDFileFieldPerMesh"); } std::size_t getHeapMemorySizeWithoutChildren() const; std::vector getDirectChildrenWithNull() const; MEDFileFieldPerMesh *deepCopy(MEDFileAnyTypeField1TSWithoutSDA *father) const; void simpleRepr(int bkOffset,std::ostream& oss, int id) const; void copyTinyInfoFrom(const MEDCouplingMesh *mesh); - void assignFieldProfile(int& start, const DataArrayInt *multiTypePfl, const std::vector& code, const std::vector& code2, const std::vector& idsInPflPerType, const std::vector& idsPerType, const MEDCouplingFieldTemplate *field, const DataArray *arr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc); - void assignFieldNoProfileNoRenum(int& start, const std::vector& code, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc); - void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob); - void assignNodeFieldProfile(int& start, const DataArrayInt *pfl, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc); - void loadOnlyStructureOfDataRecursively(med_idt fid, int &start, const MEDFileFieldNameScope& nasc); + void assignFieldProfile(mcIdType& start, const DataArrayIdType *multiTypePfl, const std::vector& code, const std::vector& code2, const std::vector& idsInPflPerType, const std::vector& idsPerType, const MEDCouplingFieldTemplate *field, const DataArray *arr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc); + void assignFieldNoProfileNoRenum(mcIdType& start, const std::vector& code, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc); + void assignNodeFieldNoProfile(mcIdType& start, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob); + void assignNodeFieldProfile(mcIdType& start, const DataArrayIdType *pfl, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc); + void loadOnlyStructureOfDataRecursively(med_idt fid, mcIdType &start, const MEDFileFieldNameScope& nasc); void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc); void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const; void fillTypesOfFieldAvailable(std::set& types) const; - std::vector< std::vector< std::pair > > getFieldSplitedByType(std::vector& types, std::vector< std::vector >& typesF, std::vector< std::vector >& pfls, std::vector< std::vector >& locs) const; + std::vector< std::vector< std::pair > > getFieldSplitedByType(std::vector& types, std::vector< std::vector >& typesF, std::vector< std::vector >& pfls, std::vector< std::vector >& locs) const; void accept(MEDFileFieldVisitor& visitor) const; void getDimension(int& dim) const; bool isUniqueLevel(int& dim) const; @@ -355,7 +368,7 @@ namespace MEDCoupling int getMeshOrder() const { return _mesh_order; } std::string getMeshName() const; void setMeshName(const std::string& meshName); - int getNumberOfComponents() const; + std::size_t getNumberOfComponents() const; bool presenceOfMultiDiscPerGeoType() const; bool presenceOfStructureElements() const; bool onlyStructureElements() const; @@ -372,37 +385,38 @@ namespace MEDCoupling std::vector getLocsReallyUsedMulti() const; void convertMedBallIntoClassic(); bool changeMeshNames(const std::vector< std::pair >& modifTab); - bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector& oldCode, const std::vector& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob); - void keepOnlySpatialDiscretization(TypeOfField tof, int &globalNum, std::vector< std::pair >& its); - void keepOnlyGaussDiscretization(std::size_t idOfDisc, int &globalNum, std::vector< std::pair >& its); + bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector& oldCode, const std::vector& newCode, const DataArrayIdType *renumO2N, MEDFileFieldGlobsReal& glob); + void keepOnlySpatialDiscretization(TypeOfField tof, mcIdType &globalNum, std::vector< std::pair >& its); + void keepOnlyGaussDiscretization(std::size_t idOfDisc, mcIdType &globalNum, std::vector< std::pair >& its); void changePflsRefsNamesGen(const std::vector< std::pair, std::string > >& mapOfModif); void changeLocsRefsNamesGen(const std::vector< std::pair, std::string > >& mapOfModif); MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, bool& isPfl, MCAuto &arrOut, const MEDFileFieldNameScope& nasc) const; - DataArray *getFieldOnMeshAtLevelWithPfl(TypeOfField type, const MEDCouplingMesh *mesh, DataArrayInt *&pfl, const MEDFileFieldGlobsReal *glob, const MEDFileFieldNameScope& nasc) const; - void getUndergroundDataArrayExt(std::vector< std::pair,std::pair > >& entries) const; - MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenTypeAndLocId(INTERP_KERNEL::NormalizedCellType typ, int locId); - const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenTypeAndLocId(INTERP_KERNEL::NormalizedCellType typ, int locId) const; - static MCAuto Aggregate(int &start, const std::vector& pms, const std::vector< std::vector< std::pair > >& dts, MEDFileAnyTypeField1TSWithoutSDA *father, std::vector > >& extractInfo); + DataArray *getFieldOnMeshAtLevelWithPfl(TypeOfField type, const MEDCouplingMesh *mesh, DataArrayIdType *&pfl, const MEDFileFieldGlobsReal *glob, const MEDFileFieldNameScope& nasc) const; + void getUndergroundDataArrayExt(std::vector< std::pair,std::pair > >& entries) const; + MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenTypeAndLocId(INTERP_KERNEL::NormalizedCellType typ, mcIdType locId); + const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenTypeAndLocId(INTERP_KERNEL::NormalizedCellType typ, mcIdType locId) const; + static MCAuto Aggregate(mcIdType &start, const std::vector& pms, const std::vector< std::vector< std::pair > >& dts, MEDFileAnyTypeField1TSWithoutSDA *father, std::vector > >& extractInfo); private: int addNewEntryIfNecessary(INTERP_KERNEL::NormalizedCellType type); MEDCouplingFieldDouble *finishField(TypeOfField type, const MEDFileFieldGlobsReal *glob, - const std::vector< std::pair >& dads, const std::vector& locs, const MEDCouplingMesh *mesh, bool& isPfl, MCAuto &arrOut, const MEDFileFieldNameScope& nasc) const; + const std::vector< std::pair >& dads, const std::vector& locs, const MEDCouplingMesh *mesh, bool& isPfl, MCAuto &arrOut, const MEDFileFieldNameScope& nasc) const; MEDCouplingFieldDouble *finishField2(TypeOfField type, const MEDFileFieldGlobsReal *glob, - const std::vector< std::pair >& dads, const std::vector& locs, + const std::vector< std::pair >& dads, const std::vector& locs, const std::vector& geoTypes, - const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MCAuto &arrOut, const MEDFileFieldNameScope& nasc) const; + const MEDCouplingMesh *mesh, const DataArrayIdType *da, bool& isPfl, MCAuto &arrOut, const MEDFileFieldNameScope& nasc) const; MEDCouplingFieldDouble *finishFieldNode2(const MEDFileFieldGlobsReal *glob, - const std::vector< std::pair >& dads, const std::vector& locs, - const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MCAuto &arrOut, const MEDFileFieldNameScope& nasc) const; - DataArray *finishField4(const std::vector< std::pair >& dads, const DataArrayInt *pflIn, int nbOfElems, DataArrayInt *&pflOut) const; + const std::vector< std::pair >& dads, const std::vector& locs, + const MEDCouplingMesh *mesh, const DataArrayIdType *da, bool& isPfl, MCAuto &arrOut, const MEDFileFieldNameScope& nasc) const; + DataArray *finishField4(const std::vector< std::pair >& dads, const DataArrayIdType *pflIn, mcIdType nbOfElems, DataArrayIdType *&pflOut) const; void assignNewLeaves(const std::vector< MCAuto< MEDFileFieldPerMeshPerTypePerDisc > >& leaves); static void SortArraysPerType(const MEDFileFieldGlobsReal *glob, TypeOfField type, - const std::vector& geoTypes, const std::vector< std::pair >& dads, const std::vector& pfls, const std::vector& locs, - std::vector& code, std::vector& notNullPfls); - static int ComputeNbOfElems(const MEDFileFieldGlobsReal *glob, TypeOfField type, const std::vector& geoTypes, const std::vector< std::pair >& dads, const std::vector& locs); + const std::vector& geoTypes, const std::vector< std::pair >& dads, const std::vector& pfls, const std::vector& locs, + std::vector& code, std::vector& notNullPfls); + static mcIdType ComputeNbOfElems(const MEDFileFieldGlobsReal *glob, TypeOfField type, const std::vector& geoTypes, const std::vector< std::pair >& dads, const std::vector& locs); MEDFileFieldPerMesh(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc, const MEDFileMesh *mm, const MEDFileEntities *entities); + MEDFileFieldPerMesh(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc, const PartDefinition *pd, const MEDFileEntities *entities); MEDFileFieldPerMesh(MEDFileAnyTypeField1TSWithoutSDA *fath, const MEDCouplingMesh *mesh); - MEDFileFieldPerMesh(MEDFileAnyTypeField1TSWithoutSDA *fath, const std::string& meshName, int meshIt, int meshOrd):_father(fath),_mesh_iteration(meshIt),_mesh_order(meshOrd) { } + MEDFileFieldPerMesh(MEDFileAnyTypeField1TSWithoutSDA *fath, const std::string& meshName, int meshIt, int meshOrd):_mesh_iteration(meshIt),_mesh_order(meshOrd),_father(fath) { } private: int _mesh_iteration; int _mesh_order;