pw::Grid

Global actions for grid entities

Derives From

pw::Object

Summary
pw::GridGlobal actions for grid entities
Static Actions
getExportFileTypesThis action gets a list of file types that can export all of the given entities.
checkForInvalidEntitiesThis action checks if a list of entities are valid for the given settings.
exportThis action exports the list of entities to the given file.
checkForMissingReferencesThis action checks if importing the given file would result in missing references.
importThis action imports a file into the grid.
saveThis action saves the entire grid in the native file format.
mergeConnectorsThis action merges connectors within a tolerance.
mergeConnectorPairThis action automatically merges two connectors.
getXYZThis action gets the 3D position of the given grid coordinate.
getPointThis action gets the position of the given grid coordinates.
getEntityThis action gets the grid entity at the given grid coordinates
mapHigherThis action maps the given grid coordinate to all coords that are immediately higher than the specified coord.
mapLowerThis action maps the given grid coordinate to all coords that are immediately lower than the specified coord.
offsetIJKThis action offsets the ijk coordinates of the given grid coordinate.
offsetNormalThis action calculates the offset from the given grid coordinate in the direction of the normal at the coordinate.
getAllThis action gets a list of all grid entities.
getCountThis action gets the number of grid entities.
getByNameThis action gets a grid entity using the name.
getExtentsThis action gets the extents of the grid entities.
getElementCountThis command returns the number of elements for the given type.
getPointCountThis action gets the number of points in the entire grid.
isMirroredDetermines if a grid mirror plane is defined.
clearMirrorPlaneUndefines the grid mirror plane.
getMirrorPlaneEntitiesProcesses entity_list for the given plane.
calculateLaminarGrowthThis action computes anisotropic growth parameters for a laminar boundary layer.
calculateTurbulentGrowthThis action computes anisotropic growth parameters for a turbulent boundary layer.
calculateGrowthRateAtLayerThis action computes the growth rate for a given layer in a boundary layer.
calculateGrowthRateScheduleThis action computes the growth rate schedule from a set of growth parameters, such as those returned by the calculateLaminarGrowth or calculateTurbulentGrowth actions.
Static Attributes
GridPointToleranceThis attribute is the grid point tolerance of grid entities and operations.
NodeToleranceThis attribute is the node tolerance of grid entities and operations.
ConnectorToleranceThis attribute is the connector tolerance of grid entities and operations.
ImportSplitAngleThis attribute is the bending angle at which unstructured domains are split on import.
ImportSplitMultipleEdgesThis attribute is the flag for whether unstructured domains with more than one edge are split on import so that they will only made up of a single edge.
MirrorPlaneThis attribute is the mirroring plane applied to the grid at export.

Static Actions

getExportFileTypes

pw::Grid getExportFileTypes ?-facesOnly? entity_list

This action gets a list of file types that can export all of the given entities.

Parameters

-facesOnlyIf this flag is present only the faces of blocks will be exported.
entity_listThis parameter is a list of pw::GridEntity objects, or a single pw::GridEntity Object.

Returns

This action returns a list containing file type names that can be used in the export command.

checkForInvalidEntities

pw::Grid checkForInvalidEntities -type file_type ?-facesOnly? ?-invalid invalid_var? entity_list

This action checks if a list of entities are valid for the given settings.

Parameters

-type file_typeThis parameter is the file type of the exported file; < Gridgen | IGES | STL | GridPro | VRML | VRML97 | PLOT3D | Segment | Patran | Nastran | UCD | Xpatch | FVUNS | FVUNS30 | CGNS | CGNS-STRUCT | CGNS-UNSTR >.
-facesOnlyThis flag if present, indicates only the faces of blocks will be exported.
-invalid invalid_varThis parameter is a string name of the variable to receive a list of invalid pw::GridEntity objects.
entity_listThis parameter is a list of pw::GridEntity objects, or a single pw::GridEntity Object.

Returns

This action returns a boolean, true if all entities are valid for given file type.

Information

The export function has more information about file types.

See Also

export

export

pw::Grid export ?-type file_type? ?-format file_format? ?-precision fp_precision? ?-surfaces surface_style? ?-facesOnly? ?-noOverwrite? ?-report report_var? entity_list filename

This action exports the list of entities to the given file.

Parameters

