15.5.6. countTrue

The countTrue function returns the number of mesh nodes on the specified region that evaluate to "true", where true means greater than or equal to 0.5. The countTrue function is valid for 1D, 2D, and 3D locations.

countTrue(<Expression>)@<Location>

where <Expression> is:

  • In CFD-Post, an expression that contains the logical operators =, >, <, <=, or >=.

  • In CFX-Solver, an Additional Variable that you define. For example:

    TemperatureLE = Temperature > 300[K]

countTrue(TemperatureLE)@Polyline1 returns the number of nodes on the specified polyline locator that evaluate to true.

15.5.6.1. Tools > Command Editor Examples

In CFD-Post:

>calculate countTrue(Temperature > 300[K]), Domain1

In CFX-Solver:

>calculate countTrue(TemperatureLE), Domain1

15.5.6.2. Tools > Function Calculator Example

This example returns the number of nodes that evaluate to "true" in the specified domain.

Function: countTrue, Location: MainDomain, Expression: Temperature > 300[K].