1 // Copyright (C) 2007-2013 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 MESHCOLLECTIONDRIVER_HXX_
20 #define MESHCOLLECTIONDRIVER_HXX_
22 #include "MEDSPLITTER.hxx"
27 class ParaDomainSelector;
29 class MEDSPLITTER_EXPORT MESHCollectionDriver
33 MESHCollectionDriver(MESHCollection*);
34 virtual ~MESHCollectionDriver(){}
36 virtual int read(char*, ParaDomainSelector* sel=0)=0;
37 int readSeq(char*,char*);
39 virtual void write(char*, ParaDomainSelector* sel=0)=0;
40 virtual void readFields (vector <MEDMEM::FIELD<int> *>& filenames, char* fieldname,
41 int itnumber, int ordernumber) =0;
42 virtual void readFields (vector <MEDMEM::FIELD<double> *>& filenames, char* fieldname,
43 int itnumber, int ordernumber) =0;
44 virtual void writeFields(vector <MEDMEM::FIELD<int> *>& filenames, char* fieldname)=0;
45 virtual void writeFields(vector <MEDMEM::FIELD<double> *>& filenames, char* fieldname)=0;
47 void readFileStruct(vector <string>& field_names,vector<int>& iternumber,vector <int>& ordernumber,vector <int> & types);
49 int getFieldType(const std::string& fieldname);
50 // void exportFamily(vector<int*>,MED_EN::medEntityMesh, const string& name);
52 void readLoc2GlobCellConnect(int idomain, const set<int>& loc_domains, ParaDomainSelector* ds,
53 vector<int> & loc2glob_corr);
55 int readMeshDimension() const;
59 void readSubdomain(vector<int*>& cellglobal,
60 vector<int*>& faceglobal,
61 vector<int*>& nodeglobal, int idomain);
62 void writeSubdomain(int idomain,int nbdomain, char*filename,
63 ParaDomainSelector* domain_selector);
65 void writeElementJoint(medEntityMesh entity ,
71 med_2_3::med_idt fid );
72 void jointSort(int* elems, int nbelems, bool is_first);
76 MESHCollection* _collection;
78 std::vector <std::string> _filename;
79 std::vector <std::string> _meshname;
86 #endif /*MESHCOLLECTIONDRIVER_HXX_*/