Salome HOME
80cb8bc77aba6660565835cb99b6b93dab92c196
[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 <set>
30 #include <string>
31
32 namespace MED
33 {
34   //---------------------------------------------------------------
35   typedef std::map<EGeometrieElement,PElemInfo> TGeom2ElemInfo;
36   typedef std::map<EEntiteMaillage,TGeom2ElemInfo> TEntity2TGeom2ElemInfo;
37   typedef std::set<PFamilyInfo> TFamilyInfoSet;
38   typedef std::map<std::string,TFamilyInfoSet> TGroupInfo;
39   typedef boost::tuple<PFamilyInfo,TInt> TFamilyTSize;
40   typedef std::set<TFamilyTSize> TFamilyTSizeSet;
41   typedef std::map<EEntiteMaillage,TFamilyTSizeSet> TEntity2FamilySet;
42   typedef std::set<PTimeStampInfo> TTimeStampInfoSet;
43   typedef std::map<PFieldInfo,TTimeStampInfoSet> TFieldInfo2TimeStampInfoSet;
44   typedef std::map<EEntiteMaillage,TFieldInfo2TimeStampInfoSet> TEntite2TFieldInfo2TimeStampInfoSet;
45   typedef std::map<TGaussInfo::TKey,PGaussInfo,TGaussInfo::TLess> TKey2Gauss;
46   typedef std::map<TProfileInfo::TKey,PProfileInfo> TKey2Profile;
47   typedef boost::tuple<EModeProfil,TKey2Profile> TMKey2Profile;
48   typedef std::map<TInt,TInt> TFamilyID2NbCells;
49   
50   //---------------------------------------------------------------
51   //! Get set of TElemInfo by its geometrical type and corresponding MED ENTITY
52   MEDWRAPPER_EXPORT
53   TEntity2TGeom2ElemInfo
54   GetEntity2TGeom2ElemInfo(const PWrapper& theWrapper, 
55                            const PMeshInfo& theMeshInfo,
56                            const MED::TEntityInfo& theEntityInfo);
57
58   //---------------------------------------------------------------
59   //! Read set of MED FAMILIES for defined MED file
60   MEDWRAPPER_EXPORT
61   TFamilyInfoSet
62   GetFamilyInfoSet(const PWrapper& theWrapper, 
63                    const PMeshInfo& theMeshInfo);
64
65   //---------------------------------------------------------------
66   //! Compare two MED FAMILIES
67   MEDWRAPPER_EXPORT
68   bool
69   operator<(const TFamilyTSize& theLeft, const TFamilyTSize& theRight);
70
71   //---------------------------------------------------------------
72   //! Split set of MED FAMILIES by corresponding MED ENTITY
73   MEDWRAPPER_EXPORT
74   TEntity2FamilySet
75   GetEntity2FamilySet(const PWrapper& theWrapper, 
76                       const TEntity2TGeom2ElemInfo& theEntity2TGeom2ElemInfo,
77                       const TFamilyInfoSet& theFamilyInfoSet);
78
79   //---------------------------------------------------------------
80   //! Split the input set of MED FAMILIES by corresponding MED GROUPS
81   MEDWRAPPER_EXPORT
82   TGroupInfo
83   GetGroupInfo(const TFamilyInfoSet& theFamilyInfoSet);
84   
85   //---------------------------------------------------------------
86   //! Read set of MED TIMESTAMPS groupped by corresponding MED FIELDS
87   MEDWRAPPER_EXPORT
88   TFieldInfo2TimeStampInfoSet
89   GetFieldInfo2TimeStampInfoSet(const PWrapper& theWrapper, 
90                                 const PMeshInfo& theMeshInfo,
91                                 const MED::TEntityInfo& theEntityInfo);
92   
93   //---------------------------------------------------------------
94   //! Split the input set of MED TIMESTAMPS by corresponding MED FIELDS and MED ENTITIES
95   MEDWRAPPER_EXPORT
96   TEntite2TFieldInfo2TimeStampInfoSet
97   GetEntite2TFieldInfo2TimeStampInfoSet(const TFieldInfo2TimeStampInfoSet& theFieldInfo2TimeStampInfoSet);
98
99   //---------------------------------------------------------------
100   //! Read set of MED GAUSS
101   MEDWRAPPER_EXPORT
102   TKey2Gauss
103   GetKey2Gauss(const PWrapper& theWrapper, 
104                TErr* theErr = NULL,
105                EModeSwitch theMode = eFULL_INTERLACE);
106
107   //---------------------------------------------------------------
108   //! Get MED PROFILE by its name
109   MEDWRAPPER_EXPORT
110   PProfileInfo
111   GetProfileInfo(const PWrapper& theWrapper, 
112                  const std::string& theProfileName,
113                  TErr* theErr = NULL,
114                  EModeProfil theMode = eCOMPACT);
115
116   //---------------------------------------------------------------
117   //! Read set of MED PROFILES
118   MEDWRAPPER_EXPORT
119   TMKey2Profile
120   GetMKey2Profile(const PWrapper& theWrapper, 
121                   TErr* theErr = NULL,
122                   EModeProfil theMode = eCOMPACT);
123
124   //---------------------------------------------------------------
125   //! Get Entity for Grille by family id.
126   MEDWRAPPER_EXPORT
127   EEntiteMaillage
128   GetEntityByFamilyId(PGrilleInfo& theInfo,
129                       TInt theId);
130
131   //---------------------------------------------------------------
132   //! Get Number of cells for theId family, for Grille
133   MEDWRAPPER_EXPORT
134   TFamilyID2NbCells
135   GetFamilyID2NbCells(PGrilleInfo& theInfo);
136
137   //---------------------------------------------------------------
138   //! Convert eNOEUD_ELEMENT to eMAILLE
139   MEDWRAPPER_EXPORT
140   EEntiteMaillage
141   ConvertEntity(const EEntiteMaillage& aEntity);
142 }
143
144 #endif // MED_Algorithm_HeaderFile