-type file_typeThis parameter is the file type of the exported file; < Automatic | Gridgen | IGES | STL | GridPro | VRML | VRML97 | PLOT3D | Segment | Patran | Nastran | UCD | Xpatch | FVUNS | FVUNS30 | CGNS | CGNS-STRUCT | CGNS-UNSTR >.
-format file_formatThis parameter is the file format of the exported file; < ASCII | Binary | Unformatted >.
-precision fp_precisionThis parameter is the floating point precision of the exported file; < Single | Double >.
-surfaces surface_styleThis parameter is the exported surface style; < Bilinear | Continuous >.
-facesOnlyIf this flag is present only the faces of blocks will be exported.
-noOverwriteIf this flag is present and the file already exists, do not export the file.
-report report_varThis parameter is a string variable name to receive the low-level export details as a pre-formatted report string.
entity_listThis parameter is a list of pw::GridEntity objects, or a single pw::GridEntity object.
filenameThis parameter is the full path and name of the file to export.

Returns

This action returns nothing.

Information

This command supports progress updates.

File Types

Automaticdetermine the file type based on the filename extension
GridgenGridgen grid file format
IGESInitial Graphics Exchange Specification v5.3
STLStereo Lithography file format
GridProGridPro’s surface patch files
VRMLVRML 1.0 format
VRML97VRML 2.0/97 format
PLOT3D3D, multi-grid format with no i-blanking
SegmentGridgen connector and line file format
PatranPatran version 2.5 Neutral file format
NastranNastran version 69 format, Double precision refers to the “large” Nastran format (using 16 character fields)
UCDAdvanced Visual Systems’ unstructured cell data file format
XpatchXpatch unstructured data file format
FVUNSFIELDVIEW unstructured data file format v2.4
FVUNS30FIELDVIEW unstructured data file format v3.0
CGNSCFD General Notation System data file format
CGNS-STRUCTCFD General Notation System data file format (structured)
CGNS-UNSTRCFD General Notation System data file format (unstructured)
For file_format A = ASCII, B = Binary, U = Unformatted

file_type     extension   file_format fp_precision     valid entity types
============= =========== =========== ================ ==================
Gridgen       gg          B           Double           any
IGES          igs,iges    A           Double           structured 2D
STL           stl         A|B         Single           unstructured 2D
GridPro       dat         A           Single|Double    2D
VRML          wrl,vrml    A           Single           2D
VRML97        wrl,vrml    A           Single           2D
PLOT3D        x,xyz,p3d   A|B|U       Double|Single    structured 2D/3D
Segment       dat         A           Double|Single    1D
Patran        pat         A           Single*          2D/3D
Nastran       nas         A           Double|Single**  2D/3D
UCD           ucd         A           Double|Single    2D/3D
Xpatch        facet       A           Double|Single    2D
FVUNS         uns         A|B|U       Single           3D
FVUNS30       uns         A|B|U       Single           3D
CGNS          cgns        B           Double|Single    3D
CGNS-STRUCT   cgns        B           Double|Single    structured 3D
CGNS-UNSTR    cgns        B           Double|Single    3D

*  The Patran format uses a fixed width field giving 10 digits of precision
   (single = 7 digits, double = 16 digits).

** The Nastran format uses a fixed width field giving 10 digits of precision
   (single = 7 digits, double = 16 digits), however the precision field is
   used to specify the style of Nastran export, where Single will generate
   the small Nastran format and Double will generate the large field
   Nastran-L format (using 16 character fields).

checkForMissingReferences

pw::Grid checkForMissingReferences ?-type file_type? ?-format file_format? ?-precision fp_precision? ?-missing missingVar? filename

This action checks if importing the given file would result in missing references.

Parameters

-type file_typeThis parameter is the file type of the imported file; < Automatic | Gridgen | IGES | STL | GridPro | VRML | VRML97 | PLOT3D | Network | Segment | Patran | Nastran | UCD | Xpatch | FVUNS | FVUNS30 | CGNS | CGNS-STRUCT | CGNS-UNSTR | UGRID >
-format file_formatThis parameter is the file format of the imported file; < ASCII | Binary | Unformatted >.
-precision fp_precisionThis parameter is the floating point precision of the imported file; < Single | Double >.
-missing missingVarThis parameter is a variable name to receive a list of names that are the missing references, if any.
filenameThis parameter is the full path and name of the file to import.

Returns

This action returns a boolean, which is true if there are no missing references.

Information

This command supports progress updates.

File Types

See import for information on file types.

import

pw::Grid import ?-type file_type? ?-format file_format? ?-precision fp_precision? ?-report report_var? filename

This action imports a file into the grid.

Parameters

-type file_typeThis parameter is the file type of the exported file; < Automatic | Gridgen | IGES | STL | GridPro | VRML | PLOT3D | Network | Segment | Patran | Nastran | UCD | Xpatch | FVUNS | CGNS | CGNS-STRUCT | CGNS-UNSTR | UGRID >.
-format file_formatThis parameter is the file format of the imported file; < ASCII | Binary | Unformatted >.
-precision fp_precisionThis parameter is the floating point precision of the imported file; < Single | Double >.
-report report_varThis parameter is a string variable name to receive the low-level import details as a pre-formatted report string.
filenameThis parameter is the full path and name of the file to import.

