Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/med.git] / src / MEDSPLITTER / MEDSPLITTER_UserGraph.cxx
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 #include "MEDSPLITTER_Graph.hxx"
20 #include "MEDSPLITTER_UserGraph.hxx"
21
22
23 using namespace MEDSPLITTER;
24
25 /*! constructor that allows to specify the desired partition
26  * \param partition as table giving the domain number for each cell 
27  *        (domain numbers range from 0 to ndomain-1
28  * \param n number of cells in the mesh
29  */
30 UserGraph::UserGraph(MEDMEM::MEDSKYLINEARRAY* array, const int* partition, int n):Graph(array,0)
31 {
32
33   int* index=new int [n+1];
34   index[0]=1;
35   for (int i=0; i<n; i++)
36   {
37     index[i+1]=index[i]+1;
38   }
39
40   //creating a skylinearray with copy of the index and partition array
41   // the fifth argument false specifies that the values are passed  
42   //to the object
43   //m_partition = new MEDMEM::MEDSKYLINEARRAY(n,n, index, partition, true);
44   m_partition = new MEDMEM::MEDSKYLINEARRAY(n,n, index, partition, false);
45   delete[] index;
46 }
47
48 UserGraph::~UserGraph()
49 {
50 }
51
52 void UserGraph::partGraph(int ndomain, const string& options, ParaDomainSelector* sel)
53 {
54   cerr<<"MEDSPLITTER::UserGraph::partGraph() should not have to be used"<<endl;
55 }
56