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">&lt;<a href="mailto:lamtmartos@hotmail.com" target="_blank">lamtmartos@hotmail.com</a>&gt;</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 &quot;wakeProfilesAllTurbines.py&quot;, line 65, in &lt;module&gt;<br>    writer.FieldAssociation = &quot;Points&quot;<br>AttributeError: &#39;NoneType&#39; object has no attribute &#39;FieldAssociation&#39;<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(&#39;Agg&#39;)<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(&#39;./wakeProfiles/plots/&#39;):<br>    os.makedirs(&#39;./wakeProfiles/plots/&#39;)<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(&#39;./layout.dat&#39;)<br>Umean_slice_0_vtk = LegacyVTKReader( FileNames=[directory+&#39;/../ADM/sliceDataADM/12746.8908019/Umean_slice_0.vtk&#39;] )<br>

Umean_slice_1_vtk = LegacyVTKReader( FileNames=[directory+&#39;/../ALM/sliceDataALM/12771/Umean_slice_0.vtk&#39;] )<br>SetActiveSource(Umean_slice_0_vtk)<br>CellDatatoPointData1 = CellDatatoPointData()<br>SetActiveSource(CellDatatoPointData1)<br>

Calculator1 = Calculator()<br>Calculator1.AttributeMode = &#39;point_data&#39;<br>Calculator1.Function = &#39;Umean_X*cos(0.84444265) + Umean_Y*sin(0.84444265)&#39;<br>Calculator1.ResultArrayName = &#39;U_row&#39;<br>SetActiveSource(Umean_slice_1_vtk)<br>

CellDatatoPointData2 = CellDatatoPointData()<br>SetActiveSource(CellDatatoPointData2)<br>Calculator2 = Calculator()<br>Calculator2.AttributeMode = &#39;point_data&#39;<br>Calculator2.Function = &#39;Umean_X*cos(0.84444265) + Umean_Y*sin(0.84444265)&#39;<br>

Calculator2.ResultArrayName = &#39;U_row&#39;<br>for i, turbine in enumerate(layout):<br>    for profile in profiles:<br>        SetActiveSource(Calculator1)<br>        PlotOverLine1 = PlotOverLine( Source=&quot;High Resolution Line Source&quot; )<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(&#39;./wakeProfiles/&#39;+str(profile)):<br>            os.makedirs(&#39;./wakeProfiles/&#39;+str(profile))<br>

        if not os.path.exists(&#39;./wakeProfiles/plots/&#39;+str(profile)):<br>            os.makedirs(&#39;./wakeProfiles/plots/&#39;+str(profile))<br>        nameADM=directory+&#39;/wakeProfiles/&#39;+str(profile)+&#39;/ADM&#39;+&#39;turbine&#39;+str(i+1)+&#39;.csv&#39;<br>

        writer = CreateWriter(nameADM, PlotOverLine1)<br>        writer.FieldAssociation = &quot;Points&quot;<br>        writer.UpdatePipeline()<br>        del writer<br>        SetActiveSource(Calculator2)<br>        PlotOverLine2 = PlotOverLine( Source=&quot;High Resolution Line Source&quot; )<br>

        PlotOverLine2.Source.Resolution = 100        <br>        PlotOverLine2.Source.Point1 = [x0, y0, 65.0]<br>        PlotOverLine2.Source.Point2 = [x1, y1, 65.0]<br>        nameALM=directory+&#39;/wakeProfiles/&#39;+str(profile)+&#39;/ALM&#39;+&#39;turbine&#39;+str(i+1)+&#39;.csv&#39;<br>

        writer = CreateWriter(nameALM, PlotOverLine2)<br>        writer.FieldAssociation = &quot;Points&quot;<br>        writer.UpdatePipeline()<br>        del writer<br>        csvreader1 = csv.reader(open(nameADM,&#39;rb&#39;))<br>

        csvreader2 = csv.reader(open(nameALM,&#39;rb&#39;))<br>        x,y,x1,y1=[],[],[],[]<br>        for j, line in enumerate(csvreader1):<br>            if j&gt;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&gt;0:<br>                x1.append((float(line[5])-width/2)/D)<br>                y1.append(float(line[0]))      <br>

        plt.plot(x,y,&#39;-&#39;,label=&#39;ADM&#39;,color=&#39;black&#39;)<br>        plt.plot(x1,y1,&#39;--&#39;,label=&#39;ALM&#39;,color=&#39;black&#39;)<br>        plt.xlabel(&#39;Distance&#39;)<br>        plt.ylabel(r&#39;$U$ (m/s)&#39;)<br>

        plt.legend(loc=&#39;best&#39;)<br>        plt.ylim([2,10])<br>        plt.savefig(&#39;./wakeProfiles/plots/&#39;+str(profile)+&#39;/turbine&#39;+str(i+1)+&#39;.eps&#39;)<br>        plt.savefig(&#39;./wakeProfiles/plots/&#39;+str(profile)+&#39;/turbine&#39;+str(i+1)+&#39;.png&#39;)<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>