Salome HOME
Merge remote branch 'origin/V8_5_asterstudy'
[modules/smesh.git] / src / MEDWrapper / MED_Algorithm.hxx
1 // Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #ifndef MED_Algorithm_HeaderFile
24 #define MED_Algorithm_HeaderFile
25
26 #include "MED_WrapperDef.hxx"
27 #include "MED_Structures.hxx"
28
29 #include <boost/tuple/tuple.hpp>
30
31 #include <set>
32 #include <string>
33
34 namespace MED
35 {
36   //---------------------------------------------------------------
37   typedef std::map<EGeometrieElement,PElemInfo> TGeom2ElemInfo;
38   typedef std::map<EEntiteMaillage,TGeom2ElemInfo> TEntity2TGeom2ElemInfo;
39   typedef std::set<PFamilyInfo> TFamilyInfoSet;
40   typedef std::map<std::string,TFamilyInfoSet> TGroupInfo;
41   typedef boost::tuple<PFamilyInfo,TInt> TFamilyTSize;
42   typedef std::set<TFamilyTSize> TFamilyTSizeSet;
43   typedef std::map<EEntiteMaillage,TFamilyTSizeSet> TEntity2FamilySet;
44   typedef std::set<PTimeStampInfo> TTimeStampInfoSet;
45   typedef std::map<PFieldInfo,TTimeStampInfoSet> TFieldInfo2TimeStampInfoSet;
46   typedef std::map<EEntiteMaillage,TFieldInfo2TimeStampInfoSet> TEntite2TFieldInfo2TimeStampInfoSet;
47   typedef std::map<TGaussInfo::TKey,PGaussInfo,TGaussInfo::TLess> TKey2Gauss;
48   typedef std::map<TProfileInfo::TKey,PProfileInfo> TKey2Profile;
49   typedef boost::tuple<EModeProfil,TKey2Profile> TMKey2Profile;
50   typedef std::map<TInt,TInt> TFamilyID2NbCells;
51
52   //---------------------------------------------------------------
53   //! Get set of TElemInfo by its geometrical type and corresponding MED ENTITY
54   MEDWRAPPER_EXPORT
55   TEntity2TGeom2ElemInfo
56   GetEntity2TGeom2ElemInfo(const PWrapper& theWrapper,
57                            const PMeshInfo& theMeshInfo,
58                            const MED::TEntityInfo& theEntityInfo);
59
60   //---------------------------------------------------------------
61   //! Read set of MED FAMILIES for defined MED file
62   MEDWRAPPER_EXPORT
63   TFamilyInfoSet
64   GetFamilyInfoSet(const PWrapper& theWrapper,
65                    const PMeshInfo& theMeshInfo);
66
67   //---------------------------------------------------------------
68   //! Compare two MED FAMILIES
69   MEDWRAPPER_EXPORT
70   bool
71   operator<(const TFamilyTSize& theLeft, const TFamilyTSize& theRight);
72
73   //---------------------------------------------------------------
74   //! Split set of MED FAMILIES by corresponding MED ENTITY
75   MEDWRAPPER_EXPORT
76   TEntity2FamilySet
77   GetEntity2FamilySet(const PWrapper& theWrapper,
78                       const TEntity2TGeom2ElemInfo& theEntity2TGeom2ElemInfo,
79                       const TFamilyInfoSet& theFamilyInfoSet);
80
81   //---------------------------------------------------------------
82   //! Split the input set of MED FAMILIES by corresponding MED GROUPS
83   MEDWRAPPER_EXPORT
84   TGroupInfo
85   GetGroupInfo(const TFamilyInfoSet& theFamilyInfoSet);
86
87   //---------------------------------------------------------------
88   //! Read set of MED TIMESTAMPS groupped by corresponding MED FIELDS
89   MEDWRAPPER_EXPORT
90   TFieldInfo2TimeStampInfoSet
91   GetFieldInfo2TimeStampInfoSet(const PWrapper& theWrapper,
92                                 const PMeshInfo& theMeshInfo,
93                                 const MED::TEntityInfo& theEntityInfo);
94
95   //---------------------------------------------------------------
96   //! Split the input set of MED TIMESTAMPS by corresponding MED FIELDS and MED ENTITIES
97   MEDWRAPPER_EXPORT
98   TEntite2TFieldInfo2TimeStampInfoSet
99   GetEntite2TFieldInfo2TimeStampInfoSet(const TFieldInfo2TimeStampInfoSet& theFieldInfo2TimeStampInfoSet);
100
101   //---------------------------------------------------------------
102   //! Read set of MED GAUSS
103   MEDWRAPPER_EXPORT
104   TKey2Gauss
105   GetKey2Gauss(const PWrapper& theWrapper,
106                TErr* theErr = NULL,
107                EModeSwitch theMode = eFULL_INTERLACE);
108
109   //---------------------------------------------------------------
110   //! Get MED PROFILE by its name
111   MEDWRAPPER_EXPORT
112   PProfileInfo
113   GetProfileInfo(const PWrapper& theWrapper,
114                  const std::string& theProfileName,
115                  TErr* theErr = NULL,
116                  EModeProfil theMode = eCOMPACT);
117
118   //---------------------------------------------------------------
119   //! Read set of MED PROFILES
120   MEDWRAPPER_EXPORT
121   TMKey2Profile
122   GetMKey2Profile(const PWrapper& theWrapper,
123                   TErr* theErr = NULL,
124                   EModeProfil theMode = eCOMPACT);
125
126   //---------------------------------------------------------------
127   //! Get Entity for Grille by family id.
128   MEDWRAPPER_EXPORT
129   EEntiteMaillage
130   GetEntityByFamilyId(PGrilleInfo& theInfo,
131                       TInt theId);
132
133   //---------------------------------------------------------------
134   //! Get Number of cells for theId family, for Grille
135   MEDWRAPPER_EXPORT
136   TFamilyID2NbCells
137   GetFamilyID2NbCells(PGrilleInfo& theInfo);
138
139   //---------------------------------------------------------------
140   //! Convert eNOEUD_ELEMENT to eMAILLE
141   MEDWRAPPER_EXPORT
142   EEntiteMaillage
143   ConvertEntity(const EEntiteMaillage& aEntity);
144 }
145
146 #endif // MED_Algorithm_HeaderFile