pw:: GridEntity

Base type for all grid entities

Derives From

pw::Object pw::Entity

Summary
Base type for all grid entities
This action gets a grid entity using the name.
This action projects grid entities onto database entities.
This action gets a list of entities adjacent to the given entities.
This action returns the number of unique points among the specified node, connector, domain and/or block entities (contained in a list of entities) or identified by one of the following types: pw::Node, pw::Connector, pw::Domain, pw::Block.
This default is the size field decay factor of a grid entity when it is created.
This default is the size field background spacing of a grid entity when it is created.
This default is the size field calculation method of a grid entity when it is created.
This attribute is a flag that controls whether the influence of sources should be ignored when determining grid point locations.
This attribute is a flag that controls whether the influence of explicitly included entities should be ignored when determining grid point locations.
This attribute is the size field decay factor used as the decay when a size field is generated for this entity.
This attribute is the size background spacing when a size field is generated for this entity.
This attribute is a string that controls how spacing is calculated for size field point primitives.
This attribute controls whether the boundary of the entity should be ignored when the size field is generated for this entity.
This action gets the pw::GridShape object that was used to create this grid entity using the <updateGridEntities> action.
This action gets the number of grid points in the given entity.
This action gets the grid coordinate that is closest to the given point.
This action gets the boundary condition that will automatically be applied to a register when this entity is added to a higher level entity (an edge register if this is a connector, and a face register if this is a domain).
This action returns the register boundary conditions for all registers in which this entity is used.
This action gets the volume condition of this entity.
This action transforms this entity by the given matrix.
This action gets all database entities the grid entity is using.
This action gets all source entities that are being explicitly excluded from affecting the grid of this entity
This action explicitly excludes a source from affecting the grid of this entity
This action gets all entities that are being explicitly included in the size field that affects the grid of this entity.
This action explicitly includes an entity in the size field source that affects the grid of this entity
This action explicitly clears all entities in the size field source from affecting the grid of this entity
This action gets the number of point primitives that will be used when generating the size field that affects this entity.
This action checks if the grid entity is currently out of sync with its sources.
This action checks if the grid entity is currently out of sync with its attributes.
This action clears the out of sync flags for this grid entity, even though the grid points may be out of sync with it’s sources or attributes.
This action returns true if the entity can be re-extruded.
This action sets the named overset render attribute.
This action returns the named overset render attribute.

Static Actions

getByName

pw::GridEntity getByName ?-path path? name

This action gets a grid entity using the name.

Parameters

nameThis parameter is a name string.
-path pathThis parameter and its argument specify the path to the framework in which the grid entity resides.  The path argument must be a list of either pw::Framework objects or framework names.  The path must start at the root framework, start at the active framework, or start at a child of the active framework.  The active framework is used as the default if this parameter is not specified.

Returns

This action returns a pw::GridEntity object.

Example

This example shows how to get a grid entity named blk-1 and then find the cell count.

Code

set block(1) [pw::GridEntity getByName "blk-1"]
puts "[$block(1) getName] has [$block(1) getCellCount] cells."

Output

blk-1 has 23440 cells.

project

pw::GridEntity project ?-type proj_type? ?-direction direction? ?-center center? ?-axis point normal? ?<-interior | -shape>? entities ?dbentities?

This action projects grid entities onto database entities.

Parameters

-type proj_typeThis optional parameter is the string projection type to perform with options < ClosestPoint | Linear | SphericalIn | SphericalOut | CylindricalIn | CylindricalOut >.
-direction directionThis optional parameter is the projection vector for linear projection.  The default is determined by the entity and can be queried using either pw::Connector.getDefaultProjectDirection or pw::Domain.getDefaultProjectDirection.
-center centerThis optional parameter is the center point vector for spherical projection.  The default is (0, 0, 0).
-axis point normalThis optional parameter is the axis defined by a point vector and normal vector used by cylindrical projection; The default point is (0, 0, 0) and the default normal is (1, 0, 0).
-interiorIf this optional flag is present, only the interior of the entities are projected.
-shapeIf this optional flag is present, the shape of the underlying curve of the connectors will be projected to the database and the original distribution will be reapplied after the projection.  This option is only valid for connectors and/or structured domains.
entitiesThis parameter is a list of entities to project.  Only pw::Connector and pw::Domain objects can be projected.
dbentitiesThis parameter is the optional list of database curve and surface-like entities to project onto.  If none are given, project to any currently enabled, visible database surface-like entities.

