# Calculator issue with LAMMPS dump file.

**URL:** https://discourse.paraview.org/t/calculator-issue-with-lammps-dump-file/303
**Category:** ParaView Support
**Created:** [July 12, 2018, 12:51am UTC](https://discourse.paraview.org/t/calculator-issue-with-lammps-dump-file/303 "2018-07-12T00:51:59Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Shane\_Jackson](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/85f322/32.png) [@Shane\_Jackson](https://discourse.paraview.org/u/Shane_Jackson)
#### Post date: [July 12, 2018, 12:51am UTC](https://discourse.paraview.org/t/calculator-issue-with-lammps-dump-file/303/1 "2018-07-12T00:51:59Z")

</div>

Hello,

I have a LAMMPS dumpfile of the form:  
Id Type x y z vx vy vz

When I use the calculator filter I cannot use any of the imported variables. If I try to make a vector out of the velocity parameters I get the following error:

Syntax Error: expecting variable name at position 0.

This occurs even if the only thing in the equation bar is the variable. I’m not even typing the variables - I’m just clicking the button built in to the calculator to automatically place them.

I’ve tried adding a glyph of just the x velocity and looking at the data in Paraview and it does exist. I have no idea what is going wrong here.

Shane

---

<div class="post-metadata">

### Author: ![jfavre](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/b5ac83/32.png) [@jfavre](https://discourse.paraview.org/u/jfavre)
#### Post date: [July 12, 2018, 2:49pm UTC](https://discourse.paraview.org/t/calculator-issue-with-lammps-dump-file/303/2 "2018-07-12T14:49:19Z")

</div>

does your expression look like that:

`iHat*vx+jHat*vy+kHat*vz`

using iHat, jHat and kHat would be the way to compose 3 scalars into a vector.

---

<div class="post-metadata">

### Author: ![Shane\_Jackson](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/85f322/32.png) [@Shane\_Jackson](https://discourse.paraview.org/u/Shane_Jackson)
#### Post date: [July 12, 2018, 6:03pm UTC](https://discourse.paraview.org/t/calculator-issue-with-lammps-dump-file/303/3 "2018-07-12T18:03:59Z")

</div>

Yes. The issue is that the calculator is not recognizing my point arrays as variables (despite being variables under the scalar list). I’ve tried both `iHat*vx+jHat*vy+kHat*vz` and just vx to test this.

---

<div class="post-metadata">

### Author: ![Shane\_Jackson](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/85f322/32.png) [@Shane\_Jackson](https://discourse.paraview.org/u/Shane_Jackson)
#### Post date: [July 12, 2018, 11:09pm UTC](https://discourse.paraview.org/t/calculator-issue-with-lammps-dump-file/303/4 "2018-07-12T23:09:39Z")

</div>

I’ve tried with both atom and custom dump styles and I still get the same error. Does anyone know how the Calculator generates the list of scalar variables in the drop down menu? Maybe the difference between that and what the equation bar accepts is the source of the issue.

---

<div class="post-metadata">

### Author: ![shawn.waldon](https://discourse.paraview.org/user_avatar/discourse.paraview.org/shawn.waldon/32/12_2.png) [@shawn.waldon](https://discourse.paraview.org/u/shawn.waldon)
#### Post date: [July 13, 2018, 1:18pm UTC](https://discourse.paraview.org/t/calculator-issue-with-lammps-dump-file/303/5 "2018-07-13T13:18:43Z")

</div>

It just iterates over the point data/cell data and puts each one in the dropdown and registers each as a variable name in the equation parser. Is your data multiblock? Or spread across multiple ranks? It may be pulling from the first block/rank and then that array is not present on some of the others. Do you have a small example dataset that exhibits the problem?

---

<div class="post-metadata">

### Author: ![DennisConklin](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/d/b19c9b/32.png) [@DennisConklin](https://discourse.paraview.org/u/DennisConklin)
#### Post date: [July 13, 2018, 2:55pm UTC](https://discourse.paraview.org/t/calculator-issue-with-lammps-dump-file/303/6 "2018-07-13T14:55:50Z")

</div>

I have seen this error with multiblock datasets where not all blocks had the referenced variable. However, in examining the Spreadsheet view, the calculator output was available for the blocks which had those variables.

YMMV

---

<div class="post-metadata">

### Author: ![Shane\_Jackson](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/85f322/32.png) [@Shane\_Jackson](https://discourse.paraview.org/u/Shane_Jackson)
#### Post date: [July 13, 2018, 4:20pm UTC](https://discourse.paraview.org/t/calculator-issue-with-lammps-dump-file/303/7 "2018-07-13T16:20:32Z")

</div>

Here is a small data file exhibiting the same issue. The variables xs ys and zs can’t be accessed by the calculator.  
[cluster.dump](https://discourse.paraview.org/uploads/default/original/1X/0de9788e057acd266680b168b9adb5891ac2088e.dump) (1011.4 KB)

[https://drive.google.com/open?id=11W36J\_iciEvVu3wsbcpyQVxDdctQJKKt](https://drive.google.com/open?id=11W36J_iciEvVu3wsbcpyQVxDdctQJKKt)

Thank you for all the help!

---

<div class="post-metadata">

### Author: ![jfavre](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/b5ac83/32.png) [@jfavre](https://discourse.paraview.org/u/jfavre)
#### Post date: [July 17, 2018, 1:01pm UTC](https://discourse.paraview.org/t/calculator-issue-with-lammps-dump-file/303/8 "2018-07-17T13:01:45Z")

</div>

The LAMMPS reader creates a multi-block dataset, with the unitCell (enabled by default), and the mesh (disabled by default). You presumably enable reading, and creating the “mesh” object as well. A vtkPolyData mesh is created with N cells and N vertices (for N atoms) with the scalars fields attached to it. Note that the uniCell has no data attached to it, and that is why you see the error.

The easiest way to read your data and use the calculator without errors would be to disable the reading of the unitCell, and only enable the “mesh”. Or to read both, but use an ExtractBlock to only select the “mesh” object, before passing it to the Calculator.
