# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2019 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
mm.setGroupsAtLevel(0,[grp0,grp1,grp2,grp3])
f=MEDCouplingFieldDouble(ON_GAUSS_NE) ; f.setMesh(m) ; f.setName("MyField") ; f.setTime(0.,0,0)
arr2=DataArrayDouble(4*4*2) ; arr2.iota() ; arr2.rearrange(2) ; arr2.setInfoOnComponents(["aa","bbb"])
-f.setArray(arr2) ; arr2+=0.1 ; f.checkCoherency()
+f.setArray(arr2) ; arr2+=0.1 ; f.checkConsistencyLight()
mm.write(fname,2)
-MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f)
+WriteFieldUsingAlreadyWrittenMesh(fname,f)
#
from paraview.simple import *
from paraview import servermanager
assert(reader.GetProperty("FieldsTreeInfo")[::2]==ExpectedEntries)
reader.AllArrays=['TS0/Mesh/ComSup0/MyField@@][@@GSSNE']
ExtractGroup1 = ExtractGroup(Input=reader)
-ExtractGroup1.UpdatePipelineInformation()
+#ExtractGroup1.UpdatePipelineInformation()
ExtractGroup1.AllGroups=["GRP_grp1"]
-ELNOPoints1=ELNOPoints(Input=ExtractGroup1)
-ELNOPoints1.SelectSourceArray=['ELNO@MyField']
+ELNOfieldToPointGaussian1=ELNOfieldToPointGaussian(Input=ExtractGroup1)
+ELNOfieldToPointGaussian1.SelectSourceArray=['ELNO@MyField']
#
-ELNOPoints1=ELNOPoints(Input=reader)
-ELNOPoints1.SelectSourceArray=['ELNO@MyField']
-ExtractGroup1 = ExtractGroup(Input=ELNOPoints1)
-ExtractGroup1.UpdatePipelineInformation()
+ELNOfieldToPointGaussian1=ELNOfieldToPointGaussian(Input=reader)
+ELNOfieldToPointGaussian1.SelectSourceArray=['ELNO@MyField']
+ExtractGroup1 = ExtractGroup(Input=ELNOfieldToPointGaussian1)
+#ExtractGroup1.UpdatePipelineInformation()
ExtractGroup1.AllGroups=["GRP_grp1"]
-ExtractGroup1.UpdatePipeline()
+#ExtractGroup1.UpdatePipeline()
res=servermanager.Fetch(ExtractGroup1,0)
assert(res.GetBlock(0).GetNumberOfCells()==8)
vtkArrToTest=res.GetBlock(0).GetPointData().GetArray("MyField")
assert(vtkArrToTest.GetNumberOfComponents()==2)
assert(vtkArrToTest.GetNumberOfTuples()==8)
-vals=[vtkArrToTest.GetValue(i) for i in xrange(16)]
+vals=[vtkArrToTest.GetValue(i) for i in range(16)]
assert(DataArrayDouble([(16.1,17.1),(18.1,19.1),(20.1,21.1),(22.1,23.1),(24.1,25.1),(26.1,27.1),(28.1,29.1),(30.1,31.1)]).isEqual(DataArrayDouble(vals,8,2),1e-12))