Returns

This action returns nothing.

Note

If the entities parameter contains any pw::Domain objects, it is an error to include any pw::Curve objects in the dbentities parameter.

Example

This example shows how to project a grid entity cylindrically out from the Z-axis and onto the first database entities it encounters in that path.  $con(1) is referencing an existing connector.

Code

pw::GridEntity project -type CylindricalOut \
-axis "0 0 0" "0 0 1" $con(1)

getAdjacentEntities

pw::GridEntity getAdjacentEntities ?-maximumAngle angle? ?-all? entities

This action gets a list of entities adjacent to the given entities.  If the -all flag is specified, the process is repeated until no more adjacent entities are found.  The return list will not include any entities specified in the argument list.

Parameters

-maximumAngle angleThis optional parameter is the maximum bend angle for considering entities as adjacent; float [0, 180]; 180 is the default.
-allThis optional parameter specifies to continue looking for adjacent entities as new ones are added.
entitiesThis paramter is a list of pw::GridEntity objects to be used as the seed.

Returns

This action returns a list of adjacent pw::GridEntity objects.

Example

This example shows how to get a list of all adjacent grid entities using a given grid entity.  $block(1) is referencing an existing block.

Code

foreach ge [pw::GridEntity getAdjacentEntities $block(1)] {
puts [$ge getName]
}

Output

blk-2
blk-4

getUniquePointCount

pw::Grid getUniquePointCount <-type type | entities>

This action returns the number of unique points among the specified node, connector, domain and/or block entities (contained in a list of entities) or identified by one of the following types: pw::Node, pw::Connector, pw::Domain, pw::Block.

Parameters

-type typeoptional type of pw::Node, pw::Connector, pw::Domain, or pw::Block to retrieve unique point count
entitiesoptional list of entities to retrieve unique points for

Returns

This action returns an integer value.

Static Defaults

SizeFieldDecay

pw::GridEntity get/setDefault SizeFieldDecay decay

This default is the size field decay factor of a grid entity when it is created.

Type

This default is a float with the range [0, 1].

Default

The default value is 0.5.

SizeFieldBackgroundSpacing

pw::GridEntity get/setDefault SizeFieldBackgroundSpacing spacing

This default is the size field background spacing of a grid entity when it is created.

Type

This default is a float with the range [0, infinity).

Default

The default value is 0.0.

SizeFieldCalculationMethod

pw::GridEntity get/setDefault SizeFieldCalculationMethod method

This default is the size field calculation method of a grid entity when it is created.

Type

This default is a string with options < MinimumDistance | InverseDistance | BlendDistance | MinimumValue >

Default

The default for this attribute is MinimumDistance

Instance Attributes

IgnoreAllSources

$entity get/setIgnoreAllSources ignore

This attribute is a flag that controls whether the influence of sources should be ignored when determining grid point locations.

Type

boolean

Default

false

IgnoreAllSizeFieldEntities

$entity get/setIgnoreAllSizeFieldEntities ignore

This attribute is a flag that controls whether the influence of explicitly included entities should be ignored when determining grid point locations.

Type

boolean

Default

false

SizeFieldDecay

$entity get/setSizeFieldDecay decay

This attribute is the size field decay factor used as the decay when a size field is generated for this entity.  The size field will use this decay for entities added to the size field that don’t have a explicitly assigned decay.

Type

This attribute is a float with the range [0, 1].