Returns

This action returns a list of the imported GridEntity objects.  Only entities explicitly defined are returned.  For example, when importing a 2D PLOT3D file, the necessary connectors will be created, but only the domain will be returned.  When importing a Gridgen file, all grid entities imported will be returned since they are all explicitly defined in the file.

Information

This command supports progress updates.

File Types

Automaticdetermine the file type based on the filename extension
GridgenGridgen grid file format
STLStereo Lithography file format
GridProGridPro’s volume grid files
VRMLVRML 1.0 or 97 format
PLOT3D3D, multi-grid format with no i-blanking
NetworkGridgen structured grid and network surface file format
SegmentGridgen connector and line file format
PatranPatran version 2.5 Neutral file format
NastranNastran version 69 format, Double precision refers to the “large” Nastran format (using 16 character fields)
UCDAdvanced Visual Systems’ unstructured cell data file format
XpatchXpatch unstructured data file format
FVUNSFIELDVIEW unstructured data file format (v2.4 or v3.0)
CGNSCFD General Notation System data file format
CGNS-STRUCTCFD General Notation System data file format (structured)
CGNS-UNSTRCFD General Notation System data file format (unstructured)
UGRID2D/3D unstructured grid format
For file_format A = ASCII, B = Binary, U = Unformatted

file_type     extension   file_format fp_precision     valid entity types
============= =========== =========== ================ ==================
Gridgen       gg          B           Double           any
IGES          igs,iges    A           Double           structured 2D
STL           stl         A|B         Single           unstructured 2D
GridPro       grd         A           Single|Double    structured 3D
VRML          wrl,vrml    A           Single           2D
PLOT3D        x,xyz,p3d   A|B|U       Double|Single    structured 2D/3D
Network       grd,net     A|B|U       Double|Single    structured 2D/3D
Segment       dat         A           Double|Single    1D
Patran        pat         A           Single*          2D/3D
Nastran       nas         A           Double|Single**  2D/3D
UCD           ucd         A           Double|Single    2D/3D
Xpatch        facet       A           Double|Single    2D
FVUNS         uns         A|B|U       Single           3D
CGNS          cgns        B           Double|Single    3D
CGNS-STRUCT   cgns        B           Double|Single    structured 3D
CGNS-UNSTR    cgns        B           Double|Single    3D
UGRID         ugrid       A|B|U       Double|Single    unstructured 2D/3D

*  The Patran format uses a fixed width field giving 10 digits of precision
   (single = 7 digits, double = 16 digits).

** The Nastran format uses a fixed width field giving 10 digits of precision
   (single = 7 digits, double = 16 digits), however the precision field is
   used to specify the style of Nastran import, where Single will generate
   the small Nastran format and Double will generate the large field
   Nastran-L format (using 16 character fields).

save

pw::Grid save ?-compress level? ?-noOverwrite? filename

This action saves the entire grid in the native file format.

Parameters

-compress levelThis action is the level of compression to save the file with; [0, 9] where 0 = no compression, 1 = minimum, 9 = maximum; default is 0.
-noOverwriteIf this flag is present and the file already exists, do not save the file.
filenameThis parameter is the full path and name of the file to save.

Returns

This action returns nothing.

Information

This command supports progress updates.

For “-compress level”, 0 = no compression, 1 = minimum, and 9 = maximum.  Higher levels of compression take longer to save.

mergeConnectors

pw::Grid mergeConnectors ?-exclude topology? ?-visibleOnly? -tolerance tol

This action merges connectors within a tolerance.

Parameters

-exclude topologyThis optional parameter is the topology to exclude from merging; None | Manifold | NonFree.
-visibleOnlyThis flag causes only visible connectors to be considered for merging.  All hidden connectors are ignored.
-tolerance tolThis parameter is the tolerance that connectors and nodes must be within for merging to take place.

Returns

This action returns nothing.

mergeConnectorPair

pw::Grid mergeConnectorPair con1 con2

This action automatically merges two connectors.

Parameters

con1This parameter is a pw::Connector object to merge.
con2This parameter is a pw::Connector object to merge.

Returns

This action returns nothing.

getXYZ

pw::Grid getXYZ coord

This action gets the 3D position of the given grid coordinate.

Parameters

coordThis parameter is a grid coord.

Returns

This action returns an xyz vector.

getPoint

pw::Grid getPoint coord

This action gets the position of the given grid coordinates.

Parameters

coordThis parameter is a grid coord.

Returns

