1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2015 CEA/DEN, EDF R&D
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 # Author : Anthony Geay (EDF R&D)
22 # Non regression test for bug EDF11343. Extract group on groups mixing cells entities and node entities.
24 from MEDLoader import *
26 fname="testMEDReader18.med"
27 arr1=DataArrayDouble(5) ; arr1.iota()
28 arr2=DataArrayDouble([0,1])
29 m=MEDCouplingCMesh() ; m.setCoords(arr1,arr2)
31 m=m.buildUnstructured()
36 grp0=DataArrayInt([1,2]) ; grp0.setName("grp0")
37 grp1=DataArrayInt([3,4,8,9]) ; grp1.setName("grp1")
44 from paraview.simple import *
46 reader=MEDReader(FileName=fname)
47 reader.AllArrays=['TS0/mesh/ComSup0/mesh@@][@@P0']
48 ExtractGroup1 = ExtractGroup(Input=reader)
49 ExtractGroup1.AllGroups=["GRP_grp0","GRP_grp1"]
50 ExtractGroup1.UpdatePipelineInformation()
51 res=servermanager.Fetch(ExtractGroup1,0)
52 assert(res.GetNumberOfBlocks()==2)
53 assert(res.GetBlock(1).GetNumberOfCells()==1)
54 assert(res.GetBlock(0).GetNumberOfCells()==2)