1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
21 #ifndef __MEDFILEFIELDOVERVIEW_HXX__
22 #define __MEDFILEFIELDOVERVIEW_HXX__
24 #include "MEDCouplingAutoRefCountObjectPtr.hxx"
25 #include "MEDCouplingRefCountObject.hxx"
27 #include "NormalizedUnstructuredMesh.hxx"
28 #include "InterpKernelException.hxx"
36 class MEDFileFieldGlobs;
37 class MEDFileAnyTypeField1TS;
38 class MEDFileAnyTypeFieldMultiTS;
40 class MEDFileMeshStruct : public RefCountObject
43 static MEDFileMeshStruct *New(const MEDFileMesh *mesh);
44 std::size_t getHeapMemorySize() const;
45 int getNumberOfNodes() const { return _nb_nodes; }
46 int getNumberOfElemsOfGeoType(INTERP_KERNEL::NormalizedCellType t) const throw(INTERP_KERNEL::Exception);
48 MEDFileMeshStruct(const MEDFileMesh *mesh);
50 const MEDFileMesh *_mesh;
53 std::vector< std::vector<int> > _geo_types_distrib;
56 class MEDFileField1TSStructItem2
59 MEDFileField1TSStructItem2(INTERP_KERNEL::NormalizedCellType a, const std::pair<int,int>& b, const std::string& pfl, const std::string& loc);
60 void checkWithMeshStructForCells(MEDFileMeshStruct *mst, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception);
61 void checkWithMeshStructForGaussNE(MEDFileMeshStruct *mst, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception);
62 void checkWithMeshStructForGaussPT(MEDFileMeshStruct *mst, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception);
64 INTERP_KERNEL::NormalizedCellType getGeo() const { return _geo_type; }
65 //! warning this method also set _nb_of_entity attribute !
66 void checkInRange(int nbOfEntity, int nip, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception);
67 bool operator==(const MEDFileField1TSStructItem2& other) const throw(INTERP_KERNEL::Exception);
69 INTERP_KERNEL::NormalizedCellType _geo_type;
70 std::pair<int,int> _start_end;
71 MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _pfl;
76 class MEDFileField1TSStructItem
79 MEDFileField1TSStructItem(TypeOfField a, const std::vector< MEDFileField1TSStructItem2 >& b);
80 void checkWithMeshStruct(MEDFileMeshStruct *mst, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception);
81 bool operator==(const MEDFileField1TSStructItem& other) const throw(INTERP_KERNEL::Exception);
82 bool isEntityCell() const;
84 MEDFileField1TSStructItem simplifyMeOnCellEntity(const MEDFileFieldGlobs *globs) const throw(INTERP_KERNEL::Exception);
87 std::vector< MEDFileField1TSStructItem2 > _items;
90 class MEDFileField1TSStruct : public RefCountObject
93 static MEDFileField1TSStruct *New(const MEDFileAnyTypeField1TS *ref) throw(INTERP_KERNEL::Exception);
94 void checkWithMeshStruct(MEDFileMeshStruct *mst, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception);
95 std::size_t getHeapMemorySize() const;
96 bool isEqualConsideringThePast(const MEDFileAnyTypeField1TS *other) throw(INTERP_KERNEL::Exception);
97 bool isSupportSameAs(const MEDFileAnyTypeField1TS *other) throw(INTERP_KERNEL::Exception);
99 MEDFileField1TSStruct(const MEDFileAnyTypeField1TS *ref);
100 static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref);
102 std::vector<MEDFileField1TSStructItem> _already_checked;
105 class MEDFileFastCellSupportComparator : public RefCountObject
108 static MEDFileFastCellSupportComparator *New(const MEDFileMesh *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception);
109 bool isEqual(const MEDFileAnyTypeFieldMultiTS *other) throw(INTERP_KERNEL::Exception);
110 std::size_t getHeapMemorySize() const;
112 MEDFileFastCellSupportComparator(const MEDFileMesh *m, const MEDFileAnyTypeFieldMultiTS *ref);
114 MEDCouplingAutoRefCountObjectPtr<MEDFileMeshStruct> _mesh_comp;
115 std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileField1TSStruct> > _f1ts_cmps;