[Paraview] Calculator filter
I am trying to compute a quantity based on two 3-vectors as input. All six components are in six columns of one (csv) file, so I read that in and create two Table to Points filters. I would like to bring up the calculator to compute the magnitudes of each vector, but if I highlight the two filters I cannot select the Calculator tool, it is greyed out. How do I do computations on two (or more) inputs? Thanks, Liam ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
Re: [Paraview] Calculator filter
The Python Calculator will accept multiple sources so I recommend that. Otherwise you will need to apply something like the Append or Merge filter to produce one source for the standard Calculator's input. David E DeMarle Kitware, Inc. R Engineer 21 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-881-4909 On Tue, Nov 10, 2015 at 2:30 PM, Liam Healywrote: > I am trying to compute a quantity based on two 3-vectors as input. All > six components are in six columns of one (csv) file, so I read that in > and create two Table to Points filters. I would like to bring up the > calculator to compute the magnitudes of each vector, but if I > highlight the two filters I cannot select the Calculator tool, it is > greyed out. How do I do computations on two (or more) inputs? > > Thanks, > Liam > ___ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the ParaView Wiki at: > http://paraview.org/Wiki/ParaView > > Search the list archives at: http://markmail.org/search/?q=ParaView > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/paraview > ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
Re: [Paraview] Calculator filter
Thanks for the advice. Indeed, I can select the two filter outputs and start up a Python Calculator. Now however, I am stumped: I don't know how to specify the input vectors which Table to Points created. The spreadsheet view shows all the fields, and a points column which happens to be the second vector. I don't know where the first one went. I was able to find http://www.vtk.org/Wiki/Python_Calculator which is a nice illustration of capability, but it's not specified there how "BrownianVectors" got named. If I do mag(Points) (Points=name at top of spreadsheet) or mag(points) or mag(Position) (Position = name of my first filter) or mag(input[0]), I get an error. I've tried looking through the documentation but I'm not even sure where to look. Thanks, Liam On Tue, Nov 10, 2015 at 2:34 PM, David E DeMarlewrote: > The Python Calculator will accept multiple sources so I recommend that. > Otherwise you will need to apply something like the Append or Merge filter > to produce one source for the standard Calculator's input. > > David E DeMarle > Kitware, Inc. > R Engineer > 21 Corporate Drive > Clifton Park, NY 12065-8662 > Phone: 518-881-4909 > > On Tue, Nov 10, 2015 at 2:30 PM, Liam Healy > wrote: >> >> I am trying to compute a quantity based on two 3-vectors as input. All >> six components are in six columns of one (csv) file, so I read that in >> and create two Table to Points filters. I would like to bring up the >> calculator to compute the magnitudes of each vector, but if I >> highlight the two filters I cannot select the Calculator tool, it is >> greyed out. How do I do computations on two (or more) inputs? >> >> Thanks, >> Liam >> ___ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Please keep messages on-topic and check the ParaView Wiki at: >> http://paraview.org/Wiki/ParaView >> >> Search the list archives at: http://markmail.org/search/?q=ParaView >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/paraview > > ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Search the list archives at: http://markmail.org/search/?q=ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
[Paraview] calculator - lock in current values over time
Hi I am using a calculator filter to get the y co-ordinates for a series of particles. I am then using that data to color by y position. However this color is changing over time as the particles move. I would like to lock in the first value, ie the original y position of the particles. Is this possible? Is there a function in the calculator or maybe a filter I can add to make sure the calculator data table isn't updated at every time increment? cheers, Tim ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
Re: [Paraview] calculator tensor field
Gianna, For Calculator filter, names with _X, _Y have special meaning. Try change Calulators 1-9 to use Result Array names as sigmaXX, sigmaYY, etc. Does that work? Utkarsh On Mon, Oct 6, 2014 at 6:31 PM, marschm...@stud.uni-heidelberg.de wrote: Hello Utkarsh, thanks for looking at it. Attached is the state file: - Calculators 1-6 calculate the 6 independent components of the symmetric stress tensor sigma_ij - Calculators 7-9 calculate the traction vectors s_i from the stress components (s_i = sigma_ij e_j , summation over j implied, e_j basis vectors) Now in another calculator I'd like to compute the stress tensor field, either directly from the stress components sigma_ij or from the traction vectors. Both approaches fail with the error message. The stress tensor is given by sigma = sigma_xx(e_x*e_x)+sigma_yy(e_y*e_y)+sigma_zz(e_z*_ez)+sigma_xy)(e_xe_y+e_ye_x)+sigma_xz(e_xe_z+e_ze_x)+sigma_yz(e_ye_z+e_ze_y) equivalent to sigma = s_x*e_x + s_y*e_y +s_z*e_z Thanks, Gianna Quoting Utkarsh Ayachit utkarsh.ayac...@kitware.com: Can you attach a sample data file/state file? That'll make it easier to identify the problem and suggest a solution. Thanks Utkarsh On Sat, Oct 4, 2014 at 4:14 AM, marschm...@stud.uni-heidelberg.de wrote: Hello everyone, I have three displacement field vector components u, v, w in my .vtk file and wish to display the associated stress tensor. I made the following steps: - Apply the filter Gradient Of Unstructued DataSet - Now have 9 scalars Gradient_0, ... , Gradient 8 - compute components of stress tensor via sigma_ij = div(Gradient) + u_i,j - Now have additional 9 scalars sigma_ij - from this form traction vectors: T_i = sigma_ij e_j ,where e_j are the unit vectors iHat - Now have three traction vectors from which the tensor field computation doesnt work: - I do Result = T_1*iHat + T_2*jHat + T_3*kHat for the tensor calculation and get the following error message: ERROR: In /home/abuild/rpmbuild/BUILD/ParaView-v4.0.1-source/VTK/Common/Misc/vtkFunctionParser.cxx, line 201 vtkFunctionParser (0x205ddac0): Parse: Error deciding between ambiguous operators ERROR: In /home/abuild/rpmbuild/BUILD/ParaView-v4.0.1-source/VTK/Common/Misc/vtkFunctionParser.cxx, line 300 vtkFunctionParser (0x205ddac0): expecting either 2 scalars or a scalar and a vector ERROR: In /home/abuild/rpmbuild/BUILD/ParaView-v4.0.1-source/VTK/Common/Misc/vtkFunctionParser.cxx, line 201 vtkFunctionParser (0x205ddac0): Parse: Error deciding between ambiguous operators - Can you help me or tell me gow to visualize the stress tensor from the displacement field? - Alternatively you it would also be good to know how to multiply the result of filter Gradient of Unstructured DataSet by a scalar value. Many thanks for helping! Gianna ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
Re: [Paraview] calculator tensor field
Dear Utkarsh, I changed the Result Array names to sigmaXX etc but still get the same error message. I think the problem is with the product between the two unit vectors. Simply calculating for example iHat*iHat yields the same error message. Would you know in general how to form a tensor field in paraview from its components? Thanks, Gianna Quoting Utkarsh Ayachit utkarsh.ayac...@kitware.com: Gianna, For Calculator filter, names with _X, _Y have special meaning. Try change Calulators 1-9 to use Result Array names as sigmaXX, sigmaYY, etc. Does that work? Utkarsh On Mon, Oct 6, 2014 at 6:31 PM, marschm...@stud.uni-heidelberg.de wrote: Hello Utkarsh, thanks for looking at it. Attached is the state file: - Calculators 1-6 calculate the 6 independent components of the symmetric stress tensor sigma_ij - Calculators 7-9 calculate the traction vectors s_i from the stress components (s_i = sigma_ij e_j , summation over j implied, e_j basis vectors) Now in another calculator I'd like to compute the stress tensor field, either directly from the stress components sigma_ij or from the traction vectors. Both approaches fail with the error message. The stress tensor is given by sigma = sigma_xx(e_x*e_x)+sigma_yy(e_y*e_y)+sigma_zz(e_z*_ez)+sigma_xy)(e_xe_y+e_ye_x)+sigma_xz(e_xe_z+e_ze_x)+sigma_yz(e_ye_z+e_ze_y) equivalent to sigma = s_x*e_x + s_y*e_y +s_z*e_z Thanks, Gianna Quoting Utkarsh Ayachit utkarsh.ayac...@kitware.com: Can you attach a sample data file/state file? That'll make it easier to identify the problem and suggest a solution. Thanks Utkarsh On Sat, Oct 4, 2014 at 4:14 AM, marschm...@stud.uni-heidelberg.de wrote: Hello everyone, I have three displacement field vector components u, v, w in my .vtk file and wish to display the associated stress tensor. I made the following steps: - Apply the filter Gradient Of Unstructued DataSet - Now have 9 scalars Gradient_0, ... , Gradient 8 - compute components of stress tensor via sigma_ij = div(Gradient) + u_i,j - Now have additional 9 scalars sigma_ij - from this form traction vectors: T_i = sigma_ij e_j ,where e_j are the unit vectors iHat - Now have three traction vectors from which the tensor field computation doesnt work: - I do Result = T_1*iHat + T_2*jHat + T_3*kHat for the tensor calculation and get the following error message: ERROR: In /home/abuild/rpmbuild/BUILD/ParaView-v4.0.1-source/VTK/Common/Misc/vtkFunctionParser.cxx, line 201 vtkFunctionParser (0x205ddac0): Parse: Error deciding between ambiguous operators ERROR: In /home/abuild/rpmbuild/BUILD/ParaView-v4.0.1-source/VTK/Common/Misc/vtkFunctionParser.cxx, line 300 vtkFunctionParser (0x205ddac0): expecting either 2 scalars or a scalar and a vector ERROR: In /home/abuild/rpmbuild/BUILD/ParaView-v4.0.1-source/VTK/Common/Misc/vtkFunctionParser.cxx, line 201 vtkFunctionParser (0x205ddac0): Parse: Error deciding between ambiguous operators - Can you help me or tell me gow to visualize the stress tensor from the displacement field? - Alternatively you it would also be good to know how to multiply the result of filter Gradient of Unstructured DataSet by a scalar value. Many thanks for helping! Gianna ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
Re: [Paraview] calculator tensor field
This may be easier to do in the Python Calculator, which is more efficient anyway. For accessing a specific component of a vector you can do something like Normals[:,0]. For a 2nd order tensor you'd do something like StrainRate[:,0,1]. On Tue, Oct 7, 2014 at 2:51 PM, marschm...@stud.uni-heidelberg.de wrote: Dear Utkarsh, I changed the Result Array names to sigmaXX etc but still get the same error message. I think the problem is with the product between the two unit vectors. Simply calculating for example iHat*iHat yields the same error message. Would you know in general how to form a tensor field in paraview from its components? Thanks, Gianna Quoting Utkarsh Ayachit utkarsh.ayac...@kitware.com: Gianna, For Calculator filter, names with _X, _Y have special meaning. Try change Calulators 1-9 to use Result Array names as sigmaXX, sigmaYY, etc. Does that work? Utkarsh On Mon, Oct 6, 2014 at 6:31 PM, marschm...@stud.uni-heidelberg.de wrote: Hello Utkarsh, thanks for looking at it. Attached is the state file: - Calculators 1-6 calculate the 6 independent components of the symmetric stress tensor sigma_ij - Calculators 7-9 calculate the traction vectors s_i from the stress components (s_i = sigma_ij e_j , summation over j implied, e_j basis vectors) Now in another calculator I'd like to compute the stress tensor field, either directly from the stress components sigma_ij or from the traction vectors. Both approaches fail with the error message. The stress tensor is given by sigma = sigma_xx(e_x*e_x)+sigma_yy(e_y*e_y)+sigma_zz(e_z*_ez)+ sigma_xy)(e_xe_y+e_ye_x)+sigma_xz(e_xe_z+e_ze_x)+sigma_yz(e_ye_z+e_ze_y) equivalent to sigma = s_x*e_x + s_y*e_y +s_z*e_z Thanks, Gianna Quoting Utkarsh Ayachit utkarsh.ayac...@kitware.com: Can you attach a sample data file/state file? That'll make it easier to identify the problem and suggest a solution. Thanks Utkarsh On Sat, Oct 4, 2014 at 4:14 AM, marschm...@stud.uni-heidelberg.de wrote: Hello everyone, I have three displacement field vector components u, v, w in my .vtk file and wish to display the associated stress tensor. I made the following steps: - Apply the filter Gradient Of Unstructued DataSet - Now have 9 scalars Gradient_0, ... , Gradient 8 - compute components of stress tensor via sigma_ij = div(Gradient) + u_i,j - Now have additional 9 scalars sigma_ij - from this form traction vectors: T_i = sigma_ij e_j ,where e_j are the unit vectors iHat - Now have three traction vectors from which the tensor field computation doesnt work: - I do Result = T_1*iHat + T_2*jHat + T_3*kHat for the tensor calculation and get the following error message: ERROR: In /home/abuild/rpmbuild/BUILD/ParaView-v4.0.1-source/VTK/ Common/Misc/vtkFunctionParser.cxx, line 201 vtkFunctionParser (0x205ddac0): Parse: Error deciding between ambiguous operators ERROR: In /home/abuild/rpmbuild/BUILD/ParaView-v4.0.1-source/VTK/ Common/Misc/vtkFunctionParser.cxx, line 300 vtkFunctionParser (0x205ddac0): expecting either 2 scalars or a scalar and a vector ERROR: In /home/abuild/rpmbuild/BUILD/ParaView-v4.0.1-source/VTK/ Common/Misc/vtkFunctionParser.cxx, line 201 vtkFunctionParser (0x205ddac0): Parse: Error deciding between ambiguous operators - Can you help me or tell me gow to visualize the stress tensor from the displacement field? - Alternatively you it would also be good to know how to multiply the result of filter Gradient of Unstructured DataSet by a scalar value. Many thanks for helping! Gianna ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/ opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
Re: [Paraview] calculator tensor field
Gianna, If I understand correctly, you are trying to multiply a row vector [a, b, c] by a column vector [d, e, f]^T (where ^T indicates transpose) to get a matrix. Actually, you are doing this three times and then summing the resulting matrices to get a tensor matrix. Is that correct? If that its the case, I do not believe it is possible to produce a matrix output. Like Andy, I suggest using the Python Calculator. Documentation is available here: http://www.itk.org/Wiki/ParaView/Users_Guide/Python_Calculator Hope that helps, Cory On Tue, Oct 7, 2014 at 2:51 PM, marschm...@stud.uni-heidelberg.de wrote: Dear Utkarsh, I changed the Result Array names to sigmaXX etc but still get the same error message. I think the problem is with the product between the two unit vectors. Simply calculating for example iHat*iHat yields the same error message. Would you know in general how to form a tensor field in paraview from its components? Thanks, Gianna Quoting Utkarsh Ayachit utkarsh.ayac...@kitware.com: Gianna, For Calculator filter, names with _X, _Y have special meaning. Try change Calulators 1-9 to use Result Array names as sigmaXX, sigmaYY, etc. Does that work? Utkarsh On Mon, Oct 6, 2014 at 6:31 PM, marschm...@stud.uni-heidelberg.de wrote: Hello Utkarsh, thanks for looking at it. Attached is the state file: - Calculators 1-6 calculate the 6 independent components of the symmetric stress tensor sigma_ij - Calculators 7-9 calculate the traction vectors s_i from the stress components (s_i = sigma_ij e_j , summation over j implied, e_j basis vectors) Now in another calculator I'd like to compute the stress tensor field, either directly from the stress components sigma_ij or from the traction vectors. Both approaches fail with the error message. The stress tensor is given by sigma = sigma_xx(e_x*e_x)+sigma_yy(e_y*e_y)+sigma_zz(e_z*_ez)+sigma_xy)(e_xe_y+e_ye_x)+sigma_xz(e_xe_z+e_ze_x)+sigma_yz(e_ye_z+e_ze_y) equivalent to sigma = s_x*e_x + s_y*e_y +s_z*e_z Thanks, Gianna Quoting Utkarsh Ayachit utkarsh.ayac...@kitware.com: Can you attach a sample data file/state file? That'll make it easier to identify the problem and suggest a solution. Thanks Utkarsh On Sat, Oct 4, 2014 at 4:14 AM, marschm...@stud.uni-heidelberg.de wrote: Hello everyone, I have three displacement field vector components u, v, w in my .vtk file and wish to display the associated stress tensor. I made the following steps: - Apply the filter Gradient Of Unstructued DataSet - Now have 9 scalars Gradient_0, ... , Gradient 8 - compute components of stress tensor via sigma_ij = div(Gradient) + u_i,j - Now have additional 9 scalars sigma_ij - from this form traction vectors: T_i = sigma_ij e_j ,where e_j are the unit vectors iHat - Now have three traction vectors from which the tensor field computation doesnt work: - I do Result = T_1*iHat + T_2*jHat + T_3*kHat for the tensor calculation and get the following error message: ERROR: In /home/abuild/rpmbuild/BUILD/ParaView-v4.0.1-source/VTK/Common/Misc/vtkFunctionParser.cxx, line 201 vtkFunctionParser (0x205ddac0): Parse: Error deciding between ambiguous operators ERROR: In /home/abuild/rpmbuild/BUILD/ParaView-v4.0.1-source/VTK/Common/Misc/vtkFunctionParser.cxx, line 300 vtkFunctionParser (0x205ddac0): expecting either 2 scalars or a scalar and a vector ERROR: In /home/abuild/rpmbuild/BUILD/ParaView-v4.0.1-source/VTK/Common/Misc/vtkFunctionParser.cxx, line 201 vtkFunctionParser (0x205ddac0): Parse: Error deciding between ambiguous operators - Can you help me or tell me gow to visualize the stress tensor from the displacement field? - Alternatively you it would also be good to know how to multiply the result of filter Gradient of Unstructured DataSet by a scalar value. Many thanks for helping! Gianna ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe:
Re: [Paraview] calculator tensor field
Can you attach a sample data file/state file? That'll make it easier to identify the problem and suggest a solution. Thanks Utkarsh On Sat, Oct 4, 2014 at 4:14 AM, marschm...@stud.uni-heidelberg.de wrote: Hello everyone, I have three displacement field vector components u, v, w in my .vtk file and wish to display the associated stress tensor. I made the following steps: - Apply the filter Gradient Of Unstructued DataSet - Now have 9 scalars Gradient_0, ... , Gradient 8 - compute components of stress tensor via sigma_ij = div(Gradient) + u_i,j - Now have additional 9 scalars sigma_ij - from this form traction vectors: T_i = sigma_ij e_j ,where e_j are the unit vectors iHat - Now have three traction vectors from which the tensor field computation doesnt work: - I do Result = T_1*iHat + T_2*jHat + T_3*kHat for the tensor calculation and get the following error message: ERROR: In /home/abuild/rpmbuild/BUILD/ParaView-v4.0.1-source/VTK/Common/Misc/vtkFunctionParser.cxx, line 201 vtkFunctionParser (0x205ddac0): Parse: Error deciding between ambiguous operators ERROR: In /home/abuild/rpmbuild/BUILD/ParaView-v4.0.1-source/VTK/Common/Misc/vtkFunctionParser.cxx, line 300 vtkFunctionParser (0x205ddac0): expecting either 2 scalars or a scalar and a vector ERROR: In /home/abuild/rpmbuild/BUILD/ParaView-v4.0.1-source/VTK/Common/Misc/vtkFunctionParser.cxx, line 201 vtkFunctionParser (0x205ddac0): Parse: Error deciding between ambiguous operators - Can you help me or tell me gow to visualize the stress tensor from the displacement field? - Alternatively you it would also be good to know how to multiply the result of filter Gradient of Unstructured DataSet by a scalar value. Many thanks for helping! Gianna ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
[Paraview] calculator tensor field
Hello everyone, I have three displacement field vector components u, v, w in my .vtk file and wish to display the associated stress tensor. I made the following steps: - Apply the filter Gradient Of Unstructued DataSet - Now have 9 scalars Gradient_0, ... , Gradient 8 - compute components of stress tensor via sigma_ij = div(Gradient) + u_i,j - Now have additional 9 scalars sigma_ij - from this form traction vectors: T_i = sigma_ij e_j ,where e_j are the unit vectors iHat - Now have three traction vectors from which the tensor field computation doesnt work: - I do Result = T_1*iHat + T_2*jHat + T_3*kHat for the tensor calculation and get the following error message: ERROR: In /home/abuild/rpmbuild/BUILD/ParaView-v4.0.1-source/VTK/Common/Misc/vtkFunctionParser.cxx, line 201 vtkFunctionParser (0x205ddac0): Parse: Error deciding between ambiguous operators ERROR: In /home/abuild/rpmbuild/BUILD/ParaView-v4.0.1-source/VTK/Common/Misc/vtkFunctionParser.cxx, line 300 vtkFunctionParser (0x205ddac0): expecting either 2 scalars or a scalar and a vector ERROR: In /home/abuild/rpmbuild/BUILD/ParaView-v4.0.1-source/VTK/Common/Misc/vtkFunctionParser.cxx, line 201 vtkFunctionParser (0x205ddac0): Parse: Error deciding between ambiguous operators - Can you help me or tell me gow to visualize the stress tensor from the displacement field? - Alternatively you it would also be good to know how to multiply the result of filter Gradient of Unstructured DataSet by a scalar value. Many thanks for helping! Gianna ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/paraview
[Paraview] Calculator Filter Troubleshooting - Bug Report
Hello, My colleagues and I use ParaView at work, we think we have been meeting a bug in the Calculator filter. We use ParaView 3.14.1 (32 64-bit). The bug seems to happen on 3 different machines. Here are steps that can reproduce this bug : - Load an *.sol.xmf solution (with multiple solutions *.solxx.xmf). - Use the Calculator Filter to compute some quantity. - Change the number of the solution, the calculator value is updated to compute the quantity on the new solution. - Use a new Calculator to compute this same quantity. We can see that the results from the two calculators are different. If you need some additional details or files, i will follow your instructions. Thank you, E. Gibaud Université Montpellier 2 Montpellier, France. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator disabled when no point or cell data exists in ParaView 3.98.0
That makes sense. I've pushed a fix (http://paraview.org/Bug/view.php?id=13824). Patch attached. Utkarsh On Thu, Jan 24, 2013 at 4:47 PM, Cory Quammen cquam...@cs.unc.edu wrote: In ParaView 3.14.1, I used to be able to create quick test data sets by using the Point Source and applying the Calculator filter to it to generate some point data using the coordinates of the points in the point source. This is no longer possible in 3.98.0. Is that by design? I'd argue that the calculator should be available in this case. A perhaps more common use case would be using the Calculator to perform a transformation on point coordinates in an object. Thanks, Cory -- Cory Quammen Research Associate Department of Computer Science The University of North Carolina at Chapel Hill ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview 0001-BUG-13824.-Calculator-can-now-work-when-cell-point-a.patch Description: Binary data ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator disabled when no point or cell data exists in ParaView 3.98.0
Thanks, Utkarsh! Cory On Fri, Jan 25, 2013 at 1:09 PM, Utkarsh Ayachit utkarsh.ayac...@kitware.com wrote: That makes sense. I've pushed a fix (http://paraview.org/Bug/view.php?id=13824). Patch attached. Utkarsh On Thu, Jan 24, 2013 at 4:47 PM, Cory Quammen cquam...@cs.unc.edu wrote: In ParaView 3.14.1, I used to be able to create quick test data sets by using the Point Source and applying the Calculator filter to it to generate some point data using the coordinates of the points in the point source. This is no longer possible in 3.98.0. Is that by design? I'd argue that the calculator should be available in this case. A perhaps more common use case would be using the Calculator to perform a transformation on point coordinates in an object. Thanks, Cory -- Cory Quammen Research Associate Department of Computer Science The University of North Carolina at Chapel Hill ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview -- Cory Quammen Research Associate Department of Computer Science The University of North Carolina at Chapel Hill ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
[Paraview] Calculator disabled when no point or cell data exists in ParaView 3.98.0
In ParaView 3.14.1, I used to be able to create quick test data sets by using the Point Source and applying the Calculator filter to it to generate some point data using the coordinates of the points in the point source. This is no longer possible in 3.98.0. Is that by design? I'd argue that the calculator should be available in this case. A perhaps more common use case would be using the Calculator to perform a transformation on point coordinates in an object. Thanks, Cory -- Cory Quammen Research Associate Department of Computer Science The University of North Carolina at Chapel Hill ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
[Paraview] calculator
I know this should be very simple, but it certainly doesn't appear to be. I have to different sets of .vtk files each one representing different variables. All that I want to do is see the instantaneous correlation between the variables, i.e. I want to multiply them together. Unfortunately I can't figure out how to specify data from different files in the calculator. When I group the datasets, there is nothing that indicates what the name of the variables are...I'm guessing that would be helpful. -Jared CCS2/CNLS Postdoctoral Research Associate Los Alamos National Laboratory ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] calculator
Take a look at this: http://paraview.org/Wiki/ParaView/Users_Guide/Python_Calculator#Comparing_Multiple_Datasets You can use similar approach to other arithmetic besides difference. Utkarsh On Tue, May 29, 2012 at 5:04 PM, Whitehead, Jared whiteh...@lanl.gov wrote: I know this should be very simple, but it certainly doesn't appear to be. I have to different sets of .vtk files each one representing different variables. All that I want to do is see the instantaneous correlation between the variables, i.e. I want to multiply them together. Unfortunately I can't figure out how to specify data from different files in the calculator. When I group the datasets, there is nothing that indicates what the name of the variables are...I'm guessing that would be helpful. -Jared CCS2/CNLS Postdoctoral Research Associate Los Alamos National Laboratory ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] calculator gives incorrect results for multiblock datasets
Hi Paul, I add a bug entry for that here http://www.paraview.org/Bug/view.php?id=13088 as I didn't manage to look into it this week... Seb On Mon, Feb 13, 2012 at 9:34 AM, Edwards, Paul paul.edwar...@rolls-royce.com wrote: Hi, ** ** The calculator gives incorrect results for multiblock unless the variables have the same index internally. This can be reproduced with the steps below: ** ** **1. **Create a python source that outputs vtkUnstructuredGrid with the following script: def add_scalar(ds, val): arr = vtk.vtkDoubleArray() arr.SetName(Scalar+str(val)) arr.SetNumberOfComponents(1) arr.SetNumberOfTuples(8) for i in range(8): arr.SetTuple1(i, float(val)) output.GetPointData().AddArray(arr) ** ** output = self.GetOutput() npts = 8 pts = vtk.vtkPoints() pts.InsertNextPoint(-3.0, -1.0, -1.0) pts.InsertNextPoint(-1.0, -1.0, -1.0) pts.InsertNextPoint(-1.0, 1.0, -1.0) pts.InsertNextPoint(-3.0, 1.0, -1.0) pts.InsertNextPoint(-3.0, -1.0, 1.0) pts.InsertNextPoint(-1.0, -1.0, 1.0) pts.InsertNextPoint(-1.0, 1.0, 1.0) pts.InsertNextPoint(-3.0, 1.0, 1.0) output.SetPoints(pts) output.Allocate(1,1) ids = vtk.vtkIdList() for i in range(npts): ids.InsertId(i,i) add_scalar(output, 1) add_scalar(output, 2) output.InsertNextCell(vtk.VTK_HEXAHEDRON, ids) **2. **Create a second python source that outputs vtkUnstructuredGrid with the following script (notice the change in order when adding the scalars): def add_scalar(ds, val): arr = vtk.vtkDoubleArray() arr.SetName(Scalar+str(val)) arr.SetNumberOfComponents(1) arr.SetNumberOfTuples(8) for i in range(8): arr.SetTuple1(i, float(val)) output.GetPointData().AddArray(arr) ** ** output = self.GetOutput() npts = 8 pts = vtk.vtkPoints() pts.InsertNextPoint(-3.0, -1.0, -1.0) pts.InsertNextPoint(-1.0, -1.0, -1.0) pts.InsertNextPoint(-1.0, 1.0, -1.0) pts.InsertNextPoint(-3.0, 1.0, -1.0) pts.InsertNextPoint(-3.0, -1.0, 1.0) pts.InsertNextPoint(-1.0, -1.0, 1.0) pts.InsertNextPoint(-1.0, 1.0, 1.0) pts.InsertNextPoint(-3.0, 1.0, 1.0) output.SetPoints(pts) output.Allocate(1,1) ids = vtk.vtkIdList() for i in range(npts): ids.InsertId(i,i) add_scalar(output, 2) add_scalar(output, 1) output.InsertNextCell(vtk.VTK_HEXAHEDRON, ids) **3. **Group the two python sources together **4. **Use the Calculator filter to pass through Scalar1 ** ** See output below: ** ** ** ** Regards, Paul The data contained in, or attached to, this e-mail, may contain confidential information. If you have received it in error you should notify the sender immediately by reply e-mail, delete the message from your system and contact +44 (0) 1332 242424 (the Rolls-Royce IT Security Director) if you need assistance. Please do not copy it for any purpose, or disclose its contents to any other person. An e-mail response to this address may be subject to interception or monitoring for operational reasons or for lawful business practices. (c) 2012 Rolls-Royce plc Registered office: 65 Buckingham Gate, London SW1E 6AT Company number: 1003142. Registered in England. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview image001.png___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
[Paraview] Calculator removes cell data
Hi, I just submitted a bug on this: http://paraview.org/Bug/view.php?id=12944 But I'm wondering if there's a way to work around it. The problem is that I'm trying to modify the coordinates insitu using the displacement, but that ends up deleting the cell data. Is there any way to merge the cell data from one data source into the another? Something like this: InputData = InputData() #get the input data from coprocessing Calculator = Calculator () #removes the cell data Merged = CopyCellDataFromAtoB (InputData, Calculator) #copies the cell data from InputData, but uses modified mesh from Calculator Thanks, Nathan. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
[Paraview] calculator gives incorrect results for multiblock datasets
Hi, The calculator gives incorrect results for multiblock unless the variables have the same index internally. This can be reproduced with the steps below: 1. Create a python source that outputs vtkUnstructuredGrid with the following script: def add_scalar(ds, val): arr = vtk.vtkDoubleArray() arr.SetName(Scalar+str(val)) arr.SetNumberOfComponents(1) arr.SetNumberOfTuples(8) for i in range(8): arr.SetTuple1(i, float(val)) output.GetPointData().AddArray(arr) output = self.GetOutput() npts = 8 pts = vtk.vtkPoints() pts.InsertNextPoint(-3.0, -1.0, -1.0) pts.InsertNextPoint(-1.0, -1.0, -1.0) pts.InsertNextPoint(-1.0, 1.0, -1.0) pts.InsertNextPoint(-3.0, 1.0, -1.0) pts.InsertNextPoint(-3.0, -1.0, 1.0) pts.InsertNextPoint(-1.0, -1.0, 1.0) pts.InsertNextPoint(-1.0, 1.0, 1.0) pts.InsertNextPoint(-3.0, 1.0, 1.0) output.SetPoints(pts) output.Allocate(1,1) ids = vtk.vtkIdList() for i in range(npts): ids.InsertId(i,i) add_scalar(output, 1) add_scalar(output, 2) output.InsertNextCell(vtk.VTK_HEXAHEDRON, ids) 2. Create a second python source that outputs vtkUnstructuredGrid with the following script (notice the change in order when adding the scalars): def add_scalar(ds, val): arr = vtk.vtkDoubleArray() arr.SetName(Scalar+str(val)) arr.SetNumberOfComponents(1) arr.SetNumberOfTuples(8) for i in range(8): arr.SetTuple1(i, float(val)) output.GetPointData().AddArray(arr) output = self.GetOutput() npts = 8 pts = vtk.vtkPoints() pts.InsertNextPoint(-3.0, -1.0, -1.0) pts.InsertNextPoint(-1.0, -1.0, -1.0) pts.InsertNextPoint(-1.0, 1.0, -1.0) pts.InsertNextPoint(-3.0, 1.0, -1.0) pts.InsertNextPoint(-3.0, -1.0, 1.0) pts.InsertNextPoint(-1.0, -1.0, 1.0) pts.InsertNextPoint(-1.0, 1.0, 1.0) pts.InsertNextPoint(-3.0, 1.0, 1.0) output.SetPoints(pts) output.Allocate(1,1) ids = vtk.vtkIdList() for i in range(npts): ids.InsertId(i,i) add_scalar(output, 2) add_scalar(output, 1) output.InsertNextCell(vtk.VTK_HEXAHEDRON, ids) 3. Group the two python sources together 4. Use the Calculator filter to pass through Scalar1 See output below: Regards, Paul The data contained in, or attached to, this e-mail, may contain confidential information. If you have received it in error you should notify the sender immediately by reply e-mail, delete the message from your system and contact +44 (0) 1332 242424 (the Rolls-Royce IT Security Director) if you need assistance. Please do not copy it for any purpose, or disclose its contents to any other person. An e-mail response to this address may be subject to interception or monitoring for operational reasons or for lawful business practices. (c) 2012 Rolls-Royce plc Registered office: 65 Buckingham Gate, London SW1E 6AT Company number: 1003142. Registered in England. image001.png___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
[Paraview] Calculator filter doesn't see a PointData vector
I have a data set that has a 308D vector associated with the PointData: descriptors-SetNumberOfComponents(308); descriptors-SetName(Descriptors); descriptors-SetNumberOfTuples(polyData-GetNumberOfPoints()); ... polyData-GetPointData()-AddArray(descriptors); I want to apply a Calculator filter to filter the points by their descriptor magnitude. In the Calculator filter, I choose Attribute mode: PointData Then if I click the Vectors drop down box, I see two other vectors (colors and coords), but not Descriptors. If I click on the Scalars drop down box, I see 308 entries for a single dimension of the descriptor vector with their index appended after an underscore (ie. Descriptors_0 ...Descriptors_307), but not the whole vector. Is there a way to apply a norm(Descriptors) operation in the Calculator filter with this data set? Thanks, David ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator filter doesn't see a PointData vector
On Mon, Jan 30, 2012 at 1:59 PM, David Doria daviddo...@gmail.com wrote: I have a data set that has a 308D vector associated with the PointData: descriptors-SetNumberOfComponents(308); descriptors-SetName(Descriptors); descriptors-SetNumberOfTuples(polyData-GetNumberOfPoints()); ... polyData-GetPointData()-AddArray(descriptors); I want to apply a Calculator filter to filter the points by their descriptor magnitude. In the Calculator filter, I choose Attribute mode: PointData Then if I click the Vectors drop down box, I see two other vectors (colors and coords), but not Descriptors. If I click on the Scalars drop down box, I see 308 entries for a single dimension of the descriptor vector with their index appended after an underscore (ie. Descriptors_0 ...Descriptors_307), but not the whole vector. Is there a way to apply a norm(Descriptors) operation in the Calculator filter with this data set? I found the Auto Convert Properties which lets me threshold the magnitudes directly in the Threshold filter (this is nice!). However, it still seems like you should be able to use the magnitude in a calculator filter. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] calculator filter - invalid array name
It seems that you're using wrong names. The name of the only data that you can use in the formulas are available under the buttons scalars and vectors in the calculator filter. If you don't see anything, no variables is stored at the points of your dataset. You can see the data stored at the center of cells by into the information tab. 2010/10/26 Jean-Baptiste Leydet jean-baptiste_ley...@whirlpool.com Hey all, I'm experiencing issues with the calculator filter. Basically I'm trying to create local_entropy_generation_rate=F(turbulent_viscosity ,space_derivatives_of_velocity_components) and I keep getting some kind of error in vtkArrayCalculator.cxx, line 305, like Invalid array name: VectorGradient or Invalid array name: TurbVisc. I tried messing around with the cell-to-point or point-to-cell data filters but it did not help. My initial input is one single CFD dataset created by Code_Saturne. I can display the turbulent viscosity and the derivatives of the velocity field as I wish, but I don't manage to use the array data to create my entropy function... Any clue? Thanks! JB ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
[Paraview] calculator filter - invalid array name
Hey all, I'm experiencing issues with the calculator filter. Basically I'm trying to create local_entropy_generation_rate=F(turbulent_viscosity ,space_derivatives_of_velocity_components) and I keep getting some kind of error in vtkArrayCalculator.cxx, line 305, like Invalid array name: VectorGradient or Invalid array name: TurbVisc. I tried messing around with the cell-to-point or point-to-cell data filters but it did not help. My initial input is one single CFD dataset created by Code_Saturne. I can display the turbulent viscosity and the derivatives of the velocity field as I wish, but I don't manage to use the array data to create my entropy function... Any clue? Thanks! JB___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator Filter -- Gradient
I am not sure that I understand. Are Q1 and Q2 vectors? Are you trying to divide the component by component? 2010/9/13 Aurélien Marsan aur.mar...@gmail.com: Hello, In order to calculate a new scalar (here for a multiblockdataset) pdi = self.GetInput() pdo = self.GetOutput() pdo.ShallowCopy(pdi) for block in output[0]: if block.GetNumberOfPoints() != 0: array = block.PointData['Q1'] / block.PointData['Q2'] block.PointData.append(array, 'newQ') For a new vector, I would like someone to explain a simple way to do that. (without many transpose, ravel, etc...) Knowing that it does not work with array = numpy.array([block.PointData['Q1'], block.PointData['Q2'], block.PointData['Q3']]) / block.PointData['Q4'] because of a problem of dimensions. Regards, A.Marsan 2010/9/10 dpar...@chromalloy.com I have a couple of questions about using the Programmable Filter. I have imported Tecplot dataset with the following data: coordsX, coordsY, coordsZ, Q1, Q2, Q3, Q4, Q5. How would I create a new data array that is Q2^2+Q3^2+Q4^2? How would I create a new vector data array (similar to Q2*iHat+Q3*jHat+Q4*kHat in the Calculator Filter)? From: David E DeMarle dave.dema...@kitware.com To: dpar...@chromalloy.com Cc: parav...@paraview.org Date: 09/10/2010 01:24 PM Subject: Re: [Paraview] Calculator Filter -- Gradient Sent by: paraview-boun...@paraview.org On Fri, Sep 10, 2010 at 1:10 PM, dpar...@chromalloy.com wrote: I have two somewhat related questions: 1. Is it possible to calculate a gradient vector using the calculator filter? No. The calculator filter does only element wise (cell by cell or point by point) computations. To compute the gradient you need information from neighboring elements. 2. Is it possible to define a new data array using a Python script without the calculator filter? Currently, I am using several Calculator Filters to calculate CFD flow variables from the conservative variables. I use a Python script to create the Calculator Filters, but I'm wondering if I can avoid the Calculator Filter and directly generate new data arrays for plotting. Not with a python script (under the python shell) since that runs on the client and can't really manipulate the data (which lives on the server) directly. However, the python programmable filter runs on the server, and with that you can create new arrays, and access neighboring elements as well. See http://www.paraview.org/Wiki/Python_Programmable_Filter for examples. David Parker ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator Filter -- Gradient
That's it. In the Calculator, I would set the formula : Q1/Q4*iHat + Q2/Q4*jHat + Q3/Q4*kHat. In the programmable filter, there is some facilities in order to use numpy arrays. But what should be the dimensions of the numpy array if we want to add a vector by doing something like block.PointData.append(array, 'newQ') ? Le 14 septembre 2010 17:15, Berk Geveci berk.gev...@kitware.com a écrit : I am not sure that I understand. Are Q1 and Q2 vectors? Are you trying to divide the component by component? 2010/9/13 Aurélien Marsan aur.mar...@gmail.com: Hello, In order to calculate a new scalar (here for a multiblockdataset) pdi = self.GetInput() pdo = self.GetOutput() pdo.ShallowCopy(pdi) for block in output[0]: if block.GetNumberOfPoints() != 0: array = block.PointData['Q1'] / block.PointData['Q2'] block.PointData.append(array, 'newQ') For a new vector, I would like someone to explain a simple way to do that. (without many transpose, ravel, etc...) Knowing that it does not work with array = numpy.array([block.PointData['Q1'], block.PointData['Q2'], block.PointData['Q3']]) / block.PointData['Q4'] because of a problem of dimensions. Regards, A.Marsan 2010/9/10 dpar...@chromalloy.com I have a couple of questions about using the Programmable Filter. I have imported Tecplot dataset with the following data: coordsX, coordsY, coordsZ, Q1, Q2, Q3, Q4, Q5. How would I create a new data array that is Q2^2+Q3^2+Q4^2? How would I create a new vector data array (similar to Q2*iHat+Q3*jHat+Q4*kHat in the Calculator Filter)? From:David E DeMarle dave.dema...@kitware.com To:dpar...@chromalloy.com Cc:paraview@paraview.org Date:09/10/2010 01:24 PM Subject:Re: [Paraview] Calculator Filter -- Gradient Sent by:paraview-boun...@paraview.org On Fri, Sep 10, 2010 at 1:10 PM, dpar...@chromalloy.com wrote: I have two somewhat related questions: 1. Is it possible to calculate a gradient vector using the calculator filter? No. The calculator filter does only element wise (cell by cell or point by point) computations. To compute the gradient you need information from neighboring elements. 2. Is it possible to define a new data array using a Python script without the calculator filter? Currently, I am using several Calculator Filters to calculate CFD flow variables from the conservative variables. I use a Python script to create the Calculator Filters, but I'm wondering if I can avoid the Calculator Filter and directly generate new data arrays for plotting. Not with a python script (under the python shell) since that runs on the client and can't really manipulate the data (which lives on the server) directly. However, the python programmable filter runs on the server, and with that you can create new arrays, and access neighboring elements as well. See http://www.paraview.org/Wiki/Python_Programmable_Filter for examples. David Parker ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http
Re: [Paraview] Calculator Filter -- Gradient
Hello, In order to calculate a new scalar (here for a multiblockdataset) pdi = self.GetInput() pdo = self.GetOutput() pdo.ShallowCopy(pdi) for block in output[0]: if block.GetNumberOfPoints() != 0: array = block.PointData['Q1'] / block.PointData['Q2'] block.PointData.append(array, 'newQ') For a new vector, I would like someone to explain a simple way to do that. (without many transpose, ravel, etc...) Knowing that it does not work with array = numpy.array([block.PointData['Q1'], block.PointData['Q2'], block.PointData['Q3']]) / block.PointData['Q4'] because of a problem of dimensions. Regards, A.Marsan 2010/9/10 dpar...@chromalloy.com I have a couple of questions about using the Programmable Filter. I have imported Tecplot dataset with the following data: coordsX, coordsY, coordsZ, Q1, Q2, Q3, Q4, Q5. How would I create a new data array that is Q2^2+Q3^2+Q4^2? How would I create a new vector data array (similar to Q2*iHat+Q3*jHat+Q4*kHat in the Calculator Filter)? From:David E DeMarle dave.dema...@kitware.com To:dpar...@chromalloy.com Cc:paraview@paraview.org Date:09/10/2010 01:24 PM Subject:Re: [Paraview] Calculator Filter -- Gradient Sent by:paraview-boun...@paraview.org -- On Fri, Sep 10, 2010 at 1:10 PM, dpar...@chromalloy.com wrote: I have two somewhat related questions: 1. Is it possible to calculate a gradient vector using the calculator filter? No. The calculator filter does only element wise (cell by cell or point by point) computations. To compute the gradient you need information from neighboring elements. 2. Is it possible to define a new data array using a Python script without the calculator filter? Currently, I am using several Calculator Filters to calculate CFD flow variables from the conservative variables. I use a Python script to create the Calculator Filters, but I'm wondering if I can avoid the Calculator Filter and directly generate new data arrays for plotting. Not with a python script (under the python shell) since that runs on the client and can't really manipulate the data (which lives on the server) directly. However, the python programmable filter runs on the server, and with that you can create new arrays, and access neighboring elements as well. See http://www.paraview.org/Wiki/Python_Programmable_Filter for examples. David Parker ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
[Paraview] Calculator Filter -- Gradient
I have two somewhat related questions: 1. Is it possible to calculate a gradient vector using the calculator filter? 2. Is it possible to define a new data array using a Python script without the calculator filter? Currently, I am using several Calculator Filters to calculate CFD flow variables from the conservative variables. I use a Python script to create the Calculator Filters, but I'm wondering if I can avoid the Calculator Filter and directly generate new data arrays for plotting. David Parker___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator Filter -- Gradient
On Fri, Sep 10, 2010 at 1:10 PM, dpar...@chromalloy.com wrote: I have two somewhat related questions: 1. Is it possible to calculate a gradient vector using the calculator filter? No. The calculator filter does only element wise (cell by cell or point by point) computations. To compute the gradient you need information from neighboring elements. 2. Is it possible to define a new data array using a Python script without the calculator filter? Currently, I am using several Calculator Filters to calculate CFD flow variables from the conservative variables. I use a Python script to create the Calculator Filters, but I'm wondering if I can avoid the Calculator Filter and directly generate new data arrays for plotting. Not with a python script (under the python shell) since that runs on the client and can't really manipulate the data (which lives on the server) directly. However, the python programmable filter runs on the server, and with that you can create new arrays, and access neighboring elements as well. See http://www.paraview.org/Wiki/Python_Programmable_Filter for examples. David Parker ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator Filter -- Gradient
I have a couple of questions about using the Programmable Filter. I have imported Tecplot dataset with the following data: coordsX, coordsY, coordsZ, Q1, Q2, Q3, Q4, Q5. How would I create a new data array that is Q2^2+Q3^2+Q4^2? How would I create a new vector data array (similar to Q2*iHat+Q3*jHat+Q4*kHat in the Calculator Filter)? From: David E DeMarle dave.dema...@kitware.com To: dpar...@chromalloy.com Cc: paraview@paraview.org Date: 09/10/2010 01:24 PM Subject:Re: [Paraview] Calculator Filter -- Gradient Sent by:paraview-boun...@paraview.org On Fri, Sep 10, 2010 at 1:10 PM, dpar...@chromalloy.com wrote: I have two somewhat related questions: 1. Is it possible to calculate a gradient vector using the calculator filter? No. The calculator filter does only element wise (cell by cell or point by point) computations. To compute the gradient you need information from neighboring elements. 2. Is it possible to define a new data array using a Python script without the calculator filter? Currently, I am using several Calculator Filters to calculate CFD flow variables from the conservative variables. I use a Python script to create the Calculator Filters, but I'm wondering if I can avoid the Calculator Filter and directly generate new data arrays for plotting. Not with a python script (under the python shell) since that runs on the client and can't really manipulate the data (which lives on the server) directly. However, the python programmable filter runs on the server, and with that you can create new arrays, and access neighboring elements as well. See http://www.paraview.org/Wiki/Python_Programmable_Filter for examples. David Parker ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
[Paraview] Calculator Filter Scripting?
I have several variables that have to be calculated using a series of calculator filters. How can I automate the task of setting up the calculator filters? David Parker Chromalloy - TDAG 730 SE Indian Street, Stuart, Florida, 34977 561-935-9737 (W) 561-307-2939 (M)___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator Filter Scripting?
You can try creating a customizable filter under Tools or recording a python trace and then create a macro from it under Tools as well. Andy On Wed, Sep 8, 2010 at 5:01 PM, dpar...@chromalloy.com wrote: I have several variables that have to be calculated using a series of calculator filters. How can I automate the task of setting up the calculator filters? David Parker Chromalloy - TDAG 730 SE Indian Street, Stuart, Florida, 34977* *561-935-9737 (W) 561-307-2939 (M) ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator Filter Scripting?
Thanks. I really like the Python trace method. I tried the Custom Filter but I didn't like the fact that all the calculations were hidden and I need the ability to modify some constants. The Python script method looks very powerful and the trace functionality makes it very easy to get started. David Parker Chromalloy - TDAG From: Andy Bauer andy.ba...@kitware.com To: dpar...@chromalloy.com Cc: paraview@paraview.org Date: 09/08/2010 05:16 PM Subject:Re: [Paraview] Calculator Filter Scripting? You can try creating a customizable filter under Tools or recording a python trace and then create a macro from it under Tools as well. Andy On Wed, Sep 8, 2010 at 5:01 PM, dpar...@chromalloy.com wrote: I have several variables that have to be calculated using a series of calculator filters. How can I automate the task of setting up the calculator filters? David Parker Chromalloy - TDAG 730 SE Indian Street, Stuart, Florida, 34977 561-935-9737 (W) 561-307-2939 (M) ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator Filter Scripting?
Most people seem to like the python scripting stuff over the custom filter. With macros you can create a GUI button for running the python script as well. The custom filter may be able to expose some of the calculator inputs in the way that you want to in the gui though. I think the custom filter can somehow be saved so that you can share it with other people but I'm not sure how to do that. On Wed, Sep 8, 2010 at 5:41 PM, dpar...@chromalloy.com wrote: Thanks. I really like the Python trace method. I tried the Custom Filter but I didn't like the fact that all the calculations were hidden and I need the ability to modify some constants. The Python script method looks very powerful and the trace functionality makes it very easy to get started. David Parker Chromalloy - TDAG From:Andy Bauer andy.ba...@kitware.com To:dpar...@chromalloy.com Cc:paraview@paraview.org Date:09/08/2010 05:16 PM Subject:Re: [Paraview] Calculator Filter Scripting? -- You can try creating a customizable filter under Tools or recording a python trace and then create a macro from it under Tools as well. Andy On Wed, Sep 8, 2010 at 5:01 PM, *dpar...@chromalloy.com*dpar...@chromalloy.com wrote: I have several variables that have to be calculated using a series of calculator filters. How can I automate the task of setting up the calculator filters? David Parker Chromalloy - TDAG 730 SE Indian Street, Stuart, Florida, 34977 561-935-9737 (W) 561-307-2939 (M) ___ Powered by *www.kitware.com* http://www.kitware.com/ Visit other Kitware open-source projects at * http://www.kitware.com/opensource/opensource.html*http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: * http://paraview.org/Wiki/ParaView* http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe:* **http://www.paraview.org/mailman/listinfo/paraview*http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator Filter
Hi Micheal, You can use the calculator filter to rename variables. Could you also create a bug report at http://www.paraview.org/Bug/main_page.php. On Sun, May 23, 2010 at 1:32 PM, Michael Deveau 0980...@acadiau.ca wrote: Hi, hopefully you can help me with my issue. I'd like to do some calculations involving some vector data, but it keeps throwing an error. (iHat*abs(2DVEL_X))+(jHat*abs( 2DVEL_Y))+(kHat*0) I think what's happening is that ParaView expects an operator between the 2 and the D. However, the 2 is part of the variable name. Is there a way to tell ParaView this, such as an escape character or a way to enclose the variable name? I'd like to not have to rename the variables in the file, because I'm not in charge of the data. If there is a way I can do that in ParaView, that would work as well, I think. I've just started using ParaView, so hopefully I'm not missing something obvious, but thanks in advance for your help. ~ Michael Deveau ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview -- Robert Maynard ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
[Paraview] Calculator performing poorly in ParaView-3-8 branch
I've noticed the calculator has started performing substantially slower in the ParaView-3-8 branch when taking the magnitude of a vector as compared to the Head before the branch. I've attached a graph summarizing the performance degradation. I used the Mandelbrot source and took the magnitude of the coords vector to collect data for the graph. One of my machines averages nearly a 6x slowdown and the other a 4.5x slowdown. The *-march is a Head build from 3/23/2010. 3-8 is the branch as of yesterday afternoon. I (believe) the change that affected the calculator performance happened after the branch as I noticed it after I updated the branch ( I wouldn't bet too much on this though)... I don't know if the Head is affected. Thanks, --John Patchett. calculator.eps Description: PostScript document ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator performing poorly in ParaView-3-8 branch
John, Attached is a patch. Can you verify that it overcomes the performance issues you are seeing? If so, I'll commit it to CVS and get in 3.8 branch as well. Utkarsh On Tue, Apr 13, 2010 at 3:23 PM, John Patchett patchett2...@gmail.com wrote: I've noticed the calculator has started performing substantially slower in the ParaView-3-8 branch when taking the magnitude of a vector as compared to the Head before the branch. I've attached a graph summarizing the performance degradation. I used the Mandelbrot source and took the magnitude of the coords vector to collect data for the graph. One of my machines averages nearly a 6x slowdown and the other a 4.5x slowdown. The *-march is a Head build from 3/23/2010. 3-8 is the branch as of yesterday afternoon. I (believe) the change that affected the calculator performance happened after the branch as I noticed it after I updated the branch ( I wouldn't bet too much on this though)... I don't know if the Head is affected. Thanks, --John Patchett. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview CalculatorPerformanceBug.patch Description: Binary data ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator performing poorly in ParaView-3-8 branch
Initial results show performance is repaired, on par with the March Head build... Thank You very much, --John. On Tue, Apr 13, 2010 at 2:20 PM, Utkarsh Ayachit utkarsh.ayac...@kitware.com wrote: John, Attached is a patch. Can you verify that it overcomes the performance issues you are seeing? If so, I'll commit it to CVS and get in 3.8 branch as well. Utkarsh On Tue, Apr 13, 2010 at 3:23 PM, John Patchett patchett2...@gmail.com wrote: I've noticed the calculator has started performing substantially slower in the ParaView-3-8 branch when taking the magnitude of a vector as compared to the Head before the branch. I've attached a graph summarizing the performance degradation. I used the Mandelbrot source and took the magnitude of the coords vector to collect data for the graph. One of my machines averages nearly a 6x slowdown and the other a 4.5x slowdown. The *-march is a Head build from 3/23/2010. 3-8 is the branch as of yesterday afternoon. I (believe) the change that affected the calculator performance happened after the branch as I noticed it after I updated the branch ( I wouldn't bet too much on this though)... I don't know if the Head is affected. Thanks, --John Patchett. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator performing poorly in ParaView-3-8 branch
Merged onto the branch. Thanks John for reporting this and trying the fix! /cvsroot/ParaView3/ParaView3/Servers/Filters/vtkPVArrayCalculator.cxx,v -- Servers/Filters/vtkPVArrayCalculator.cxx new revision: 1.2.2.2; previous revision: 1.2.2.1 /cvsroot/ParaView3/ParaView3/VTK/Common/vtkFunctionParser.cxx,v -- VTK/Common/vtkFunctionParser.cxx new revision: 1.45.2.2; previous revision: 1.45.2.1 On Tue, Apr 13, 2010 at 5:51 PM, John Patchett patchett2...@gmail.comwrote: Initial results show performance is repaired, on par with the March Head build... Thank You very much, --John. On Tue, Apr 13, 2010 at 2:20 PM, Utkarsh Ayachit utkarsh.ayac...@kitware.com wrote: John, Attached is a patch. Can you verify that it overcomes the performance issues you are seeing? If so, I'll commit it to CVS and get in 3.8 branch as well. Utkarsh On Tue, Apr 13, 2010 at 3:23 PM, John Patchett patchett2...@gmail.com wrote: I've noticed the calculator has started performing substantially slower in the ParaView-3-8 branch when taking the magnitude of a vector as compared to the Head before the branch. I've attached a graph summarizing the performance degradation. I used the Mandelbrot source and took the magnitude of the coords vector to collect data for the graph. One of my machines averages nearly a 6x slowdown and the other a 4.5x slowdown. The *-march is a Head build from 3/23/2010. 3-8 is the branch as of yesterday afternoon. I (believe) the change that affected the calculator performance happened after the branch as I noticed it after I updated the branch ( I wouldn't bet too much on this though)... I don't know if the Head is affected. Thanks, --John Patchett. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator and Python
There's seems to be a bug with Calculator panel, that it does not respect the value set using the python shell. I've added it to the bug tracker: http://paraview.org/Bug/view.php?id=10049 Utkarsh On Fri, Dec 11, 2009 at 11:44 AM, Dominic Jennewein dominic.jennew...@gmail.com wrote: Hello, I'm trying to programm the Calculator with the help of Python to automate the pipeline. Isn't it possible to see the changes in the GUI? I tried it like this: calc=Calculator() calc.Function='Normals.U' #Pointproduct of two Vectors U and Normals calc.ResultArrayName='newResult' calc.ReplaceInvalidResults=0 calc.UpdatePipeline() Show() but in the GUI, it didn't change. In the shell the values are changed. (If I press Apply in the GUI, the values change back (ok, thats not a bug)) I think the Calculator Filter isn't really Applyed after that. I don't get any result if I'm adding a IntegrateVariablesFilter on this. Has somebody the same problems? Thank you, Dominic ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
[Paraview] Calculator and Python
Hello, I'm trying to programm the Calculator with the help of Python to automate the pipeline. Isn't it possible to see the changes in the GUI? I tried it like this: calc=Calculator() calc.Function='Normals.U' #Pointproduct of two Vectors U and Normals calc.ResultArrayName='newResult' calc.ReplaceInvalidResults=0 calc.UpdatePipeline() Show() but in the GUI, it didn't change. In the shell the values are changed. (If I press Apply in the GUI, the values change back (ok, thats not a bug)) I think the Calculator Filter isn't really Applyed after that. I don't get any result if I'm adding a IntegrateVariablesFilter on this. Has somebody the same problems? Thank you, Dominic ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
[Paraview] calculator problem
Hi, I've found a bug with the calculator: create a box apply calculator filter: array name a, value 1 apply calculator again: array name b, value 2 now change the input for the second calculator to the box and you get the following error: vtkArrayCalculator (0x28b3d40): Invalid array name: a Even though it doesn't use that array... Regards, Paul ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] calculator problem
The problem is more general. Create a custom filter using calculator and the data (u,v,w,p) sqrt(u^2+v^2+w^2). Save a custom filter. Now re-open the data but now do not read 'p' array this time (XDMF). Apply custom filter. Calculator will complain p is absent. Dominik Utkarsh Ayachit wrote: Very interesting. I am adding this to the bug tracker. http://paraview.org/Bug/view.php?id=10012 Thanks for reporting. Utkarsh On Tue, Dec 8, 2009 at 9:46 AM, Paul Edwards paul.m.edwa...@gmail.com wrote: Hi, I've found a bug with the calculator: create a box apply calculator filter: array name a, value 1 apply calculator again: array name b, value 2 now change the input for the second calculator to the box and you get the following error: vtkArrayCalculator (0x28b3d40): Invalid array name: a Even though it doesn't use that array... Regards, Paul ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] calculator problem
I am not sure why this is a problem? The custom filter will preserve your equation. So the next time you use the custom filter, it an array required in the calculator is missing, it should indeed complain. Utkarsh On Tue, Dec 8, 2009 at 10:10 AM, Dominik Szczerba domi...@itis.ethz.ch wrote: The problem is more general. Create a custom filter using calculator and the data (u,v,w,p) sqrt(u^2+v^2+w^2). Save a custom filter. Now re-open the data but now do not read 'p' array this time (XDMF). Apply custom filter. Calculator will complain p is absent. Dominik Utkarsh Ayachit wrote: Very interesting. I am adding this to the bug tracker. http://paraview.org/Bug/view.php?id=10012 Thanks for reporting. Utkarsh On Tue, Dec 8, 2009 at 9:46 AM, Paul Edwards paul.m.edwa...@gmail.com wrote: Hi, I've found a bug with the calculator: create a box apply calculator filter: array name a, value 1 apply calculator again: array name b, value 2 now change the input for the second calculator to the box and you get the following error: vtkArrayCalculator (0x28b3d40): Invalid array name: a Even though it doesn't use that array... Regards, Paul ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] calculator problem
Please note that 'p' is not required in the Results formula. Only those variables should be required that are needed to form a valid formula, not those that were originally present. Dominik Utkarsh Ayachit wrote: I am not sure why this is a problem? The custom filter will preserve your equation. So the next time you use the custom filter, it an array required in the calculator is missing, it should indeed complain. Utkarsh On Tue, Dec 8, 2009 at 10:10 AM, Dominik Szczerba domi...@itis.ethz.ch wrote: The problem is more general. Create a custom filter using calculator and the data (u,v,w,p) sqrt(u^2+v^2+w^2). Save a custom filter. Now re-open the data but now do not read 'p' array this time (XDMF). Apply custom filter. Calculator will complain p is absent. Dominik Utkarsh Ayachit wrote: Very interesting. I am adding this to the bug tracker. http://paraview.org/Bug/view.php?id=10012 Thanks for reporting. Utkarsh On Tue, Dec 8, 2009 at 9:46 AM, Paul Edwards paul.m.edwa...@gmail.com wrote: Hi, I've found a bug with the calculator: create a box apply calculator filter: array name a, value 1 apply calculator again: array name b, value 2 now change the input for the second calculator to the box and you get the following error: vtkArrayCalculator (0x28b3d40): Invalid array name: a Even though it doesn't use that array... Regards, Paul ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator question
Isn't this bug number 5626? It should be in version 3.8. Alan -Original Message- From: paraview-boun...@paraview.org [mailto:paraview-boun...@paraview.org] On Behalf Of Berk Geveci Sent: Wednesday, September 02, 2009 12:15 PM To: Paul Edwards Cc: paraview Subject: Re: [Paraview] Calculator question Hmmm. I am afraid not. I think you need to write a custom filter that extracts geometry while assigning a cell variable copied from the field variable. I would also add a feature request for coloring by a field variable. It sounds like a useful feature. -berk On Tue, Sep 1, 2009 at 7:20 AM, Paul Edwardspaul.m.edwa...@gmail.com wrote: Hi, Is it possible to use the calculator to get field data that is associated with the whole dataset? I have a multiblock dataset where each block has a rotational speed associated with it. I would like to highlight by that value. Thanks, Paul ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator question
Hmmm. I am afraid not. I think you need to write a custom filter that extracts geometry while assigning a cell variable copied from the field variable. I would also add a feature request for coloring by a field variable. It sounds like a useful feature. -berk On Tue, Sep 1, 2009 at 7:20 AM, Paul Edwardspaul.m.edwa...@gmail.com wrote: Hi, Is it possible to use the calculator to get field data that is associated with the whole dataset? I have a multiblock dataset where each block has a rotational speed associated with it. I would like to highlight by that value. Thanks, Paul ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
[Paraview] Calculator question
Hi, Is it possible to use the calculator to get field data that is associated with the whole dataset? I have a multiblock dataset where each block has a rotational speed associated with it. I would like to highlight by that value. Thanks, Paul ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
[Paraview] Calculator filter
Dear all, after some time with paraview I am quite impressed about its features. However one thing I am not very happy with remains: I do an ipmort of a dataset from CFD and afterwards create some slices or clips... Now I realize there was a variable missing. I calculate it using the calculator but afterwards the scalar is not available on all allredy created parts. This means I have to re-create all slices,... using the calculator filter as an input. I do not think this is very effective. Are there reasons for this? Any workarounds? Plans to change this? Regards BastiL ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator filter
Hi, Sorry if I am misunderstanding your question... but perhaps the solution is to use paraviews Change input dialog. You can right click an object in the pipeline browser and select Change input... This way you can use the calculator as an input to your pre-existing pipeline. On Thu, Aug 13, 2009 at 3:01 PM, bastil2...@yahoo.debastil2...@yahoo.de wrote: Dear all, after some time with paraview I am quite impressed about its features. However one thing I am not very happy with remains: I do an ipmort of a dataset from CFD and afterwards create some slices or clips... Now I realize there was a variable missing. I calculate it using the calculator but afterwards the scalar is not available on all allredy created parts. This means I have to re-create all slices,... using the calculator filter as an input. I do not think this is very effective. Are there reasons for this? Any workarounds? Plans to change this? Regards BastiL ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator and Time history
Unfortunately, doing what you want without writing a new filter is not possible. I suggest modifying the temporal statistics filter to add what you need. I'd like to see the next generation array calculator supporting this sort of thing much better but that won't make it into 3.6. -berk On Tue, Mar 17, 2009 at 11:05 AM, David Fuentes fuente...@gmail.com wrote: Hello, Is there a way to use the Calculator on a variable at two different time instances? I have a time series of data stored in an exodus file. I'm trying to accumulate the sum of a variable over time and need to add the previous value of a variable to the variable's current value. Is there a way to use the Temporal Cache, Temporal Shift Scale, or a similar filter to provide the calculator access to a variable at a previous time instance? Thank you, David Fuentes ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator and vector products
Am I correct that the cross() operation is still broken in ParaView 3.4.0 related to the bug posted: http://www.gccxml.org/Bug/view.php?id=2903 ? randall.hand once suggested the addition of the support for the vector cross product operator. It was added some time later. Then some new operators such as boolean ones were added and during this process unfortunately the vector cross product operator was carelessly disabled due to the incorrect check on the number of the input parameters. The correct format of a vector cross product operation is: vector_C = cross(vector_A, vector_B) INSTEAD OF cross(vector_A, vector_B, vector_C) In other words, there should be TWO parameters and ONE comma. However, the bug in vtkFunctionParser:: CheckSyntax() occurred within the following segment (between line 1444 and line 1453): if ((functionNumber == VTK_PARSER_MIN) || (functionNumber == VTK_PARSER_MAX)) { expectCommaOnParenthesisCount[parenthesisCount+1] = 1; } if ((functionNumber == VTK_PARSER_IF) || (functionNumber == VTK_PARSER_CROSS)) { expectTwoCommasOnParenthesisCount[parenthesisCount+1] = 1; } Now this segment has been replaced with if ((functionNumber == VTK_PARSER_MIN) || (functionNumber == VTK_PARSER_MAX) || (functionNumber == VTK_PARSER_CROSS)) { expectCommaOnParenthesisCount[parenthesisCount+1] = 1; } if (functionNumber == VTK_PARSER_IF) { expectTwoCommasOnParenthesisCount[parenthesisCount+1] = 1; } Now the code performs correct check on the input format in terms of vector cross product and the suggested functionality is supported. Thanks for suggesting the enhancement. new revision: 1.43; previous revision: 1.42 It says it is fixed but it seems to exhibit the behavior described it the history of this bug (in 3.4.0). Namely if you give it two arguments it complains about needing three? Is this fixed in the cvs version? Thanks Dan On Mar 4, 2009, at 4:23 PM, Jacques Papper wrote: Thanks for the answer. I guess I missed the cross button ! (The whole point was that I didn't want to write out the cross product anymore !! :) 2009/3/4 Scott, W Alan wasc...@sandia.gov Silly me, of course. Math class was just too many years ago. alan -Original Message- From: Pebay, Philippe P Sent: Wednesday, March 04, 2009 2:59 PM To: Scott, W Alan; 'Jacques Papper'; 'paraview' Subject: RE: [Paraview] Calculator and vector products Hello The + sighs between cross terms should be replaced by - signs as follows: i ( a_2b_3 - a_3b_2 ) + j ( a_3b_1 - a_1b_3 ) + k (a_1b_2 - a_2b_1 ) P. -- Philippe Pébay Sandia National Laboratories From: paraview-boun...@paraview.org [paraview-boun...@paraview.org] On Behalf Of Scott, W Alan [wasc...@sandia.gov] Sent: Wednesday, March 04, 2009 1:30 PM To: 'Jacques Papper'; 'paraview' Subject: Re: [Paraview] Calculator and vector products I don't know if this is correct, but I took a quick attempt at making a cross product. I am using the dataset can.exo. In the calculator, I am trying to create the cross of the DISP and ACCL vectors. Here is the formula: iHat*(DISPL_Y*VEL_Z+DISPL_Z*VEL_Y)+jHat*(DISPL_X*VEL_Z+DISPL_Z*VEL_X) +kHat*(DISPL_X*VEL_Y+DISPL_Y*VEL_X) Alan -Original Message- From: paraview-boun...@paraview.org [mailto:paraview-boun...@paraview.org ] On Behalf Of Jacques Papper Sent: Wednesday, March 04, 2009 12:27 PM To: 'paraview' Subject: [Paraview] Calculator and vector products I am trying to do a vector product with the Calculator, but this seems to fail Error deciding between ambiguous operators. Is there a way to do vector products ? Or is this something that needs to be implemented ? Jacques PAPPER Applied CFD Team Leader Tel: +44 (0) 1234 324677 --- This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender. Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons. Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245 ___ Powered by www.kitware.com
Re: [Paraview] Calculator and vector products
Yes, that was fixed after 3.4.0 was released. It works in CVS head. On Thu, Mar 5, 2009 at 11:18 AM, Dan Goldstein d...@cora.nwra.com wrote: Am I correct that the cross() operation is still broken in ParaView 3.4.0 related to the bug posted: http://www.gccxml.org/Bug/view.php?id=2903 ? randall.hand once suggested the addition of the support for the vector cross product operator. It was added some time later. Then some new operators such as boolean ones were added and during this process unfortunately the vector cross product operator was carelessly disabled due to the incorrect check on the number of the input parameters. The correct format of a vector cross product operation is: vector_C = cross(vector_A, vector_B) INSTEAD OF cross(vector_A, vector_B, vector_C) In other words, there should be TWO parameters and ONE comma. However, the bug in vtkFunctionParser:: CheckSyntax() occurred within the following segment (between line 1444 and line 1453): if ((functionNumber == VTK_PARSER_MIN) || (functionNumber == VTK_PARSER_MAX)) { expectCommaOnParenthesisCount[parenthesisCount+1] = 1; } if ((functionNumber == VTK_PARSER_IF) || (functionNumber == VTK_PARSER_CROSS)) { expectTwoCommasOnParenthesisCount[parenthesisCount+1] = 1; } Now this segment has been replaced with if ((functionNumber == VTK_PARSER_MIN) || (functionNumber == VTK_PARSER_MAX) || (functionNumber == VTK_PARSER_CROSS)) { expectCommaOnParenthesisCount[parenthesisCount+1] = 1; } if (functionNumber == VTK_PARSER_IF) { expectTwoCommasOnParenthesisCount[parenthesisCount+1] = 1; } Now the code performs correct check on the input format in terms of vector cross product and the suggested functionality is supported. Thanks for suggesting the enhancement. new revision: 1.43; previous revision: 1.42 It says it is fixed but it seems to exhibit the behavior described it the history of this bug (in 3.4.0). Namely if you give it two arguments it complains about needing three? Is this fixed in the cvs version? Thanks Dan On Mar 4, 2009, at 4:23 PM, Jacques Papper wrote: Thanks for the answer. I guess I missed the cross button ! (The whole point was that I didn't want to write out the cross product anymore !! :) 2009/3/4 Scott, W Alan wasc...@sandia.gov Silly me, of course. Math class was just too many years ago. alan -Original Message- From: Pebay, Philippe P Sent: Wednesday, March 04, 2009 2:59 PM To: Scott, W Alan; 'Jacques Papper'; 'paraview' Subject: RE: [Paraview] Calculator and vector products Hello The + sighs between cross terms should be replaced by - signs as follows: i ( a_2b_3 - a_3b_2 ) + j ( a_3b_1 - a_1b_3 ) + k (a_1b_2 - a_2b_1 ) P. -- Philippe Pébay Sandia National Laboratories From: paraview-boun...@paraview.org [paraview-boun...@paraview.org] On Behalf Of Scott, W Alan [wasc...@sandia.gov] Sent: Wednesday, March 04, 2009 1:30 PM To: 'Jacques Papper'; 'paraview' Subject: Re: [Paraview] Calculator and vector products I don't know if this is correct, but I took a quick attempt at making a cross product. I am using the dataset can.exo. In the calculator, I am trying to create the cross of the DISP and ACCL vectors. Here is the formula: iHat*(DISPL_Y*VEL_Z+DISPL_Z*VEL_Y)+jHat*(DISPL_X*VEL_Z+DISPL_Z*VEL_X)+kHat*(DISPL_X*VEL_Y+DISPL_Y*VEL_X) Alan -Original Message- From: paraview-boun...@paraview.org [mailto:paraview-boun...@paraview.org] On Behalf Of Jacques Papper Sent: Wednesday, March 04, 2009 12:27 PM To: 'paraview' Subject: [Paraview] Calculator and vector products I am trying to do a vector product with the Calculator, but this seems to fail Error deciding between ambiguous operators. Is there a way to do vector products ? Or is this something that needs to be implemented ? Jacques PAPPER Applied CFD Team Leader Tel: +44 (0) 1234 324677 --- This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender. Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons. Aircraft Research Association Ltd. Registered in England
[Paraview] Calculator and vector products
I am trying to do a vector product with the Calculator, but this seems to fail Error deciding between ambiguous operators. Is there a way to do vector products ? Or is this something that needs to be implemented ? Jacques PAPPER Applied CFD Team Leader Tel: +44 (0) 1234 324677 --- This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender. Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons. Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245 ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator and vector products
I don't know if this is correct, but I took a quick attempt at making a cross product. I am using the dataset can.exo. In the calculator, I am trying to create the cross of the DISP and ACCL vectors. Here is the formula: iHat*(DISPL_Y*VEL_Z+DISPL_Z*VEL_Y)+jHat*(DISPL_X*VEL_Z+DISPL_Z*VEL_X)+kHat*(DISPL_X*VEL_Y+DISPL_Y*VEL_X) Alan -Original Message- From: paraview-boun...@paraview.org [mailto:paraview-boun...@paraview.org] On Behalf Of Jacques Papper Sent: Wednesday, March 04, 2009 12:27 PM To: 'paraview' Subject: [Paraview] Calculator and vector products I am trying to do a vector product with the Calculator, but this seems to fail Error deciding between ambiguous operators. Is there a way to do vector products ? Or is this something that needs to be implemented ? Jacques PAPPER Applied CFD Team Leader Tel: +44 (0) 1234 324677 --- This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender. Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons. Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245 ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator and vector products
Why isn't it one of the buttons? Or am I being dense? Alan From: Moreland, Kenneth Sent: Wednesday, March 04, 2009 2:36 PM To: Scott, W Alan; Jacques Papper; paraview Subject: Re: [Paraview] Calculator and vector products The calculator supports a cross function: cross(DISPL, VEL) -Ken On 3/4/09 2:30 PM, Scott, W Alan wasc...@sandia.gov wrote: I don't know if this is correct, but I took a quick attempt at making a cross product. I am using the dataset can.exo. In the calculator, I am trying to create the cross of the DISP and ACCL vectors. Here is the formula: iHat*(DISPL_Y*VEL_Z+DISPL_Z*VEL_Y)+jHat*(DISPL_X*VEL_Z+DISPL_Z*VEL_X)+kHat*(DISPL_X*VEL_Y+DISPL_Y*VEL_X) Alan -Original Message- From: paraview-boun...@paraview.org [mailto:paraview-boun...@paraview.org] On Behalf Of Jacques Papper Sent: Wednesday, March 04, 2009 12:27 PM To: 'paraview' Subject: [Paraview] Calculator and vector products I am trying to do a vector product with the Calculator, but this seems to fail Error deciding between ambiguous operators. Is there a way to do vector products ? Or is this something that needs to be implemented ? Jacques PAPPER Applied CFD Team Leader Tel: +44 (0) 1234 324677 --- This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender. Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons. Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245 ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview Kenneth Moreland *** Sandia National Laboratories *** *** *** *** email: kmo...@sandia.gov ** *** ** phone: (505) 844-8919 *** web: http://www.cs.unm.edu/~kmorel ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator and vector products
I don't know. Perhaps it should be. -Ken On 3/4/09 2:38 PM, Scott, W Alan wasc...@sandia.gov wrote: Why isn't it one of the buttons? Or am I being dense? Alan From: Moreland, Kenneth Sent: Wednesday, March 04, 2009 2:36 PM To: Scott, W Alan; Jacques Papper; paraview Subject: Re: [Paraview] Calculator and vector products The calculator supports a cross function: cross(DISPL, VEL) -Ken On 3/4/09 2:30 PM, Scott, W Alan wasc...@sandia.gov wrote: I don't know if this is correct, but I took a quick attempt at making a cross product. I am using the dataset can.exo. In the calculator, I am trying to create the cross of the DISP and ACCL vectors. Here is the formula: iHat*(DISPL_Y*VEL_Z+DISPL_Z*VEL_Y)+jHat*(DISPL_X*VEL_Z+DISPL_Z*VEL_X)+kHat*(DISPL_X*VEL_Y+DISPL_Y*VEL_X) Alan -Original Message- From: paraview-boun...@paraview.org [mailto:paraview-boun...@paraview.org] On Behalf Of Jacques Papper Sent: Wednesday, March 04, 2009 12:27 PM To: 'paraview' Subject: [Paraview] Calculator and vector products I am trying to do a vector product with the Calculator, but this seems to fail Error deciding between ambiguous operators. Is there a way to do vector products ? Or is this something that needs to be implemented ? Jacques PAPPER Applied CFD Team Leader Tel: +44 (0) 1234 324677 --- This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender. Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons. Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245 ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview Kenneth Moreland *** Sandia National Laboratories *** *** *** *** email: kmo...@sandia.gov ** *** ** phone: (505) 844-8919 *** web: http://www.cs.unm.edu/~kmorel Kenneth Moreland *** Sandia National Laboratories *** *** *** *** email: kmo...@sandia.gov ** *** ** phone: (505) 844-8919 *** web: http://www.cs.unm.edu/~kmorel ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator and vector products
Silly me, of course. Math class was just too many years ago. alan -Original Message- From: Pebay, Philippe P Sent: Wednesday, March 04, 2009 2:59 PM To: Scott, W Alan; 'Jacques Papper'; 'paraview' Subject: RE: [Paraview] Calculator and vector products Hello The + sighs between cross terms should be replaced by - signs as follows: i ( a_2b_3 - a_3b_2 ) + j ( a_3b_1 - a_1b_3 ) + k (a_1b_2 - a_2b_1 ) P. -- Philippe Pébay Sandia National Laboratories From: paraview-boun...@paraview.org [paraview-boun...@paraview.org] On Behalf Of Scott, W Alan [wasc...@sandia.gov] Sent: Wednesday, March 04, 2009 1:30 PM To: 'Jacques Papper'; 'paraview' Subject: Re: [Paraview] Calculator and vector products I don't know if this is correct, but I took a quick attempt at making a cross product. I am using the dataset can.exo. In the calculator, I am trying to create the cross of the DISP and ACCL vectors. Here is the formula: iHat*(DISPL_Y*VEL_Z+DISPL_Z*VEL_Y)+jHat*(DISPL_X*VEL_Z+DISPL_Z*VEL_X)+kHat*(DISPL_X*VEL_Y+DISPL_Y*VEL_X) Alan -Original Message- From: paraview-boun...@paraview.org [mailto:paraview-boun...@paraview.org] On Behalf Of Jacques Papper Sent: Wednesday, March 04, 2009 12:27 PM To: 'paraview' Subject: [Paraview] Calculator and vector products I am trying to do a vector product with the Calculator, but this seems to fail Error deciding between ambiguous operators. Is there a way to do vector products ? Or is this something that needs to be implemented ? Jacques PAPPER Applied CFD Team Leader Tel: +44 (0) 1234 324677 --- This email contains information that is private and confidential and is intended only for the addressee. If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender. Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons. Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245 ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] calculator filter with pvpython
If you mean the new python based calculator in the development version, perhaps Berk can chime in. Otherwise, if you meant, how do I use the calculator filter from within python, perhaps this email will be of use: http://paraview.markmail.org/search/?q=calculator%20filter%20python#query:calculator%20filter%20python+page:1+mid:uvj55aql4e5rrh7a+state:results On Tue, Feb 24, 2009 at 5:20 AM, Michael Buchmayr michi.buchm...@hotmail.fr wrote: Hallo, I'm having a hard time writing a Python script using the Calculator filter. Does anybody of you have a working example that he/she can send me? Thanks, Michael Votre correspondant a choisi Hotmail et profite d'un stockage quasiment illimité. Créez un compte Hotmail gratuitement ! ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview -- David E DeMarle Kitware, Inc. RD Engineer 28 Corporate Drive Clifton Park, NY 12065-8662 Phone: 518-371-3971 x109 ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] calculator filter via python
Alas there's no way for the python programmable filter to ask for a particular timestep currently. This should be remedied soon. Feel free to add a bug report at: www.paraview.org/Bug Thanks Utkarsh On Fri, Jan 2, 2009 at 4:00 PM, Peter Brady petertbr...@gmail.com wrote: I don't think I can do what I originally intended via the calculator filter due to the need to access the data in center[i][k] which is a data array in my script but the function parser won't know what to do with it. I was able to make some good progress using the programmable filter and the information on the wiki. My main question at this point is how do I access the time data from the programmable filter? I am using multiblockdatasets. Thanks, Peter. On Fri, Jan 2, 2009 at 11:04 AM, Peter Brady petertbr...@gmail.com wrote: Hello all, I am trying to do calculations based on coordinate locations. In the GUI I can simply select 'coordsX', 'coordsY', 'coordsZ'. From python things seem to be more complicated. I've tried the snippet below with several variations and keep getting errors calc_radius = servermanager.filters.Calculator(Input=g_cont) calc_radius.AddCoordinateScalarVariable('coordsX', 0) calc_radius.Function = 'sqrt((coordsX-center[i][0])^2+(coordsY-center[i][1])^2+(coordsZ-center[i][2])^2)' calc_radius.UpdatePipeline() I've also tried calc_radius.AddCoordinateScalarVariable('coordsX') but I get the error: calc_radius.AddCoordinateScalarVariable('coordsX') TypeError: __call__() takes exactly 1 argument (2 given) I've also tried using the scalar array name ('G' in this case) in place of coordsX but have met the same error message. What is the correct way of doing this? Also, I've tried using the PV-Dump.py script that was suggested to me previously but am met with the error: Traceback (most recent call last): File console, line 1, in module File string, line 33, in allToPython File string, line 48, in proxiesToPython File string, line 149, in __orderProxies AttributeError: 'NoneType' object has no attribute 'groups' The offending lines are: def __orderProxies( proxies ): Returns an array, where each entry contains the names of the proxies that depend on the previous array entry. patternName = re.compile(' *XMLName: *(.*)') patternValues = re.compile(' *Values: *(.*)') patternHex= re.compile('^0x[0-9a-f]+$') pmanager = servermanager.ProxyManager() dependencies = {}# COLLECT DEPS for group in proxies: # For each proxy for name in proxies[group]: dependencies[group+':'+name] = {} # Init its depend. proxy = proxies[group][name] for prop in proxy: 148 match = patternName.search( str(prop) ) 149 propName = match.groups()[0] I was hoping that this script would be very helpful. Anyone else have similar problems? Thanks in advance for your help, Peter. ___ 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] calculator filter via python
I don't think I can do what I originally intended via the calculator filter due to the need to access the data in center[i][k] which is a data array in my script but the function parser won't know what to do with it. I was able to make some good progress using the programmable filter and the information on the wiki. My main question at this point is how do I access the time data from the programmable filter? I am using multiblockdatasets. Thanks, Peter. On Fri, Jan 2, 2009 at 11:04 AM, Peter Brady petertbr...@gmail.com wrote: Hello all, I am trying to do calculations based on coordinate locations. In the GUI I can simply select 'coordsX', 'coordsY', 'coordsZ'. From python things seem to be more complicated. I've tried the snippet below with several variations and keep getting errors calc_radius = servermanager.filters.Calculator(Input=g_cont) calc_radius.AddCoordinateScalarVariable('coordsX', 0) calc_radius.Function = 'sqrt((coordsX-center[i][0])^2+(coordsY-center[i][1])^2+(coordsZ-center[i][2])^2)' calc_radius.UpdatePipeline() I've also tried calc_radius.AddCoordinateScalarVariable('coordsX') but I get the error: calc_radius.AddCoordinateScalarVariable('coordsX') TypeError: __call__() takes exactly 1 argument (2 given) I've also tried using the scalar array name ('G' in this case) in place of coordsX but have met the same error message. What is the correct way of doing this? Also, I've tried using the PV-Dump.py script that was suggested to me previously but am met with the error: Traceback (most recent call last): File console, line 1, in module File string, line 33, in allToPython File string, line 48, in proxiesToPython File string, line 149, in __orderProxies AttributeError: 'NoneType' object has no attribute 'groups' The offending lines are: def __orderProxies( proxies ): Returns an array, where each entry contains the names of the proxies that depend on the previous array entry. patternName = re.compile(' *XMLName: *(.*)') patternValues = re.compile(' *Values: *(.*)') patternHex= re.compile('^0x[0-9a-f]+$') pmanager = servermanager.ProxyManager() dependencies = {}# COLLECT DEPS for group in proxies: # For each proxy for name in proxies[group]: dependencies[group+':'+name] = {} # Init its depend. proxy = proxies[group][name] for prop in proxy: 148 match = patternName.search( str(prop) ) 149 propName = match.groups()[0] I was hoping that this script would be very helpful. Anyone else have similar problems? Thanks in advance for your help, Peter. ___ ParaView mailing list ParaView@paraview.org http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator speed
(assuming you are using cvs paraview) In the programmable filter, you can do something like: from paraview import numpy_support input = self.GetInputDataObject(0, 0) ar = numpy_support.vtk_to_numpy(input.GetPointData().GetArray(pressure)) ar2 = ar*2 newArray = nump7_support.numpy_to_vtk(ar2, True) newArray.SetName(pressure times 2) output = self.GetOutputDataObject(0) output.GetPointData().AddArray(newArray) In the future, this should look like: output.point_data['pressure times 2'] = input.point_data['pressure'] * 2 -berk On Tue, Sep 9, 2008 at 2:40 PM, Tobias Brandvik [EMAIL PROTECTED] wrote: Thanks for the replies. I've got some experience with Python/NumPy so any pointers on that approach would be appreciated. Tobias -- Tobias Brandvik PhD Student Whittle Laboratory 1 JJ Thomson Avenue Cambridge CB3 0DY, UK On Tue, Sep 9, 2008 at 2:51 PM, Berk Geveci [EMAIL PROTECTED] wrote: The array calculator does not use Python but it is slow nevertheless. Actually, this could be done much faster using Python/NumPy. This is currently possible but hard to do (complicated API). We are working on an easier-to-use interface. If you are adventurous, I can give you some pointers. Otherwise, C++ custom filter is the way to go. -berk On Tue, Sep 9, 2008 at 8:58 AM, Tobias Brandvik [EMAIL PROTECTED] wrote: Hi, I've written a CFD solver that uses Paraview in parallel mode with hdf5/xdmf. Currently, the application writes out the primary variables and lets the user calculate any desired secondary variables using the calculator. However, this procedure is very slow -- it seems to be an order of magnitude faster to calculate the data in the solver itself and have Paraview read it from disk. I suspect this is because the calculator expressions get translated to python code, but I might also be doing something wrong. Am I correct in thinking that the easiest way to fix this would be to write a custom filter in C++? Cheers, Tobias -- Tobias Brandvik PhD Student Whittle Laboratory 1 JJ Thomson Avenue Cambridge CB3 0DY, UK ___ 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] Calculator speed
Dig it. Is numpy_support documented anywhere? Thanks, Greg On 9/11/08 10:31 AM, Berk Geveci [EMAIL PROTECTED] wrote: (assuming you are using cvs paraview) In the programmable filter, you can do something like: from paraview import numpy_support input = self.GetInputDataObject(0, 0) ar = numpy_support.vtk_to_numpy(input.GetPointData().GetArray(pressure)) ar2 = ar*2 newArray = nump7_support.numpy_to_vtk(ar2, True) newArray.SetName(pressure times 2) output = self.GetOutputDataObject(0) output.GetPointData().AddArray(newArray) In the future, this should look like: output.point_data['pressure times 2'] = input.point_data['pressure'] * 2 -berk On Tue, Sep 9, 2008 at 2:40 PM, Tobias Brandvik [EMAIL PROTECTED] wrote: Thanks for the replies. I've got some experience with Python/NumPy so any pointers on that approach would be appreciated. Tobias -- Tobias Brandvik PhD Student Whittle Laboratory 1 JJ Thomson Avenue Cambridge CB3 0DY, UK On Tue, Sep 9, 2008 at 2:51 PM, Berk Geveci [EMAIL PROTECTED] wrote: The array calculator does not use Python but it is slow nevertheless. Actually, this could be done much faster using Python/NumPy. This is currently possible but hard to do (complicated API). We are working on an easier-to-use interface. If you are adventurous, I can give you some pointers. Otherwise, C++ custom filter is the way to go. -berk On Tue, Sep 9, 2008 at 8:58 AM, Tobias Brandvik [EMAIL PROTECTED] wrote: Hi, I've written a CFD solver that uses Paraview in parallel mode with hdf5/xdmf. Currently, the application writes out the primary variables and lets the user calculate any desired secondary variables using the calculator. However, this procedure is very slow -- it seems to be an order of magnitude faster to calculate the data in the solver itself and have Paraview read it from disk. I suspect this is because the calculator expressions get translated to python code, but I might also be doing something wrong. Am I correct in thinking that the easiest way to fix this would be to write a custom filter in C++? Cheers, Tobias -- Tobias Brandvik PhD Student Whittle Laboratory 1 JJ Thomson Avenue Cambridge CB3 0DY, UK ___ 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 mailing list ParaView@paraview.org http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator speed
It will be once we update the wiki pages :-) On Thu, Sep 11, 2008 at 1:18 PM, Weirs, V Gregory [EMAIL PROTECTED] wrote: Dig it. Is numpy_support documented anywhere? Thanks, Greg On 9/11/08 10:31 AM, Berk Geveci [EMAIL PROTECTED] wrote: (assuming you are using cvs paraview) In the programmable filter, you can do something like: from paraview import numpy_support input = self.GetInputDataObject(0, 0) ar = numpy_support.vtk_to_numpy(input.GetPointData().GetArray(pressure)) ar2 = ar*2 newArray = nump7_support.numpy_to_vtk(ar2, True) newArray.SetName(pressure times 2) output = self.GetOutputDataObject(0) output.GetPointData().AddArray(newArray) In the future, this should look like: output.point_data['pressure times 2'] = input.point_data['pressure'] * 2 -berk On Tue, Sep 9, 2008 at 2:40 PM, Tobias Brandvik [EMAIL PROTECTED] wrote: Thanks for the replies. I've got some experience with Python/NumPy so any pointers on that approach would be appreciated. Tobias -- Tobias Brandvik PhD Student Whittle Laboratory 1 JJ Thomson Avenue Cambridge CB3 0DY, UK On Tue, Sep 9, 2008 at 2:51 PM, Berk Geveci [EMAIL PROTECTED] wrote: The array calculator does not use Python but it is slow nevertheless. Actually, this could be done much faster using Python/NumPy. This is currently possible but hard to do (complicated API). We are working on an easier-to-use interface. If you are adventurous, I can give you some pointers. Otherwise, C++ custom filter is the way to go. -berk On Tue, Sep 9, 2008 at 8:58 AM, Tobias Brandvik [EMAIL PROTECTED] wrote: Hi, I've written a CFD solver that uses Paraview in parallel mode with hdf5/xdmf. Currently, the application writes out the primary variables and lets the user calculate any desired secondary variables using the calculator. However, this procedure is very slow -- it seems to be an order of magnitude faster to calculate the data in the solver itself and have Paraview read it from disk. I suspect this is because the calculator expressions get translated to python code, but I might also be doing something wrong. Am I correct in thinking that the easiest way to fix this would be to write a custom filter in C++? Cheers, Tobias -- Tobias Brandvik PhD Student Whittle Laboratory 1 JJ Thomson Avenue Cambridge CB3 0DY, UK ___ 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 mailing list ParaView@paraview.org http://www.paraview.org/mailman/listinfo/paraview
Re: [Paraview] Calculator speed
Or in the meantime... from paraview import numpy_support help(numpy_support) Help on module paraview.numpy_support in paraview: NAME paraview.numpy_support FILE /source/paraview/streaming-release/build/Utilities/VTKPythonWrapping/paraview/numpy_support.py DESCRIPTION This module adds support to easily import and export NumPy (http://numpy.scipy.org) arrays into/out of VTK arrays. The code is loosely based on TVTK (https://svn.enthought.com/enthought/wiki/TVTK). This code depends on an addition to the VTK data arrays made by Berk Geveci to make it support Python's buffer protocol (on Feb. 15, 2008). The main functionality of this module is provided by the two functions: numpy_to_vtk, vtk_to_numpy. Caveats: - Bit arrays in general do not have a numpy equivalent and are not supported. Char arrays are also not easy to handle and might not work as you expect. Patches welcome. - You need to make sure you hold a reference to a Numpy array you want to import into VTK. If not you'll get a segfault (in the best case). The same holds in reverse when you convert a VTK array to a numpy array -- don't delete the VTK array. Created by Prabhu Ramachandran in Feb. 2008. FUNCTIONS create_vtk_array(vtk_arr_type) Internal function used to create a VTK data array from another VTK array given the VTK array type. get_numpy_array_type(vtk_array_type) Returns a numpy array typecode given a VTK array type. get_vtk_array_type(numpy_array_type) Returns a VTK typecode given a numpy array. get_vtk_to_numpy_typemap() Returns the VTK array type to numpy array type mapping. numpy_to_vtk(num_array, deep=0) Converts a contiguous real numpy Array to a VTK array object. This function only works for real arrays that are contiguous. Complex arrays are NOT handled. It also works for multi-component arrays. However, only 1, and 2 dimensional arrays are supported. This function is very efficient, so large arrays should not be a problem. If the second argument is set to 1, the array is deep-copied from from numpy. This is not as efficient as the default behavior (shallow copy) and uses more memory but detaches the two arrays such that the numpy array can be released. WARNING: You must maintain a reference to the passed numpy array, if the numpy data is gc'd and VTK will point to garbage which will in the best case give you a segfault. Parameters -- - num_array : a contiguous 1D or 2D, real numpy array. vtk_to_numpy(vtk_array) Converts a VTK data array to a numpy array. Given a subclass of vtkDataArray, this function returns an appropriate numpy array containing the same data -- it actually points to the same data. WARNING: This does not work for bit arrays. Parameters -- - vtk_array : `vtkDataArray` The VTK data array to be converted. DATA VTK_ID_TYPE_SIZE = 8 VTK_LONG_TYPE_SIZE = 8 On Thu, Sep 11, 2008 at 2:09 PM, Berk Geveci [EMAIL PROTECTED] wrote: It will be once we update the wiki pages :-) On Thu, Sep 11, 2008 at 1:18 PM, Weirs, V Gregory [EMAIL PROTECTED] wrote: Dig it. Is numpy_support documented anywhere? Thanks, Greg On 9/11/08 10:31 AM, Berk Geveci [EMAIL PROTECTED] wrote: (assuming you are using cvs paraview) In the programmable filter, you can do something like: from paraview import numpy_support input = self.GetInputDataObject(0, 0) ar = numpy_support.vtk_to_numpy(input.GetPointData().GetArray(pressure)) ar2 = ar*2 newArray = nump7_support.numpy_to_vtk(ar2, True) newArray.SetName(pressure times 2) output = self.GetOutputDataObject(0) output.GetPointData().AddArray(newArray) In the future, this should look like: output.point_data['pressure times 2'] = input.point_data['pressure'] * 2 -berk On Tue, Sep 9, 2008 at 2:40 PM, Tobias Brandvik [EMAIL PROTECTED] wrote: Thanks for the replies. I've got some experience with Python/NumPy so any pointers on that approach would be appreciated. Tobias -- Tobias Brandvik PhD Student Whittle Laboratory 1 JJ Thomson Avenue Cambridge CB3 0DY, UK On Tue, Sep 9, 2008 at 2:51 PM, Berk Geveci [EMAIL PROTECTED] wrote: The array calculator does not use Python but it is slow nevertheless. Actually, this could be done much faster using Python/NumPy. This is currently possible but hard to do (complicated API). We are working on an easier-to-use interface. If you are adventurous, I can give you some pointers. Otherwise, C++ custom filter is the way to go. -berk On Tue, Sep 9, 2008 at 8:58 AM, Tobias Brandvik [EMAIL PROTECTED] wrote: Hi, I've written a CFD solver that uses Paraview in parallel mode with
Re: [Paraview] Calculator speed
Tobias, I would agree that the parsing of calculator expressions is probably slowing down the calculations. I also agree that a custom filter would be the easiest way to fix the problem (and would probably simplify things for users). -Ken On 9/9/08 6:58 AM, Tobias Brandvik [EMAIL PROTECTED] wrote: Hi, I've written a CFD solver that uses Paraview in parallel mode with hdf5/xdmf. Currently, the application writes out the primary variables and lets the user calculate any desired secondary variables using the calculator. However, this procedure is very slow -- it seems to be an order of magnitude faster to calculate the data in the solver itself and have Paraview read it from disk. I suspect this is because the calculator expressions get translated to python code, but I might also be doing something wrong. Am I correct in thinking that the easiest way to fix this would be to write a custom filter in C++? Cheers, Tobias -- Tobias Brandvik PhD Student Whittle Laboratory 1 JJ Thomson Avenue Cambridge CB3 0DY, UK ___ 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