1 // Copyright (C) 2021 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, or (at your option) any later version.
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
22 #include "MED_Wrapper.hxx"
24 #include "MEDFileMesh.hxx"
28 class MEDWRAPPER_EXPORT MCTWrapper
31 //! Create a MEDWrapper MED Mesh representation
33 CrMeshInfo(TInt theDim = 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
44 CrNodeInfo(const PMeshInfo& theMeshInfo,
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);
53 //! Read a MEDWrapper MED Family representation by its numbers
54 void GetFamilyInfo(TInt theFamId, TFamilyInfo& theInfo);
56 //! Create a MEDWrapper MED Family representation
58 CrFamilyInfo(const PMeshInfo& theMeshInfo,
59 const std::string& theValue,
61 const TStringSet& theGroupNames,
62 const TStringVector& theAttrDescs = TStringVector(),
63 const TIntVector& theAttrIds = TIntVector(),
64 const TIntVector& theAttrVals = TIntVector());
66 //! Create a MEDWrapper MED Polygones representation
69 CrPolygoneInfo(const PMeshInfo& theMeshInfo,
70 EEntiteMaillage theEntity,
71 EGeometrieElement theGeom,
74 EConnectivite theConnMode = eNOD,
75 EBooleen theIsElemNum = eVRAI,
76 EBooleen theIsElemNames = eVRAI);
78 //! Create a MEDWrapper MED Polygones representation
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());
92 //! Write a MEDWrapper MED Polygones representation into the MED file
93 void SetPolygoneInfo(const TPolygoneInfo& theInfo) { }
96 //! Create a MEDWrapper MED Polyedres representation
98 CrPolyedreInfo(const PMeshInfo& theMeshInfo,
99 EEntiteMaillage theEntity,
100 EGeometrieElement theGeom,
104 EConnectivite theConnMode = eNOD,
105 EBooleen theIsElemNum = eVRAI,
106 EBooleen theIsElemNames = eVRAI);
109 //! Write a MEDWrapper MED Polyedres representation into the MED file
110 void SetPolyedreInfo(const TPolyedreInfo& theInfo) { }
113 //! Create a MEDWrapper MED Balls representation
114 /*! This feature is supported since version 3.0 */
116 CrBallInfo(const PMeshInfo& theMeshInfo,
118 EBooleen theIsElemNum = eVRAI);
120 //! Write a MEDWrapper representation of MED_BALL into the MED file
121 /*! This feature is supported since version 3.0 */
123 SetBallInfo(const TBallInfo& theInfo) { }
126 //! Create a MEDWrapper MED Cells representation
129 CrCellInfo(const PMeshInfo& theMeshInfo,
130 EEntiteMaillage theEntity,
131 EGeometrieElement theGeom,
133 EConnectivite theConnMode = eNOD,
134 EBooleen theIsElemNum = eVRAI,
135 EBooleen theIsElemNames = eFAUX,
136 EModeSwitch theMode = eFULL_INTERLACE);
138 //! Write the MEDWrapper MED Cells representation into the MED file
139 void SetCellInfo(const TCellInfo& theInfo) { }
141 MEDCoupling::MCAuto<MEDCoupling::MEDFileUMesh> _mc_mesh;
142 MEDCoupling::MCAuto<MEDCoupling::DataArrayDouble> _coords;
143 std::string _mesh_name;
148 using MCPWrapper = std::shared_ptr<MCTWrapper>;