[visit-users] queries in the python interface
Valmor de Almeida
val.lists at gmail.com
Mon Mar 29 15:25:58 EDT 2010
Thanks for letting me know the additional query function control.
Am I doing this right?
>>> PickByNode(0, 0, ("elementname","element"))
VisIt: Message -
E: complex-01.pdb timestep 0
Point: <0.6145, -0.0375, -0.1045>
Incident Nodes: 26 27
(26) = (67,0,0) mag = 67
(27) = (67,0,0) mag = 67
(26) = 6
(27) = 6
Should I see an atom symbol anywhere here?
Meredith, Jeremy S. wrote:
> I see Brad already responded to the query output. In case it's useful, I thought I'd mention there's also a GetQueryOutputString() command, and you can do SuppressQueryOutputOn() (or ...Off) if it's important.
> About the atom name: the easiest way if you know the node ID is with a node pick. In the python interface, you might do this:
> PickByNode(222, 0, "element")
> print GetPickOutput()
> For some file formats, you can query "elementname" to get the atomic symbol instead of the atomic number. ("He" instead of "2")
> If you need to figure out the atom index (the "222" above) based on a global position, that's where "NodePick" comes in, as you can give it world coordinates, e.g. "NodePick((20,-55,5))" will tell you atom index #222 is at that spot. At that, point, though, you can just add the element variable and get it all in a single pass, e.g.:
> NodePick((20,-55,5), "element")
> Jeremy Meredith
> Oak Ridge National Laboratory
>> -----Original Message-----
>> From: Valmor de Almeida [mailto:val.lists at gmail.com]
>> Sent: Monday, March 29, 2010 2:19 PM
>> To: VisIt software users community
>> Subject: [visit-users] queries in the python interface
>> How can grab the information from Query("QueryName") into a variable.
>> Say, this does not work:
>>>>> tmp = Query("Centroid")
>> VisIt: Message - Centroid = (0.00215143, -2.89472, 0.0108211)
>> Alternatively if I could get the value of NumNodes from
>> Query("NumNodes") that should enable me to loop over the nodes and
>> compute the centroid.
>> In addition, I would like to query the name of the atom the node is
>> associated to. Here the data is a molecule in pdb format.
>> List subscription information:
>> Searchable list archives: https://email.ornl.gov/pipermail/visit-users
>> VisIt Users Wiki: http://visitusers.org/
>> Frequently Asked Questions for VisIt: http://visit.llnl.gov/FAQ.html
> List subscription information: https://email.ornl.gov/mailman/listinfo/visit-users
> Searchable list archives: https://email.ornl.gov/pipermail/visit-users
> VisIt Users Wiki: http://visitusers.org/
> Frequently Asked Questions for VisIt: http://visit.llnl.gov/FAQ.html
More information about the visit-users