1 // Copyright (C) 2007-2012 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 #include "MEDSPLITTER_Graph.hxx"
20 #include "MEDSPLITTER_UserGraph.hxx"
23 using namespace MEDSPLITTER;
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
30 UserGraph::UserGraph(MEDMEM::MEDSKYLINEARRAY* array, const int* partition, int n):Graph(array,0)
33 int* index=new int [n+1];
35 for (int i=0; i<n; i++)
37 index[i+1]=index[i]+1;
40 //creating a skylinearray with copy of the index and partition array
41 // the fifth argument false specifies that the values are passed
43 //m_partition = new MEDMEM::MEDSKYLINEARRAY(n,n, index, partition, true);
44 m_partition = new MEDMEM::MEDSKYLINEARRAY(n,n, index, partition, false);
48 UserGraph::~UserGraph()
52 void UserGraph::partGraph(int ndomain, const string& options, ParaDomainSelector* sel)
54 cerr<<"MEDSPLITTER::UserGraph::partGraph() should not have to be used"<<endl;