Default

The default for this attribute is the value in the SizeFieldDecay default when the grid entity was created.

SizeFieldBackgroundSpacing

$entity get/setSizeFieldBackgroundSpacing spacing

This attribute is the size background spacing when a size field is generated for this entity.

Type

This attribute is a float with the range [0, infinity).

Default

The default for this attribute is the value in the SizeFieldBackgroundSpacing default when the grid entity was created.

SizeFieldCalculationMethod

$entity get/setSizeFieldCalculationMethod method

This attribute is a string that controls how spacing is calculated for size field point primitives.

Type

This attribute is a string with options < MinimumDistance | InverseDistance | BlendDistance | MinimumValue >

Default

The default for this attribute is the value in the SizeFieldCalculationMethod default when the grid entity was created.

SizeFieldIgnoreEntityBoundary

$entity get/setSizeFieldIgnoreEntityBoundary ignore

This attribute controls whether the boundary of the entity should be ignored when the size field is generated for this entity.

Type

This attribute is a boolean

Default

The default for this attribute is false.

Instance Actions

getGridShape

$entity getGridShape

This action gets the pw::GridShape object that was used to create this grid entity using the <updateGridEntities> action.

Parameters

none

Returns

This action returns a pw::GridShape object if a grid shape was used to create this entity, otherwise it returns an empty string.

getPointCount

$entity getPointCount ?-constrained constrainedVar? ?-owned?

This action gets the number of grid points in the given entity.

Parameters

-constrained constrainedVarThis optional parameter is a variable name to receive the number of points in the given entity, that are constrained to database entities.
-ownedThis optional flag can be set to return the count of points that are owned solely by this grid entity.

Returns

This action returns the integer number of points.

Example

This example shows how to find the point count in a domain, as well as the point count that is constrained to database entities.  $dom(1) is referencing an existing domain.

Code

puts [$dom(1) getPointCount -constrained onDB]
puts $onDB

Output

640
0

closestCoordinate

$entity closestCoordinate ?-boundary? ?-distance distVar? point ?dir?

This action gets the grid coordinate that is closest to the given point.

Parameters

-boundaryThis optional parameter indicates to find the closest coordinate on the boundary of this entity.
-distance distVarThis optional parameter is a variable name to receive the distance between the given point or ray and the grid coordinate returned.
pointThis parameter is the point from which to find the closest coordinate.
dirThis optional parameter is a direction vector for finding the closest point from a ray.

Returns

This action returns a grid coordinate on this entity.

Example

This example shows how to find the closest coordinate on the boundary of a domain to the given point.  $dom(1) is referencing an existing domain.

Code

puts [pw::Application getDescription \
[$dom(1) closestCoordinate -boundary "0 0 -5"]]

Output

dom-18 11

getAutomaticBoundaryCondition

$ent getAutomaticBoundaryCondition

This action gets the boundary condition that will automatically be applied to a register when this entity is added to a higher level entity (an edge register if this is a connector, and a face register if this is a domain).

Parameters

none

Returns

This action returns a pw::BoundaryCondition object

Information

An error will occur if this is called for anything other than a pw::Connector object in 2D mode and anything other than a pw::Domain object in 3D mode.

See Also

pw::BoundaryCondition

Example

This example shows how to get the boundary condition that will be applied when this entity is added to a higher level entity.  If a boundary condition is created and applied to an entity, that means that it becomes the default boundary condition for that entity.  $dom(1) is referencing an existing domain.

Code

puts [[$dom(1) getAutomaticBoundaryCondition] getName]
set bc [pw::BoundaryCondition create]
$bc setName Wall
$bc setId 2
$bc setPhysicalType "Wall Viscous"
$bc apply $dom(1)
puts [[$dom(1) getAutomaticBoundaryCondition] getName]

Output

Unspecified
Wall

getRegisterBoundaryConditions

$ent getRegisterBoundaryConditions

