pw::Rule

Rule type

Derives From

pw::Object

Summary
pw::RuleRule type
Static Actions
createThis action creates a new rule object.
getAllThis action gets a list of all of the current rules.
getAllowableEntityTypesThis action gets a list of allowable entity types supported by the specified function.
getFunctionNamesThis action gets a list of allowable function names.
Static Attributes
setViolationLimitThis attribute is the maximum number of cell or point locations that will be reported in violation of any rule.
Instance Attributes
GlobalThis attribute controls whether the rule is a global rule.
DescriptionThis attribute is a description of the rule.
ColorThis attribute is the color of the rule.
VisibilityThis attribute controls whether rule violations are displayed.
Instance Actions
deleteThis action deletes this rule.
isDefaultDescriptionThis action checks to see if the description is the default description.
setCriterionThis action sets the measurement to be used, the comparison operand, and the limit to check.
getCriterionThis action gets the measurement to used, the comparison operand, and the limit being checked.
addThis action adds an entity to the rule.
removeThis action removes an entity from the rule (can only call for non-global rules).
containsThis action checks to see if a rule contains a specified entity.
getEntityCountThis action gets the number of entities monitored by the rule and optionally gets the list of entities.
getOutdatedEntityCountThis action gets the number of outdated entities monitored by the rule and optionally gets the list of entities.
getFailingEntityCountThis action gets the number of failing entities monitored by the rule and optionally gets the list of entities.
evaluateThis action evaluates any assigned entities that have not been evaluated or that have changed since the last evaluation.
getEntityViolationsThis action gets the number of rule violations for a specific entity.
resetThis action resets the criterion and removes all entities from the rule.
getAllowableEntityTypesThis action gets a list of allowable entity types currently supported by the rule based on the specified criterion and any entities already added.

Static Actions

create

pw::Rule create

This action creates a new rule object.

Parameters

None

Returns

This action returns a new pw::Rule object.

getAll

pw::Rule getAll

This action gets a list of all of the current rules.

Parameters

None

Returns

This action returns a list of pw::Rule objects.

getAllowableEntityTypes

pw::Rule getAllowableEntityTypes function

This action gets a list of allowable entity types supported by the specified function.

Parameters

functionThis parameter is the type of measurement to be used BlockAspectRatio | BlockCentroidX | BlockCentroidY | BlockCentroidZ | BlockComponentVolume | BlockJacobian | BlockLengthI | BlockLengthJ | BlockLengthK | BlockLengthRatioI | BlockLengthRatioJ | BlockLengthRatioK | BlockMaximumAngle | BlockMinimumAngle | BlockSkewCentroid | BlockSkewEquiangle | BlockSkewEquivolume | BlockSmoothnessI | BlockSmoothnessJ | BlockSmoothnessK | BlockVolume | BlockVolumeRatio | BlockNone | BlockCellType | ConnectorLengthI | ConnectorLengthRatioI | ConnectorOnDatabase | ConnectorSmoothnessI | DomainArea | DomainAreaRatio | DomainAspectRatio | DomainCentroidX | DomainCentroidY | DomainCentroidZ | DomainDatabaseDeviation | DomainRelativeDeviation | DomainLengthI | DomainLengthJ | DomainLengthRatioI | DomainLengthRatioJ | DomainMaximumAngle | DomainMinimumAngle | DomainOnDatabase | DomainSkewEquiangle | DomainSkewEquiarea | DomainSmoothnessI | DomainSmoothnessJ | DomainWarp | FaceWallOrthogonality | FaceWallSpacing.

Returns

This action returns a list of strings representing the supported entity types.

getFunctionNames

pw::Rule getFunctionNames

This action gets a list of allowable function names.

Parameters

None

Returns

This action returns a list of strings representing the supported function names.

Static Attributes

setViolationLimit

pw::Rule get/setViolationLimit limit

This attribute is the maximum number of cell or point locations that will be reported in violation of any rule.  This does not affect the count reported by getEntityViolations.  It only affects the number of actual locations reported.

Type

This attribute is a integer with range [1, infinity)

Default

1000

Instance Attributes

Global

$rule get/setGlobal global

This attribute controls whether the rule is a global rule.

Type

This attribute is a boolean, with true meaning that rule is global.

Default

The default value for this attribute is false.

Information

