Cubit
17.02
User Documentation
In addition to basic entity specification, entities may be specified using an extended expression. An extended expression identifies one or more entities using a set of entity criteria. These criteria describe properties of the entities one wishes to operate upon.
The most common type of extended parsing expression is in the following format:
{Entity_Type} With {Criteria}
Entity_Type is the name of any type of entity that can be used in a command, such as Curve, Hex, or SideSet. Criteria is a combination of entity properties (such as Length), operators (such as >=), keywords (such as Not), and values (such as 5.3) that can be evaluated to true or false for a given entity. Here are some examples:
curve with length <1
surface with is_meshed = false
node with x_coord > 10 And y_coord > 0
These are the keyword defined by extended parsing
Keyword |
Description |
All, To, Step, By, Except, In, Common_To, Expand, Include |
These keywords are used the same way as in basic entity specification. For example: draw surface all draw surface 1 to 5 step 2 curve 1 to 3 in body 4 to 8 by 2 draw hex in face in surface 2 draw face common_to volume 1 2 draw node in hex in face in surface 2 curve 1 2 5 to 50 except 2 3 4 draw volume 10 include similar list block in hex 10 |
Not |
Not flips the logical sense of an expression - it changes true to false and false to true. For example: draw surface with not is_meshed |
Of |
The "of" operator is used to get an attribute value for a single entity, such as "length of curve 5". Only attributes that return a single numeric value may be used in an "of" expression. There must be only one entity specified after the "of" operator, but it can be identified using any valid entity expression. An example of a complete command which includes the "of" operator is: list curve with length < length of curve 5 ids |
And, Or |
These logic operators determine how multiple criteria are combined. draw surface with length > 3 or with is_meshed = false |
< > <= >= = <> |
These relational operators compare two expressions. You may use = or == for "equals". <> means "not equal". For example: draw surface with x_max <= 3 draw volume with z_max <>12.3 |
Tolerance |
In the case of = or == you may include a tolerence parameter for these relational operators rather than needing to write a more lengthy inequality with >= and <=. For example: draw curve with length = 5 tolerance 1e-3 |
+ - * / |
These arithmetic operators work in the traditional manner. draw surface with length * 3 + 1.2 > 10 |
( ) |
Parentheses are used to group expressions and to override precedence. When in doubt about precedence, use parentheses. draw surface with length > 3 and ( with is_meshed = false or x_min > 1 ) |
The following functions are defined. Not all functions apply to all entities. If a function does not apply to a given entity, the function returns 0 or false.
For complicated expressions, which entities are referred to is influenced by the order in which portions of the expression are evaluated. This order is determined by precedence. Operators with high precedence are evaluated before operators with low precedence. You may always include parentheses to determine which sub-expressions are evaluated first. Here all operators and keywords listed from high to low precedence. Items listed together have the same precedence and are evaluated from left to right.
(, ) Expand Not *, / +, - <, >, <=, >=, <>, = And, Or Except In Of With
Because of precedence, the following two expressions are identical:
curve with length + 2 * 2 > 10 and length <= 20 in my_group
expand(curve with (((length + (2*2)) > 10 )and( length <= 20 ))) in ( my_group expand )