<br clear="all">I have a bit of code where I read in a data file, extract a small portion of it and then integrate the variables of the extracted portion. In my python code I then fetch the data from the server with the intent to write it out to a log file. The issue that I have come across is when I run my script in the Python Shell it gives me <0,0,0> for my tuple. Then if I repeat the final four lines interactively in the Python Shell starting with the fetch command I get a proper result of <0.14, 0.5, 0>. Any ideas why I can't fetch the data properly in the script but can right after in interactively?<div>
<br></div><div>The script looks like:</div><div><br></div><div>#**********************************************************8</div><div><div>#Do X-direction</div><div>xscale = 1.0</div><div>yscale = 1.0/(2*ymax)</div><div>zscale = 1.0/zmax</div>
<div><br></div><div>print "load Fluid"</div><div>fluid = XMLPolyDataReader(FileName=xSlice)</div><div>fluid.PointArrayStatus = ['U', 'p']</div><div>RenderView1 = GetRenderView()</div><div>DataRepresentation1 = Show()</div>
<div><br></div><div>print "extract Block"</div><div>fluidBlock = ExtractCellsByRegion(Input = fluid, IntersectWith = "Box")</div><div>fluidBlock.IntersectWith.Scale = [xscale, yscale, zscale]</div><div>
DataRepresentation2 = Show()</div><div><br></div><div>print "integrate"</div><div>avgData = IntegrateVariables(Input = fluidBlock)</div><div>DataRepresentation3 = Show()</div><div>Render()</div><div><br></div><div>
data = servermanager.Fetch(avgData,0)</div><div>pointData = data.GetPointData()</div><div>avgVar = pointData.GetArray(0).GetTuple3(0)</div><div>print avgVar</div><div>#****************************************************</div>
<div><br></div><div>Thanks,</div>-- <br>Matt Cragun<br> <br>Engineer<br>TotalSim LLC <br>7003 Post Road, <br>Suite 415 <br>Dublin, Ohio 43016<br>O: (614) 255-7426<br>M: (801) 404-6021 <br>E: <a href="mailto:mcragun@totalsim.us">mcragun@totalsim.us</a><br>
</div>