<div dir="ltr">Hi everyone,<div><br></div><div>I am in the field of atomic simulation. </div><div>Paraview can display atoms beautifully, but I currently cannot find a way to draw bonds between atoms within certain distance. </div>
<div>Can anyone help me with this? Thanks very much.</div><div><br></div><div style>Best Regards,</div><div style>LJ</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Oct 3, 2013 at 11:09 AM, <span dir="ltr"><<a href="mailto:paraview-request@paraview.org" target="_blank">paraview-request@paraview.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send ParaView mailing list submissions to<br>
<a href="mailto:paraview@paraview.org">paraview@paraview.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:paraview-request@paraview.org">paraview-request@paraview.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:paraview-owner@paraview.org">paraview-owner@paraview.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of ParaView digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Re: My own filter as part of pipeline for coprocessing raises<br>
"name not defined" error (Andy Bauer)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Thu, 3 Oct 2013 11:09:15 -0400<br>
From: Andy Bauer <<a href="mailto:andy.bauer@kitware.com">andy.bauer@kitware.com</a>><br>
Subject: Re: [Paraview] My own filter as part of pipeline for<br>
coprocessing raises "name not defined" error<br>
To: Hong Yi <<a href="mailto:hongyi@renci.org">hongyi@renci.org</a>><br>
Cc: "<a href="mailto:paraview@paraview.org">paraview@paraview.org</a>" <<a href="mailto:paraview@paraview.org">paraview@paraview.org</a>><br>
Message-ID:<br>
<<a href="mailto:CAMaOp%2BF1nzKJfHzZ9FvNOjmSioFbQcsiTcQqxBc7ygm8szkJkA@mail.gmail.com">CAMaOp+F1nzKJfHzZ9FvNOjmSioFbQcsiTcQqxBc7ygm8szkJkA@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="windows-1252"<br>
<br>
Hmm, I would check the link line for your adaptor and for creating the<br>
executable to see if the plugin library is included there. Something else<br>
you can try is explicitly create the plugin's filter in the adaptor code to<br>
make sure that it is linked in properly.<br>
<br>
Regards,<br>
Andy<br>
<br>
<br>
On Thu, Oct 3, 2013 at 10:41 AM, Hong Yi <<a href="mailto:hongyi@renci.org">hongyi@renci.org</a>> wrote:<br>
<br>
> Hi Andy,****<br>
><br>
> ** **<br>
><br>
> That is exactly what I did, and I also modified CMakeLists.txt to link<br>
> ${PARAVIEW_PLUGINLIST} to the target via target_link_libraries. However,<br>
> the symbol ?pv_plugin_instance_SMVorticity? is undefined in the built<br>
> target static library, while following the same process to build pvbatch<br>
> and pvpython executable works, i.e., the same plugin symbol is defined in<br>
> built pvpython executable. Since it is static linking, I know linking order<br>
> matters, but have not got it to work by adjusting linking orders. Let me<br>
> know if you have ideas on what I could try to figure out and resolve this<br>
> issue.****<br>
><br>
> ** **<br>
><br>
> Thanks,****<br>
><br>
> ** **<br>
><br>
> Hong****<br>
><br>
> ** **<br>
><br>
> ** **<br>
><br>
> *From:* Andy Bauer [mailto:<a href="mailto:andy.bauer@kitware.com">andy.bauer@kitware.com</a>]<br>
> *Sent:* Thursday, October 03, 2013 10:19 AM<br>
><br>
> *To:* Hong Yi<br>
> *Cc:* David E DeMarle; <a href="mailto:paraview@paraview.org">paraview@paraview.org</a><br>
> *Subject:* Re: [Paraview] My own filter as part of pipeline for<br>
> coprocessing raises "name not defined" error****<br>
><br>
> ** **<br>
><br>
> Hi Hong,****<br>
><br>
> There won't be a separate library created for Python wrapping your plugin<br>
> for doing ParaView. Did you add in the following to your adaptor:****<br>
><br>
> #ifndef BUILD_SHARED_LIBS****<br>
><br>
> #include "pvStaticPluginsInit.h"****<br>
><br>
> #endif****<br>
><br>
><br>
> And then in the adaptor initialization step you should have something in<br>
> it like:****<br>
><br>
> #ifndef BUILD_SHARED_LIBS****<br>
><br>
> paraview_static_plugins_init();****<br>
><br>
> #endif****<br>
><br>
> If that doesn't work then it will probably take a bit of tinkering to<br>
> figure out what's wrong.<br>
><br>
> Regards,<br>
> Andy****<br>
><br>
> ** **<br>
><br>
> On Wed, Oct 2, 2013 at 12:28 PM, Hong Yi <<a href="mailto:hongyi@renci.org">hongyi@renci.org</a>> wrote:****<br>
><br>
> Thanks for the helpful info, Andy. I looked at the link and followed the<br>
> code change Burlen posted to add the static linked plugin initialization<br>
> into pvbatch and pvpython and that worked fine. Now pvbatch and pypthon all<br>
> have my filter plugin statically loaded. I still got the ?name not defined?<br>
> error when coprocessing parses the pipeline though. I believe the problem<br>
> remains because there is still no python wrapped proxy to my filter since<br>
> there is no change to lib\site-packages after I add the static linked<br>
> plugin initialization into pybatch and pvpython. To make sure I am on the<br>
> right track for my further investigation, I am hoping to get answers to a<br>
> couple of my further questions below:****<br>
><br>
> ****<br>
><br>
> 1. What is the right way to go to have the proxy to my filter<br>
> Python wrapped? How can I verity I have the proxy to my filter Python<br>
> wrapped? Is it true that the Python-wrapped proxy to my filter should show<br>
> up in some python file in lib\site-packages if the filter is indeed<br>
> python-wrapped? ****<br>
><br>
> 2. I made similar changes to CPythonAdaptorAPI.cxx and<br>
> CMakeLists.txt as I did to pvpthon and pvbatch to load and init static<br>
> plugin in function coprocessorinitializewithpython() hoping to have plugin<br>
> loaded when doing coprocessing linked to simulation, however, I still have<br>
> the symbol ?pv_plugin_instance_SMVorticity? undefined in built<br>
> PythonCatalyst static lib while the plugin symbol is indeed defined in<br>
> pvpython with the same code changes. Just to confirm, does the plugin need<br>
> to be loaded in Catalyst initialization in order to use it in a<br>
> coprocessing pipeline? In other words, to get my plugin working in catalyst<br>
> linked to simulation, I need to resolve two problems: (1) get the plugin<br>
> statically loaded in Catalyst initialization; (2) get the proxy to the<br>
> plugin Python wrapped and show up in some python file in lib\site-packages.<br>
> Is this true?****<br>
><br>
> ****<br>
><br>
> Yes, I know the gradient of unstructured data set filter can compute<br>
> vorticity, which I referenced to write this custom vorticity filter to make<br>
> it fit our needs better with better performance. I did try to use the<br>
> genetic gradient filter to compute vorticity for coprocessing, but it<br>
> raises a segmentation fault after outputting several images. Will have to<br>
> debug and investigate more to find out more on that.****<br>
><br>
> ****<br>
><br>
> Thanks,****<br>
><br>
> Hong****<br>
><br>
> ****<br>
><br>
> *From:* Andy Bauer [mailto:<a href="mailto:andy.bauer@kitware.com">andy.bauer@kitware.com</a>]<br>
> *Sent:* Tuesday, October 01, 2013 2:19 PM****<br>
><br>
><br>
> *To:* Hong Yi<br>
> *Cc:* David E DeMarle; <a href="mailto:paraview@paraview.org">paraview@paraview.org</a><br>
> *Subject:* Re: [Paraview] My own filter as part of pipeline for<br>
> coprocessing raises "name not defined" error****<br>
><br>
> ****<br>
><br>
> Hi Hong,****<br>
><br>
> I don't think you want to do VTK Python wrapping of your class. What you<br>
> want is to have the proxy to the filter Python wrapped such that it's<br>
> available when you import paraview.simple. This is what's needed for<br>
> Catalyst Python pipelines. I don't think you're properly initializing the<br>
> plugins from the previous directions I sent. You may want to look at<br>
> <a href="http://public.kitware.com/pipermail/paraview-developers/2013-September/002499.html" target="_blank">http://public.kitware.com/pipermail/paraview-developers/2013-September/002499.html</a><br>
> ****<br>
><br>
> As a side note, the gradient of unstructured data set filter can compute<br>
> vorticity as well. It does require a vtkDataArray with three components to<br>
> use though. ****<br>
><br>
> Regards,<br>
> Andy****<br>
><br>
> ****<br>
><br>
> On Mon, Sep 30, 2013 at 5:06 PM, Hong Yi <<a href="mailto:hongyi@renci.org">hongyi@renci.org</a>> wrote:****<br>
><br>
> Thanks, Andy. The CMakeLists.txt for my plugin is copied below with newly<br>
> added lines for python wrapping in orange:<br>
><br>
> -----------------------------<br>
> if(NOT ParaView_SOURCE_DIR)<br>
> find_package(ParaView)<br>
> include("${PARAVIEW_USE_FILE}")<br>
> include (ParaViewPlugins)<br>
> else()<br>
> # we're building from within ParaView Source.<br>
> endif()<br>
><br>
> include_directories(${VTK_INCLUDE_DIRS})<br>
> include(wrap-python.cmake)<br>
><br>
> # create a paraview plugin containing server manager xml and the server<br>
> # manager classes to build<br>
> # this plugin can be loaded on the server side<br>
><br>
> ADD_PARAVIEW_PLUGIN(SMVorticity "1.0"<br>
> SERVER_MANAGER_XML VorticityFilter.xml<br>
> SERVER_MANAGER_SOURCES VorticityFilter.cxx)<br>
><br>
> target_link_libraries(SMVorticity ${deps})<br>
><br>
> if(VTK_WRAP_PYTHON)<br>
> wrap_python(SMVorticity "${sources}")<br>
> endif()<br>
> -----------------------------<br>
><br>
> The orange lines are added by following<br>
> <a href="http://www.paraview.org/pipermail/paraview/2012-May/024855.html" target="_blank">http://www.paraview.org/pipermail/paraview/2012-May/024855.html</a> which<br>
> works well and builds my filter and also wraps it in Python (i.e., it<br>
> generates libSMVorticity.a and libSMVorticityPythonD.a). I have also<br>
> verified the plugin is indeed loaded into pvserver and pvpython in paraview<br>
> built bin directory.<br>
><br>
> However, I still got "name not defined" error in coprocessing script when<br>
> creating this filter by name "VorticityOfUnstructuredDataSet" in python<br>
> script. I have a couple of specific questions I am currently investigating<br>
> and hoping to get some inputs from experts in the list:<br>
><br>
> 1. I am not sure where this name "VorticityOfUnstructuredDataSet"<br>
> (exported by coprocessing script generator plugin) comes from, the only<br>
> clue I can see is in plugin.cmake, where the plugin is specified with<br>
> DESCRIPTION "Vorticity Of Unstructured DataSet" and in VorticityFilter.xml,<br>
> where the plugin is given a label of "Vorticity Of Unstructured DataSet."<br>
> Should this name be defined somewhere such as in some python file in<br>
> paraview python site-packages?<br>
><br>
> 2. I did try to add PV_PLUGIN_IMPORT macros to the adaptor since I am<br>
> using Catalyst, however, the plugin symbol "pv_plugin_instance_SMVorticity"<br>
> is undefined in the adaptor static lib (the same plugin symbol is defined<br>
> in pvserver), hence I got an undefined error when linking simulation code<br>
> to the adaptor. I did try to add my plugin static lib (in which the plugin<br>
> symbol is defined) to the adaptor target via target_link_libraries before<br>
> linking to vtkPVPythonCatalyst, but that does not seem to take any effect.<br>
> For some reason I am still investigating, my plugin lib does not get to<br>
> link to the adaptor via target_link_libraries. What I did is to go to src<br>
> directory in the cross target and modified CMakeLists.txt for<br>
> PhastaAdaptor, then went to corresponding paraview-build directory, and did<br>
> "make clean" followed by "make" to rebuild PhastaAdaptor lib. Is there<br>
> something obvious that I did not do correctly?<br>
><br>
> Thanks for any inputs!<br>
><br>
> Hong****<br>
> ------------------------------<br>
><br>
> *From:* Andy Bauer [<a href="mailto:andy.bauer@kitware.com">andy.bauer@kitware.com</a>]<br>
> *Sent:* Friday, September 27, 2013 3:00 PM<br>
> *To:* Hong Yi<br>
> *Cc:* David E DeMarle; <a href="mailto:paraview@paraview.org">paraview@paraview.org</a>****<br>
><br>
><br>
> *Subject:* Re: [Paraview] My own filter as part of pipeline for<br>
> coprocessing raises "name not defined" error****<br>
><br>
> ****<br>
><br>
> Can you share your plugin or at least the CMakeLists.txt for your plugin?<br>
> Have you tried with any other plugins that get packaged with ParaView to<br>
> see if they work?****<br>
><br>
> If you're using Catalyst, I would suggest adding in the<br>
> PV_PLUGIN_IMPORT_INIT macros to the adaptor.****<br>
><br>
> Andy****<br>
><br>
> ****<br>
><br>
> On Thu, Sep 26, 2013 at 3:40 PM, Hong Yi <<a href="mailto:hongyi@renci.org">hongyi@renci.org</a>> wrote:****<br>
><br>
> Thanks! I did put my plugin inside ParaView/Plugins in the same way as<br>
> other Plugins, and enabled it when building ParaView superbuild on Titan. I<br>
> can see the static lib for the Plugin is built in paraview-build/lib<br>
> directory. And yes, I did use a plugin and load it via Tools|Manage Plugins<br>
> when creating python coprocessing script. However, it looks like my plugin<br>
> is not loaded automatically even though it is built by ParaView superbuild.<br>
> Perhaps I should still follow the link<br>
> <a href="http://www.paraview.org/Wiki/ParaView/Plugin_HowTo#Plugins_in_Static_Applications" target="_blank">http://www.paraview.org/Wiki/ParaView/Plugin_HowTo#Plugins_in_Static_Applications</a> but<br>
> I am having some difficulty in following the info in the link to do what is<br>
> suggested. Specifically, to what file should I insert two macros? It does<br>
> not sound right to insert them into my custom plugin cxx file. Where should<br>
> I add two macros to get my custom filter plugin to be loaded and wrapper<br>
> into python module? I see "LoadPlugin" function defined in simple.py to<br>
> call servermanager.LoadPlugin(filename, remote) which I am thinking perhaps<br>
> should be called to load my plugin before my python coprocessing script is<br>
> executed, but not sure whether this is the case or not. ****<br>
><br>
> ****<br>
><br>
> Thanks for any suggestions! ****<br>
><br>
> ****<br>
><br>
> Hong****<br>
><br>
> ****<br>
><br>
> ****<br>
><br>
> *From:* David E DeMarle [mailto:<a href="mailto:dave.demarle@kitware.com">dave.demarle@kitware.com</a>]<br>
> *Sent:* Thursday, September 26, 2013 1:28 PM<br>
> *To:* Andy Bauer<br>
> *Cc:* Hong Yi; <a href="mailto:paraview@paraview.org">paraview@paraview.org</a><br>
> *Subject:* Re: [Paraview] My own filter as part of pipeline for<br>
> coprocessing raises "name not defined" error****<br>
><br>
> ****<br>
><br>
> Utkarsh pointed out that you still need to follow<br>
> <a href="http://www.paraview.org/Wiki/ParaView/Plugin_HowTo#Plugins_in_Static_Applications" target="_blank">http://www.paraview.org/Wiki/ParaView/Plugin_HowTo#Plugins_in_Static_Applications</a><br>
> ****<br>
><br>
> when the plugin is external to ParaView. If you put your plugin inside<br>
> ParaView/Plugins, then it is done automatically.****<br>
><br>
><br>
> ****<br>
><br>
> David E DeMarle<br>
> Kitware, Inc.<br>
> R&D Engineer<br>
> 21 Corporate Drive<br>
> Clifton Park, NY 12065-8662<br>
> Phone: <a href="tel:518-881-4909" value="+15188814909">518-881-4909</a>****<br>
><br>
> ****<br>
><br>
> On Thu, Sep 26, 2013 at 12:23 PM, David E DeMarle <<br>
> <a href="mailto:dave.demarle@kitware.com">dave.demarle@kitware.com</a>> wrote:****<br>
><br>
> I think that information is out of date. I believe that is done<br>
> automatically now.****<br>
><br>
> ****<br>
><br>
> Otherwise Andy is right. Putting the filter inside a plugin a good way to<br>
> go. The plugin infrastructure will make it so that when you provide the XML<br>
> that describes your vtk class, ParaView's build system will automatically<br>
> wrap it into a proxy and python class so that ParaView will be able to use<br>
> it.****<br>
><br>
> ****<br>
><br>
> Also, I recommend trying it on a local static build first. That way the<br>
> build time will be less and development will be quicker. Once you can load<br>
> you plugin locally, then you should only have to compile on titan once.***<br>
> *<br>
><br>
> ****<br>
><br>
><br>
> ****<br>
><br>
> David E DeMarle<br>
> Kitware, Inc.<br>
> R&D Engineer<br>
> 21 Corporate Drive<br>
> Clifton Park, NY 12065-8662<br>
> Phone: <a href="tel:518-881-4909" value="+15188814909">518-881-4909</a>****<br>
><br>
> ****<br>
><br>
> On Wed, Sep 25, 2013 at 10:34 PM, Andy Bauer <<a href="mailto:andy.bauer@kitware.com">andy.bauer@kitware.com</a>><br>
> wrote:****<br>
><br>
> Did you use a plugin to add in your custom filter when creating the Python<br>
> co-processing script? I'm not sure how plugins are "loaded" for static<br>
> builds but you may want to look at<br>
> <a href="http://www.paraview.org/Wiki/ParaView/Plugin_HowTo#Plugins_in_Static_Applications" target="_blank">http://www.paraview.org/Wiki/ParaView/Plugin_HowTo#Plugins_in_Static_Applications</a>.<br>
> If that doesn't work, we'll have to figure out some other way to do it.***<br>
> *<br>
><br>
> Andy****<br>
><br>
> ****<br>
><br>
> ****<br>
><br>
> ****<br>
><br>
> ****<br>
><br>
> On Wed, Sep 25, 2013 at 9:16 PM, Hong Yi <<a href="mailto:hongyi@renci.org">hongyi@renci.org</a>> wrote:****<br>
><br>
> Hello,<br>
><br>
> I set up a pipeline that used a custom filter I developed and exported it<br>
> as a python script for coprocessing. I have made sure the static library<br>
> for my custom filter is built and available in paraview-build/lib<br>
> directory, and I have also linked this custom filter static library along<br>
> with Catalyst libs to the simulation code for coprocessing. However, when I<br>
> run the simulation linked with ParaView coprocessing for in-situ<br>
> visualization, I got "NameError: name 'MyCustomizedFilterName' is not<br>
> defined" error when the line of my customized filter in my python<br>
> coprocessing script is read in for pipeline coprocessing. What should I do<br>
> to get my custom filter wrapped in python so that it can be recognized and<br>
> used as part of the python pipeline script for coprocessing? Any advice and<br>
> suggestions are very much appreciated.<br>
><br>
> Thanks,<br>
><br>
> Hong****<br>
><br>
> ****<br>
><br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the ParaView Wiki at:<br>
> <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.paraview.org/mailman/listinfo/paraview****" target="_blank">http://www.paraview.org/mailman/listinfo/paraview****</a><br>
><br>
> ****<br>
><br>
><br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the ParaView Wiki at:<br>
> <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.paraview.org/mailman/listinfo/paraview****" target="_blank">http://www.paraview.org/mailman/listinfo/paraview****</a><br>
><br>
> ****<br>
><br>
> ****<br>
><br>
> ****<br>
><br>
> ****<br>
><br>
> ** **<br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://www.paraview.org/pipermail/paraview/attachments/20131003/9f68cf01/attachment.htm" target="_blank">http://www.paraview.org/pipermail/paraview/attachments/20131003/9f68cf01/attachment.htm</a>><br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br>
<br>
End of ParaView Digest, Vol 114, Issue 6<br>
****************************************<br>
</blockquote></div><br></div></div></div></div>