Luis, <div><br></div><div>I had similar problem with some writers. </div><div>It was very strange and sporadic (it occurred both when I used *.vtu and *.csv writers). </div><div>I kind of got the feeling that most of the times it appeared when I ran PV in parallel so I could solve it by running PV in serial mode. </div>
<div>But as I said, I am not 100% what is going on. </div><div><br></div><div>Good luck, </div><div>Mohamad</div><div><br></div><div>On Sun, May 6, 2012 at 11:44 AM, Luis Martinez <span dir="ltr"><<a href="mailto:lamtmartos@hotmail.com" target="_blank">lamtmartos@hotmail.com</a>></span> wrote:</div>
<div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr">
Hi all,<br><br>I have a pvbatch script that worked in version 3.12. It uses plot over line and writes out CSV data. Now I get the following error in version 3.14:<br><br>Is this a bug or am I supposed to call the writer differently in 3.14?<br>
<br>Thanks!<br><br>Tony<br><br><br><br>ERROR: In /build/buildd/paraview-3.14.1/ParaViewCore/ServerManager/vtkSMWriterFactory.cxx, line 374<br>vtkSMWriterFactory (0x17ee360): No matching writer found for extension: csv<br>
<br>Traceback (most recent call last):<br> File "wakeProfilesAllTurbines.py", line 65, in <module><br> writer.FieldAssociation = "Points"<br>AttributeError: 'NoneType' object has no attribute 'FieldAssociation'<br>
<br><br><br><br>Here is the script Im using:<br><br><br><br>try: paraview.simple<br>except: from paraview.simple import *<br>paraview.simple._DisableFirstRenderCameraReset()<br>import os<br>import math<br>import matplotlib as mpl<br>
mpl.use('Agg')<br>import matplotlib.pyplot as plt<br>import csv<br>from scipy.integrate import trapz<br># Current location<br>directory=os.getcwd()<br>if not os.path.exists('./wakeProfiles/plots/'):<br> os.makedirs('./wakeProfiles/plots/')<br>
# Rotor Diameter<br>D=93<br>width=D*1.5<br>profiles=[0.125,0.25,0.5,0.75,1,2,3,4]<br>layout=open('./layout.dat')<br>Umean_slice_0_vtk = LegacyVTKReader( FileNames=[directory+'/../ADM/sliceDataADM/12746.8908019/Umean_slice_0.vtk'] )<br>
Umean_slice_1_vtk = LegacyVTKReader( FileNames=[directory+'/../ALM/sliceDataALM/12771/Umean_slice_0.vtk'] )<br>SetActiveSource(Umean_slice_0_vtk)<br>CellDatatoPointData1 = CellDatatoPointData()<br>SetActiveSource(CellDatatoPointData1)<br>
Calculator1 = Calculator()<br>Calculator1.AttributeMode = 'point_data'<br>Calculator1.Function = 'Umean_X*cos(0.84444265) + Umean_Y*sin(0.84444265)'<br>Calculator1.ResultArrayName = 'U_row'<br>SetActiveSource(Umean_slice_1_vtk)<br>
CellDatatoPointData2 = CellDatatoPointData()<br>SetActiveSource(CellDatatoPointData2)<br>Calculator2 = Calculator()<br>Calculator2.AttributeMode = 'point_data'<br>Calculator2.Function = 'Umean_X*cos(0.84444265) + Umean_Y*sin(0.84444265)'<br>
Calculator2.ResultArrayName = 'U_row'<br>for i, turbine in enumerate(layout):<br> for profile in profiles:<br> SetActiveSource(Calculator1)<br> PlotOverLine1 = PlotOverLine( Source="High Resolution Line Source" )<br>
PlotOverLine1.Source.Resolution = 100 <br> alpha0=0.84444265-math.atan((width/2)/(profile*D))<br> alpha1=0.84444265+math.atan((width/2)/(profile*D))<br> L=math.sqrt((D*profile)**2+(width/2)**2)<br>
x0=float(turbine.split()[0])+L*math.cos(alpha0)<br> y0=float(turbine.split()[1])+L*math.sin(alpha0)<br> x1=float(turbine.split()[0])+L*math.cos(alpha1)<br> y1=float(turbine.split()[1])+L*math.sin(alpha1)<br>
PlotOverLine1.Source.Point1 = [x0, y0, 65.0]<br> PlotOverLine1.Source.Point2 = [x1, y1, 65.0]<br> if not os.path.exists('./wakeProfiles/'+str(profile)):<br> os.makedirs('./wakeProfiles/'+str(profile))<br>
if not os.path.exists('./wakeProfiles/plots/'+str(profile)):<br> os.makedirs('./wakeProfiles/plots/'+str(profile))<br> nameADM=directory+'/wakeProfiles/'+str(profile)+'/ADM'+'turbine'+str(i+1)+'.csv'<br>
writer = CreateWriter(nameADM, PlotOverLine1)<br> writer.FieldAssociation = "Points"<br> writer.UpdatePipeline()<br> del writer<br> SetActiveSource(Calculator2)<br> PlotOverLine2 = PlotOverLine( Source="High Resolution Line Source" )<br>
PlotOverLine2.Source.Resolution = 100 <br> PlotOverLine2.Source.Point1 = [x0, y0, 65.0]<br> PlotOverLine2.Source.Point2 = [x1, y1, 65.0]<br> nameALM=directory+'/wakeProfiles/'+str(profile)+'/ALM'+'turbine'+str(i+1)+'.csv'<br>
writer = CreateWriter(nameALM, PlotOverLine2)<br> writer.FieldAssociation = "Points"<br> writer.UpdatePipeline()<br> del writer<br> csvreader1 = csv.reader(open(nameADM,'rb'))<br>
csvreader2 = csv.reader(open(nameALM,'rb'))<br> x,y,x1,y1=[],[],[],[]<br> for j, line in enumerate(csvreader1):<br> if j>0:<br> x.append((float(line[5])-width/2)/D)<br>
y.append(float(line[0]))<br> for j, line in enumerate(csvreader2):<br> if j>0:<br> x1.append((float(line[5])-width/2)/D)<br> y1.append(float(line[0])) <br>
plt.plot(x,y,'-',label='ADM',color='black')<br> plt.plot(x1,y1,'--',label='ALM',color='black')<br> plt.xlabel('Distance')<br> plt.ylabel(r'$U$ (m/s)')<br>
plt.legend(loc='best')<br> plt.ylim([2,10])<br> plt.savefig('./wakeProfiles/plots/'+str(profile)+'/turbine'+str(i+1)+'.eps')<br> plt.savefig('./wakeProfiles/plots/'+str(profile)+'/turbine'+str(i+1)+'.png')<br>
plt.clf()<br> del x,y,x1,y1,csvreader1,csvreader2<br><br><br><br>                                            </div></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br></div>