This action returns a point giving the position of the grid coordinate It may be in the form “u v dbentity”.

getEntity

pw::Grid getEntity coord

This action gets the grid entity at the given grid coordinates

Parameters

coordThis parameter is a grid coord.

Returns

This action returns a pw::GridEntity object.

Information

If the given coord is not valid, an error will occur.

mapHigher

pw::Grid mapHigher coord

This action maps the given grid coordinate to all coords that are immediately higher than the specified coord.  That is, a node based grid coord will be mapped to all connector based coords at that point (and similarly; connectors to domains, and domains to blocks).

Parameters

coordThis parameter is a grid coord.

Returns

This action returns a list of grid coords based on higher level grid entities that represent the same point.  An empty list is returned if coord does not map to any higher level entities.

Example

This example starts with $nod (an existing node entity) and maps it up to all unique higher level entities.

Code

puts "***********************************************"
puts "Dumping higher coords for \{1 $nod\}"
puts "***********************************************"
puts ""

# prime coords array with {nodeName nodeCoord}
array set coords [list [$nod getName] [list 1 $nod]]
set indent ""

# keep processing as long as coords array is not empty
while { [array size coords] > 0 } {
    array unset higherCoords ;# clear this out

    # process each name coord pair in the coords array
    foreach { name coord } [array get coords] {
        set xyz [pw::Grid getXYZ $coord]
        puts [format "%-20.20s | %-30.30s | %-s" \
                        "$indent$name" "\{$coord\}" "($xyz)"]

        foreach higherCoord [pw::Grid mapHigher $coord] {
            set higherEnt [lindex $higherCoord end]  ;# get coord's entity
            set higherEntName [$higherEnt getName] ;# get entity name

            # if higherEntName is NOT in higherCoords array
            if { {} == [array get higherCoords $higherEntName] } {
                # Use higherEntName as key to store higherCoord in the
                # higherCoords array
                set higherCoords($higherEntName) $higherCoord
            }
        }
    }
    array unset coords ;# All done with coords

    # reload coords with any lower coordinates found above.
    array set coords [array get higherCoords]

    append indent ".." ;# increase indent level string for next pass
}

Output

***********************************************
Dumping higher coords for {1 ::pw::Node_1}
***********************************************

Node_1            | {1 ::pw::Node_1}               | (-11.0 0.0 9.0)
..conBlkLeft-12   | {3 ::pw::Connector_27}         | (-11.0 0.0 9.0)
..conBlkLeft-13   | {3 ::pw::Connector_31}         | (-11.0 0.0 9.0)
..conBlkLeft-15   | {1 ::pw::Connector_25}         | (-11.0 0.0 9.0)
....domBlkLeft-7  | {3 3 ::pw::DomainStructured_2} | (-11.0 0.0 9.0)
....domBlkLeft-8  | {1 3 ::pw::DomainStructured_1} | (-11.0 0.0 9.0)
....domBlkLeft-10 | {1 1 ::pw::DomainStructured_3} | (-11.0 0.0 9.0)
......blk-1       | {13 ::pw::BlockUnstructured_1} | (-11.0 0.0 9.0)

mapLower

pw::Grid mapLower ?-includeNodes? coord

This action maps the given grid coordinate to all coords that are immediately lower than the specified coord.  That is, a block based grid coord will be mapped to all domain based coords at that point (and similarly; domains to connectors and connectors to nodes).

Parameters

coordThis parameter is a grid coord.
-includeNodesIf this flag is present, connector endpoint grid coordinates will map down to their associated pw::Node objects.  By default, mapLower will only map down to connector entities.

Returns

This action returns a list of grid coords based on lower level grid entities that represent the same point.  An empty list is returned if coord does not map to any lower level entities.

Example

This example starts with $blk (an existing block entity) and maps a corner coord down to all unique lower level entities.

Code

puts "***********************************************"
puts "Dumping lower coords for \{1 1 1 $blk\}"
puts "***********************************************"
puts ""

# prime coords array with {blockName blockCornerCoord}
array set coords [list [$blk getName] [list 1 1 1 $blk]]
set indent ""

# keep processing as long as coords array is not empty
while { [array size coords] > 0 } {
    array unset lwrCoords ;# clear this out

    # process each name coord pair in the coords array
    foreach { name coord } [array get coords] {
        set xyz [pw::Grid getXYZ $coord]
        puts [format "%-20.20s | %-30.30s | %-s" \
                  "$indent$name" "\{$coord\}" "($xyz)"]

        foreach lwrCoord [pw::Grid mapLower -includeNodes $coord] {
            set lowerEnt [lindex $lwrCoord end]  ;# get coord's entity
            set lowerEntName [$lowerEnt getName] ;# get entity name

            # if lowerEntName is NOT in lwrCoords array
            if { {} == [array get lwrCoords $lowerEntName] } {
                # Use lowerEntName as key to store lwrCoord in the
                # lwrCoords array
                set lwrCoords($lowerEntName) $lwrCoord
            }
        }
    }
    array unset coords ;# All done with coords

    # reload coords with any lower coordinates found above.
    array set coords [array get lwrCoords]

    append indent ".." ;# increase indent level string for next pass
}

