Predicates

A predicate is a conditional statement that is applied to a set of objects. An object either satisfies the condition or it does not; if it does, it is included in the results.

The query editor allows you to create and modify predicates through drop-down lists and object selectors. You can also drag and drop objects or properties from the simulation tree into the query editor.

Although there are a few small variations, a predicate generally consists of a predicate type, a predicate operator, and a predicate value. For example, in the predicate, [Name Contains MyPart], the type is Name, the operator is Contains, and the value is MyPart.

Consider an example. Suppose that a predicate is applied to three parts: a cylinder (Tube), a block part (Cube), and a sphere (Ball). Some different predicates applied to this set of parts are as follows:
  1. [Name ends with ube] returns both the cylinder (Tube) and the block (Cube)

  2. [Type is Geometry Part] has results consisting of all three parts

  3. [Type is Block Part] has results consisting only of the block (Cube)

Predicates can be combined using the 'AND' and 'OR' operators. When two predicates are combined using AND, the filter displays the intersection of their results. For instance, by combining Query 1 with Query 3 using AND, you receive the result, Cube.

When two predicates are combined with OR, the filter displays the union of their results. For instance, combining [Type is Block Part] with [Name contains Ball] returns both the cube and the sphere.



When creating or editing filters, all changes are automatically committed to the server. The Discard Changes (X) button restores the predicate as it existed before any edits. Undo is available using the right-click menu or CTRL+<z>.

The 'Pre-11.06 Results' Predicate

In Simcenter STAR-CCM+, a named object is an object that can be renamed. To rename, you select, for example, a part, press <F2> (or right-click and choose Rename...), and then give the object a new name. Objects such as parts, part surfaces, part curves, regions, continua, reports, scenes, and plots are all named objects.

Objects such as meshers, default controls, models, physics conditions, physics values, and initial conditions cannot be renamed. These objects are termed non-named.

Generally, you can consider named objects as physical objects that you incorporate into your simulation, while non-named objects represent the attributes of those physical objects.

Prior to Simcenter STAR-CCM+ v11.06, queries returned only named objects. Since v11.06, queries return both named objects and non-named objects. This change in behavior became necessary to make some of the relationship and property-based nested queries work properly.

As this change in behavior could cause backwards compatibility problems for some cases, you can include the predicate, Pre-11.06 Results, that restricts queries to return only named objects. Queries that contain Pre-11.06 Results behave in the same manner as queries made in versions of Simcenter STAR-CCM+ prior to v11.06.



Hence, when restoring a query written before v11.06, Simcenter STAR-CCM+ automatically adds the Pre-11.06 Results predicate with an AND operator.

Returning Only Named Objects (without Using Pre-11.06 Results)

If you want to restrict results to return only named objects, you can add the predicate [Name contains ]. This predicate has the effect of limiting the results to only named objects—the Pre-11.06 Results predicate is essentially [Name contains ].

To illustrate the difference between named and non-named objects, consider the following example in which the Continua > Mold Physics > Models node is dragged into the query editor to create [Type is Model]. All the models in the continuum appear as results:

[Type is Model] returns models.



Now, when the predicate [Name contains ] is added using AND, all the results disappear. As the names of model objects are fixed by Simcenter STAR-CCM+ and cannot be modified, the [Name contains ] predicate ignores them:

[Type is Model] AND [Name contains ] returns nothing.



Two further examples illustrate the behavior of named objects in a query:

  • [Type is Part Surface] returns all part surfaces. Part surfaces depend on the geometry of the model and are objects that you create when building a simulation.

  • [Type is Part Surface] AND [Name contains ] returns the identical results, because part surfaces are also named objects.

Extending a Type Predicate

When you are looking for a particular object type and cannot find it in the existing drop-down list of the Type predicate, you can add that type to the list temporarily.

  1. In the drop-down list of the Type predicate, select Other.

  2. In the Select Type from Object dialog, open the node containing the object type that you want. As you hover with the mouse pointer over an individual object in the view, a message at the lower left identifies that object type, meaning that it is selectable. In this example, the message states that Type is Automated Mesh Operation.

  3. Select the object in the view and click OK. The object type that you selected in the dialog (Automated Mesh Operation in this example) is available for you to add to the predicate.

    NoteThe added object type appears in the list only for that one predicate. If you cancel the creation of that predicate, or edit it to replace the selection with another object type, that object type no longer appears in the drop-down list.