This action returns the register boundary conditions for all registers in which this entity is used.

Parameters

none

Returns

This action returns a list of lists, each containing the register and boundary condition, in the form [list register pw::BoundaryCondition].  If the CAE mode is 2D the registers will be connector usage registers, and if the CAE mode is 3D the registers will be domain usage registers.

Information

An error will occur if this is called for anything other than a pw::Connector object in 2D mode and anything other than a pw::Domain object in 3D mode.

Example

This example shows how to find the boundary conditions for all registers which include the given entity.  $dom(1) is referencing an existing domain.

Code

set n 1
foreach regBCs [$dom(1) getRegisterBoundaryConditions] {
lassign $regBCs reg($n) bc($n)
lappend r($n) [[lindex $reg($n) 0] getName]
lappend r($n) [[lindex $reg($n) 1] getName]
lappend r($n) [lindex $reg($n) 2]
lappend b($n) [$bc($n) getName]
puts "The register $r($n) has an $b($n) boundary condition."
incr n
}

Output

The register blk-2 dom-18 Opposite has an Unspecified boundary
condition.
The register blk-3 dom-18 Same has an Unspecified boundary
condition.

getVolumeCondition

$ent getVolumeCondition

This action gets the volume condition of this entity.

Parameters

none

Returns

This action returns a pw::VolumeCondition object.

Information

An error will occur if this is called for anything other than a pw::Domain object in 2D mode and anything other than a pw::Block object in 3D mode.

Example

This example shows how to get the volume condition for a block while in 3D mode.  $block(1) is referencing an existing block.

Code

puts [[$block(1) getVolumeCondition] getName]

Output

Unspecified

transform

$entity transform matrix

This action transforms this entity by the given matrix.

Parameters

matrixThis parameter is the 4x4 transform matrix.

Returns

This action returns nothing.

See Also

pwu::Transform

Example

This example shows how to rotate grid entities using a transform utility command that sets an anchor point and the new vectors of the X-axis (1 1 0) and Y-axis (1 0 1).  $block(1) is referencing an existing block.

Code

$block(1) transform \
[pwu::Transform rotation -anchor "0 10 5" "1 1 0" "1 0 1"]

getDatabaseEntities

$entity getDatabaseEntities

This action gets all database entities the grid entity is using.

Parameters

none

Returns

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

Example

This example shows how to get the number of database entities the given grid entity is using.  $dom(1) is referencing an existing domain.

Code

puts [llength [$dom(1) getDatabaseEntities]]

Output

2

getExcludedSources

$entity getExcludedSources

This action gets all source entities that are being explicitly excluded from affecting the grid of this entity

Parameters

none

Returns

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

excludeSource

$entity excludeSource source ?exclude?

This action explicitly excludes a source from affecting the grid of this entity

Parameters

sourceThis parameter is an pw::SourceEntity object to exclude
excludeThis optional boolean parameter determines whether the entity should be added or removed from the excluded entities.  The default value is true.

Returns

nothing

getIncludedSizeFieldEntities

$entity getIncludedSizeFieldEntities ?-global?

This action gets all entities that are being explicitly included in the size field that affects the grid of this entity.

Parameters

-globalthis flag indicates that the returned list include all entities.  If this flag is not set, only entities from the active framework are returned.

Returns

This action returns a list of pw::Entity objects or a list of pw::Framework and pw::Entity objects.

includeSizeFieldEntity

$entity includeSizeFieldEntity entity ?include?

This action explicitly includes an entity in the size field source that affects the grid of this entity

Parameters

entityThis parameter is a framework_entity object, or list of framework_entity objects to include in the size field.
includeThis optional boolean parameter determines whether the entity should be added or removed from the included entities.  The default value is true.

Returns

nothing

clearSizeFieldEntities

$entity clearSizeFieldEntities

This action explicitly clears all entities in the size field source from affecting the grid of this entity

Parameters

none

Returns

nothing

getSizeFieldPointCount