Output

***********************************************
Dumping lower coords for {1 1 1 ::pw::BlockExtruded_1}
***********************************************

blk-3         | {1 1 1 ::pw::BlockExtruded_1}  | (0.0 0.0 -6.0)
..dom-13      | {1 1 ::pw::DomainStructured_5} | (0.0 0.0 -6.0)
..dom-9       | {1 ::pw::DomainUnstructured_1} | (0.0 0.0 -6.0)
..dom-11      | {3 1 ::pw::DomainStructured_4} | (0.0 0.0 -6.0)
....con-13    | {1 ::pw::Connector_6}          | (0.0 0.0 -6.0)
....con-15    | {4 ::pw::Connector_4}          | (0.0 0.0 -6.0)
....con-19    | {1 ::pw::Connector_5}          | (0.0 0.0 -6.0)
......Node_1  | {1 ::pw::Node_1}               | (0.0 0.0 -6.0)

offsetIJK

pw::Grid offsetIJK coord < i | ij | ijk >

This action offsets the ijk coordinates of the given grid coordinate.

Parameters

coordThis parameter is a grid coord.
iThis parameter is the i amount to offset.
ijThis parameter is list with the i and j amounts to offset.
ijkThis parameter is with the i, j, and k amounts to offset.

Returns

This action returns a grid coord.

offsetNormal

pw::Grid offsetNormal coord distance

This action calculates the offset from the given grid coordinate in the direction of the normal at the coordinate.

Parameters

coordThis parameter is a grid coord.
distanceThis parameter is the distance to offset.

Returns

This action returns an xyz vector.

Information

If the normal is not defined for the given grid coordinate, an error will occur.

getAll

pw::Grid getAll ?-type type_string? ?-gridgenCompatible? ?-framework framework?

This action gets a list of all grid entities.

Parameters

-type type_stringIf specified, this option filters the result to include only entities of the specified type.  Only types derived from pw::GridEntity are valid.
-gridgenCompatibleIf specified, this option filters the result to include only entities that can be exported to the Gridgen format.
-frameworkIf specified, this argument specifies which pw::Framework to query.  If not specified, the active pw::Framework is used as the target.

Returns

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

getCount

pw::Grid getCount ?-type type_string? ?-gridgenCompatible?

This action gets the number of grid entities.

Parameters

-type type_string If specified, this option filters the result to include only entities of the specified type.  Only types derived from pw::GridEntity are valid.  -gridgenCompatible If specified, this option filters the result to include only entities that can be exported to the Gridgen format.

Returns

This action returns an integer value.

getByName

pw::Grid 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 database 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.

getExtents

pw::Grid getExtents ?-enabledOnly? ?-visibleOnly?

This action gets the extents of the grid entities.

Parameters

-enabledOnlyThis flag, if present, restricts the calculations to only enabled entities, regardless of their visibility.  Enabled entities in off layers are included, for example.
-visibleOnlyThis flag, if present, restricts the calculations to only visible entities.

Returns

This action returns a list of two vectors representing the min and max xyz points of the extents.

getElementCount

pw::Grid getElementCount type ?-skip3DCells? ?-frameworks? ?entity_list?

This command returns the number of elements for the given type.  If no entities are provided, then the cell count applies to the entire grid.  If entities are provided, then only elements unique to the provided entities will be counted.

Parameters

typeThis parameter is an element type: < Triangle | Quad | Tet | Pyramid | Prism | Hex >.
-skip3DCellsoptional parameter that will prevent 3D cells from contributing to 2D cell counts.  Note that this parameter only takes effect when the specified cell type is 2D.  For example, hex cells will not contribute to a Quad count if this parameter is set.
-frameworksoptional parameter that will query element counts across all frameworks. entity_list is not supported when the parameter is set.
entity_listoptional list of entites to retrieve counts from

Returns

This action returns an integer value.

Example

Code

set domains [pw::Grid getAll -type pw::Domain]
set blocks [pw::Grid getAll -type pw::Block]
# Counts all quad elements of all grid entities
puts [pw::Grid getElementCount Quad]
# Counts only the Quad elements unique to the provided blocks.
# This will count only interior elements, not the shared boundary
# elements.
puts [pw::Grid getElementCount Quad $blocks]
# Counts only the Quad elements unique to the provided domains
puts [pw::Grid getElementCount Quad $domains]

