Salome HOME
Approche brute force laborieuse. On va tenter l'approche MEDmemFileOpen
[modules/smesh.git] / src / MEDWrapper / MEDCoupling_Wrapper.hxx
1 // Copyright (C) 2021  CEA/DEN, EDF R&D
2 //
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, or (at your option) any later version.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #pragma once
21
22 #include "MED_Wrapper.hxx"
23
24 #include "MEDFileMesh.hxx"
25
26 namespace MED
27 {
28   class MEDWRAPPER_EXPORT MCTWrapper
29   {
30     public:
31       //! Create a MEDWrapper MED Mesh representation
32     PMeshInfo
33     CrMeshInfo(TInt theDim = 0,
34                TInt theSpaceDim = 0,
35                const std::string& theValue = "",
36                EMaillage theType = eNON_STRUCTURE,
37                const std::string& theDesc = "");
38     //! Write the MEDWrapper MED Mesh representation into the MED file
39     void SetMeshInfo(const TMeshInfo& theInfo);
40     //! Write a MEDWrapper MED Family representation into the MED file
41     void SetFamilyInfo(const TFamilyInfo& theInfo) { }
42     //! Create a MEDWrapper MED Nodes representation
43     PNodeInfo
44     CrNodeInfo(const PMeshInfo& theMeshInfo,
45                TInt theNbElem,
46                EModeSwitch theMode = eFULL_INTERLACE,
47                ERepere theSystem = eCART,
48                EBooleen theIsElemNum = eVRAI,
49                EBooleen theIsElemNames = eFAUX);
50     //! Write the MEDWrapper MED Nodes representation into the MED file
51     void SetNodeInfo(const TNodeInfo& theInfo);
52                 
53     //! Read a MEDWrapper MED Family representation by its numbers
54     void GetFamilyInfo(TInt theFamId, TFamilyInfo& theInfo);
55                   
56     //! Create a MEDWrapper MED Family representation
57     PFamilyInfo
58     CrFamilyInfo(const PMeshInfo& theMeshInfo,
59                  const std::string& theValue,
60                  TInt theId,
61                  const TStringSet& theGroupNames,
62                  const TStringVector& theAttrDescs = TStringVector(),
63                  const TIntVector& theAttrIds = TIntVector(),
64                  const TIntVector& theAttrVals = TIntVector());
65     
66     //! Create a MEDWrapper MED Polygones representation
67     virtual
68     PPolygoneInfo
69     CrPolygoneInfo(const PMeshInfo& theMeshInfo,
70                    EEntiteMaillage theEntity,
71                    EGeometrieElement theGeom,
72                    TInt theNbElem,
73                    TInt theConnSize,
74                    EConnectivite theConnMode = eNOD,
75                    EBooleen theIsElemNum = eVRAI,
76                    EBooleen theIsElemNames = eVRAI);
77     
78     //! Create a MEDWrapper MED Polygones representation
79     virtual
80     PPolygoneInfo
81     CrPolygoneInfo(const PMeshInfo& theMeshInfo,
82                    EEntiteMaillage theEntity,
83                    EGeometrieElement theGeom,
84                    const TIntVector& theIndexes,
85                    const TIntVector& theConnectivities,
86                    EConnectivite theConnMode = eNOD,
87                    const TIntVector& theFamilyNums = TIntVector(),
88                    const TIntVector& theElemNums = TIntVector(),
89                    const TStringVector& theElemNames = TStringVector());
90                    
91                    
92     //! Write a MEDWrapper MED Polygones representation into the MED file
93     void SetPolygoneInfo(const TPolygoneInfo& theInfo) { }
94     
95
96     //! Create a MEDWrapper MED Polyedres representation
97     PPolyedreInfo
98     CrPolyedreInfo(const PMeshInfo& theMeshInfo,
99                    EEntiteMaillage theEntity,
100                    EGeometrieElement theGeom,
101                    TInt theNbElem,
102                    TInt theNbFaces,
103                    TInt theConnSize,
104                    EConnectivite theConnMode = eNOD,
105                    EBooleen theIsElemNum = eVRAI,
106                    EBooleen theIsElemNames = eVRAI);
107                    
108                    
109     //! Write a MEDWrapper MED Polyedres representation into the MED file
110     void SetPolyedreInfo(const TPolyedreInfo& theInfo) { }
111                     
112                     
113     //! Create a MEDWrapper MED Balls representation
114     /*! This feature is supported since version 3.0 */
115     PBallInfo
116     CrBallInfo(const PMeshInfo& theMeshInfo,
117                TInt theNbBalls,
118                EBooleen theIsElemNum = eVRAI);
119
120     //! Write a MEDWrapper representation of MED_BALL into the MED file
121     /*! This feature is supported since version 3.0 */
122     void
123     SetBallInfo(const TBallInfo& theInfo) { }
124
125     
126     //! Create a MEDWrapper MED Cells representation
127     virtual
128     PCellInfo
129     CrCellInfo(const PMeshInfo& theMeshInfo,
130                EEntiteMaillage theEntity,
131                EGeometrieElement theGeom,
132                TInt theNbElem,
133                EConnectivite theConnMode = eNOD,
134                EBooleen theIsElemNum = eVRAI,
135                EBooleen theIsElemNames = eFAUX,
136                EModeSwitch theMode = eFULL_INTERLACE);
137
138     //! Write the MEDWrapper MED Cells representation into the MED file
139     void SetCellInfo(const TCellInfo& theInfo) { }
140   private:
141     MEDCoupling::MCAuto<MEDCoupling::MEDFileUMesh> _mc_mesh;
142     MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> _coords;
143     std::string _mesh_name;
144     int _space_dim;
145     int _mesh_dim;
146   };
147
148   using MCPWrapper = std::shared_ptr<MCTWrapper>;
149 }