$entity getSizeFieldPointCount

This action gets the number of point primitives that will be used when generating the size field that affects this entity.

Parameters

none

Returns

This action returns an integer count of the source points.

Info

When this value is large (greater than 300,000) the time to apply the size field to the grid entity will increase dramatically.

getOutOfSyncWithSources

$entity getOutOfSyncWithSources

This action checks if the grid entity is currently out of sync with its sources.  This can happen when a source is changed but the grid entity has not been updated since the change occured.

Parameters

none

Returns

This action returns a boolean value

getOutOfSyncAttributes

$entity getOutOfSyncAttributes

This action checks if the grid entity is currently out of sync with its attributes.  This can happen when an attribute is changed but the grid entity has not been updated since the change occured.

Parameters

none

Returns

This action returns a boolean value

clearOutOfSync

$entity clearOutOfSync

This action clears the out of sync flags for this grid entity, even though the grid points may be out of sync with it’s sources or attributes.  This should only be used when the entity is understood to be out of sync and will be updated at a later time, but it shouldn’t be displayed as out of sync in the list panel.

Parameters

none

Returns

This action returns nothing

canReExtrude

$entity canReExtrude

This action returns true if the entity can be re-extruded.

Parameters

none

Returns

This action returns a boolean value indicating if the entity can be re-extruded.

Example

This example shows how to get a list of all entities that can be re-extruded.

Code

puts "Entities valid for re-extrusion:"
set reExtEnts [list]
foreach ent [pw::Grid getAll] {
if {[$ent canReExtrude]} {
lappend reExtEnts $ent
puts " [$ent getName]"
}
}

setOversetObjectVisibility

$entity setOversetObjectVisibility ?-path path? ?-fringe? ?-hole? ?-orphan? ?-orphanDonorCandidates?

This action sets the named overset render attribute.

Parameters

-pathThis optional parameter specifies the framework path to the specific instance of the block.  If no path is specified, the action is applied to all instances.
-fringeThis optional parameter indicates if the fringe objects should be rendered.
-holeThis optional parameter indicates if the hole objects should be rendered.
-orphanThis optional parameter indicates if the orphan objects should be rendered.
-orphanDonorCandidatesThis optional parameter indicates if the orphan donor candidates should be rendered.

Information

Overset object visibility will be turned on for the type flag(s) included in the parameter list, and will be turned off for missing type flag(s).  If all flags are missing, the visibility of all overset objects will be turned off.

An error will occur if this is called for anything other than a pw::Block object in 3D mode.

Returns

This action returns nothing.

Example

This example shows how to turn on fringe and orphan objects, implicitly turning off hole and orphan donor candidate objects.

Code

$blk setOversetObjectVisibility -fringe -orphan

getOversetObjectVisibility

$entity getOversetObjectVisibility ?-path path?

This action returns the named overset render attribute.

Parameters

-pathThis optional parameter specifies the framework path to the specific instance of the block.  The default value is the active framework.

Information

An error will occur if this is called for anything other than a pw::Block object in 3D mode.

Returns

This action returns a list of boolean indicating the visibility state of fringe, hole, orphan and orphan donor candidate objects for this entity.

Example

This example shows how to retrieve the overset object visibility states for an entity.

Code

$blk getOversetObjectVisibility

Output

