1 from paraview.simple import *
2 from medcoupling import *
3 #### disable automatic camera reset on 'Show'
4 paraview.simple._DisableFirstRenderCameraReset()
8 raise RuntimeError("Assertion failed !")
10 fname = "maxwell_streamline.med"
12 arr = DataArrayDouble([0,1,2,3,4,5,6,7,8,9,10])
13 m = MEDCouplingCMesh()
14 m.setCoords(arr,arr,arr)
15 m = m.buildUnstructured()
17 m.changeSpaceDimension(3,0.)
19 f = MEDCouplingFieldDouble(ON_CELLS)
22 arrf = DataArrayDouble(10*10*10,3)
23 arrf[:,0] = 1 ; arrf[:,1] = 0 ; arrf[:,2] = 0
25 f.getArray().setInfoOnComponents(["X","Y","Z"])
26 f.checkConsistencyLight()
29 arrf2 = DataArrayDouble(10*10*10,3)
30 arrf2[:,0] = 0 ; arrf2[:,1] = 1 ; arrf2[:,2] = 0
33 WriteFieldUsingAlreadyWrittenMesh(fname,f2)
35 testmed = MEDReader(FileName=fname)
36 testmed.AllArrays = ['TS0/mesh/ComSup0/field@@][@@P0', 'TS0/mesh/ComSup0/field2@@][@@P0', 'TS0/mesh/ComSup0/mesh@@][@@P0']
37 testmed.AllTimeSteps = ['0000']
38 streamTraceur1 = LigneDeChamp(Input=testmed,SeedType='Point Cloud')
39 streamTraceur1.SeedType.Radius = 1
40 streamTraceur1.SeedType.Center = [ 7.23,7.26,3.42 ]
41 streamTraceur1.Vectors = ['CELLS', "field"]
42 streamTraceur1.UpdatePipeline()
43 ds0 = servermanager.Fetch(streamTraceur1)
44 MyAssert(ds0.GetNumberOfCells()==200)