Output

36
12
24

getPointCount

pw::Grid getPointCount ?<Node | Connector | Domain | Block>?

This action gets the number of points in the entire grid.

Parameters

typeThis optional parameter gives a specific entity type to the get the point count of with valid values <Node | Connector | Domain | Block>.

Returns

This action returns an integer value.

Note

When specifying a type, the return value will be the sum of all points for each entity of the given type, which means shared points will be counted twice.  If a unique point count is desired, do not specify the type parameter or use pw::GridEntity.getUniquePointCount.

isMirrored

pw::Grid isMirrored

Determines if a grid mirror plane is defined.

Parameters

none

Returns

This action returns a boolean, true if a mirror plane is defined.

See Also

MirrorPlane, clearMirrorPlane, getMirrorPlaneEntities

clearMirrorPlane

pw::Grid clearMirrorPlane

Undefines the grid mirror plane.

Parameters

none

Returns

This action returns nothing.

See Also

MirrorPlane, isMirrored, getMirrorPlaneEntities

getMirrorPlaneEntities

pw::Grid getMirrorPlaneEntities ?-partial partial_var? ?-other other_var? ?-plane plane? mirrored_var unmirrored_var ?entity_list?

Processes entity_list for the given plane.

Parameters

-partial partial_varThis parameter is a string name of the variable to receive a list of pw::GridEntity objects.  The owned points of these entities lie partially in and partially out of the mirror plane.  For a valid export, this list should be empty.
-other other_varThis parameter is a string name of the variable to receive a list of pw::GridEntity objects.  The owned points of these entities lie completely out of the mirror plane.  This list will contain the top-level entities from entity_list and their appropriate lower-level entities.
-plane planeThis parameter is a mirror plane.  If not specified, the current grid mirror plane is used.
mirrored_varThis parameter is a string name of the variable to receive a list of pw::GridEntity objects.  These entities lie in the mirror plane and are mirrored.
unmirrored_varThis parameter is a string name of the variable to receive a list of pw::GridEntity objects.  These entities lie in the mirror plane and are not mirrored.
entity_listThis optional parameter is a list of pw::GridEntity objects, or a single pw::GridEntity Object.  These entities must be of type pw::Block in 3D or pw::Domain in 2D.  If missing, all visible, type appropriate entities will be used.

Returns

This action returns a list of lower-level entities.  The owned points of these entities all lie on the plane.

Information

In 3D, the returned list contains only domains, connectors and nodes.

In 2D, the returned list contains only connectors and nodes.

The returned list will be empty if no entities lie on the plane or if the mirror plane is undefined.

See Also

MirrorPlane, isMirrored, clearMirrorPlane

calculateLaminarGrowth

pw::Grid calculateLaminarGrowth reynoldsNumber characteristicLength initialSpacingFactor

This action computes anisotropic growth parameters for a laminar boundary layer.  The calculations are based on Blasius’s equation for a smooth flat plate, as referenced in Boundary Layer Theory, Seventh Edition, Schlichting, H., McGraw-Hill: 1979, p 142.

Parameters

reynoldsNumberThis parameter is the Reynolds number.
characteristicLengthThis parameter is the characteristing length of the geometry.
initialSpacingFactorThis parameter is the desired initial spacing at the wall as a fraction of the total laminar boundary layer thickness.

Returns

This action returns a list of values whose elements are, in order:

  • integer number of initial layers in which a growth rate of 1.0 and a growth acceleration of 1.0 will be applied
  • integer number of layers for which the growth accleration rate will be applied after the initial layers
  • float growth acceleration rate
  • float initial wall spacing satisfying the initialSpacingFactor input value.  Note that this spacing value will still need to be assigned to the appropriate T-Rex domains as BCs

See Also

calculateTurbulentGrowth, calculateGrowthRateAtLayer, calculateGrowthRateSchedule

calculateTurbulentGrowth

pw::Grid calculateTurbulentGrowth reynoldsNumber characteristicLength yPlus

This action computes anisotropic growth parameters for a turbulent boundary layer.  The calculations are based on turbulent boundary layers (Law of the Wall) for a smooth flat plate, as referenced in Boundary Layer Theory, Seventh Edition, Schlichting, H., McGraw-Hill: 1979, p 643.

Parameters

reynoldsNumberThis parameter is the Reynolds number.
characteristicLengthThis parameter is the characteristic length of the geometry.
yPlusThis parameter is the desired dimensionless Y+ spacing at the wall.

Returns

