Base type for all grid entities. A grid entity is a zero-, one-, two- or three-dimensional collection of discrete cell elements, defined by discrete point locations and connectivity in space.
pw:: | Base type for all grid entities. |
Static Actions | |
getByName | This action gets a grid entity using the name. |
project | This action projects grid entities onto database entities. |
getAdjacentEntities | This action gets a list of entities adjacent to the given entities. |
getUniquePointCount | 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 specifying the entity type. |
Static Defaults | |
SizeFieldBackgroundSpacing (Default) | This default is the size field background spacing of a grid entity when it is created. |
SizeFieldCalculationMethod (Default) | This default is the size field calculation method of a grid entity when it is created. |
Instance Attributes | |
IgnoreAllSources | This attribute is a flag that controls whether the influence of sources should be ignored when determining grid point locations. |
IgnoreAllSizeFieldEntities | This attribute is a flag that controls whether the influence of explicitly included entities should be ignored when determining grid point locations. |
SizeFieldDecay | This attribute is the size field decay factor used as the decay when a size field is generated for this entity. |
SizeFieldDelayMultiplier | This attribute is the size field decay factor used as the decay when a size field is generated for this entity. |
SizeFieldBackgroundSpacing | This attribute is the size background spacing when a size field is generated for this entity. |
SizeFieldCalculationMethod | This attribute is a string that controls how spacing is calculated for size field point primitives. |
SizeFieldIgnoreEntityBoundary | This attribute controls whether the boundary of the entity should be ignored when the size field is generated for this entity. |
Instance Actions | |
getGridShape | This action gets the pw::GridShape object that was used to create this grid entity using the <updateGridEntities> action. |
getPointCount | This action gets the number of grid points in the given entity. |
getUsageTopology | This action gets the grid entity’s usage topology type. |
closestCoordinate | This action gets the grid coordinate that is closest to the given point. |
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). |
getRegisterBoundaryConditions | This action returns the register boundary conditions for all registers in which this entity is used. |
getVolumeCondition | This action gets the volume condition of this entity. |
transform | This action transforms this entity by the given matrix. |
getDatabaseEntities | This action gets all database entities the grid entity is using. |
getExcludedSources | This action gets all source entities that are being explicitly excluded from affecting the grid of this entity |
excludeSource | This action explicitly excludes a source from affecting the grid of this entity |
getIncludedSizeFieldEntities | This action gets all entities that are being explicitly included in the size field that affects the grid of this entity. |
includeSizeFieldEntity | This action explicitly includes an entity in the size field source that affects the grid of this entity |
clearSizeFieldEntities | This action explicitly clears all entities in the size field source from affecting the grid of this entity |
getSizeFieldPointCount | This action gets the number of point primitives that will be used when generating the size field that affects this entity. |
getOutOfSyncWithSources | This action checks if the grid entity is currently out of sync with its sources. |
getOutOfSyncAttributes | This action checks if the grid entity is currently out of sync with its attributes. |
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. |
canReExtrude | This action returns true if the entity can be re-extruded. |
setOversetObjectVisibility | This action sets the named overset render attribute. |
getOversetObjectVisibility | This action returns the named overset render attribute. |
pw::GridEntity getByName ?-path path? name
This action gets a grid entity using the name.
name | This required parameter is a name string. |
-path path | This optional parameter and its argument specify the framework_path to the framework in which the grid entity resides. The path argument must be a list of either pw::Framework objects or string 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. |
This action returns a pw::GridEntity object.
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.
pw::GridEntity project ?-type proj_type? ?-direction direction? ?-center center? ?-axis point normal? ?-fit tolerance? ?<-interior | -shape>? entities ?dbentities?
This action projects grid entities onto database entities.
-type proj_type | This optional parameter is the string projection type to perform with options < ClosestPoint | Linear | SphericalIn | SphericalOut | CylindricalIn | CylindricalOut >. |
-direction direction | This 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 center | This optional parameter is the center point vector for spherical projection. The default is (0, 0, 0). |
-axis point normal | This 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). |
-interior | If this optional flag is present, only the interior of the entities are projected. |
-fit tolerance | This optional parameter is the float tolerance used to fit any connector. The default for this is 0.0 which means there is no fitting applied onto the projected curve. The valid range for this parameter is [0.0, infinity). |
-shape | If 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. |
entities | This required parameter is a list of entities to project. Only pw::Connector and pw::Domain objects can be projected. |
dbentities | This optional parameter is a list of database curve and surface-like pw::DatabaseEntity objects to project onto. If none are given, project to any currently enabled, visible database surface-like entities. |
This action returns nothing.
If the entities parameter contains any pw::Domain objects, it is an error to include any pw::Curve objects in the dbentities parameter.
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)
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.
-maximumAngle angle | This optional parameter is the float maximum bend angle in the range [0.0, 180.0] for considering entities as adjacent. 180.0 is the default. |
-all | This optional parameter specifies to continue looking for adjacent entities as new ones are added. |
entities | This required parameter is a list of pw::GridEntity objects to be used as the seed. |
This action returns a list of adjacent pw::GridEntity objects.
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
pw::GridEntity 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 specifying the entity type.
-type type | This optional parameter is a type of entity to retrieve the unique point count of with options < pw::Node | pw::Connector | pw::Domain | pw::Block >. If given, the entities parameter may not be used. |
entities | This optional parameter is list of pw::GridEntity objects to count the unique points of. If given the -type parameter may not be used. |
Either -type or entities must be specified.
This action returns an integer value.
pw::GridEntity get/setDefault SizeFieldBackgroundSpacing spacing
This default is the size field background spacing of a grid entity when it is created.
A float in the range [0.0, infinity).
The default value is 0.0.
pw::GridEntity get/setDefault SizeFieldCalculationMethod method
This default is the size field calculation method of a grid entity when it is created.
A string with options < MinimumDistance | InverseDistance | BlendDistance | MinimumValue >
The default for this attribute is MinimumDistance
$entity get/setIgnoreAllSources ignore
This attribute is a flag that controls whether the influence of sources should be ignored when determining grid point locations.
This attribute is a boolean.
The default for this attribute is false.
$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.
This attribute is a boolean.
The default value of this attribute is false.
$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.
A float in the range [0.0, 1.0].
The default for this attribute is the value of the <SizeFieldDecay (Default)> default when the grid entity was created.
$entity get/setSizeFieldDelayMultiplier delayMultiplier
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.
A float in the range [0.0, 1.0].
The default for this attribute is the value of the <SizeFieldDelayMultiplier (Default)> default when the grid entity was created.
$entity get/setSizeFieldBackgroundSpacing spacing
This attribute is the size background spacing when a size field is generated for this entity.
A float in the range [0.0, infinity).
The default for this attribute is the value in the SizeFieldBackgroundSpacing (Default) default when the grid entity was created.
$entity get/setSizeFieldCalculationMethod method
This attribute is a string that controls how spacing is calculated for size field point primitives.
A string with options < MinimumDistance | InverseDistance | BlendDistance | MinimumValue >
The default for this attribute is the value in the SizeFieldCalculationMethod (Default) default when the grid entity was created.
$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.
This attribute is a boolean.
The default for this attribute is false.
$entity getGridShape
This action gets the pw::GridShape object that was used to create this grid entity using the <updateGridEntities> action.
none
This action returns a pw::GridShape object if a grid shape was used to create this entity, otherwise it returns an empty string.
$entity getPointCount ?-constrained constrainedVar? ?-owned?
This action gets the number of grid points in the given entity.
-constrained constrainedVar | This optional parameter is a string variable name to receive the number of points in the given entity, that are constrained to database entities. |
-owned | This optional flag can be set to return the count of points that are owned solely by this grid entity. |
This action returns the integer number of points.
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
$entity closestCoordinate ?-boundary? ?-distance distVar? point ?dir?
This action gets the grid coordinate that is closest to the given point.
-boundary | This optional parameter indicates to find the closest coordinate on the boundary of this entity. |
-distance distVar | This optional parameter is a string variable name to receive the distance between the given point or ray and the grid coordinate returned. |
point | This required parameter is the point from which to find the closest coordinate. |
dir | This optional parameter is a direction vector for finding the closest point from a ray. |
This action returns a grid coordinate on this entity.
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
$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).
none
This action returns a pw::BoundaryCondition object.
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.
pw::BoundaryCondition, register
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
$ent getRegisterBoundaryConditions
This action returns the register boundary conditions for all registers in which this entity is used.
none
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.
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.
register, pw::BoundaryCondition
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.
$ent getVolumeCondition
This action gets the volume condition of this entity.
none
This action returns a pw::VolumeCondition object.
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.
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
$entity transform matrix
This action transforms this entity by the given matrix.
matrix | This required parameter is the 4x4 transform matrix. |
This action returns nothing.
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"]
$entity getDatabaseEntities
This action gets all database entities the grid entity is using.
none
This action returns a list of pw::DatabaseEntity objects.
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
$entity getExcludedSources
This action gets all source entities that are being explicitly excluded from affecting the grid of this entity
none
This action returns a list of pw::SourceEntity objects.
$entity excludeSource source ?exclude?
This action explicitly excludes a source from affecting the grid of this entity
source | This required parameter is an pw::SourceEntity object to exclude. |
exclude | This optional boolean parameter determines whether the entity should be added or removed from the excluded entities. The default value is true. |
nothing
$entity getIncludedSizeFieldEntities ?-global? ?-recursive?
This action gets all entities that are being explicitly included in the size field that affects the grid of this entity.
-global | This optional flag indicates that the returned list include all entities. If this flag is not set, only entities from the active framework are returned. |
-recursive | This optional flag indicates that the returned list recursively include the included size field entities of the entities that affects the grid of this entity. |
This action returns a list of pw::Entity objects or a list of pw::Framework and pw::Entity objects.
pw::SourceEntity, excludeSource, getExcludedSources, includeSizeFieldEntity
$entity includeSizeFieldEntity ?-reject rejectVar? entity ?include?
This action explicitly includes an entity in the size field source that affects the grid of this entity
-reject rejectVar | This optional parameter is a string variable name to receive a list of entities that were rejected for including as size field entities. If this is not given, no rejections will be reported. An entity is rejected if it is the same as this entity, a higher level grid entity (a block cannot be a size field entity for a domain) or if including the size field entity would create a cycle. |
entity | This required parameter is a framework_entity object, or list of framework_entity objects to include in the size field. |
include | This optional boolean parameter determines whether the entity should be added or removed from the included entities. The default value is true. |
nothing
$entity getSizeFieldPointCount
This action gets the number of point primitives that will be used when generating the size field that affects this entity.
none
This action returns an integer count of the source points.
When this value is large (greater than 300,000) the time to apply the size field to the grid entity will increase dramatically.
$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 occurred.
none
This action returns a boolean value where true indicates that the grid entity is out of sync with its associated sources.
$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 occurred.
none
This action returns a boolean value where true indicates that the grid entity is 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. 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.
none
This action returns nothing
$entity canReExtrude
This action returns true if the entity can be re-extruded.
none
This action returns a boolean value indicating if the entity can be re-extruded.
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]" } }
$entity setOversetObjectVisibility ?-path path? ?-fringe? ?-hole? ?-orphan? ?-orphanDonorCandidates?
This action sets the named overset render attribute.
-path path | This 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. |
-fringe | This optional flag indicates that the fringe objects should be rendered. |
-hole | This optional flag indicates that the hole objects should be rendered. |
-orphan | This optional flag indicates that the orphan objects should be rendered. |
-orphanDonorCandidates | This optional flag indicates that the orphan donor candidates should be rendered. |
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.
This action returns nothing.
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
$entity getOversetObjectVisibility ?-path path?
This action returns the named overset render attribute.
-path path | This optional parameter specifies the framework_path to the specific instance of the block. The default value is the active framework. |
An error will occur if this is called for anything other than a pw::Block object in 3D mode.
This action returns a list of boolean indicating the visibility state of fringe, hole, orphan and orphan donor candidate objects for this entity.
This example shows how to retrieve the overset object visibility states for an entity.
Code
$blk getOversetObjectVisibility
Output
{1 0 1 0}
This action gets a grid entity using the name.
pw::GridEntity getByName ?-path path? name
This action projects grid entities onto database entities.
pw::GridEntity project ?-type proj_type? ?-direction direction? ?-center center? ?-axis point normal? ?-fit tolerance? ?<-interior | -shape>? entities ?dbentities?
This action gets a list of entities adjacent to the given entities.
pw::GridEntity getAdjacentEntities ?-maximumAngle angle? ?-all? 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 specifying the entity type.
pw::GridEntity getUniquePointCount <-type type | entities>
This default is the size field background spacing of a grid entity when it is created.
pw::GridEntity get/setDefault SizeFieldBackgroundSpacing spacing
This default is the size field calculation method of a grid entity when it is created.
pw::GridEntity get/setDefault SizeFieldCalculationMethod method
This attribute is a flag that controls whether the influence of sources should be ignored when determining grid point locations.
$entity get/setIgnoreAllSources 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/setIgnoreAllSizeFieldEntities ignore
This attribute is the size field decay factor used as the decay when a size field is generated for this entity.
$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.
$entity get/setSizeFieldDelayMultiplier delayMultiplier
This attribute is the size background spacing when a size field is generated for this entity.
$entity get/setSizeFieldBackgroundSpacing spacing
This attribute is a string that controls how spacing is calculated for size field point primitives.
$entity get/setSizeFieldCalculationMethod method
This attribute controls whether the boundary of the entity should be ignored when the size field is generated for this entity.
$entity get/setSizeFieldIgnoreEntityBoundary ignore
This action gets the pw::GridShape object that was used to create this grid entity using the updateGridEntities action.
$entity getGridShape
This action gets the number of grid points in the given entity.
$entity getPointCount ?-constrained constrainedVar? ?-owned?
This action gets the grid entity’s usage topology type.
$entity getUsageTopology
This action gets the grid coordinate that is closest to the given point.
$entity closestCoordinate ?-boundary? ?-distance distVar? point ?dir?
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 getAutomaticBoundaryCondition
This action returns the register boundary conditions for all registers in which this entity is used.
$ent getRegisterBoundaryConditions
This action gets the volume condition of this entity.
$ent getVolumeCondition
This action transforms this entity by the given matrix.
$entity transform matrix
This action gets all database entities the grid entity is using.
$entity getDatabaseEntities
This action gets all source entities that are being explicitly excluded from affecting the grid of this entity
$entity getExcludedSources
This action explicitly excludes a source from affecting the grid of this entity
$entity excludeSource source ?exclude?
This action gets all entities that are being explicitly included in the size field that affects the grid of this entity.
$entity getIncludedSizeFieldEntities ?-global? ?-recursive?
This action explicitly includes an entity in the size field source that affects the grid of this entity
$entity includeSizeFieldEntity ?-reject rejectVar? entity ?include?
This action explicitly clears all entities in the size field source from affecting the grid of this entity
$entity clearSizeFieldEntities
This action gets the number of point primitives that will be used when generating the size field that affects this entity.
$entity getSizeFieldPointCount
This action checks if the grid entity is currently out of sync with its sources.
$entity getOutOfSyncWithSources
This action checks if the grid entity is currently out of sync with its attributes.
$entity getOutOfSyncAttributes
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 clearOutOfSync
This action returns true if the entity can be re-extruded.
$entity canReExtrude
This action sets the named overset render attribute.
$entity setOversetObjectVisibility ?-path path? ?-fringe? ?-hole? ?-orphan? ?-orphanDonorCandidates?
This action returns the named overset render attribute.
$entity getOversetObjectVisibility ?-path path?
This action gets the default projection direction for this connector.
$con getDefaultProjectDirection
This action gets the default projection direction for this domain.
$dom getDefaultProjectDirection