{1 0 1 0}
pw::GridEntity getByName ?-path path? name
This action gets a grid entity using the name.
pw::GridEntity project ?-type proj_type? ?-direction direction? ?-center center? ?-axis point normal? ?<-interior | -shape>? entities ?dbentities?
This action projects grid entities onto database entities.
pw::GridEntity getAdjacentEntities ?-maximumAngle angle? ?-all? entities
This action gets a list of entities adjacent to the given entities.
pw::Grid getUniquePointCount <-type type | entities>
This action returns the number of unique points among the specified node, connector, domain and/or block entities (contained in a list of entities) or identified by one of the following types: pw::Node, pw::Connector, pw::Domain, pw::Block.
pw::GridEntity get/setDefault SizeFieldDecay decay
This default is the size field decay factor of a grid entity when it is created.
pw::GridEntity get/setDefault SizeFieldBackgroundSpacing spacing
This default is the size field background spacing of a grid entity when it is created.
pw::GridEntity get/setDefault SizeFieldCalculationMethod method
This default is the size field calculation method of a grid entity when it is created.
$entity get/setIgnoreAllSources ignore
This attribute is a flag that controls whether the influence of sources should be ignored when determining grid point locations.
$entity get/setIgnoreAllSizeFieldEntities ignore
This attribute is a flag that controls whether the influence of explicitly included entities should be ignored when determining grid point locations.
$entity get/setSizeFieldIgnoreEntityBoundary ignore
This attribute controls whether the boundary of the entity should be ignored when the size field is generated for this entity.
$entity getGridShape
This action gets the pw::GridShape object that was used to create this grid entity using the updateGridEntities action.
Grid shape type
$entity getPointCount ?-constrained constrainedVar? ?-owned?
This action gets the number of grid points in the given entity.
$entity closestCoordinate ?-boundary? ?-distance distVar? point ?dir?
This action gets the grid coordinate that is closest to the given point.
$ent getAutomaticBoundaryCondition
This action gets the boundary condition that will automatically be applied to a register when this entity is added to a higher level entity (an edge register if this is a connector, and a face register if this is a domain).
$ent getRegisterBoundaryConditions
This action returns the register boundary conditions for all registers in which this entity is used.
$ent getVolumeCondition
This action gets the volume condition of this entity.
$entity transform matrix
This action transforms this entity by the given matrix.
$entity getDatabaseEntities
This action gets all database entities the grid entity is using.
$entity getExcludedSources
This action gets all source entities that are being explicitly excluded from affecting the grid of this entity
$entity excludeSource source ?exclude?
This action explicitly excludes a source from affecting the grid of this entity
$entity getIncludedSizeFieldEntities ?-global?
This action gets all entities that are being explicitly included in the size field that affects the grid of this entity.
$entity includeSizeFieldEntity entity ?include?
This action explicitly includes an entity in the size field source that affects the grid of this entity
$entity clearSizeFieldEntities
This action explicitly clears all entities in the size field source from affecting the grid of this entity
$entity getSizeFieldPointCount
This action gets the number of point primitives that will be used when generating the size field that affects this entity.
$entity getOutOfSyncWithSources
This action checks if the grid entity is currently out of sync with its sources.
$entity getOutOfSyncAttributes
This action checks if the grid entity is currently out of sync with its attributes.
$entity clearOutOfSync
This action clears the out of sync flags for this grid entity, even though the grid points may be out of sync with it’s sources or attributes.
$entity canReExtrude
This action returns true if the entity can be re-extruded.
$entity setOversetObjectVisibility ?-path path? ?-fringe? ?-hole? ?-orphan? ?-orphanDonorCandidates?
This action sets the named overset render attribute.
$entity getOversetObjectVisibility ?-path path?
This action returns the named overset render attribute.
Base type for all glyph types
Entity type
Framework type
Base type for all grid entities
A string is an array of characters.
A vector is a list of float values.
$con getDefaultProjectDirection
This action gets the default projection direction for this connector.
$dom getDefaultProjectDirection
This action gets the default projection direction for this domain.
Connector type
Domain type
Database curve type
A type is the class name of a Glyph2 object.
An integer is a whole number.
A float is a fractional number.
A boolean is represented as a 0 or 1, with 0 being false and 1 being true.
CAE boundary condition type
A register is the usage of a lower level entity in a higher level entity.
CAE volume condition type
Block type
Utility functions for transform matrices, which are represented as a list of sixteen real values.
Base type for all database entities
Base type for all source entities
A framework_entity is a reference to an entity in a pw::Framework.