This action returns a list of values whose elements are, in order:

  • integer number of initial layers in which a growth rate of 1.0 and a growth acceleration of 1.0 will be applied
  • integer number of layers for which the growth accleration rate will be applied after the initial layers
  • float growth acceleration rate
  • float initial wall spacing satisfying the yPlus input value.  Note that this spacing value will still need to be assigned to the appropriate T-Rex domains as BCs

See Also

calculateLaminarGrowth, calculateGrowthRateAtLayer, calculateGrowthRateSchedule

calculateGrowthRateAtLayer

pw::Grid calculateGrowthRateAtLayer layer numLinearLayers numAccelerationLayers growthAcceleration defaultGrowthRate

This action computes the growth rate for a given layer in a boundary layer.

Parameters

layerThis parameter is the integer layer number at which to compute the growth rate, with the range [0, infinity).
numLinearLayersThis parameter is the integer number of layers from the wall where growth rate and acceleration are constant (1.0), with the range [0, infinity).
numAccelerationLayersThis parameter is the integer number of layers beyond numLinearLayers where growth rate increases according to the growth acceleration, with the range [0, infinity).
growthAccelerationThis parameter is the float growth acceleration rate to be applied in the growth acceleration layers, with the range [1.0, infinity).
defaultGrowthRateThist parameter is the float growth rate to use when no acceleration layers are requested (i.e., when numAccelerationLayers is zero), with the range [1.0, infinity).

Returns

This action returns a float representing the growth rate to apply at the given layer.

See Also

pw::BlockUnstructured.TRexGrowthProfile

calculateGrowthRateSchedule

pw::Grid calculateGrowthRateSchedule numLinearLayers numAccelerationLayers growthAcceleration

This action computes the growth rate schedule from a set of growth parameters, such as those returned by the calculateLaminarGrowth or calculateTurbulentGrowth actions.

Parameters

numLinearLayersThis parameter is the integer number of layers from the wall where growth rate and acceleration are constant (1.0), with the range [0, infinity).
numAccelerationLayersThis parameter is the integer number of layers beyond numLinearLayers where growth rate increases according to the specfied growth acceleration rate, with the range [0, infinity).
growthAccelerationThis parameter is the float growth acceleration rate to apply in the growth acceleration layers, with the range [1.0, infinity).

Returns

This action returns a list of float representing the growth rate to apply at each layer.  The length of the result list is the sum of numLinearLayers and numAccelerationLayers.

See Also

pw::BlockUnstructured.TRexGrowthProfile

Static Attributes

GridPointTolerance

pw::Grid get/setGridPointTolerance tolerance

This attribute is the grid point tolerance of grid entities and operations.

Type

float (0, infinity)

Default

0.0000001

NodeTolerance

pw::Grid get/setNodeTolerance tolerance

This attribute is the node tolerance of grid entities and operations.

Type

float (0, infinity)

Default

0.0001

ConnectorTolerance

pw::Grid get/setConnectorTolerance tolerance

This attribute is the connector tolerance of grid entities and operations.

Type

float (0, infinity)

Default

0.0001

ImportSplitAngle

pw::Grid get/setImportSplitAngle angle

This attribute is the bending angle at which unstructured domains are split on import.

Type

float [0, 180)

Default

0

ImportSplitMultipleEdges

pw::Grid get/setImportSplitMultipleEdges split

This attribute is the flag for whether unstructured domains with more than one edge are split on import so that they will only made up of a single edge.

Type

boolean

Default

false

MirrorPlane

pw::Grid get/setMirrorPlane plane

This attribute is the mirroring plane applied to the grid at export.

Type

plane

Default

none

Information

Setting to an invalid plane value generates a glyph error.

Getting the plane generates a glyph error if the plane is not defined.

Use Use pw::Grid isMirrored to determine if calling getMirrorPlane is allowed.

Example

Code

# plnDef is in the plane in coefficent form {A B C D}
set plnDef [pwu::Plane set {1 0 0} {0 0 0}]

# A glyph error is generated if plnDef is invalid
pw::Grid setMirrorPlane $plnDef

See Also

isMirrored, clearMirrorPlane, getMirrorPlaneEntities

