Version: 6.3.1

src/MEDLoader/MEDFileField.hxx

Go to the documentation of this file.
00001 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #ifndef __MEDFILEFIELD_HXX__
00021 #define __MEDFILEFIELD_HXX__
00022 
00023 #include "MEDFileUtilities.hxx"
00024 
00025 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
00026 #include "MEDCouplingRefCountObject.hxx"
00027 #include "MEDCouplingMemArray.hxx"
00028 
00029 #include "NormalizedUnstructuredMesh.hxx"
00030 #include "InterpKernelException.hxx"
00031 
00032 #include <vector>
00033 #include <string>
00034 
00035 extern "C"
00036 {
00037 #include "med.h"
00038 }
00039 
00040 namespace ParaMEDMEM
00041 {
00042   class MEDFieldFieldGlobs;
00043   class MEDCouplingMesh;
00044   class MEDCouplingFieldDouble;
00045   class MEDFileMesh;
00046 
00047   class MEDFileFieldLoc : public RefCountObject
00048   {
00049   public:
00050     const std::string& getName() const { return _name; }
00051     static MEDFileFieldLoc *New(med_idt fid, const char *locName);
00052     static MEDFileFieldLoc *New(const char *locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
00053     int getNbOfGaussPtPerCell() const { return _nb_gauss_pt; }
00054     void writeLL(med_idt fid) const;
00055     bool isName(const char *name) const { return _name==name; }
00056     const std::vector<double>& getRefCoords() const { return _ref_coo; }
00057     const std::vector<double>& getGaussCoords() const { return _gs_coo; }
00058     const std::vector<double>& getGaussWeights() const { return _w; }
00059     bool isEqual(const MEDFileFieldLoc& other, double eps) const;
00060   private:
00061     MEDFileFieldLoc(med_idt fid, const char *locName);
00062     MEDFileFieldLoc(const char *locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
00063   private:
00064     int _dim;
00065     int _nb_gauss_pt;
00066     int _nb_node_per_cell;
00067     std::string _name;
00068     INTERP_KERNEL::NormalizedCellType _geo_type;
00069     std::vector<double> _ref_coo;
00070     std::vector<double> _gs_coo;
00071     std::vector<double> _w;
00072   };
00073 
00074   class MEDFileFieldPerMeshPerType;
00075   class MEDFileField1TSWithoutDAS;
00076   class MEDFileFieldPerMesh;
00077 
00078   class MEDFileFieldPerMeshPerTypePerDisc : public RefCountObject, public MEDFileWritable
00079   {
00080   public:
00081     static MEDFileFieldPerMeshPerTypePerDisc *New(MEDFileFieldPerMeshPerType *fath, med_idt fid, TypeOfField type, int profileIt) throw(INTERP_KERNEL::Exception);
00082     static MEDFileFieldPerMeshPerTypePerDisc *New(MEDFileFieldPerMeshPerType *fath, TypeOfField type, int locId);
00083     void assignFieldNoProfile(int offset, int nbOfCells, const MEDCouplingFieldDouble *field, MEDFieldFieldGlobs& glob) throw(INTERP_KERNEL::Exception);
00084     void assignFieldProfile(const char *pflName, const DataArrayInt *globIds, const MEDCouplingFieldDouble *field, MEDFieldFieldGlobs& glob) throw(INTERP_KERNEL::Exception);
00085     void assignNodeFieldNoProfile(const MEDCouplingFieldDouble *field, MEDFieldFieldGlobs& glob) throw(INTERP_KERNEL::Exception);
00086     void assignNodeFieldProfile(const char *pflName, const DataArrayInt *globIds, const MEDCouplingFieldDouble *field, MEDFieldFieldGlobs& glob) throw(INTERP_KERNEL::Exception);
00087     void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception);
00088     const MEDFileFieldPerMeshPerType *getFather() const;
00089     int getIteration() const;
00090     int getOrder() const;
00091     double getTime() const;
00092     std::string getName() const;
00093     std::string getMeshName() const;
00094     TypeOfField getType() const;
00095     void setType(TypeOfField newType);
00096     INTERP_KERNEL::NormalizedCellType getGeoType() const;
00097     int getNumberOfComponents() const;
00098     int getNumberOfTuples() const;
00099     const std::vector<std::string>& getInfo() const;
00100     std::string getProfile() const;
00101     std::string getLocalization() const;
00102     int getLocId() const { return _loc_id; }
00103     void getFieldAtLevel(TypeOfField type, const MEDFieldFieldGlobs *glob, std::vector<const DataArrayDouble *>& dads, std::vector<const DataArrayInt *>& pfls, std::vector<int>& locs,
00104                          std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes) const;
00105     static int ConvertType(TypeOfField type, int locId) throw(INTERP_KERNEL::Exception);
00106   private:
00107     MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerType *fath, med_idt fid, TypeOfField type, int profileIt) throw(INTERP_KERNEL::Exception);
00108     MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerType *fath, TypeOfField type, int profileIt);
00109   private:
00110     TypeOfField _type;
00111     MEDFileFieldPerMeshPerType *_father;
00112     MEDCouplingAutoRefCountObjectPtr< DataArrayDouble > _arr;
00114     int _nval;
00115     int _profile_it;
00116     std::string _profile;
00117     std::string _localization;
00119     mutable int _loc_id;
00120   };
00121 
00122   class MEDFileFieldPerMeshPerType : public RefCountObject, public MEDFileWritable
00123   {
00124   public:
00125     static MEDFileFieldPerMeshPerType *New(MEDFileFieldPerMesh *fath, INTERP_KERNEL::NormalizedCellType geoType) throw(INTERP_KERNEL::Exception);
00126     void assignFieldNoProfile(int offset, int nbOfCells, const MEDCouplingFieldDouble *field, MEDFieldFieldGlobs& glob) throw(INTERP_KERNEL::Exception);
00127     void assignFieldProfile(const DataArrayInt *globIds, DataArrayInt *locIds, const MEDCouplingFieldDouble *field, MEDFieldFieldGlobs& glob) throw(INTERP_KERNEL::Exception);
00128     void assignNodeFieldNoProfile(const MEDCouplingFieldDouble *field, MEDFieldFieldGlobs& glob) throw(INTERP_KERNEL::Exception);
00129     void assignNodeFieldProfile(const DataArrayInt *pfl, const MEDCouplingFieldDouble *field, MEDFieldFieldGlobs& glob) throw(INTERP_KERNEL::Exception);
00130     const MEDFileFieldPerMesh *getFather() const;
00131     void finishLoading(med_idt fid, TypeOfField type) throw(INTERP_KERNEL::Exception);
00132     void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception);
00133     void getDimension(int& dim) const;
00134     int getIteration() const;
00135     int getOrder() const;
00136     double getTime() const;
00137     std::string getName() const;
00138     std::string getMeshName() const;
00139     INTERP_KERNEL::NormalizedCellType getGeoType() const;
00140     int getNumberOfComponents() const;
00141     const std::vector<std::string>& getInfo() const;
00142     std::vector<std::string> getPflsReallyUsed() const;
00143     std::vector<std::string> getLocsReallyUsed() const;
00144     void getFieldAtLevel(int meshDim, TypeOfField type, const MEDFieldFieldGlobs *glob, std::vector<const DataArrayDouble *>& dads, std::vector<const DataArrayInt *>& pfls, std::vector<int>& locs, std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes) const;
00145     static med_entity_type ConvertIntoMEDFileType(TypeOfField ikType, INTERP_KERNEL::NormalizedCellType ikGeoType, med_geometry_type& medfGeoType);
00146   private:
00147     std::vector<int> addNewEntryIfNecessary(const MEDCouplingFieldDouble *field, int offset, int nbOfCells) throw(INTERP_KERNEL::Exception);
00148     std::vector<int> addNewEntryIfNecessaryGauss(const MEDCouplingFieldDouble *field, int offset, int nbOfCells) throw(INTERP_KERNEL::Exception);
00149     std::vector<int> addNewEntryIfNecessary(const MEDCouplingFieldDouble *field, const DataArrayInt *subCells) throw(INTERP_KERNEL::Exception);
00150     std::vector<int> addNewEntryIfNecessaryGauss(const MEDCouplingFieldDouble *field, const DataArrayInt *subCells) throw(INTERP_KERNEL::Exception);
00151     MEDFileFieldPerMeshPerType(MEDFileFieldPerMesh *fath, INTERP_KERNEL::NormalizedCellType geoType) throw(INTERP_KERNEL::Exception);
00152   private:
00153     MEDFileFieldPerMesh *_father;
00154     std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> > _field_pm_pt_pd;
00155     INTERP_KERNEL::NormalizedCellType _geo_type;
00156   };
00157 
00158   class MEDFileFieldPerMesh : public RefCountObject, public MEDFileWritable
00159   {
00160   public:
00161     static MEDFileFieldPerMesh *New(MEDFileField1TSWithoutDAS *fath, const MEDCouplingMesh *mesh);
00162     static MEDFileFieldPerMesh *New(MEDFileField1TSWithoutDAS *fath, int meshCsit, int meshIteration, int meshOrder);
00163     void copyTinyInfoFrom(const MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
00164     void assignFieldProfile(const std::vector<int>& code, const std::vector<DataArrayInt *>& globIdsPerType, const std::vector<DataArrayInt *>& idsPerType, const MEDCouplingFieldDouble *field, MEDFieldFieldGlobs& glob) throw(INTERP_KERNEL::Exception);
00165     void assignFieldProfileGeneral(const std::vector<int>& code, const std::vector<DataArrayInt *>& globIdsPerType, const std::vector<DataArrayInt *>& idsPerType, const MEDCouplingFieldDouble *field, MEDFieldFieldGlobs& glob) throw(INTERP_KERNEL::Exception);
00166     void assignFieldNoProfileNoRenum(const std::vector<int>& code, const MEDCouplingFieldDouble *field, MEDFieldFieldGlobs& glob) throw(INTERP_KERNEL::Exception);
00167     void assignNodeFieldNoProfile(const MEDCouplingFieldDouble *field, MEDFieldFieldGlobs& glob) throw(INTERP_KERNEL::Exception);
00168     void assignNodeFieldProfile(const DataArrayInt *pfl, const MEDCouplingFieldDouble *field, MEDFieldFieldGlobs& glob) throw(INTERP_KERNEL::Exception);
00169     void finishLoading(med_idt fid) throw(INTERP_KERNEL::Exception);
00170     void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception);
00171     void getDimension(int& dim) const;
00172     double getTime() const;
00173     int getIteration() const;
00174     int getOrder() const;
00175     int getMeshIteration() const { return _mesh_iteration; }
00176     int getMeshOrder() const { return _mesh_order; }
00177     const std::string& getDtUnit() const;
00178     std::string getName() const;
00179     std::string getMeshName() const { return _mesh_name; }
00180     int getNumberOfComponents() const;
00181     const std::vector<std::string>& getInfo() const;
00182     std::vector<std::string> getPflsReallyUsed() const;
00183     std::vector<std::string> getLocsReallyUsed() const;
00184     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDFieldFieldGlobs *glob, const MEDCouplingMesh *mesh, bool& isPfl) const throw(INTERP_KERNEL::Exception);
00185     DataArrayDouble *getFieldOnMeshAtLevelWithPfl(TypeOfField type, const MEDCouplingMesh *mesh, DataArrayInt *&pfl, const MEDFieldFieldGlobs *glob) const throw(INTERP_KERNEL::Exception);
00186   private:
00187     int addNewEntryIfNecessary(INTERP_KERNEL::NormalizedCellType type);
00188     MEDCouplingFieldDouble *finishField(TypeOfField type, const MEDFieldFieldGlobs *glob,
00189                                         const std::vector<const DataArrayDouble *>& dads, const std::vector<int>& locs, const MEDCouplingMesh *mesh, bool& isPfl) const throw(INTERP_KERNEL::Exception);
00190     MEDCouplingFieldDouble *finishField2(TypeOfField type, const MEDFieldFieldGlobs *glob,
00191                                          const std::vector<const DataArrayDouble *>& dads, const std::vector<int>& locs,
00192                                          const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl) const throw(INTERP_KERNEL::Exception);
00193     MEDCouplingFieldDouble *finishField3(const MEDFieldFieldGlobs *glob,
00194                                          const std::vector<const DataArrayDouble *>& dads, const std::vector<int>& locs,
00195                                          const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl) const throw(INTERP_KERNEL::Exception);
00196     DataArrayDouble *finishField4(const std::vector<const DataArrayDouble *>& dads, const DataArrayInt *pflIn, int nbOfElems, DataArrayInt *&pflOut) const throw(INTERP_KERNEL::Exception);
00197     static void SortArraysPerType(const MEDFieldFieldGlobs *glob,
00198                                   const std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes, const std::vector<const DataArrayDouble *>& dads, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& locs,
00199                                   std::vector<int>& code, std::vector<DataArrayInt *>& notNullPfls);
00200     static int ComputeNbOfElems(const MEDFieldFieldGlobs *glob, const std::vector<const DataArrayDouble *>& dads, const std::vector<int>& locs) throw(INTERP_KERNEL::Exception);
00201     MEDFileFieldPerMesh(MEDFileField1TSWithoutDAS *fath, int meshCsit, int meshIteration, int meshOrder);
00202     MEDFileFieldPerMesh(MEDFileField1TSWithoutDAS *fath, const MEDCouplingMesh *mesh);
00203   private:
00204     std::string _mesh_name;
00205     int _mesh_iteration;
00206     int _mesh_order;
00207     int _mesh_csit;
00208     MEDFileField1TSWithoutDAS *_father;
00209     std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > > _field_pm_pt;
00210   };
00211 
00212   class MEDFieldFieldGlobs
00213   {
00214   public:
00215     MEDFieldFieldGlobs(const char *fname);
00216     MEDFieldFieldGlobs();
00217     void loadProfileInFile(med_idt fid, int id, const char *pflName) throw(INTERP_KERNEL::Exception);
00218     void loadProfileInFile(med_idt fid, int id);
00219     void loadGlobals(med_idt fid) throw(INTERP_KERNEL::Exception);
00220     void writeGlobals(med_idt fid, const MEDFileWritable& opt) const throw(INTERP_KERNEL::Exception);
00221     std::vector<std::string> getPfls() const;
00222     std::vector<std::string> getLocs() const;
00223     void setFileName(const char *fileName);
00224     int getNbOfGaussPtPerCell(int locId) const throw(INTERP_KERNEL::Exception);
00225     int getLocalizationId(const char *loc) const throw(INTERP_KERNEL::Exception);
00226     const char *getFileName() const { return _file_name.c_str(); }
00227     const MEDFileFieldLoc& getLocalizationFromId(int locId) const throw(INTERP_KERNEL::Exception);
00228     const DataArrayInt *getProfile(const std::string& pflName) const throw(INTERP_KERNEL::Exception);
00229     virtual std::vector<std::string> getPflsReallyUsed() const = 0;
00230     virtual std::vector<std::string> getLocsReallyUsed() const = 0;
00231     //
00232     void appendProfile(DataArrayInt *pfl) throw(INTERP_KERNEL::Exception);
00233     void appendLoc(const char *locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w) throw(INTERP_KERNEL::Exception);
00234   protected:
00235     std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > _pfls;
00236     std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc> > _locs;
00237     std::string _file_name;
00238   };
00239 
00240   class MEDFileField1TSWithoutDAS : public RefCountObject, public MEDFileWritable
00241   {
00242   public:
00243     void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
00244     int getDimension() const;
00245     int getIteration() const { return _iteration; }
00246     int getOrder() const { return _order; }
00247     double getTime() const { return _dt; }
00248     std::string getName() const { return _name; }
00249     const std::string& getDtUnit() const { return _dt_unit; }
00250     std::string getMeshName() const throw(INTERP_KERNEL::Exception);
00251     int getMeshIteration() const throw(INTERP_KERNEL::Exception);
00252     int getMeshOrder() const throw(INTERP_KERNEL::Exception);
00253     int getNumberOfComponents() const { return _infos.size(); }
00254     bool isDealingTS(int iteration, int order) const;
00255     std::pair<int,int> getDtIt() const;
00256     void fillIteration(std::pair<int,int>& p) const;
00257     const std::vector<std::string>& getInfo() const { return _infos; }
00258     //
00259     static MEDFileField1TSWithoutDAS *New(const char *fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
00260     void finishLoading(med_idt fid) throw(INTERP_KERNEL::Exception);
00261     void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception);
00262     std::vector<std::string> getPflsReallyUsed2() const;
00263     std::vector<std::string> getLocsReallyUsed2() const;
00264     static void CheckMeshDimRel(int meshDimRelToMax) throw(INTERP_KERNEL::Exception);
00265     static std::vector<int> CheckSBTMesh(const MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
00266     //
00267     void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, MEDFieldFieldGlobs& glob) throw(INTERP_KERNEL::Exception);
00268     void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile, MEDFieldFieldGlobs& glob) throw(INTERP_KERNEL::Exception);
00269   public:
00270     MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, const char *mName, int renumPol, const MEDFieldFieldGlobs *glob) const throw(INTERP_KERNEL::Exception);
00271     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol, const MEDFieldFieldGlobs *glob, const MEDFileMesh *mesh) const throw(INTERP_KERNEL::Exception);
00272     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int renumPol, const MEDFieldFieldGlobs *glob, const MEDCouplingMesh *mesh, const DataArrayInt *cellRenum, const DataArrayInt *nodeRenum) const throw(INTERP_KERNEL::Exception);
00273     DataArrayDouble *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl, const MEDFieldFieldGlobs *glob) const throw(INTERP_KERNEL::Exception);
00274   protected:
00275     int addNewEntryIfNecessary(const MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
00276     int getMeshIdFromMeshName(const char *mName) const throw(INTERP_KERNEL::Exception);
00277     MEDFileField1TSWithoutDAS(const char *fieldName, int csit, int iteration, int order, const std::vector<std::string>& infos);
00278   public:
00279     MEDFileField1TSWithoutDAS();
00280   protected:
00281     std::string _name;
00282     std::string _dt_unit;
00283     std::vector<std::string> _infos;
00284     std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > > _field_per_mesh;
00285     int _csit;
00286     int _iteration;
00287     int _order;
00288     double _dt;
00289   };
00290 
00294   class MEDFileField1TS : public MEDFileField1TSWithoutDAS, public MEDFieldFieldGlobs
00295   {
00296   public:
00297     static MEDFileField1TS *New(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
00298     static MEDFileField1TS *New();
00299     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
00300     void setFileName(const char *fileName);
00301     MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
00302     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
00303     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
00304     MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
00305     DataArrayDouble *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const throw(INTERP_KERNEL::Exception);
00306     //
00307     void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
00308     void setFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
00309   private:
00310     std::vector<std::string> getPflsReallyUsed() const;
00311     std::vector<std::string> getLocsReallyUsed() const;
00312     MEDFileField1TS(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception);
00313     MEDFileField1TS();
00314   };
00315   
00316   class MEDFileFieldMultiTSWithoutDAS : public RefCountObject, public MEDFileWritable
00317   {
00318   public:
00319     static MEDFileFieldMultiTSWithoutDAS *New(med_idt fid, const char *fieldName, int id, const std::vector<std::string>& infos, int nbOfStep) throw(INTERP_KERNEL::Exception);
00320     int getNumberOfTS() const;
00321     std::vector< std::pair<int,int> > getIterations() const;
00322     void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception);
00323   public:
00324     std::vector<std::string> getPflsReallyUsed2() const;
00325     std::vector<std::string> getLocsReallyUsed2() const;
00326   protected:
00327     const MEDFileField1TSWithoutDAS& getTimeStepEntry(int iteration, int order) const throw(INTERP_KERNEL::Exception);
00328     MEDFileField1TSWithoutDAS& getTimeStepEntry(int iteration, int order) throw(INTERP_KERNEL::Exception);
00329     const std::vector<std::string>& getInfo() const throw(INTERP_KERNEL::Exception);
00330     std::string getMeshName() const throw(INTERP_KERNEL::Exception);
00331     std::string getDtUnit() const throw(INTERP_KERNEL::Exception);
00332     MEDFileFieldMultiTSWithoutDAS();
00333     MEDFileFieldMultiTSWithoutDAS(const char *fieldName);
00334     MEDFileFieldMultiTSWithoutDAS(med_idt fid, const char *fieldName, int id, const std::vector<std::string>& infos, int nbOfStep) throw(INTERP_KERNEL::Exception);
00335     void finishLoading(med_idt fid, int nbPdt) throw(INTERP_KERNEL::Exception);
00336     void copyTinyInfoFrom(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
00337     void checkCoherencyOfTinyInfo(const MEDCouplingFieldDouble *field) const throw(INTERP_KERNEL::Exception);
00338   protected:
00339     std::string _name;
00340     std::vector<std::string> _infos;
00341     std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileField1TSWithoutDAS>  > _time_steps;
00342   };
00343 
00347   class MEDFileFieldMultiTS : public MEDFileFieldMultiTSWithoutDAS, public MEDFieldFieldGlobs
00348   {
00349   public:
00350     static MEDFileFieldMultiTS *New();
00351     static MEDFileFieldMultiTS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
00352     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
00353     MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
00354     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
00355     MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, int iteration, int order, const MEDCouplingMesh *mesh, int renumPol=0) const throw(INTERP_KERNEL::Exception);
00356     MEDCouplingFieldDouble *getFieldAtLevelOld(TypeOfField type, const char *mname, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception);
00357     DataArrayDouble *getFieldWithProfile(TypeOfField type, int iteration, int order, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl) const throw(INTERP_KERNEL::Exception);
00358     //
00359     void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field) throw(INTERP_KERNEL::Exception);
00360     void appendFieldProfile(const MEDCouplingFieldDouble *field, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception);
00361   private:
00362     std::vector<std::string> getPflsReallyUsed() const;
00363     std::vector<std::string> getLocsReallyUsed() const;
00364   private:
00365     MEDFileFieldMultiTS();
00366     MEDFileFieldMultiTS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception);
00367   };
00368 
00372   class MEDFileFields : public RefCountObject, public MEDFieldFieldGlobs, public MEDFileWritable
00373   {
00374   public:
00375     static MEDFileFields *New();
00376     static MEDFileFields *New(const char *fileName) throw(INTERP_KERNEL::Exception);
00377     void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
00378     int getNumberOfFields() const;
00379     //
00380     void resize(int newSize) throw(INTERP_KERNEL::Exception);
00381     void pushField(MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
00382     void setFieldAtPos(int i, MEDFileFieldMultiTS *field) throw(INTERP_KERNEL::Exception);
00383     void destroyFieldAtPos(int i) throw(INTERP_KERNEL::Exception);
00384   private:
00385     std::vector<std::string> getPflsReallyUsed() const;
00386     std::vector<std::string> getLocsReallyUsed() const;
00387   private:
00388     MEDFileFields();
00389     MEDFileFields(const char *fileName) throw(INTERP_KERNEL::Exception);
00390   private:
00391     std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldMultiTSWithoutDAS> > _fields;
00392   };
00393 }
00394 
00395 #endif
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS