Re: [Paraview] Animation. Second view of a field variable. How to format the file.

2008-09-16 Thread Christer Gustafsson

Hi Dave,

Thank you for your second response on the 12th of September in which you 
pointed out that it is very easy to get the file formats wrong. You also 
sent a full vts example which I copied to a vts file and let ParaView 
display in a 3D window. OK.


Therefore I followed your example and wrote my vts as follows: the 
fileddata (which represents an integrated variable of the system) is now 
put before the first Piece Extent in every one of the vts files. This 
takes me a step further, but there is still something that I have not 
got correctly because this is what happens in ParaView:


File/Open/pvd/Apply --- OK. I see my geometry in the 3D view.
Split Vertical --- Empty window opens
SpreadSheet View --- OK
Click eye  --- Some table opens in second window
Display FieldData --- OK I see my FieldData in second window
animate --- OK FieldData value changes

But it is an animated xyPlot that I wish, so I try the xyplot now in 
ParaView:


File/Open/pvd/Apply --- 3D view opens correctly
Split Vertical --- Empty window opens
xyPlot View --- NO EYE

From here I cannot proceed and I conclude I still do something wrong.  
Now, you also wrote ... make sure you copy the point and cell centred 
data across too. Is this where I fail?


Christer



My vts file(s) as they look now:

?xml version=1.0?
VTKFile type=StructuredGrid version=0.1 byte_order=LittleEndian
compressor=vtkZLibDataCompressor
StructuredGrid WholeExtent=0 1 0 40 0 91
 FieldData
  DataArray type=Float32 Name=SF1 NumberOfTuples=1 format=ascii
 RangeMin=5.204563E+04 RangeMax=5.204563E+04
   5.204563E+04
  /DataArray
 /FieldData
 Piece Extent=0 1 0 40 0 45
  PointData Scalars=Temperature
   DataArray type=Float32 Name=Temperature format=ascii
 1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  
1  1  1  1  1  1  1
 1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  
1  1  1  1  1  1  1

[snip]

David E DeMarle wrote:

You could save K(t) as field data. Then you can extract the zero'th
entry in the K array (which has just one element) and plot that over
time. A vts file with field data in it looks something like this...

VTKFile type=StructuredGrid [snip]
StructuredGrid WholeExtent=[snip]
FieldData
DataArray type=Float64 Name=MyField NumberOfTuples=1 format=ascii
RangeMin=26.1 RangeMax=26.1
26.1
/DataArray
/FieldData
[snip]

On Mon, Sep 8, 2008 at 12:30 AM, Christer Gustafsson
[EMAIL PROTECTED] wrote:

Hi All,

The data (x_i(t),y_i(t),z_i(t)) is formatted as one pvd and many vts 
file.

The animation runs fine in one 3D view.

In addition there is an associated time-varying function (t,K(t)) 
(e.g. the

kinetic energy of the system). I would like to create a second view and
herein animate K(t) along with the 3D view.

In what file format (example?) would the (t,K(t)) be cast in order to 
make

the animations in two views be possible? (The ParaView Guide talks about
`unaligned data items' in connection with `Time' in Chapter 10, section
10.3, but from that point on I find no more path).

Thanks,
ChG

___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview





___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


[Paraview] Excluding properties from state files

2008-09-16 Thread Paul Edwards
Hi,

Sorry to post this again - I still haven't found a solution.  Is there
a way to stop the state file (pvsm) from storing the property?  I.e.
is there an attribute I can add in the XML file?  I would like
ParaView to call the function to get the property instead.

Thanks in advance,
Paul
___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


Re: [Paraview] Excluding properties from state files

2008-09-16 Thread Utkarsh Ayachit
Set  'is_internal=1' and that property won't be saved in the state 
file. It also means that it's default value won't be pushed on to the 
underlying VTK object when the proxy is created. If you change the 
value, however, then it will be pushed as usual.


Utkarsh

Paul Edwards wrote:

Hi,

Sorry to post this again - I still haven't found a solution.  Is there
a way to stop the state file (pvsm) from storing the property?  I.e.
is there an attribute I can add in the XML file?  I would like
ParaView to call the function to get the property instead.

Thanks in advance,
Paul
___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


Re: [Paraview] Excluding properties from state files

2008-09-16 Thread Paul Edwards
Thanks Utkarsh - that's the property I needed.

