Salome HOME
Fix problem of make distcheck
[modules/med.git] / src / MEDSPLITTER / MEDSPLITTER_MESHCollectionDriver.hxx
1 // Copyright (C) 2007-2012  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.
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 #ifndef MESHCOLLECTIONDRIVER_HXX_
20 #define MESHCOLLECTIONDRIVER_HXX_
21
22 #include "MEDSPLITTER.hxx"
23
24 namespace MEDSPLITTER
25 {
26   class MESHCollection;
27   class ParaDomainSelector;
28
29   class MEDSPLITTER_EXPORT MESHCollectionDriver
30   {
31   public:
32
33     MESHCollectionDriver(MESHCollection*);
34     virtual ~MESHCollectionDriver(){}
35
36     virtual int read(char*, ParaDomainSelector* sel=0)=0;
37     int readSeq(char*,char*);
38
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;
46
47     void readFileStruct(vector <string>&  field_names,vector<int>& iternumber,vector <int>&  ordernumber,vector <int> & types);
48
49     int getFieldType(const std::string& fieldname);
50     //  void exportFamily(vector<int*>,MED_EN::medEntityMesh, const string& name);
51
52     void readLoc2GlobCellConnect(int idomain, const set<int>& loc_domains, ParaDomainSelector* ds,
53                                  vector<int> & loc2glob_corr);
54
55     int readMeshDimension() const;
56
57   protected:
58
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);
64
65     void writeElementJoint(medEntityMesh entity ,
66                            int icz, 
67                            int idomain, 
68                            int idistant, 
69                            char* mesh_name, 
70                            char* joint_name,  
71                            med_2_3::med_idt fid );
72     void jointSort(int* elems, int nbelems, bool is_first);
73
74
75
76     MESHCollection* _collection;
77
78     std::vector <std::string> _filename;
79     std::vector <std::string> _meshname;
80
81   };
82
83 }
84
85
86 #endif /*MESHCOLLECTIONDRIVER_HXX_*/