You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/parserhelp.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ The SCIRun parser is designed to give the user the ability to evaluate almost an
17
17
18
18
### Using the parser
19
19
20
-
Each parser has several preloaded variables available to the user. These preloaded varaibles in SCIRun are always denoted with an upper case variable name. For example for the {% include moduleLink.md moduleName='CalculateFieldData' %} has the following variables available:
20
+
Each parser has several preloaded variables available to the user. These preloaded variables in SCIRun are always denoted with an upper case variable name. For example for the {% include moduleLink.md moduleName='CalculateFieldData' %} has the following variables available:
21
21
22
22
`DATA, X,Y,Z, POS`
23
23
@@ -31,23 +31,23 @@ This will assign the value of `sin(X) + cos(Y)` to `MYDATA`, where `X` and `Y` a
31
31
32
32
As the output of the expression is a vector `MYDATA` will now be an array of vectors instead of an array of scalars as in the previous example.
33
33
34
-
To assign any data to the output of a module, certain variables need to be assigned. For example in case of the CalculateFieldData, the output variable is called RESULT and hence a second expression can be added to assign the newly created vector to the output:
34
+
To assign any data to the output of a module, certain variables need to be assigned. For example in case of the {% include moduleLink.md moduleName='CalculateFieldData' %}, the output variable is called `RESULT` and hence a second expression can be added to assign the newly created vector to the output:
35
35
36
36
`MYDATA = vector(Y,X,2*Z); RESULT = MYDATA;`
37
37
38
38
Now this expression could have been simplified to one expression, which would result in the same operation:
39
39
40
40
`RESULT = vector(Y,X,2*Z);`
41
41
42
-
From a performance perspective both would be evaluated equally fast as, copying operations are generally removed by the internal optimizer. However to increase user readability one can split an expression in as many pieces as one wants. For example, the following expression is perfectlt valid expression:
42
+
From a performance perspective both would be evaluated equally fast as, copying operations are generally removed by the internal optimizer. However to increase user readability one can split an expression in as many pieces as one wants. For example, the following expression is a perfectly valid expression:
43
43
44
44
`DX = X-3; DY = Y-4; DZ = Z - 2; RESULT = norm(vector(DX,DY,DZ));`
The array parser generally allows two types of input, an array with one element, or an array with many elements. When combining multiple fields or matrices, the arrays with many elements are required to have the same number of elements and the math operations are done by taking correspondeing elements from each array. However an array with one element is treated special, and its value is used for every element for the arrays that have many arrays. For example, assume matrix `A = [1]`, and `B = [1,2,3,4]`. We can now evaluate the following expression:
50
+
The array parser generally allows two types of input, an array with one element, or an array with many elements. When combining multiple fields or matrices, the arrays with many elements are required to have the same number of elements and the math operations are done by taking corresponding elements from each array. However an array with one element is treated special, and its value is used for every element for the arrays that have many arrays. For example, assume matrix `A = [1]`, and `B = [1,2,3,4]`. We can now evaluate the following expression:
51
51
52
52
`RESULT = A+B;`
53
53
@@ -154,7 +154,7 @@ For converting any Scalar, Vector or Tensor in to a boolean, e.g. whether all co
0 commit comments