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 attribute is a flag that controls whether the influence of sources should be ignored when determining grid point locations.
This attribute is a string that controls how spacing is calculated when multiple sources are available.
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 the number of source points 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 it’s sources.
This action checks if the grid entity is currently out of sync with it’s 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 name

This action gets a grid entity using the name.

Parameters

nameThis parameter is a name string.

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 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 enitities to project onto.  If none are given, project to any currently enabled, visible database entities.

Returns

This action returns nothing.

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

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

SourceCalculationMethod

$entity get/setSourceCalculationMethod method

This attribute is a string that controls how spacing is calculated when multiple sources are available.

Type

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

Default

The default for this attribute is MinimumDistance

Instance Actions

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 recieve 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

getSourcePointCount

$entity getSourcePointCount

This action gets the number of source points 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 it’s 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 it’s 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 ?-fringe? ?-hole? ?-orphan? ?-orphanDonorCandidates?

This action sets the named overset render attribute.

Parameters

-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

This action returns the named overset render attribute.

Parameters

None.

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 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.
$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/setSourceCalculationMethod method
This attribute is a string that controls how spacing is calculated when multiple sources are available.
$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 getSourcePointCount
This action gets the number of source points 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 it’s sources.
$entity getOutOfSyncAttributes
This action checks if the grid entity is currently out of sync with it’s 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 ?-fringe? ?-hole? ?-orphan? ?-orphanDonorCandidates?
This action sets the named overset render attribute.
$entity getOversetObjectVisibility
This action returns the named overset render attribute.
Base type for all glyph types
Entity 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
An integer is a whole number.
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 boolean is represented as a 0 or 1, with 0 being false and 1 being true.