If a global rule has this attribute set to false, the rule will retain the current entities but will not be automatically updated with any future entities, although they can still be added manually.  A non-global rule cannot be made global if the function is not defined.

Description

$rule get/setDescription description

This attribute is a description of the rule.

Type

This attribute is a string.

Default

The default value for this attribute is generated based on the type of rule created.

Color

$rule get/setColor color

This attribute is the color of the rule.

Type

This attribute is a color.

Default

The default value of this attribute is 0x00ff0000.

Visibility

$rule get/setVisibility value

This attribute controls whether rule violations are displayed.

Type

This attribute is a boolean value, with true meaning that element violations will be displayed.

Default

The default for this attribute is true.

Instance Actions

delete

$rule delete

This action deletes this rule.

Parameters

None

Returns

This action returns nothing.

isDefaultDescription

$rule isDefaultDescription

This action checks to see if the description is the default description.

Parameters

None

Returns

This action returns a boolean, which is true if the rule’s description is the default value, false if the description has been set by the user.

setCriterion

$rule setCriterion function operand limit

This action sets the measurement to be used, the comparison operand, and the limit to check.

Parameters

functionThis parameter is the type of measurement to be used BlockAspectRatio | BlockCentroidX | BlockCentroidY | BlockCentroid Z | BlockComponentVolume | BlockJacobian | BlockLengthI | BlockLengthJ | BlockLengthK | BlockLengthRatioI | BlockLengthRatioJ | BlockLengthRatioK | BlockMaximumAngle | BlockMinimumAngle | BlockSkewCentroid | BlockSkewEquiangle | BlockSkewEquivolume | BlockSmoothnessI | BlockSmoothnessJ | BlockSmoothnessK | BlockVolume | BlockVolumeRatio | BlockNone | BlockCellType | ConnectorLengthI | ConnectorLengthRatioI | ConnectorOnDatabase | ConnectorSmoothnessI | DomainArea | DomainAreaRatio | DomainAspectRatio | DomainCentroidX | DomainCentroidY | DomainCentroidZ | DomainLengthI | DomainLengthJ | DomainLengthRatioI | DomainLengthRatioJ | DomainMaximumAngle | DomainMinimumAngle | DomainOnDatabase | DomainSkewEquiangle | DomainSkewEquiarea | DomainSmoothnessI | DomainSmoothnessJ | DomainWarp | FaceWallOrthogonality | FaceWallSpacing.
operandThis parameter is the comparison operand to be used Equal | NotEqual | LessThan | LessThanEqual | GreaterThan | GreaterThanEqual.
limitThis parameter is the float value against which the results are compared.

Returns

This action returns boolean, which is true if the criterion was successfully set.

getCriterion

$rule getCriterion

This action gets the measurement to used, the comparison operand, and the limit being checked.

Parameters

None

Returns

This action returns a list of three values corresponding to the function, the operand, and the limit.

add

$rule add entity

This action adds an entity to the rule.

Parameters

entityThis parameter is the pw::GridEntity object to add.  The acceptable types may be constrained by the criterion or by previously added entities (can only add to non-global rules).

Returns

This action returns boolean, which is true if the entity was successfully added.

remove

$rule remove entity

This action removes an entity from the rule (can only call for non-global rules).

Parameters

entityThis parameter is the pw::GridEntity object to remove.

Returns

This action returns boolean, which is true if the entity was successfully removed.

contains

$rule contains entity

This action checks to see if a rule contains a specified entity.

Parameters

entityThis parameter is the pw::GridEntity object to check.

Returns

This action returns boolean, which is true if the entity is monitored by the rule.

getEntityCount

$rule getEntityCount ?-entities entsVar?

This action gets the number of entities monitored by the rule and optionally gets the list of entities.

Parameters

-entities entsVarThis parameter is a string variable name which will be assigned with the list of pw::GridEntity objects monitored by the rule.

Returns

This action returns the integer number of entities.

getOutdatedEntityCount

$rule getOutdatedEntityCount ?-entities entsVar?

This action gets the number of outdated entities monitored by the rule and optionally gets the list of entities.  Outdated entities are entities that have had their points modified since the last rule evaluation.

Parameters

-entities entsVarThis parameter is a string variable name which will be assigned with the list of pw::GridEntity objects monitored by the rule.

Returns

This action returns the integer number of outdated entities.