2008/9/16 Utkarsh Ayachit [EMAIL PROTECTED]:
 Set  'is_internal=1' and that property won't be saved in the state file.
 It also means that it's default value won't be pushed on to the underlying
 VTK object when the proxy is created. If you change the value, however, then
 it will be pushed as usual.

 Utkarsh

 Paul Edwards wrote:

 Hi,

 Sorry to post this again - I still haven't found a solution.  Is there
 a way to stop the state file (pvsm) from storing the property?  I.e.
 is there an attribute I can add in the XML file?  I would like
 ParaView to call the function to get the property instead.

 Thanks in advance,
 Paul
 ___
 ParaView mailing list
 ParaView@paraview.org
 http://www.paraview.org/mailman/listinfo/paraview


___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


Re: [Paraview] Getting values from a saved state with a script

2008-09-16 Thread Walter Landry
Walter Landry [EMAIL PROTECTED] wrote:
 Hello,
 
 I have set up paraview so that it does some calculations and displays
 the result in a spreadsheet.  I can save the state and then load it in
 a script with LoadState().  I know how to save images of the 3D views
 with GetRenderView().WriteImage.  But I have not figured out how to
 get the data from the spreadsheet.  Ideally, I would be like to have
 the script print out a number, although it would be fine to just save
 an image of the spreadsheet.
 
 I tried getting the list of proxies with 
 
   
 paraview.servermanager.pyProxyManager().GetProxiesOnOcnnection(paraview.servermanager.ActiveConnection)
 
 I can get a SpreadSheetView object and SpreadSheetRepresentation
 objects, but I do not know what to do with them.  I just can't manage
 to get numbers out.  I am sure there is a way to do it, but I am a bit
 stumped right now.

I figured it out.  I can just connect them to a DataSetWriter using a
script like

  pm=ProxyManager()
  
energy=pm.GetProxiesOnConnection(ActiveConnection)[sources][IntegrateAttributes3]
  
work=pm.GetProxiesOnConnection(ActiveConnection)[sources][IntegrateAttributes2]
  
energy_writer=writers.DataSetWriter(Input=energy,FileType=1,FileName=energy.vtk)
  work_writer=writers.DataSetWriter(Input=work,FileType=1,FileName=work.vtk)
  energy_writer.UpdatePipeline()
  work_writer.UpdatePipeline()

That writes the data to a file.

Cheers,
Walter Landry
[EMAIL PROTECTED]
___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


[Paraview] filter

2008-09-16 Thread Natalie Happenhofer

Hi!
I´m still encountering problems with my filter, it does compile and link neatly 
with paraview, but at runtime  an error occurs which causes paraview to shut 
down. I´m pretty sure that the problem is how I define the output, that this is 
not done correctly. Lastly, I commented just the algorithm out to test the in- 
and output, and it looks like this:

