1 // Copyright (C) 2007-2008 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.
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
19 #ifndef __MEDLOADER_HXX__
20 #define __MEDLOADER_HXX__
22 #include "InterpKernelException.hxx"
23 #include "NormalizedUnstructuredMesh.hxx"
33 class MEDCouplingUMesh;
38 class MEDConnOfOneElemType
41 MEDConnOfOneElemType(INTERP_KERNEL::NormalizedCellType type, int *conn, int lgth);
42 INTERP_KERNEL::NormalizedCellType getType() const { return _type; }
43 int getLength() const { return _lgth; }
44 int *getArray() const { return _conn; }
45 void setGlobal(int *global);
51 INTERP_KERNEL::NormalizedCellType _type;
53 unsigned calculateHighestMeshDim(const std::list<MEDConnOfOneElemType>& conn);
54 void keepSpecifiedMeshDim(std::list<MEDConnOfOneElemType>& conn, unsigned meshDim);
55 void tradMEDFileCoreFrmt2MEDCouplingUMesh(const std::list<MEDConnOfOneElemType>& medConnFrmt,
56 ParaMEDMEM::DataArrayInt* &conn,
57 ParaMEDMEM::DataArrayInt* &connIndex);
58 void releaseMEDFileCoreFrmt(std::list<MEDLoader::MEDConnOfOneElemType>& medConnFrmt);
59 void writeMasterFile(const char *fileName, const std::vector<std::string>& fileNames, const char *meshName);
60 int buildMEDSubConnectivityOfOneType(ParaMEDMEM::DataArrayInt *conn, ParaMEDMEM::DataArrayInt *connIndex,
61 INTERP_KERNEL::NormalizedCellType type, std::vector<int>& conn4MEDFile);
63 ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const char *fileName, const char *meshName=0, int meshDimRelToMax=0) throw(INTERP_KERNEL::Exception);
64 void writeUMesh(const char *fileName, ParaMEDMEM::MEDCouplingUMesh *mesh);
65 void writeParaMesh(const char *fileName, ParaMEDMEM::ParaMESH *mesh);
66 void writeParaField(const char *fileName, const char *meshName, ParaMEDMEM::ParaFIELD *f);