getFailingEntityCount

$rule getFailingEntityCount ?-entities entsVar?

This action gets the number of failing entities monitored by the rule and optionally gets the list of entities.  Failing entities are entities that had cells or points that violated the rule at the time of the last rule evaluation.

Parameters

-entities entsVarThis parameter is a string variable name which will be assigned with the list of pw::GridEntity objects monitored by the rule.

Returns

This action returns the integer number of failing entities.

evaluate

$rule evaluate

This action evaluates any assigned entities that have not been evaluated or that have changed since the last evaluation.

Parameters

None

Returns

This action returns nothing.

getEntityViolations

$rule getEntityViolations ?-locations locationsVar? ?-percent percentVar? entity

This action gets the number of rule violations for a specific entity.  It returns the total count, regardless of the value set by setViolationLimit.  Optionally, a list of the cell or points violating the rule can be retrieved.  This list is limited by the number specified with setViolationLimit.

Parameters

-locations locationsVarThis parameter is a string variable name that will be assigned with a list of violation locations (the length of this list may be smaller than the value returned by the function depending on the limit set in setViolationLimit).  Each location is a list of 3 integer values regardless of the entity type.  For connectors, the first value is the point or cell location and the remaining 2 values are ignored.  For structured domains, the first 2 values represent the IJ values.  For unstructured domains and blocks, the first value represents the cell or point index.  For structured blocks, the three values represent the IJK location.  For prism blocks, the first value represents the cell or point location within the layer, and the last value represents the layer.
-percent percentVarThis parameter is a string variable name that will be assigned with the fraction of cells or points that are in violation of the rule.  The value will be in the range [0.0, 1.0].

Returns

This action returns the integer number of rule violations.

reset

$rule reset

This action resets the criterion and removes all entities from the rule.  It also turns the global setting off.

Parameters

None

Returns

This action returns nothing.

getAllowableEntityTypes

pw::Rule getAllowableEntityTypes function

This action gets a list of allowable entity types currently supported by the rule based on the specified criterion and any entities already added.

Parameters

NOne

Returns

This action returns a list of strings representing the supported entity types.

pw::Rule create
This action creates a new rule object.
pw::Rule getAll
This action gets a list of all of the current rules.
pw::Rule getAllowableEntityTypes function
This action gets a list of allowable entity types supported by the specified function.
pw::Rule getFunctionNames
This action gets a list of allowable function names.
pw::Rule get/setViolationLimit limit
This attribute is the maximum number of cell or point locations that will be reported in violation of any rule.
$rule get/setGlobal global
This attribute controls whether the rule is a global rule.
$rule get/setDescription description
This attribute is a description of the rule.
$rule get/setColor color
This attribute is the color of the rule.
$rule get/setVisibility value
This attribute controls whether rule violations are displayed.
$rule delete
This action deletes this rule.
$rule isDefaultDescription
This action checks to see if the description is the default description.
$rule setCriterion function operand limit
This action sets the measurement to be used, the comparison operand, and the limit to check.
$rule getCriterion
This action gets the measurement to used, the comparison operand, and the limit being checked.
$rule add entity
This action adds an entity to the rule.
$rule remove entity
This action removes an entity from the rule (can only call for non-global rules).
$rule contains entity
This action checks to see if a rule contains a specified entity.
$rule getEntityCount ?-entities entsVar?
This action gets the number of entities monitored by the rule and optionally gets the list of entities.
$rule getOutdatedEntityCount ?-entities entsVar?
This action gets the number of outdated entities monitored by the rule and optionally gets the list of entities.
$rule getFailingEntityCount ?-entities entsVar?
This action gets the number of failing entities monitored by the rule and optionally gets the list of entities.
$rule evaluate
This action evaluates any assigned entities that have not been evaluated or that have changed since the last evaluation.
$rule getEntityViolations ?-locations locationsVar? ?-percent percentVar? entity
This action gets the number of rule violations for a specific entity.
$rule reset
This action resets the criterion and removes all entities from the rule.
Base type for all glyph types
Rule type
A string is an array of characters.
An integer is a whole number.
A boolean is represented as a 0 or 1, with 0 being false and 1 being true.
A color is represented as a 32-bit hex value, 0x00RRBBGG.
A float is a fractional number.
Base type for all grid entities.
Close