+
+ if ( status == Driver_Mesh::DRS_TOO_LARGE_MESH )
+ throw TooLargeForExport("MED");
+}
+
+//================================================================================
+/*!
+ * Same as SMESH_Mesh::ExportMED except for \a file and \a theVersion
+ */
+//================================================================================
+
+MEDCoupling::MCAuto<MEDCoupling::DataArrayByte>
+SMESH_Mesh::ExportMEDCoupling(const char* theMeshName,
+ bool theAutoGroups,
+ const SMESHDS_Mesh* theMeshPart,
+ bool theAutoDimension,
+ bool theAddODOnVertices,
+ double theZTolerance,
+ bool theSaveNumbers)
+{
+ DriverMED_W_SMESHDS_Mesh_Mem writer;
+ this->exportMEDCommmon( writer, theMeshName, theAutoGroups, theMeshPart, theAutoDimension,
+ theAddODOnVertices, theZTolerance, theSaveNumbers,
+ /*AllElemsToGroup(for ExportSAUV())=*/false);
+ return writer.getData();
+}
+
+//================================================================================
+/*!
+ * \brief Export the mesh to a med file
+ * \param [in] theFile - name of the MED file
+ * \param [in] theMeshName - name of this mesh
+ * \param [in] theAutoGroups - boolean parameter for creating/not creating
+ * the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
+ * the typical use is auto_groups=false.
+ * \param [in] theVersion - define the minor (xy, where version is x.y.z) of MED file format.
+ * If theVersion is equal to -1, the minor version is not changed (default).
+ * \param [in] theMeshPart - mesh data to export
+ * \param [in] theAutoDimension - if \c true, a space dimension of a MED mesh can be either
+ * - 1D if all mesh nodes lie on OX coordinate axis, or
+ * - 2D if all mesh nodes lie on XOY coordinate plane, or
+ * - 3D in the rest cases.
+ * If \a theAutoDimension is \c false, the space dimension is always 3.
+ * \param [in] theAddODOnVertices - to create 0D elements on all vertices
+ * \param [in] theZTolerance - tolerance in Z direction. If Z coordinate of a node is close to zero
+ * within a given tolerance, the coordinate is set to zero.
+ * If \a ZTolerance is negative, the node coordinates are kept as is.
+ * \param [in] theSaveNumbers : enable saving numbers of nodes and cells.
+ * \param [in] theAllElemsToGroup - to make every element to belong to any group (PAL23413).
+ * It is used by ExportSAUV() only
+ * \return int - mesh index in the file
+ */
+//================================================================================
+
+void SMESH_Mesh::ExportMED(const char * theFile,
+ const char* theMeshName,
+ bool theAutoGroups,
+ int theVersion,
+ const SMESHDS_Mesh* theMeshPart,
+ bool theAutoDimension,
+ bool theAddODOnVertices,
+ double theZTolerance,
+ bool theSaveNumbers,
+ bool theAllElemsToGroup)
+{
+ MESSAGE("MED_VERSION:"<< theVersion);
+ DriverMED_W_SMESHDS_Mesh writer;
+ writer.SetFile( theFile, theVersion );
+ this->exportMEDCommmon( writer, theMeshName, theAutoGroups, theMeshPart, theAutoDimension, theAddODOnVertices, theZTolerance, theSaveNumbers, theAllElemsToGroup );