pw::Grid getExportFileTypes ?-facesOnly? entity_list
This action gets a list of file types that can export all of the given entities.
pw::Grid checkForInvalidEntities -type file_type ?-facesOnly? ?-invalid invalid_var? entity_list
This action checks if a list of entities are valid for the given settings.
pw::Grid export ?-type file_type? ?-format file_format? ?-precision fp_precision? ?-surfaces surface_style? ?-facesOnly? ?-noOverwrite? ?-report report_var? entity_list filename
This action exports the list of entities to the given file.
pw::Grid checkForMissingReferences ?-type file_type? ?-format file_format? ?-precision fp_precision? ?-missing missingVar? filename
This action checks if importing the given file would result in missing references.
pw::Grid import ?-type file_type? ?-format file_format? ?-precision fp_precision? ?-report report_var? filename
This action imports a file into the grid.
pw::Grid save ?-compress level? ?-noOverwrite? filename
This action saves the entire grid in the native file format.
pw::Grid mergeConnectors ?-exclude topology? ?-visibleOnly? -tolerance tol
This action merges connectors within a tolerance.
pw::Grid mergeConnectorPair con1 con2
This action automatically merges two connectors.
pw::Grid getXYZ coord
This action gets the 3D position of the given grid coordinate.
pw::Grid getPoint coord
This action gets the position of the given grid coordinates.
pw::Grid getEntity coord
This action gets the grid entity at the given grid coordinates
pw::Grid mapHigher coord
This action maps the given grid coordinate to all coords that are immediately higher than the specified coord.
pw::Grid mapLower ?-includeNodes? coord
This action maps the given grid coordinate to all coords that are immediately lower than the specified coord.
pw::Grid offsetIJK coord < i | ij | ijk >
This action offsets the ijk coordinates of the given grid coordinate.
pw::Grid offsetNormal coord distance
This action calculates the offset from the given grid coordinate in the direction of the normal at the coordinate.
pw::Grid getAll ?-type type_string? ?-gridgenCompatible? ?-framework framework?
This action gets a list of all grid entities.
pw::Grid getCount ?-type type_string? ?-gridgenCompatible?
This action gets the number of grid entities.
pw::Grid getByName ?-path path? name
This action gets a grid entity using the name.
pw::Grid getExtents ?-enabledOnly? ?-visibleOnly?
This action gets the extents of the grid entities.
pw::Grid getElementCount type ?-skip3DCells? ?-frameworks? ?entity_list?
This command returns the number of elements for the given type.
pw::Grid getPointCount ?<Node | Connector | Domain | Block>?
This action gets the number of points in the entire grid.
pw::Grid isMirrored
Determines if a grid mirror plane is defined.
pw::Grid clearMirrorPlane
Undefines the grid mirror plane.
pw::Grid getMirrorPlaneEntities ?-partial partial_var? ?-other other_var? ?-plane plane? mirrored_var unmirrored_var ?entity_list?
Processes entity_list for the given plane.
pw::Grid calculateLaminarGrowth reynoldsNumber characteristicLength initialSpacingFactor
This action computes anisotropic growth parameters for a laminar boundary layer.
pw::Grid calculateTurbulentGrowth reynoldsNumber characteristicLength yPlus
This action computes anisotropic growth parameters for a turbulent boundary layer.
pw::Grid calculateGrowthRateAtLayer layer numLinearLayers numAccelerationLayers growthAcceleration defaultGrowthRate
This action computes the growth rate for a given layer in a boundary layer.
pw::Grid calculateGrowthRateSchedule numLinearLayers numAccelerationLayers growthAcceleration
This action computes the growth rate schedule from a set of growth parameters, such as those returned by the calculateLaminarGrowth or calculateTurbulentGrowth actions.
pw::Grid get/setGridPointTolerance tolerance
This attribute is the grid point tolerance of grid entities and operations.
pw::Grid get/setNodeTolerance tolerance
This attribute is the node tolerance of grid entities and operations.
pw::Grid get/setConnectorTolerance tolerance
This attribute is the connector tolerance of grid entities and operations.
pw::Grid get/setImportSplitAngle angle
This attribute is the bending angle at which unstructured domains are split on import.
pw::Grid get/setImportSplitMultipleEdges split
This attribute is the flag for whether unstructured domains with more than one edge are split on import so that they will only made up of a single edge.
pw::Grid get/setMirrorPlane plane
This attribute is the mirroring plane applied to the grid at export.
Base type for all glyph types
Base type for all grid entities.
A string is an array of characters.
A boolean is represented as a 0 or 1, with 0 being false and 1 being true.
A connector is a computationally one-dimensional grid entity, defined in the parameter space of one or more end-connected curve segments.
A coord is a position in grid space.
A vector is a list of float values.
A point is a position either in model space or database parameter space.
A type is the class name of a Glyph object.
Framework type
An integer is a whole number.
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.
A plane is a list of four float values representing the geometric plane coefficients A, B, C and D.
A block is a volume grid bounded by one or more pw::Faces.
A domain is a computationally two-dimensional grid entity, bounded by one or more pw::Edges.
A float is a fractional number.
$block get/setUnstructuredSolverAttribute TRexGrowthProfile profile
This attribute specifies the growth rate for each anisotropic layer.
Close