#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
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"])
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"])
ExtractGroup1 = ExtractGroup(Input=reader)
ExtractGroup1.UpdatePipelineInformation()
ExtractGroup1.AllGroups=["GRP_grp1"]
ExtractGroup1 = ExtractGroup(Input=reader)
ExtractGroup1.UpdatePipelineInformation()
ExtractGroup1.AllGroups=["GRP_grp1"]
-ELNOMesh1=ELNOMesh(Input=ExtractGroup1)
-ELNOPoints1=ELNOPoints(Input=ExtractGroup1)
-ELNOPoints1.SelectSourceArray=['ELNO@MyField']
-for elt in [ELNOMesh1,ELNOPoints1]:
- elnoMesh=servermanager.Fetch(ELNOPoints1,0)
+ELNOfieldToSurface1=ELNOfieldToSurface(Input=ExtractGroup1)
+ELNOfieldToPointSprite1=ELNOfieldToPointSprite(Input=ExtractGroup1)
+ELNOfieldToPointSprite1.SelectSourceArray=['ELNO@MyField']
+for elt in [ELNOfieldToSurface1,ELNOfieldToPointSprite1]:
+ elnoMesh=servermanager.Fetch(ELNOfieldToPointSprite1,0)
vtkArrToTest=elnoMesh.GetBlock(0).GetPointData().GetArray("MyField")
assert(vtkArrToTest.GetNumberOfTuples()==8)
assert(vtkArrToTest.GetNumberOfComponents()==2)
vtkArrToTest=elnoMesh.GetBlock(0).GetPointData().GetArray("MyField")
assert(vtkArrToTest.GetNumberOfTuples()==8)
assert(vtkArrToTest.GetNumberOfComponents()==2)
-for elt in [ELNOMesh1,ELNOPoints1]:
- elnoMesh=servermanager.Fetch(ELNOMesh1)
+for elt in [ELNOfieldToSurface1,ELNOfieldToPointSprite1]:
+ elnoMesh=servermanager.Fetch(ELNOfieldToSurface1)
vtkArrToTest=elnoMesh.GetBlock(0).GetPointData().GetArray("MyField")
assert(vtkArrToTest.GetNumberOfTuples()==8)
assert(vtkArrToTest.GetNumberOfComponents()==2)
vtkArrToTest=elnoMesh.GetBlock(0).GetPointData().GetArray("MyField")
assert(vtkArrToTest.GetNumberOfTuples()==8)
assert(vtkArrToTest.GetNumberOfComponents()==2)
pass
# important to check that if all the field is present that it is OK (check of the optimization)
ExtractGroup1.AllGroups=["GRP_grp3"]
pass
# important to check that if all the field is present that it is OK (check of the optimization)
ExtractGroup1.AllGroups=["GRP_grp3"]
-for elt in [ELNOMesh1,ELNOPoints1]:
- elnoMesh=servermanager.Fetch(ELNOMesh1)
+for elt in [ELNOfieldToSurface1,ELNOfieldToPointSprite1]:
+ elnoMesh=servermanager.Fetch(ELNOfieldToSurface1)
vtkArrToTest=elnoMesh.GetBlock(0).GetPointData().GetArray("MyField")
assert(vtkArrToTest.GetNumberOfTuples()==16)
assert(vtkArrToTest.GetNumberOfComponents()==2)
vtkArrToTest=elnoMesh.GetBlock(0).GetPointData().GetArray("MyField")
assert(vtkArrToTest.GetNumberOfTuples()==16)
assert(vtkArrToTest.GetNumberOfComponents()==2)
vals=[vtkArrToTest.GetValue(i) for i in xrange(32)]
assert(arr2.isEqualWithoutConsideringStr(DataArrayDouble(vals,16,2),1e-12))
pass
vals=[vtkArrToTest.GetValue(i) for i in xrange(32)]
assert(arr2.isEqualWithoutConsideringStr(DataArrayDouble(vals,16,2),1e-12))
pass
-ELNOMesh1=ELNOMesh(Input=reader)
-ELNOPoints1=ELNOPoints(Input=reader)
-ELNOPoints1.SelectSourceArray=['ELNO@MyField']
-for elt in [ELNOMesh1,ELNOPoints1]:
- elnoMesh=servermanager.Fetch(ELNOMesh1)
+ELNOfieldToSurface1=ELNOfieldToSurface(Input=reader)
+ELNOfieldToPointSprite1=ELNOfieldToPointSprite(Input=reader)
+ELNOfieldToPointSprite1.SelectSourceArray=['ELNO@MyField']
+for elt in [ELNOfieldToSurface1,ELNOfieldToPointSprite1]:
+ elnoMesh=servermanager.Fetch(ELNOfieldToSurface1)
vtkArrToTest=elnoMesh.GetBlock(0).GetPointData().GetArray("MyField")
assert(vtkArrToTest.GetNumberOfTuples()==16)
assert(vtkArrToTest.GetNumberOfComponents()==2)
vtkArrToTest=elnoMesh.GetBlock(0).GetPointData().GetArray("MyField")
assert(vtkArrToTest.GetNumberOfTuples()==16)
assert(vtkArrToTest.GetNumberOfComponents()==2)