void vtkHorizontalAverage::Execute()
{vtkDataSet *input = this - GetInput();
 vtkStructuredGrid *output = this - GetOutput();

 int DataSetType;
 DataSetType = input - GetDataObjectType();

 if(DataSetType != VTK_RECTILINEAR_GRID) { vtkErrorMacro(unsupported DataSet 
format);}
 
 
 
 int dims[3],i,j,k;
 // pointer for casting
 vtkSmartPointervtkRectilinearGrid rect_input = 
vtkSmartPointervtkRectilinearGrid::New();
 //vtkStructuredGrid *structgrid_input = vtkStructuredGrid::New();


 vtkPointData *scaldat = input - GetPointData();
 vtkDataArray *new_scaldat;

 vtkSmartPointervtkFloatArray scalars = vtkSmartPointervtkFloatArray::New();
 vtkSmartPointervtkFloatArray new_scalars = 
vtkSmartPointervtkFloatArray::New();

 scalars = vtkFloatArray::SafeDownCast(scaldat); //this is now the input as 
vtkFloatArray
 scaldat - Delete();
 int numbOfComp = scalars - GetNumberOfComponents();
 if(numbOfComp ==1) vtkErrorMacro(Number of Components of Input Array bigger 
than 1!); //
 int numOfTuples = scalars - GetNumberOfTuples();


 new_scalars - SetNumberOfComponents(1);
 new_scalars - SetNumberOfTuples(numOfTuples);


 rect_input = vtkRectilinearGrid::SafeDownCast(input);

 if(!rect_input) {vtkErrorMacro(SafeDownCast to Rectilinear Grid failed);}

else {  rect_input - GetDimensions(dims);
   
   //get the points:
   /*vtkDataArray *XCoord = vtkDataArray::New();
   vtkDataArray *YCoord = vtkDataArray::New();
   vtkDataArray *ZCoord = vtkDataArray::New();*/

   vtkDataArray *XCoord = rect_input - GetXCoordinates();
   vtkDataArray *YCoord = rect_input - GetYCoordinates();
   vtkDataArray *ZCoord = rect_input - GetZCoordinates();
 
output - SetDimensions(dims);
vtkSmartPointervtkPoints pts = vtkSmartPointervtkPoints::New();
pts - SetNumberOfPoints(numOfTuples);


for(int i=0;i=dims[2];i++)
{ for(int j=0;j=dims[1];j++)
{for(int k=0;k=dims[0];k++)
{pts - InsertNextPoint(XCoord - GetTuple1(k),YCoord - 
GetTuple1(j), ZCoord - GetTuple1(i));
}//for (int k
}//for(int j
}//for (int i

XCoord - Delete();
YCoord - Delete();
ZCoord - Delete();

output - SetPoints(pts); //Now the points are set
//output - GetPointData()- CopyAllocate(new_scalars,0,new_scalars - 
GetNumberOfTuples());
output - GetPointData() - PassData(input - GetPointData());
new_scalars - Delete();


Here I get as an input a data set, cast it down to rectilinear grid and compute 
the points for the structured grid. As I said, Paraview shuts down (Access 
violation my debugger says) when I execute it. 

Any help would be appreciated!
thx,
NH

_
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


Re: [Paraview] filter

2008-09-16 Thread Mike Jackson

what line of code is the access violation occurring at?


 _
| Mike Jackson - Principal Software Engineer  |
| BlueQuartz Software |
| [EMAIL PROTECTED] |
| www.bluequartz.net  |
---

On Sep 16, 2008, at 1:08 PM, Natalie Happenhofer wrote:


Hi!
I´m still encountering problems with my filter, it does compile and  
link neatly with paraview, but at runtime  an error occurs which  
causes paraview to shut down. I´m pretty sure that the problem is  
how I define the output, that this is not done correctly. Lastly, I  
commented just the algorithm out to test the in- and output, and it  
looks like this:


void vtkHorizontalAverage::Execute()
{vtkDataSet *input = this - GetInput();
 vtkStructuredGrid *output = this - GetOutput();

 int DataSetType;
 DataSetType = input - GetDataObjectType();

 if(DataSetType != VTK_RECTILINEAR_GRID)  
{ vtkErrorMacro(unsupported DataSet format);}




 int dims[3],i,j,k;
 // pointer for casting
 vtkSmartPointervtkRectilinearGrid rect_input =  
vtkSmartPointervtkRectilinearGrid::New();

 //vtkStructuredGrid *structgrid_input = vtkStructuredGrid::New();


 vtkPointData *scaldat = input - GetPointData();
 vtkDataArray *new_scaldat;

 vtkSmartPointervtkFloatArray scalars =  
vtkSmartPointervtkFloatArray::New();
 vtkSmartPointervtkFloatArray new_scalars =  
vtkSmartPointervtkFloatArray::New();


 scalars = vtkFloatArray::SafeDownCast(scaldat); //this is now the  
input as vtkFloatArray

 scaldat - Delete();
 int numbOfComp = scalars - GetNumberOfComponents();
 if(numbOfComp ==1) vtkErrorMacro(Number of Components of Input  
Array bigger than 1!); //

 int numOfTuples = scalars - GetNumberOfTuples();


 new_scalars - SetNumberOfComponents(1);
 new_scalars - SetNumberOfTuples(numOfTuples);


 rect_input = vtkRectilinearGrid::SafeDownCast(input);

 if(!rect_input) {vtkErrorMacro(SafeDownCast to Rectilinear Grid  
failed);}


else {  rect_input - GetDimensions(dims);

   //get the points:
   /*vtkDataArray *XCoord = vtkDataArray::New();
   vtkDataArray *YCoord = vtkDataArray::New();
   vtkDataArray *ZCoord = vtkDataArray::New();*/

   vtkDataArray *XCoord = rect_input - GetXCoordinates();
   vtkDataArray *YCoord = rect_input - GetYCoordinates();
   vtkDataArray *ZCoord = rect_input - GetZCoordinates();

output - SetDimensions(dims);
vtkSmartPointervtkPoints pts =  
vtkSmartPointervtkPoints::New();

pts - SetNumberOfPoints(numOfTuples);


for(int i=0;i=dims[2];i++)
{ for(int j=0;j=dims[1];j++)
{for(int k=0;k=dims[0];k++)
{pts - InsertNextPoint(XCoord - GetTuple1(k),YCoord -  
GetTuple1(j), ZCoord - GetTuple1(i));

}//for (int k
}//for(int j
}//for (int i

XCoord - Delete();
YCoord - Delete();
ZCoord - Delete();

output - SetPoints(pts); //Now the points are set
//output - GetPointData()- CopyAllocate(new_scalars, 
0,new_scalars - GetNumberOfTuples());

output - GetPointData() - PassData(input - GetPointData());
new_scalars - Delete();


Here I get as an input a data set, cast it down to rectilinear grid  
and compute the points for the structured grid. As I said, Paraview  
shuts down (Access violation my debugger says) when I execute it.


Any help would be appreciated!
thx,
NH

Express yourself instantly with MSN Messenger! MSN Messenger  
___

ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview


Re: [Paraview] filter

2008-09-16 Thread Moreland, Kenneth
It might help if you ran your code in a debugger and found out exactly where
the error occurred.

I think the for loops are wrong.  The conditions should be , not =.  You
might be mixing up dimension lengths and extent values.

-Ken


On 9/16/08 11:08 AM, Natalie Happenhofer [EMAIL PROTECTED] wrote:

 Hi!
 I´m still encountering problems with my filter, it does compile and link
 neatly with paraview, but at runtime  an error occurs which causes paraview to
 shut down. I´m pretty sure that the problem is how I define the output, that
 this is not done correctly. Lastly, I commented just the algorithm out to test
 the in- and output, and it looks like this:

 void vtkHorizontalAverage::Execute()
 {vtkDataSet *input = this - GetInput();
  vtkStructuredGrid *output = this - GetOutput();

  int DataSetType;
  DataSetType = input - GetDataObjectType();

  if(DataSetType != VTK_RECTILINEAR_GRID) { vtkErrorMacro(unsupported DataSet
 format);}



  int dims[3],i,j,k;
  // pointer for casting
  vtkSmartPointervtkRectilinearGrid rect_input =
 vtkSmartPointervtkRectilinearGrid::New();
  //vtkStructuredGrid *structgrid_input = vtkStructuredGrid::New();


  vtkPointData *scaldat = input - GetPointData();
  vtkDataArray *new_scaldat;

  vtkSmartPointervtkFloatArray scalars =
 vtkSmartPointervtkFloatArray::New();
  vtkSmartPointervtkFloatArray new_scalars =
 vtkSmartPointervtkFloatArray::New();

  scalars = vtkFloatArray::SafeDownCast(scaldat); //this is now the input as
 vtkFloatArray
  scaldat - Delete();
  int numbOfComp = scalars - GetNumberOfComponents();
  if(numbOfComp ==1) vtkErrorMacro(Number of Components of Input Array bigger
 than 1!); //
  int numOfTuples = scalars - GetNumberOfTuples();


  new_scalars - SetNumberOfComponents(1);
  new_scalars - SetNumberOfTuples(numOfTuples);


  rect_input = vtkRectilinearGrid::SafeDownCast(input);

  if(!rect_input) {vtkErrorMacro(SafeDownCast to Rectilinear Grid failed);}

 else {  rect_input - GetDimensions(dims);

//get the points:
/*vtkDataArray *XCoord = vtkDataArray::New();
vtkDataArray *YCoord = vtkDataArray::New();
vtkDataArray *ZCoord = vtkDataArray::New();*/

vtkDataArray *XCoord = rect_input - GetXCoordinates();
vtkDataArray *YCoord = rect_input - GetYCoordinates();
vtkDataArray *ZCoord = rect_input - GetZCoordinates();

 output - SetDimensions(dims);
 vtkSmartPointervtkPoints pts = vtkSmartPointervtkPoints::New();
 pts - SetNumberOfPoints(numOfTuples);


 for(int i=0;i=dims[2];i++)
 { for(int j=0;j=dims[1];j++)
 {for(int k=0;k=dims[0];k++)
 {pts - InsertNextPoint(XCoord - GetTuple1(k),YCoord -
 GetTuple1(j), ZCoord - GetTuple1(i));
 }//for (int k
 }//for(int j
 }//for (int i

 XCoord - Delete();
 YCoord - Delete();
 ZCoord - Delete();

 output - SetPoints(pts); //Now the points are set
 //output - GetPointData()- CopyAllocate(new_scalars,0,new_scalars -
 GetNumberOfTuples());
 output - GetPointData() - PassData(input - GetPointData());
 new_scalars - Delete();


 Here I get as an input a data set, cast it down to rectilinear grid and
 compute the points for the structured grid. As I said, Paraview shuts down
 (Access violation my debugger says) when I execute it.

 Any help would be appreciated!
 thx,
 NH


 Express yourself instantly with MSN Messenger! MSN Messenger
 http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/


     Kenneth Moreland
***  Sandia National Laboratories
***
*** *** ***  email: [EMAIL PROTECTED]
**  ***  **  phone: (505) 844-8919
***  fax:   (505) 845-0833



___
ParaView mailing list
ParaView@paraview.org
http://www.paraview.org/mailman/listinfo/paraview