Follow

Calculator variable problems

Why is the calculator having trouble parsing my variables or running slow? 

The parsing error may be due to a known limitation in EnSight's variable name parser. 

Variable names with only a letter or two that happen to match those in a function name used in your expression can be mistaken by the variable parser causing problems. 

For example, if you have a scalar variable called "T" and then try to tuse the ATAN function you'll get the following error: 

ERROR: Expression contains non-variable names which can not be parsed 

And here is the problem.... 

A variable exists in the system called "T". We're trying to create an expression of foo = ATAN(ZoverY). EnSight's parser is rather weak in correctly determining variable names. The first thing that occurs is a variable substitution step where the variable names are matched up with variable id's. In this step the equation goes from ATAN(ZoverY) to A001AN(002), i.e., the T in ATAN has been detected to be the variable T which is internal variable id 001. ZoverY is variable 002. Now the rest of the equation can not be parsed which is the error you are getting. 

The slowness may be due to the way the calculator evaluates expressions. 

If you include a reference to a variable references from two or more different timesteps, the calculator will change back and forth between timesteps element by element or node by node and take a considerable amount of time. If you need to do a calculation with two different timesteps, assign each of the timesteps to a temporary variable, then use the temporary variables in your calculation. 

For example, 

var{5} - var{0} 

is prone to slowdown in EnSight. Whereas 

temp5 = var{5} 
temp0 = var{0} 
temp5-temp0 

will run much faster. 

Here a list of tips to help avoid these calculator problems. 

EnSight recommended calculator tips

  • Short 1 letter variable names should be avoided if possible. They will certainly have the greatest chance of interferring with the parser. However, if the variable names are coming to you from some solver this is probably not an option. 
  • If possible make variable names lower case, i.e., "t" does not interfere with the "T" in ATAN. But again, if the variable names are coming to you from a solver this probably isn't so easy to change. 
  • If your variable names are all upper case then write your equation using all lower case function names, i.e., atan(ZoverY) will work if your variable name is "T". Unfortunately this means you can't just click on the functions in the "Math" column since this inserts uppper case nto the working expression - you will need to type it in. 
  • Don't include variables from two or more timesteps in a single expression. Use temporary variables when you reference two or more timesteps.
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments