pw:: DatabaseMesherThe database mesher mode type Derives Frompw::Object pw::Mode NotesThis mode is used to create grid entities on database entities. Unlike other modes, the state of the mode is saved when it is ended and subsequent modes will be created with the same state. This state is also saved in the application project file, so a new mode created after a file is loaded will have the same state as the last mode ended before saving the file. To create a mode of this type, use the pw::Application.begin command with the mode DatabaseMesher specified, like this: set mesher [pw::Application begin DatabaseMesher $models]
Summary | The database mesher mode type | | | | This attribute is the tolerance to use when merging connectors. | | This attribute is the preferred method for setting the minimum spacing. | | This attribute is the minimum number of mesh subdivisions per database boundary. | | This attribute is the minimum edge spacing for the mesh. | | This attribute is the minimum edge subdivision length in the mesh. | | This attribute is the minimum radius of surface curvature to use when resolving curvature along an edge in the mesh. | | This attribute is the preferred method for setting the maximum spacing. | | This attribute is the maximum number of mesh subdivisions per the extents of the entities being meshed. | | This attribute is the maximum edge spacing for the mesh. | | This attribute is the curvature angle resolution in degrees. | | This attribute specifies the maximum aspect ratio. | | This attribute specifies the boundary growth rate. | | This attribute determines the algorithm to use when meshing domains. | | This attribute is the refinement factor used to globally scale the parameters of the mesher in order to increase the refinement. | | This attribute is the ratio between the number of subdivisions used to detect domains that can be initialized from structured domains. | | This attribute controls how nearby boundaries influence clustering on a surface. | | This attribute is the target number of mesh subdivisions across gaps between boundaries of the entities being meshed. | | This attribute is the target number of buffer subdivisions when TRex stretching reaches the median between boundaries of the entities being meshed. | | This attribute is the turning angle to use when grouping boundaries. | | This attribute is the ratio between the surface and curve curvature along a boundary to use when detecting Curvature boundaries. | | This attribute is the angle between normals to use when detecting Convex and Concave manifold boundaries. | | This attribute is the metric threshold for domain area ratio. | | This attribute is the metric threshold for domain aspect ratio. | | This attribute is the metric threshold for domain maximum angle. | | This attribute controls whether any pre-existing domains constrained to the quilts in the mode are retained or destroyed. | | This attribute controls whether connectors should be split where they intersect or come within Node tolerance of souce curves on the database being meshed. | | | | This action gets the extents of the models of the mode. | | This action gets the quilts that are detected as thin surfaces, such as a blunt trailing edge of a wing. | | This action gets the quilt boundary group with the minimum length. | | This action gets the length of the minimum boundary group. | | This action gets a list of symmetry loops, where each loop is a list of quilt boundaries that are lamina and lie on a symmetry plane. | | This action gets a list of lamina quilt boundary lists of a certain classification. | | This action gets a list of manifold quilt boundary lists of a certain classification. | | This action creates grid entities on the database entities of this mode. | | This action gets a list of database entities that a surface mesh was not able to be constructed on during the <createSurfaceMesh> action. | | This action gets a list of domains that are dependent upon the quilts included in the mode. | | This action gets a list of sources that are dependent upon the quilts included in the mode. | | This action returns a list of supported filter type names. | | This action adds a new, mesher mode filter to a filter queue. | | This action deletes a filter. | | This action renames a filter. | | This action returns a list of filter names defined in the mesher mode filter_type. | | This action returns the number of filters of the given filter_type defined in the mesher mode. | | This action gets the definition of a filter identified by index or name. | | This action gets a list of all filter definitions of the given filter_type. | | This action matches the name of each mode entity against the filter patterns in filter priority order and returns the match count for each filter. | | This action sets the priority of one or more existing filters. | | This action sets the patterns of an existing filter. | | This action modifies filter patterns as needed to guarantee that the entities in dbentity_list are captured by the specified filter. | | This action sets a filter’s value. | | This action adds a new mapping filter for the mesher mode. | | This action deletes a mapping filter. | | This action renames a mapping filter. | | This action returns a list of mapping filter names defined in the mesher mode. | | This action returns the number of mapping filters of the defined in the mesher mode. | | This action gets the definition of a mapping filter identified by index or name. | | This action gets a list of all mapping filter definitions. | | This action matches the name of each mode entity against the mapping filter patterns in filter priority order and returns the match count for each filter. | | This action sets the priority of one or more existing mapping filters. | | This action sets the patterns of an existing mapping filters. | | This action modifies mapping filter patterns as needed to guarantee that the entities in dbentity_list are captured by the specified filter. | | This action sets a mapping filter’s value. | | This action sets a mapping filter to use equal spacing. | | This action returns whether a mapping filter uses equal spacing. | | This action sets a mapping filter to force adjacent grid spacing on neighboring surface grids. | | This action returns whether a mapping filter forces adjacent grid spacing on neighboring surface grids. | | This action sets a mapping filter’s maximum aspect ratio. | | This action returns the maximum aspect ratio allowed for a mapped domain. | | This action gets whether or not a created unstructured domain was mapped to a structured domain. | | This action adds a new boundary filter to control how stretching is applied to the matching boundaries. | | This function deletes an existing boundary filter. | | This function returns a list of the names of the current boundary filters. | | This action changes the name of an existing boundary filter. | | This action specifies the patterns used to select which quilt boundaries will have the boundary conditions applied. | | This function returns the current definition for a boundary filter. | | This method adds a new entry to the end of a current boundary filter definition. | | This action returns the growth type associated with the boundary filter. | | This action sets the growth type associated with the boundary filter. | | This action gets the growth rate associated with the boundary filter. | | This action sets the growth rate associated with the boundary filter. | | This action gets the growth angle associated with an Angle boundary filter. | | This action sets the growth angle associated with a boundary filter of type Angle. | | This action gets the maximum aspect ratio associated with a boundary filter. | | This action sets the growth maximum aspect ratio associated with a boundary filter. | | This action gets the initial growth boundary spacing for a Wall boundary filter. | | This action sets the growth initial spacing for a Wall boundary filter. | | This action gets the growth rate delay associated with the boundary filter. | | This action sets the growth rate delay associated with the boundary filter. | | This action gets the lower limit for cell spacing along the boundaries matched by the filter. | | This action sets the target lower limit for cell spacing along a boundary. | | This action gets the lower limit for cell spacing along the boundaries matched by the filter. | | This action sets the target lower limit for evaluating the radius of curvature along a boundary. | | This function gets the factor used to scale the spacing of the boundaries associated with the filter. | | This function sets the factor used to scale the spacing of the boundaries associated with the filter. | | This action returns a list of quilt boundaries associated with a boundary filter. | | This sets the priority of one or more existing boundary filters. |
MergeTolerance$mesher get/setMergeTolerance tol |
This attribute is the tolerance to use when merging connectors. TypeThis attribute is a float with the range [0, infinity), where 0 means no merging will be done. DefaultThe default for this attribute is 0.
MinimumSpacingMode$mesher get/setMinimumSpacingMode mode |
This attribute is the preferred method for setting the minimum spacing. TypeThis attribute is of type string with values < Subdivisions | Spacing >. DefaultThe default for this attribute is Subdivisions. InformationThis attribute will be set to match the last attribute set between MinimumBoundarySubdivisions and MinimumEdgeSpacing.
MinimumBoundarySubdivisionsThis attribute is the minimum number of mesh subdivisions per database boundary. TypeThis attribute is an integer with the range [2, inf) that specifies the minimum number of boundary subdivisions. DefaultThe default for this attribute is 2. InformationThis attribute and the MinimumEdgeSpacing attribute will be adjusted to match each other depending on the last one set, and the MinimumSpacingMode will be set to Subdivisions.
MinimumEdgeSpacing$mesher get/setMinimumEdgeSpacing spacing |
This attribute is the minimum edge spacing for the mesh. TypeThis attribute is a positive float that specifies the minimum edge spacing for the mesh. DefaultThe default for this attribute is the minimum edge spacing based on the default for the <MinimumBoundarySubdivision> attribute. InformationThis attribute and the MinimumBoundarySubdivisions attribute will be adjusted to match each other depending on the last one set, and the MinimumSpacingMode will be set to Spacing.
MinimumSubdivisionLength$mesher get/setMinimumSubdivisionLength length |
This attribute is the minimum edge subdivision length in the mesh. TypeThis attribute is a positive float that specifies the minimum edge subdivision length for the mesh. DefaultThe default for this attribute is 0.0 indicating that the minimum spacing determined by MinimumEdgeSpacing, MinimumBoundarySubdivisions and/or MinimumRadiusOfCurvature will be used to limit boundary edge lengths. InformationThis attribute and the MinimumRadiusOfCurvature attribute will be used to limit the minimum allowable edge length on any boundary in the mesh.
MinimumRadiusOfCurvature$mesher get/setMinimumRadiusOfCurvature radius |
This attribute is the minimum radius of surface curvature to use when resolving curvature along an edge in the mesh. TypeThis attribute is a positive float that specifies the minimum radius of surface curvature. DefaultThe default for this attribute is 0.0 indicating that the minimum spacing determined by MinimumEdgeSpacing, MinimumBoundarySubdivisions and/or MinimumSubdivisionLength will be used to limit boundary edge lengths. InformationThis attribute and the MinimumSubdivisionLength attribute will be used to limit the minimum allowable edge length on any boundary in the mesh.
MaximumSpacingMode$mesher get/setMaximumSpacingMode mode |
This attribute is the preferred method for setting the maximum spacing. TypeThis attribute is of type string with values < Subdivisions | Spacing >. DefaultThe default for this attribute is Subdivisions. InformationThis attribute will be set to match the last attribute set between MaximumExtentsSubdivisions and MaximumEdgeSpacing.
MaximumExtentsSubdivisions$mesher get/setMaximumExtentsSubdivisions subdivisions |
This attribute is the maximum number of mesh subdivisions per the extents of the entities being meshed. TypeThis attribute is an integer with the range [2, inf) that specifies the maximum number of mesh subdivisions. DefaultThe default for this attribute is 150. InformationThis attribute and the MaximumEdgeSpacing attribute will be adjusted to match each other depending on the last one set, and the MaximumSpacingMode will be set to Subdivisions.
MaximumEdgeSpacing$mesher get/setMaximumEdgeSpacing spacing |
This attribute is the maximum edge spacing for the mesh. TypeThis attribute is a positive float that specifies the maximum edge spacing for the mesh. DefaultThe default for this attribute is the maximum spacing based on the default for the <MaximumExtentsSubdivision> attribute. InformationThis attribute and the MaximumExtentsSubdivisions attribute will be adjusted to match each other depending on the last one set, and the MaximumSpacingMode will be set to Spacing.
CurvatureResolutionAngle$mesher get/setCurvatureResolutionAngle angle |
This attribute is the curvature angle resolution in degrees. TypeThis attribute is a float with the range [0, 180), where 0 means the curvature resolution will not be applied. DefaultThe default for this attribute is 15.
MaximumAspectRatio$mesher get/setMaximumAspectRatio ratio |
This attribute specifies the maximum aspect ratio. TypeThis attribute is a float with the value of 0.0 or in the range [1.0, infinity), where 0.0 means the aspect ratio will not be enforced. DefaultThe default for this attribute is 10.
BoundaryGrowthRate$mesher get/setBoundaryGrowthRate rate |
This attribute specifies the boundary growth rate. TypeThis attribute is a float with the range [1.0, 2.0]. DefaultThe default for this attribute is 1.2.
DomainAlgorithm$mesher get/setDomainAlgorithm < AdvancingFront | QuadDominant | Hybrid > |
This attribute determines the algorithm to use when meshing domains. TypeThis attribute is of type string with values < AdvancingFront | QuadDominant | Hybrid >. DefaultThe default for this attribute is AdvancingFront.
RefinementFactor$mesher get/setRefinementFactor factor |
This attribute is the refinement factor used to globally scale the parameters of the mesher in order to increase the refinement. TypeThis attribute is a float with the range [0.125, 8], where 1 means no refinement, 2 means 2x refinement, 0.5 means 2x coarser, etc. DefaultThe default for this attribute is 1.
MappedSurfaceSubdivisionRatio$mesher get/setMappedSurfaceSubdivisionRatio factor |
This attribute is the ratio between the number of subdivisions used to detect domains that can be initialized from structured domains. TypeThis attribute is a float with the range [0, infinity), where a value of 0.0 disables thin surface detection. DefaultThe default for this attribute is 10.
BoundaryProximityInfluence$mesher get/setBoundaryProximityInfluence < Orientation | All | None > |
This attribute controls how nearby boundaries influence clustering on a surface. TypeThis attribute is of type string with values < Orientation | All | None >. DefaultThe default for this attribute is Orientation. NoteIf the value is set to All, then all boundaries influence the mesh on a surface. If the value is set to None, then no boundaries influence the mesh. If the value is set to the default value of Orientation, then a boundary only contributes to the clustering on the surface if the majority of the boundary is on the outward side of the surface. For example, this would prevent boundaries on a wing pylon from influencing the clustering on the other side of the wing. Be aware that this computation can be very expensive for very large numbers of surfaces.
BoundaryGapSubdivisions$mesher get/setBoundaryGapSubdivisions subdivisions |
This attribute is the target number of mesh subdivisions across gaps between boundaries of the entities being meshed. TypeThis attribute is an integer with the range [0, inf) that specifies the target number of mesh subdivisions across the gap. DefaultThe default for this attribute is 0. InformationDefining this attribute greater than zero will enable additional processing to determine refined boundary spacing such that the target number of subdivisions is present across the gap.
StretchingBuffer$mesher get/setStretchingBuffer subdivisions |
This attribute is the target number of buffer subdivisions when TRex stretching reaches the median between boundaries of the entities being meshed. TypeThis attribute is an integer with the range [0, inf) that specifies the target number of buffer subdivisions across the median between stretching fronts. DefaultThe default for this attribute is 1. InformationDefining this attribute greater than zero will enable additional processing to determine refined TRex boundary spacing to ensure the target number of buffer cells at the median of the gap.
BoundaryGroupAngle$mesher get/setBoundaryGroupAngle angle |
This attribute is the turning angle to use when grouping boundaries. A connector will be built on each boundary group. TypeThis attribute is a float with the range [0, 180), where 0 means no grouping will be done. DefaultThe default for this attribute is 40.
BoundaryCurvatureRatio$mesher get/setBoundaryCurvatureRatio ratio |
This attribute is the ratio between the surface and curve curvature along a boundary to use when detecting Curvature boundaries. TypeThis attribute is a float with the range [0, infinity), where 0 means no Curvature boundaries will be detected. DefaultThe default for this attribute is 2.5.
BoundaryHardAngle$mesher get/setBoundaryHardAngle angle |
This attribute is the angle between normals to use when detecting Convex and Concave manifold boundaries. TypeThis attribute is a float with the range [0, 180), where 0 means no Convex and Concave boundaries will be detected. DefaultThe default for this attribute is 45.
DomainAreaRatioThreshold$mesher get/setDomainAreaRatioThreshold threshold |
This attribute is the metric threshold for domain area ratio. TypeThis attribute is a float with the range [1, inf) DefaultThe default for this attribute is 1.0. InformationThis attribute has no effect on the meshing algorithm, and is used by the GUI when displaying metrics on the resulting mesh.
DomainAspectRatioThreshold$mesher get/setDomainAspectRatioThreshold threshold |
This attribute is the metric threshold for domain aspect ratio. TypeThis attribute is a float with the range [1, inf) DefaultThe default for this attribute is 1.0. InformationThis attribute has no effect on the meshing algorithm, and is used by the GUI when displaying metrics on the resulting mesh.
DomainMaximumAngleThreshold$mesher get/setDomainMaximumAngleThreshold threshold |
This attribute is the metric threshold for domain maximum angle. TypeThis attribute is a float with the range [1, inf) DefaultThe default for this attribute is 1.0. InformationThis attribute has no effect on the meshing algorithm, and is used by the GUI when displaying metrics on the resulting mesh.
KeepExistingDomains$mesher get/setKeepExistingDomains value |
This attribute controls whether any pre-existing domains constrained to the quilts in the mode are retained or destroyed. If this attribute is true (the default) and new grid entities are created through the createGridEntities function, then any previously existing domains that were constrained to the models’ quilts will be destroyed, along with any blocks that used those domains and any connectors that were used exclusively by those domains. TypeThis attribute is a boolean value. DefaultThe default for this attribute is false.
SplitConnectorsAtAlignSources$mesher get/setSplitConnectorsAtAlignSources value |
This attribute controls whether connectors should be split where they intersect or come within Node tolerance of souce curves on the database being meshed. TypeThis attribute is a boolean. DefaultThe default for this attribute is true.
getExtentsThis action gets the extents of the models of the mode. ParametersThis action has no parameters. ReturnsThis action returns a list of two vectors representing the min and max points of the extents. ExampleCode # $mesher is a DatabaseMesher mode puts [$mesher getExtents]
Output {-1.0408340855860843e-16 -8.537024980200823e-18 1.0376479089327297} {1.3993905942253984 0.5000000036000275 1.1816511795199895}
getThinSurfaceQuilts$mesher getThinSurfaceQuilts |
This action gets the quilts that are detected as thin surfaces, such as a blunt trailing edge of a wing. ParametersThis action has no parameters. ReturnsThis action returns a list of pw::Quilt objects. ExampleCode # $mesher is a DatabaseMesher mode puts [$mesher getThinSurfaceQuilts]
Output {::pw::Quilt_1 ::pw::Quilt_2}
getMinimumBoundaryGroup$mesher getMinimumBoundaryGroup |
This action gets the quilt boundary group with the minimum length. ParametersThis action has no parameters. ReturnsThis action returns a list of quilt boundaries forming the group with the minimum length. ExampleCode # $mesher is a DatabaseMesher mode puts [$mesher getMinimumBoundaryGroup]
Output {::pw::Quilt_1 1}
getMinimumBoundaryGroupLength$mesher getMinimumBoundaryGroupLength |
This action gets the length of the minimum boundary group. ParametersThis action has no parameters. ReturnsThis action returns a float minimum length. ExampleCode # $mesher is a DatabaseMesher mode puts [$mesher getMinimumBoundaryGroupLength]
Output 5.9917162670408274e-5
getSymmetryLoops$mesher getSymmetryLoops ?symmetry? |
This action gets a list of symmetry loops, where each loop is a list of quilt boundaries that are lamina and lie on a symmetry plane. Parameterssymmetry | This optional parameter is a string with options < MinimumX | MaximumX | MinimumY | MaximumY | MinimumZ | MaximumZ > that specifies the symmetry plane to get the boundary loops for. If not given, the boundary loops for all symmetry planes are returned. |
ReturnsThis action returns a list of quilt boundary lists. ExampleCode # $mesher is a DatabaseMesher mode foreach sym {{} MinimumX MaximumX MinimumY MaximumY MinimumZ MaximumZ} { set loops [$mesher getSymmetryLoops {*}$sym] puts [format "%-10.10s: %s" $sym $loops] }
Output : MinimumX : MaximumX : MinimumY : MaximumY : MinimumZ : MaximumZ :
getLaminaBoundaryGroups$mesher getLaminaBoundaryGroups classify |
This action gets a list of lamina quilt boundary lists of a certain classification. Note that this returns boundary values without regard for any boundary filters added with addBoundaryFilter. Parametersclassify | This parameter is a string with options < Symmetry | NonSymmetry | Curvature > of the classification of the boundaries to retrieve. |
ReturnsThis action returns a list of quilt boundary lists. NoteIt is possible for boundary groups to be classified as both Curvature and Symmetry or NonSymmetry, but Symmetry and NonSymmetry groups will always be distinct. Also, the Symmetry groups will be returned as loops using the getSymmetryLoops action. ExampleCode # $mesher is a DatabaseMesher mode foreach classifyType {Symmetry NonSymmetry Curvature} { puts [format "%12.12s: %s" $classifyType [$mesher getLaminaBoundaryGroups $classifyType]] }
Output Symmetry: NonSymmetry: Curvature:
getManifoldBoundaryGroups$mesher getManifoldBoundaryGroups classify |
This action gets a list of manifold quilt boundary lists of a certain classification. Since all of the boundaries returned are manifold, they will be organized in pairs of boundaries that are topologically the same, one from each neighboring quilt. Note that this returns boundary values without regard for any boundary filters added with addBoundaryFilter. Parametersclassify | This parameter is a string with options < None | Curvature | Convex | Concave > of the classification of the boundaries to retrieve. |
ReturnsThis action returns a list of quilt boundary lists. ExampleCode # $mesher is a DatabaseMesher mode foreach classify {None Curvature Convex Concave} { set grps [$mesher getManifoldBoundaryGroups $classify] puts "$classify:" if { 0 == [llength $grps] } { lappend grps {<none>} } foreach grp $grps { puts " $grp" } }
Output None: {::pw::Quilt_3 3} {::pw::Quilt_8 4} {::pw::Quilt_5 3} {::pw::Quilt_6 2} {::pw::Quilt_6 4} {::pw::Quilt_7 2} {::pw::Quilt_7 4} {::pw::Quilt_8 2} Curvature: <none> Convex: {::pw::Quilt_1 1} {::pw::Quilt_2 1} {::pw::Quilt_1 2} {::pw::Quilt_3 1} ...SNIP... {::pw::Quilt_4 5} {::pw::Quilt_6 3} {::pw::Quilt_4 6} {::pw::Quilt_5 2} Concave: <none>
createGridEntities$mesher createGridEntities ent_type |
This action creates grid entities on the database entities of this mode. The current settings of the mode will control how the connectors, domains, and/or blocks will be created and the parameters to use. The grid entities created by previous invocations of this action will be deleted as part of the process. Parametersent_type | This parameter is the string type of the highest level of grid entities to create with options < Connector | Domain >. |
ReturnsThis action returns a list of new pw::Connector or pw::Domain objects, depending on the ent_type parameter. See Alsopw::Connector.createOnDatabase, pw::DomainStructured.createOnDatabase and pw::DomainUnstructured.createOnDatabase, which work similar to this action except that it does not allow as much control over the process. ExampleCode # $mesher is a DatabaseMesher mode foreach ent_type {Domain} { set ents [$mesher createGridEntities $ent_type] foreach ent $ents { puts " $ent ([$ent getName])" } }
Output ::pw::DomainUnstructured_1 (dom-1) ::pw::DomainUnstructured_2 (dom-2) ::pw::DomainUnstructured_3 (dom-3) ::pw::DomainUnstructured_4 (dom-4) ::pw::DomainUnstructured_5 (dom-5) ::pw::DomainUnstructured_6 (dom-6) ::pw::DomainUnstructured_7 (dom-7) ::pw::DomainUnstructured_8 (dom-8) ::pw::DomainStructured_1 (dom-9)
getRejectedEntities$mesher getRejectedEntities |
This action gets a list of database entities that a surface mesh was not able to be constructed on during the <createSurfaceMesh> action. ParametersThis action has no parameters. ReturnsThis action returns a list of pw::DatabaseEntity objects. ExampleCode # $mesher is a DatabaseMesher mode puts "rejected: [$mesher getRejectedEntities]"
Output rejected:
getExistingDomains$mesher getExistingDomains |
This action gets a list of domains that are dependent upon the quilts included in the mode. If <createSurfaceMesh> is called and the mode is ended through the <end> call, these domains, along with any connectors used exclusively by the domains, will be destroyed. ParametersThis action has no parameters. ReturnsThis action returns a list of pw::Domain objects.
getExistingSources$mesher getExistingSources |
This action gets a list of sources that are dependent upon the quilts included in the mode. If <createSurfaceMesh> is called and the mode is ended through the <end> call, these sources will be destroyed. ParametersThis action has no parameters. ReturnsThis action returns a list of pw::SourceEntity objects.
getFilterTypesThis action returns a list of supported filter type names. ParametersThis action has no parameters. ReturnsA list of strings of the filter type names. These names are suitable for use as -type filter_type parameters. ExampleCode # $mesher is a DatabaseMesher mode puts "\$mesher getFilterTypes: [list [$mesher getFilterTypes]]"
Output $mesher getFilterTypes: MaximumEdgeSpacing
addFilter$mesher addFilter ?-type filter_type? ?-priority < index | name >? ?-name name? value ?pattern_list? |
This action adds a new, mesher mode filter to a filter queue. Parameters-type filter_type | This optional parameter specifies the string type of the value parameter. One of < MaximumEdgeSpacing >. Each filter_type has an associated filter queue. | -priority < index | name > | This optional parameter specifies the priority of the new filter. The new filter will be inserted into the filter_type queue before the (existing) filter identified by its integer index or string name. If not specified, the new filter is appended to the filter queue (lowest priority). | -name name | This optional parameter is the string filter name. If not provided, a unique “filter-N” name will be assigned. | value | This required parameter is the filter’s value. See Ranges section below. | pattern_list | This optional parameter defines the list of string patterns that will be used to match against database entity names. The default is an empty list (matches nothing). |
ReturnsThis action returns the name of the added filter. NotesWhen applying filters, each entity’s name is matched against each filter in a queue. Within a queue, each filter is tried in priority order. The first match within a queue stops searching, applies the filter to the matched entity, and then continues matching with the next filter queue. MaximumEdgeSpacing filters are matched against quilts. For each match, a quilt source is created with the specified value. ThinSurfaceSubdivision filters are matched against quilts. For each match, the domain built from the quilt will have special thin surface handling controlled by the value. RangesMaximumEdgeSpacing | value is a float in the range [0, infinity). |
See AlsogetFilterDefinition, getFilterDefinitions ExampleCode # $mesher is a DatabaseMesher mode $mesher addFilter -name F3 0.3 {quilt-1* quilt-2 quilt-4 !quilt-11} $mesher addFilter -priority 1 -name F1 0.1 {quilt-4 quilt-5} $mesher addFilter -priority F3 -name F2 0.2 quilt-3
puts "\$mesher getFilterDefinitions -dict" dict for {priority filterDefn} [$mesher getFilterDefinitions -dict] { puts "$priority [list $filterDefn]" dict for {key val} $filterDefn { puts [format " %-10.10s = %-s" $key $val] } puts "" }
# Global filter always exists and always lowest priority puts "\$mesher addFilter -name Global 0.2 bad*" catch {$mesher addFilter -name Global 0.2 bad*} err puts $err
Output $mesher getFilterDefinitions -dict 1 {Type MaximumEdgeSpacing Priority 1 Name F1 Value 0.1 Patterns {quilt-4 quilt-5}} Type = MaximumEdgeSpacing Priority = 1 Name = F1 Value = 0.1 Patterns = quilt-4 quilt-5
2 {Type MaximumEdgeSpacing Priority 2 Name F2 Value 0.2 Patterns quilt-3} Type = MaximumEdgeSpacing Priority = 2 Name = F2 Value = 0.2 Patterns = quilt-3
3 {Type MaximumEdgeSpacing Priority 3 Name F3 Value 0.3 Patterns {quilt-1* quilt-2 quilt-4 !quilt-11}} Type = MaximumEdgeSpacing Priority = 3 Name = F3 Value = 0.3 Patterns = quilt-1* quilt-2 quilt-4 !quilt-11
4 {Type MaximumEdgeSpacing Priority 4 Name Global Value 0.0 Patterns *} Type = MaximumEdgeSpacing Priority = 4 Name = Global Value = 0.0 Patterns = *
$mesher addFilter -name Global 0.2 bad* ERROR: Filter Global already exists.
deleteFilter$mesher deleteFilter ?-type filter_type? < index | name > |
This action deletes a filter. Parameters-type filter_type | This optional parameter specifies the string filter type. One of < MaximumEdgeSpacing >. | index | This parameter is the integer index of the filter in the range [1, number of filters]. | name | This parameter is the string filter name. |
ReturnsThis action returns nothing. See AlsoaddFilter, getFilterDefinition, getFilterDefinitions ExampleCode # $mesher is a DatabaseMesher mode puts "\$mesher addFilter F1 0.1 {quilt-1*}" $mesher addFilter F1 0.1 {quilt-1*}
puts "\$mesher addFilter F2 0.2 {quilt-2*}" $mesher addFilter F2 0.2 {quilt-2*} puts "\$mesher getFilterCount: [$mesher getFilterCount]"
puts "\$mesher deleteFilter F1" $mesher deleteFilter F1 puts "\$mesher getFilterCount: [$mesher getFilterCount]"
puts "\$mesher deleteFilter F2" $mesher deleteFilter F2 puts "\$mesher getFilterCount: [$mesher getFilterCount]"
puts "\$mesher deleteFilter F1" catch {$mesher deleteFilter F1} err puts " [join [split [string trim $err] "\n"] "\n "]"
puts "\$mesher deleteFilter Global" catch {$mesher deleteFilter Global} err puts " [join [split [string trim $err] "\n"] "\n "]"
Output $mesher addFilter F1 0.1 {quilt-1*} $mesher addFilter F2 0.2 {quilt-2*} $mesher getFilterCount: 3 $mesher deleteFilter F1 $mesher getFilterCount: 2 $mesher deleteFilter F2 $mesher getFilterCount: 1 $mesher deleteFilter F1 ERROR: Filter 'F1' does not exist. $mesher deleteFilter Global ERROR: Cannot delete the Global filter.
setFilterName$mesher setFilterName ?-type filter_type? < index | name > newName |
This action renames a filter. Parameters-type filter_type | This optional parameter specifies the string filter type. One of < MaximumEdgeSpacing >. | index | This parameter is the integer index of the filter in the range [1, number of filters]. | name | This parameter is the string filter name. | newName | The filter’s new name. |
ReturnsThis action returns the actual new name. Note that it will not be the specified name if another filter of that name exists. See AlsoaddFilter, getFilterDefinition, getFilterDefinitions ExampleCode # $mesher is a DatabaseMesher mode puts "set nm \[\$mesher addFilter {} 0.1\]" set nm [$mesher addFilter {} 0.1] puts "\$mesher getFilterDefinition -dict \$nm" puts " [$mesher getFilterDefinition -dict $nm]" puts "\$mesher setFilterName \$nm FX" $mesher setFilterName $nm FX puts "\$mesher getFilterDefinition -dict \$nm" catch {$mesher getFilterDefinition -dict $nm} err puts " [join [split [string trim $err] "\n"] "\n "]" puts "\$mesher getFilterDefinition -dict FX" puts " [$mesher getFilterDefinition -dict FX]"
Output set nm [$mesher addFilter {} 0.1] $mesher getFilterDefinition -dict $nm Type MaximumEdgeSpacing Priority 1 Name filter-1 Value 0.1 Patterns {} $mesher setFilterName $nm FX $mesher getFilterDefinition -dict $nm ERROR: Filter 'filter-1' does not exist. ERROR: usage (argument 3): ::pw::DatabaseMesher_1 getFilterDefinition ?-type filter_type? < index | name > $mesher getFilterDefinition -dict FX Type MaximumEdgeSpacing Priority 1 Name FX Value 0.1 Patterns {}
getFilterNames$mesher getFilterNames ?-type filter_type? ?-regex? ?pattern? |
This action returns a list of filter names defined in the mesher mode filter_type. Parameters-type filter_type | This optional parameter specifies the string filter type. One of < MaximumEdgeSpacing >. | -regex | This optional flag signifies that the given pattern should be considered a regular expression pattern rather than a glob pattern. | pattern | This optional parameter is the string pattern used to filter the returned filter names. |
ReturnsA list of strings of the filter names that match the pattern. If a pattern is not given, all filter names will be returned. ExampleCode # $mesher is a DatabaseMesher mode $mesher addFilter F1 0.1 {quilt-1*} $mesher addFilter F2 0.2 {quilt-2*} $mesher addFilter F3 0.3 {quilt-3*}
puts "\$mesher getFilterNames: [list [$mesher getFilterNames]]"
Output $mesher getFilterNames: {F1 F2 F3 Global}
getFilterCount$mesher getFilterCount ?-type filter_type? |
This action returns the number of filters of the given filter_type defined in the mesher mode. Parameters-type filter_type | This optional parameter specifies the string filter type. One of < MaximumEdgeSpacing >. |
ReturnsThe integer number of filters. ExampleCode # $mesher is a DatabaseMesher mode puts "\$mesher getFilterCount: [$mesher getFilterCount]"
$mesher addFilter F1 0.1 {quilt-1*} $mesher addFilter F2 0.2 {quilt-2*} $mesher addFilter F3 0.3 {quilt-3*}
puts "\$mesher getFilterCount: [$mesher getFilterCount]"
Output $mesher getFilterCount: 1 $mesher getFilterCount: 4
getFilterDefinition$mesher getFilterDefinition ?-type filter_type? ?-dict? < index | name > |
This action gets the definition of a filter identified by index or name. Parameters-type filter_type | This optional parameter specifies the string filter type. One of < MaximumEdgeSpacing >. | -dict | This optional flag signifies that the return value should be formatted as a dictionary instead of a plain old list. | index | This parameter is the integer index of the filter in the range [1, number of filters]. | name | This parameter is the string filter name. |
ReturnsThis action returns the filter definition as a list. A returned list contains { type priority name value patterns }. A return dictionary is suitable for use with the dict command and is of the form: { Type type Priority priority Name name Value value Patterns patterns } Where, - type is the string type of the filter.
- priority is the integer priority of the filter.
- name is the string name of the filter
- value is the value of the filter (see addFilter for details)
- patterns is a string list of glob patterns matched against entity names.
See AlsoaddFilter, getFilterDefinitions ExampleCode # $mesher is a DatabaseMesher mode $mesher addFilter F1 0.1 {quilt-1* wing-1*} $mesher addFilter F2 0.2 {quilt-2* wing-2*}
foreach name [$mesher getFilterNames] { puts "" puts "\$mesher getFilterDefinition [list $name]:" puts " list[list [$mesher getFilterDefinition $name]]" puts "\$mesher getFilterDefinition -dict [list $name]:" dict for {key val} [$mesher getFilterDefinition -dict $name] { puts [format " %-10.10s: %-s" $key $val] } } puts "" for {set ii 1} {$ii <= [$mesher getFilterCount]} {incr ii} { puts "" puts "\$mesher getFilterDefinition $ii:" puts " list[list [$mesher getFilterDefinition $ii]]" puts "\$mesher getFilterDefinition -dict $ii:" dict for {key val} [$mesher getFilterDefinition -dict $ii] { puts [format " %-10.10s: %-s" $key $val] } }
Output $mesher getFilterDefinition F1: list{MaximumEdgeSpacing 1 F1 0.1 {quilt-1* wing-1*}} $mesher getFilterDefinition -dict F1: Type : MaximumEdgeSpacing Priority : 1 Name : F1 Value : 0.1 Patterns : quilt-1* wing-1*
$mesher getFilterDefinition F2: list{MaximumEdgeSpacing 2 F2 0.2 {quilt-2* wing-2*}} $mesher getFilterDefinition -dict F2: Type : MaximumEdgeSpacing Priority : 2 Name : F2 Value : 0.2 Patterns : quilt-2* wing-2*
$mesher getFilterDefinition Global: list{MaximumEdgeSpacing 3 Global 0.0 *} $mesher getFilterDefinition -dict Global: Type : MaximumEdgeSpacing Priority : 3 Name : Global Value : 0.0 Patterns : *
$mesher getFilterDefinition 1: list{MaximumEdgeSpacing 1 F1 0.1 {quilt-1* wing-1*}} $mesher getFilterDefinition -dict 1: Type : MaximumEdgeSpacing Priority : 1 Name : F1 Value : 0.1 Patterns : quilt-1* wing-1*
$mesher getFilterDefinition 2: list{MaximumEdgeSpacing 2 F2 0.2 {quilt-2* wing-2*}} $mesher getFilterDefinition -dict 2: Type : MaximumEdgeSpacing Priority : 2 Name : F2 Value : 0.2 Patterns : quilt-2* wing-2*
$mesher getFilterDefinition 3: list{MaximumEdgeSpacing 3 Global 0.0 *} $mesher getFilterDefinition -dict 3: Type : MaximumEdgeSpacing Priority : 3 Name : Global Value : 0.0 Patterns : *
getFilterDefinitions$mesher getFilterDefinitions ?-type filter_type? ?-dict? |
This action gets a list of all filter definitions of the given filter_type. Parameters-type filter_type | This optional parameter specifies the string filter type. One of < MaximumEdgeSpacing >. | -dict | This optional flag signifies that the return value should be formatted as a dictionary instead of a plain old list. |
ReturnsThis action returns a list of all filter definitions in priority order. See getFilterDefinition See AlsoaddFilter, getFilterDefinition ExampleCode # $mesher is a DatabaseMesher mode $mesher addFilter F1 0.1 {quilt-1* wing-1*} $mesher addFilter F2 0.2 {quilt-2* wing-2*}
puts "\n\$mesher getFilterDefinitions:" foreach filterDefn [$mesher getFilterDefinitions] { puts " [list $filterDefn]" }
puts "\n\$mesher getFilterDefinitions -dict:" dict for {priority filterDefn} [$mesher getFilterDefinitions -dict] { puts " $priority [list $filterDefn]" dict for {key val} $filterDefn { puts [format " %-10.10s: %-s" $key $val] } }
Output $mesher getFilterDefinitions: {MaximumEdgeSpacing 1 F1 0.1 {quilt-1* wing-1*}} {MaximumEdgeSpacing 2 F2 0.2 {quilt-2* wing-2*}} {MaximumEdgeSpacing 3 Global 0.0 *}
$mesher getFilterDefinitions -dict: 1 {Type MaximumEdgeSpacing Priority 1 Name F1 Value 0.1 Patterns {quilt-1* wing-1*}} Type : MaximumEdgeSpacing Priority : 1 Name : F1 Value : 0.1 Patterns : quilt-1* wing-1* 2 {Type MaximumEdgeSpacing Priority 2 Name F2 Value 0.2 Patterns {quilt-2* wing-2*}} Type : MaximumEdgeSpacing Priority : 2 Name : F2 Value : 0.2 Patterns : quilt-2* wing-2* 3 {Type MaximumEdgeSpacing Priority 3 Name Global Value 0.0 Patterns *} Type : MaximumEdgeSpacing Priority : 3 Name : Global Value : 0.0 Patterns : *
getFilterEntityCounts$mesher getFilterEntityCounts ?-type filter_type? ?-includeEntities? ?-dict? |
This action matches the name of each mode entity against the filter patterns in filter priority order and returns the match count for each filter. Parameters-type filter_type | This optional parameter specifies the string filter type. One of < MaximumEdgeSpacing >. | -includeEntities | This optional flag signifies that the matching entities should also be included in the return value. | -dict | This optional flag signifies that the return value should be formatted as a dictionary instead of a list. |
ReturnsThis action returns the entity match count for each filter as a list or dictionary. See AlsoaddFilter, getFilterDefinition NoteOnce an entity matches a filter, it is removed from consideration for lower priority filters. That is, each entity is only counted once. A return list is of the form: {filtername entcnt ?entitylist? ... filtername entcnt ?entitylist?} A return dictionary is suitable for use with the dict command and is of the form: {filtername {Count entcnt ?Entities entitylist?} ... filtername {Count entcnt ?Entities entitylist?}} Filters that do not match any mode entity names are not included in the return. Mode entities that do not match any filter are included in the return in the Global filter. ExampleCode # $mesher is a DatabaseMesher mode # $dbEnts is a list of database entities
proc toNames { ents } { set ret [list] foreach ent $ents { lappend ret [$ent getName] } return $ret }
puts "All Database Entities:" puts " [toNames $dbEnts]" puts ""
$mesher addFilter F1 0.1 {quilt-4 quilt-5 {WING X*}} $mesher addFilter F2 0.2 quilt-3 $mesher addFilter F3 0.3 {quilt-1* quilt-2 quilt-4 !quilt-11}
# format template set fmt "| %-6.6s | %3.3s | %-30.30s | %-35.35s |" set hr [string repeat - 50]
puts "\$mesher getFilterEntityCounts -includeEntities" puts [format $fmt Filter Cnt "Matched Entities" Patterns] puts [format $fmt $hr $hr $hr $hr] foreach {name entCnt ents} [$mesher getFilterEntityCounts -includeEntities] { set patterns [dict get [$mesher getFilterDefinition -dict $name] Patterns] puts [format $fmt $name $entCnt [list [toNames $ents]] $patterns] }
puts "" puts "\$mesher getFilterEntityCounts -dict -includeEntities" puts [format $fmt Filter Cnt "Matched Entities" Patterns] puts [format $fmt $hr $hr $hr $hr] dict for {name keyVals} [$mesher getFilterEntityCounts -dict -includeEntities] { set entCnt [dict get $keyVals Count] set ents [dict get $keyVals Entities] set patterns [dict get [$mesher getFilterDefinition -dict $name] Patterns] puts [format $fmt $name $entCnt [list [toNames $ents]] $patterns] }
Output All Database Entities: body_0 quilt-1 quilt-2 quilt-3 quilt-4 quilt-5 quilt-12 {WING XL} quilt-11
$mesher getFilterEntityCounts -includeEntities | Filter | Cnt | Matched Entities | Patterns | | ------ | --- | ------------------------------ | ----------------------------------- | | F1 | 3 | {quilt-4 quilt-5 {WING XL}} | quilt-4 quilt-5 {WING X*} | | F2 | 1 | quilt-3 | quilt-3 | | F3 | 3 | {quilt-1 quilt-2 quilt-12} | quilt-1* quilt-2 quilt-4 !quilt-11 | | Global | 1 | quilt-11 | * |
$mesher getFilterEntityCounts -dict -includeEntities | Filter | Cnt | Matched Entities | Patterns | | ------ | --- | ------------------------------ | ----------------------------------- | | F1 | 3 | {quilt-4 quilt-5 {WING XL}} | quilt-4 quilt-5 {WING X*} | | F2 | 1 | quilt-3 | quilt-3 | | F3 | 3 | {quilt-1 quilt-2 quilt-12} | quilt-1* quilt-2 quilt-4 !quilt-11 | | Global | 1 | quilt-11 | * |
setFilterPriority$mesher setFilterPriority ?-type filter_type? name_list |
This action sets the priority of one or more existing filters. Parameters-type filter_type | This optional parameter specifies the string filter type. One of < MaximumEdgeSpacing >. | name_list | This parameter is a list of string filter names. Any filters not in name_list will be prioritized after the entities in name_list. |
ReturnsThis action returns nothing. See AlsoaddFilter, getFilterDefinition, getFilterDefinitions NoteThe relative ordering of the re-prioritized filters will be maintained. ExampleCode # $mesher is a DatabaseMesher mode
proc doSetPriority { mesher names } { puts "\$mesher setFilterPriority [list $names]:" if { [catch {$mesher setFilterPriority $names} err] } { puts " [string trim $err]" } else { puts " [$mesher getFilterNames]" } }
$mesher addFilter F1 0.1 {quilt-1*} $mesher addFilter F2 0.2 {quilt-2*} $mesher addFilter F3 0.3 {quilt-3*} $mesher addFilter F4 0.4 {quilt-4*} $mesher addFilter F5 0.5 {quilt-5*} $mesher addFilter F6 0.6 {quilt-6*}
puts "Starting filter priority:" puts " [$mesher getFilterNames]" doSetPriority $mesher {F2 F6 F4} doSetPriority $mesher F6 doSetPriority $mesher {F6 F5 F4 F3 F2 F1} puts "\nThese will fail:" doSetPriority $mesher {F4 F2 F4 F2} doSetPriority $mesher {XX YY} doSetPriority $mesher {F4 F2 F4 XX} doSetPriority $mesher {F2 Global F6 F4}
Output Starting filter priority: F1 F2 F3 F4 F5 F6 Global $mesher setFilterPriority {F2 F6 F4}: F2 F6 F4 F1 F3 F5 Global $mesher setFilterPriority F6: F6 F2 F4 F1 F3 F5 Global $mesher setFilterPriority {F6 F5 F4 F3 F2 F1}: F6 F5 F4 F3 F2 F1 Global
These will fail: $mesher setFilterPriority {F4 F2 F4 F2}: ERROR: Found duplicate filter names {F4 F2}. $mesher setFilterPriority {XX YY}: ERROR: Filters {XX YY} do not exist. $mesher setFilterPriority {F4 F2 F4 XX}: ERROR: Filter XX does not exist. Found duplicate filter name F4. $mesher setFilterPriority {F2 Global F6 F4}: ERROR: Cannot change the Global filter priority.
setFilterPatterns$mesher setFilterPatterns ?-type filter_type? < index | name > pattern_list |
This action sets the patterns of an existing filter. Parameters-type filter_type | This optional parameter specifies the string filter type. One of < MaximumEdgeSpacing >. | index | This parameter is the integer index of the filter in the range [1, number of filters]. | name | This parameter is the string filter name. | patterns | The list of string patterns that will be used to match against database entity names. |
ReturnsThis action returns nothing. See AlsoaddFilter, getFilterDefinition, getFilterDefinitions ExampleCode $mesher addFilter F1 0.1 {quilt-4 quilt-5}
puts "patterns: [dict get [$mesher getFilterDefinition -dict F1] Patterns]" puts "\$mesher setFilterPatterns F1 {quilt-4 quilt-5 {WING X*}}" $mesher setFilterPatterns F1 {quilt-4 quilt-5 {WING X*}} puts "patterns: [dict get [$mesher getFilterDefinition -dict F1] Patterns]"
# Will fail catch {$mesher setFilterPatterns Global {W*}} err puts $err
Output patterns: quilt-4 quilt-5 $mesher setFilterPatterns F1 {quilt-4 quilt-5 {WING X*}} patterns: quilt-4 quilt-5 {WING X*} ERROR: Cannot change the Global filter patterns.
setFilterEntities$mesher setFilterEntities ?-type filter_type? ?-op op_type? < index | name > dbentity_list |
This action modifies filter patterns as needed to guarantee that the entities in dbentity_list are captured by the specified filter. Parameters-type filter_type | This optional parameter specifies the string filter type. One of < MaximumEdgeSpacing >. | -op op_type | This optional parameter specifies the string operation type. One of < Set | Remove >. | index | This parameter is the integer index of the filter in the range [1, number of filters]. | name | This parameter is the string filter name. | dbentity_list | This parameter is a list of pw::DatabaseEntity objects, or a single pw::DatabaseEntity object. |
ReturnsThis action returns nothing. See AlsoaddFilter, getFilterDefinition, getFilterDefinitions NoteOther filters may need to be adjusted to properly fulfill the requested configure operation. For instance, to add or set entities on a filter, those same entities will be removed from other filters as needed so that they no longer capture those entities. ExampleCode # $mesher is a DatabaseMesher mode # $dbEnts is a list of database entities
proc toNames { ents } { set ret [list] foreach ent $ents { lappend ret [$ent getName] } return $ret }
proc dumpPatterns { mesher } { set filterCnts [$mesher getFilterEntityCounts -dict -includeEntities] set fmt "| %-6.6s | %-37.37s | %-55.55s |" set hr [string repeat - 80] puts [format $fmt Filter Patterns "Matched Entities"] puts [format $fmt $hr $hr $hr] foreach name [$mesher getFilterNames] { set defn [$mesher getFilterDefinition -dict $name] if { [catch {dict get $filterCnts $name Entities} ents] } { set ents [list] } puts [format $fmt $name [dict get $defn Patterns] [toNames $ents]] } }
set quilts [list] set names {quilt-11 quilt-2 quilt-1} foreach name $names { lappend quilts [pw::DatabaseEntity getByName $name] }
$mesher addFilter F1 0.1 {quilt-1*} $mesher addFilter F2 0.2 {quilt-2*} $mesher addFilter F3 0.3 {quilt-1* quilt-3*}
puts "All Database Entities:" puts " [toNames $dbEnts]" puts "" dumpPatterns $mesher puts "" puts "\$mesher setFilterEntities -op Set F2 [list $names]" $mesher setFilterEntities -op Set F2 $quilts dumpPatterns $mesher puts "" puts "\$mesher setFilterEntities -op Set F3 [list $names]" $mesher setFilterEntities -op Set F3 $quilts dumpPatterns $mesher puts "" puts "\$mesher setFilterEntities F1 [list $names]" $mesher setFilterEntities F1 $quilts dumpPatterns $mesher puts "" puts "\$mesher setFilterEntities -op Remove F1 [list $names]" $mesher setFilterEntities -op Remove F1 $quilts dumpPatterns $mesher puts "" # Setting entities to the Global filter removes them from all other filters puts "\$mesher setFilterEntities Global [list $names]" $mesher setFilterEntities Global $quilts dumpPatterns $mesher puts "" puts "\$mesher setFilterEntities -op Remove Global [list $names]" catch {$mesher setFilterEntities -op Remove Global $quilts} err puts " [join [split [string trim $err] "\n"] "\n "]"
Output All Database Entities: body_0 quilt-1 quilt-2 quilt-3 quilt-4 quilt-5 quilt-12 {WING XL} quilt-11
| Filter | Patterns | Matched Entities | | ------ | ------------------------------------- | ------------------------------------------------------- | | F1 | quilt-1* | quilt-1 quilt-12 quilt-11 | | F2 | quilt-2* | quilt-2 | | F3 | quilt-1* quilt-3* | quilt-3 | | Global | * | quilt-4 quilt-5 {WING XL} |
$mesher setFilterEntities -op Set F2 {quilt-11 quilt-2 quilt-1} | Filter | Patterns | Matched Entities | | ------ | ------------------------------------- | ------------------------------------------------------- | | F1 | quilt-1* !quilt-11 !quilt-1 | quilt-12 | | F2 | quilt-2* quilt-11 quilt-1 | quilt-1 quilt-2 quilt-11 | | F3 | quilt-1* quilt-3* | quilt-3 | | Global | * | quilt-4 quilt-5 {WING XL} |
$mesher setFilterEntities -op Set F3 {quilt-11 quilt-2 quilt-1} | Filter | Patterns | Matched Entities | | ------ | ------------------------------------- | ------------------------------------------------------- | | F1 | quilt-1* !quilt-11 !quilt-1 | quilt-12 | | F2 | quilt-2* !quilt-2 | | | F3 | quilt-1* quilt-3* quilt-2 | quilt-1 quilt-2 quilt-3 quilt-11 | | Global | * | quilt-4 quilt-5 {WING XL} |
$mesher setFilterEntities F1 {quilt-11 quilt-2 quilt-1} | Filter | Patterns | Matched Entities | | ------ | ------------------------------------- | ------------------------------------------------------- | | F1 | quilt-1* quilt-2 | quilt-1 quilt-2 quilt-12 quilt-11 | | F2 | quilt-2* !quilt-2 | | | F3 | quilt-1* quilt-3* quilt-2 | quilt-3 | | Global | * | quilt-4 quilt-5 {WING XL} |
$mesher setFilterEntities -op Remove F1 {quilt-11 quilt-2 quilt-1} | Filter | Patterns | Matched Entities | | ------ | ------------------------------------- | ------------------------------------------------------- | | F1 | quilt-1* !quilt-11 !quilt-1 | quilt-12 | | F2 | quilt-2* !quilt-2 | | | F3 | quilt-1* quilt-3* quilt-2 | quilt-1 quilt-2 quilt-3 quilt-11 | | Global | * | quilt-4 quilt-5 {WING XL} |
$mesher setFilterEntities Global {quilt-11 quilt-2 quilt-1} | Filter | Patterns | Matched Entities | | ------ | ------------------------------------- | ------------------------------------------------------- | | F1 | quilt-1* !quilt-11 !quilt-1 | quilt-12 | | F2 | quilt-2* !quilt-2 | | | F3 | quilt-1* quilt-3* !quilt-11 !quilt-1 | quilt-3 | | Global | * | quilt-1 quilt-2 quilt-4 quilt-5 {WING XL} quilt-11 |
$mesher setFilterEntities -op Remove Global {quilt-11 quilt-2 quilt-1} ERROR: Cannot remove entities from the Global filter.
setFilterValue$mesher setFilterValue ?-type filter_type? < index | name > value |
This action sets a filter’s value. Parameters-type filter_type | This optional parameter specifies the string filter type. One of < MaximumEdgeSpacing >. | index | This parameter is the integer index of the filter in the range [1, number of filters]. | name | This parameter is the string filter name. | value | The filter’s new value. The value’s type and range depend on the filter_type. See Ranges section below. |
ReturnsThis action returns nothing. See AlsoaddFilter, getFilterDefinition, getFilterDefinitions RangesMaximumEdgeSpacing | value is a float in the range [0, infinity). | ThinSurfaceInterpolation | value is string with valid values < None | Automatic | ThinSurfaceInterpolation > or an integer with the range [2, infinity). |
ExampleCode # $mesher is a DatabaseMesher mode $mesher addFilter F1 0.1 {quilt-1*}
puts "value: [dict get [$mesher getFilterDefinition -dict F1] Value]" $mesher setFilterValue F1 0.9 puts "\n\$mesher setFilterValue F1 0.9" puts "value: [dict get [$mesher getFilterDefinition -dict F1] Value]"
puts "\n\$mesher setFilterValue F1 -1.0" catch {$mesher setFilterValue F1 -1.0} err puts " [join [split [string trim $err] "\n"] "\n "]" puts "value: [dict get [$mesher getFilterDefinition -dict F1] Value]"
puts "\n\$mesher setFilterValue Q1 1.0" catch {$mesher setFilterValue Q1 1.0} err puts " [join [split [string trim $err] "\n"] "\n "]"
Output value: 0.1
$mesher setFilterValue F1 0.9 value: 0.9
$mesher setFilterValue F1 -1.0 ERROR: value outside the range [0,infinity) ERROR: usage (argument 3): ::pw::DatabaseMesher_1 setFilterValue ?-type filter_type? < index | name > value value: 0.9
$mesher setFilterValue Q1 1.0 ERROR: Filter 'Q1' does not exist. ERROR: usage (argument 2): ::pw::DatabaseMesher_1 setFilterValue ?-type filter_type? < index | name > value
addMappingFilter$mesher addMappingFilter ?-priority < index | name >? ?-name name? value ?pattern_list ?equal_spacing ?force_adjacent ?max_aspect_ratio? |
This action adds a new mapping filter for the mesher mode. A mapping filter controls whether unstructured domains on quilts are mapped to structured domains or initialized via the Thin Surface Interpolation algorithm. Parameters-priority < index | name > | This optional flag specifies the priority of the new mapping filter. The new mapping filter will be inserted into the mapping filter queue before the (existing) mapping filter identified by its integer index or string name. If not specified, the new filter is appended to the filter queue (lowest priority). | -name name | This optional flag is the string mapping filter name. If not provided, a unique “filter-N” name will be assigned. | value | This required parameter is the mapping filter’s value. See Ranges section below. | pattern_list | This optional parameter defines the list of string patterns that will be used to match against database entity names. The default is an empty list (matches nothing). | equals_spacing | This optional boolean parameter controls whether or not equal spacing is applied along the short direction. The default value is false. | force_adjacent | If this optional boolean parameter is set to true, adjacent domains will have their neighboring boundaries set to use the adjacent grid boundary condition. The default value is false. | max_aspect_ratio | If set, this float parameter overrides the global maximum aspect ratio setting for any domain that maps to this filter. The default value is 0.0, which forces the global value to be used. |
ReturnsThis action returns the name of the added mapping filter. NotesWhen applying mapping filters, each entity’s name is matched against each mapping filter in a queue. Within a queue, each mapping filter is tried in priority order. The first match within a queue stops searching, applies the mapping filter to the matched entity, and then continues matching with the next mapping filter. Mapping filters are matched against quilts. For each match, the domain built from the quilt will have special thin surface handling controlled by the value. A value of “None” causes the corresponding domains to be initialized normally without any special thin surface handling. A value of “Automatic” is the default behavior and analyzes the domains to see if it is appropriate to map the unstructured domain to a corresponding structured domain, setting an appropriate number of subdivisions for the shorter sides of the domain. The “ThinSurfaceInterpolation” setting will result in the domains getting initialized with the Thin Surface Interpolation algorithm. The matching domains will not be mapped, but the resulting algorithm produces a similar result while allowing the dimensions to differ on opposing sides. The “Force” value skips a large portion of the analysis performed with the “Automatic” mode and will map the filtered domains to structured domains where feasible regardless of any analytics with regard to aspect ratio, etc. The number of subdivisions on the shorter sides will be automatically computed by the code. Finally, an integer value of 2 or greater is similar to the “Force” value except that the number of subdivisions on the short edges is set to the given value. Note that if the quilt has more than one boundary loop (i.e., holes) or has less that 4 boundaries, the resulting domains will not be mapped, regardless of the mapping filter specifications. RangesA valid value is string with valid values < None | Automatic | Force | ThinSurfaceInterpolation > or an integer with the range [2, infinity). See AlsogetMappingFilterDefinition, getMappingFilterDefinitions ExampleCode # $mesher is a DatabaseMesher mode $mesher addMappingFilter -name F3 3 {quilt-1* quilt-2 quilt-4 !quilt-11} 1 1 20.0 $mesher addMappingFilter -priority 1 -name F1 Automatic {quilt-4 quilt-5} $mesher addMappingFilter -priority F3 -name F2 ThinSurfaceInterpolation quilt-3 0 1
puts "\$mesher getMappingFilterDefinitions -dict" dict for {priority filterDefn} [$mesher getMappingFilterDefinitions -dict] { puts "$priority [list $filterDefn]" dict for {key val} $filterDefn { puts [format " %-19.19s = %-s" $key $val] } puts "" }
# Global filter always exists and always has the lowest priority puts "\$mesher addMappingFilter -name Global 2 bad*" catch {$mesher addMappingFilter -name Global 2 bad*} err puts $err
Output $mesher getMappingFilterDefinitions -dict 1 {Priority 1 Name F1 Value Automatic Patterns {quilt-4 quilt-5}} Priority = 1 Name = F1 Value = Automatic Patterns = quilt-4 quilt-5 EqualSpacing = 0 ForceAdjacentGrid = 0 MaximumAspectRatio = 0.0
2 {Priority 2 Name F2 Value ThinSurfaceInterpolation Patterns quilt-3} Priority = 2 Name = F2 Value = ThinSurfaceInterpolation Patterns = quilt-3 EqualSpacing = 0 ForceAdjacentGrid = 1 MaximumAspectRatio = 0.0
3 {Priority 3 Name F3 Value 3 Patterns {quilt-1* quilt-2 quilt-4 !quilt-11}} Priority = 3 Name = F3 Value = 3 Patterns = quilt-1* quilt-2 quilt-4 !quilt-11 EqualSpacing = 1 ForceAdjacentGrid = 1 MaximumAspectRatio = 20.0
4 {Priority 4 Name Global Value Automatic Patterns *} Priority = 4 Name = Global Value = Automatic Patterns = * EqualSpacing = 0 ForceAdjacentGrid = 0 MaximumAspectRatio = 0.0
$mesher addMappingFilter -name Global 5 bad* ERROR: Filter Global already exists.
deleteMappingFilter$mesher deleteMappingFilter < index | name > |
This action deletes a mapping filter. Parametersindex | This parameter is the integer index of the filter in the range [1, number of filters]. | name | This parameter is the string filter name. |
ReturnsThis action returns nothing. See AlsoaddMappingFilter, getMappingFilterDefinition, getMappingFilterDefinitions ExampleCode # $mesher is a DatabaseMesher mode puts "\$mesher addMappingFilter F1 5 {quilt-1*}" $mesher addMappingFilter F1 5 {quilt-1*}
puts "\$mesher addMappingFilter F2 0.2 {quilt-2*}" $mesher addMappingFilter F2 2 {quilt-2*} puts "\$mesher getMappingFilterCount: [$mesher getMappingFilterCount]"
puts "\$mesher deleteMappingFilter F1" $mesher deleteMappingFilter F1 puts "\$mesher getMappingFilterCount: [$mesher getMappingFilterCount]"
puts "\$mesher deleteMappingFilter F2" $mesher deleteMappingFilter F2 puts "\$mesher getMappingFilterCount: [$mesher getMappingFilterCount]"
puts "\$mesher deleteMappingFilter F1" catch {$mesher deleteMappingFilter F1} err puts " [join [split [string trim $err] "\n"] "\n "]"
puts "\$mesher deleteMappingFilter Global" catch {$mesher deleteMappingFilter Global} err puts " [join [split [string trim $err] "\n"] "\n "]"
Output $mesher addMappingFilter F1 5 {quilt-1*} $mesher addMappingFilter F2 2 {quilt-2*} $mesher getMappingFilterCount: 3 $mesher deleteMappingFilter F1 $mesher getMappingFilterCount: 2 $mesher deleteMappingFilter F2 $mesher getMappingFilterCount: 1 $mesher deleteMappingFilter F1 ERROR: Filter 'F1' does not exist. $mesher deleteMappingFilter Global ERROR: Cannot delete the Global filter.
setMappingFilterName$mesher setMappingFilterName < index | name > newName |
This action renames a mapping filter. Parametersindex | This parameter is the integer index of the filter in the range [1, number of filters]. | name | This parameter is the string mapping filter name. | newName | The mapping filter’s new name. |
ReturnsThis action returns the actual new name. Note that it will not be the specified name if another filter of that name exists. See AlsoaddMappingFilter, getMappingFilterDefinition, getMappingFilterDefinitions ExampleCode # $mesher is a DatabaseMesher mode puts "set nm \[\$mesher addMappingFilter {} 5\]" set nm [$mesher addMappingFilter {} 5] puts "\$mesher getMappingFilterDefinition -dict \$nm" puts " [$mesher getMappingFilterDefinition -dict $nm]" puts "\$mesher setMappingFilterName \$nm FX" $mesher setMappingFilterName $nm FX puts "\$mesher getMappingFilterDefinition -dict \$nm" catch {$mesher getMappingFilterDefinition -dict $nm} err puts " [join [split [string trim $err] "\n"] "\n "]" puts "\$mesher getMappingFilterDefinition -dict FX" puts " [$mesher getMappingFilterDefinition -dict FX]"
Output set nm [$mesher addMappingFilter {} 5] $mesher getMappingFilterDefinition -dict $nm Priority 1 Name filter-1 Value 5 Patterns {} $mesher setMappingFilterName $nm FX $mesher getMappingFilterDefinition -dict $nm ERROR: Filter 'filter-1' does not exist. ERROR: usage (argument 3): ::pw::DatabaseMesher_1 getMappingFilterDefinition ?-type filter_type? < index | name > $mesher getMappingFilterDefinition -dict FX Priority 1 Name FX Value 5 Patterns {}
getMappingFilterNames$mesher getMappingFilterNames ?-regex? ?pattern? |
This action returns a list of mapping filter names defined in the mesher mode. Parameters-regex | This optional flag signifies that the given pattern should be considered a regular expression pattern rather than a glob pattern. | pattern | This optional parameter is the string pattern used to filter the returned filter names. |
ReturnsA list of strings of the filter names that match the pattern. If a pattern is not given, all filter names will be returned. ExampleCode # $mesher is a DatabaseMesher mode $mesher addMappingFilter F1 Automatic {quilt-1*} $mesher addMappingFilter F2 2 {quilt-2*} $mesher addMappingFilter F3 3 {quilt-3*}
puts "\$mesher getMappingFilterNames: [list [$mesher getMappingFilterNames]]"
Output $mesher getMappingFilterNames: {F1 F2 F3 Global}
getMappingFilterCount$mesher getMappingFilterCount ?-type filter_type? |
This action returns the number of mapping filters of the defined in the mesher mode. ParametersNone. ReturnsThe integer number of filters. ExampleCode # $mesher is a DatabaseMesher mode puts "\$mesher getMappingFilterCount: [$mesher getMappingFilterCount]"
$mesher addMappingFilter F1 Automatic {quilt-1*} $mesher addMappingFilter F2 2 {quilt-2*} $mesher addMappingFilter F3 3 {quilt-3*}
puts "\$mesher getMappingFilterCount: [$mesher getMappingFilterCount]"
Output $mesher getMappingFilterCount: 1 $mesher getMappingFilterCount: 4
getMappingFilterDefinition$mesher getMappingFilterDefinition ?-type filter_type? ?-dict? < index | name > |
This action gets the definition of a mapping filter identified by index or name. Parameters-dict | This optional flag signifies that the return value should be formatted as a dictionary instead of a plain old list. | index | This parameter is the integer index of the filter in the range [1, number of filters]. | name | This parameter is the string filter name. |
ReturnsThis action returns the filter definition as a list. A returned list contains { priority name value patterns }. A return dictionary is suitable for use with the dict command and is of the form: { Priority priority Name name Value value Patterns patterns } Where, - priority is the integer priority of the filter.
- name is the string name of the filter
- value is either a string equaling either “None”, “Automatic”, “Force”, “ThinSurfaceInterpolation”, or an integer value representing the number of subdivisions to use on a “Force” mapping (see addMappingFilter for details)
- patterns is a string list of glob patterns matched against entity names.
See AlsoaddMappingFilter, getMappingFilterDefinitions ExampleCode # $mesher is a DatabaseMesher mode $mesher addMappingFilter F1 Automatic {quilt-1* wing-1*} $mesher addMappingFilter F2 2 {quilt-2* wing-2*}
foreach name [$mesher getMappingFilterNames] { puts "" puts "\$mesher getMappingFilterDefinition [list $name]:" puts " list[list [$mesher getMappingFilterDefinition $name]]" puts "\$mesher getMappingFilterDefinition -dict [list $name]:" dict for {key val} [$mesher getMappingFilterDefinition -dict $name] { puts [format " %-10.10s: %-s" $key $val] } } puts "" for {set ii 1} {$ii <= [$mesher getMappingFilterCount]} {incr ii} { puts "" puts "\$mesher getMappingFilterDefinition $ii:" puts " list[list [$mesher getMappingFilterDefinition $ii]]" puts "\$mesher getMappingFilterDefinition -dict $ii:" dict for {key val} [$mesher getMappingFilterDefinition -dict $ii] { puts [format " %-10.10s: %-s" $key $val] } }
Output $mesher getMappingFilterDefinition F1: list{1 F1 Automatic {quilt-1* wing-1*}} $mesher getMappingFilterDefinition -dict F1: Priority : 1 Name : F1 Value : Automatic Patterns : quilt-1* wing-1*
$mesher getMappingFilterDefinition F2: list{2 F2 2 {quilt-2* wing-2*}} $mesher getMappingFilterDefinition -dict F2: Priority : 2 Name : F2 Value : 2 Patterns : quilt-2* wing-2*
$mesher getMappingFilterDefinition Global: list{3 Global 0.0 *} $mesher getMappingFilterDefinition -dict Global: Priority : 3 Name : Global Value : Automatic Patterns : *
$mesher getMappingFilterDefinition 1: list{1 F1 Automatic {quilt-1* wing-1*}} $mesher getMappingFilterDefinition -dict 1: Priority : 1 Name : F1 Value : Automatic Patterns : quilt-1* wing-1*
$mesher getMappingFilterDefinition 2: list{2 F2 0.2 {quilt-2* wing-2*}} $mesher getMappingFilterDefinition -dict 2: Priority : 2 Name : F2 Value : 2 Patterns : quilt-2* wing-2*
$mesher getMappingFilterDefinition 3: list{3 Global 0.0 *} $mesher getMappingFilterDefinition -dict 3: Priority : 3 Name : Global Value : Automatic Patterns : *
getMappingFilterDefinitions$mesher getMappingFilterDefinitions ?-dict? |
This action gets a list of all mapping filter definitions. Parameters-dict | This optional flag signifies that the return value should be formatted as a dictionary instead of a plain old list. |
ReturnsThis action returns a list of all filter definitions in priority order. See getMappingFilterDefinition See AlsoaddMappingFilter, getMappingFilterDefinition ExampleCode # $mesher is a DatabaseMesher mode $mesher addMappingFilter F1 ThinSurfaceInterpolation {quilt-1* wing-1*} $mesher addMappingFilter F2 2 {quilt-2* wing-2*} 1 1 15.0
puts "\n\$mesher getMappingFilterDefinitions:" foreach filterDefn [$mesher getMappingFilterDefinitions] { puts " [list $filterDefn]" }
puts "\n\$mesher getMappingFilterDefinitions -dict:" dict for {priority filterDefn} [$mesher getMappingFilterDefinitions -dict] { puts " $priority [list $filterDefn]" dict for {key val} $filterDefn { puts [format " %-19.19s: %-s" $key $val] } }
Output $mesher getMappingFilterDefinitions: {1 F1 ThinSurfaceInterpolation {quilt-1* wing-1*}} {2 F2 2 {quilt-2* wing-2*}} {3 Global Automatic *}
$mesher getMappingFilterDefinitions -dict: 1 {Priority 1 Name F1 Value ThinSurfaceInterpolation Patterns {quilt-1* wing-1*}} Priority : 1 Name : F1 Value : ThinSurfaceInterpolation Patterns : quilt-1* wing-1* EqualSpacing : 0 ForceAdjacentGrid : 0 MaximumAspectRatio : 0.0 2 {Priority 2 Name F2 Value 0.2 Patterns {quilt-2* wing-2*}} Priority : 2 Name : F2 Value : 2 Patterns : quilt-2* wing-2* EqualSpacing : 1 ForceAdjacentGrid : 1 MaximumAspectRatio : 15.0 3 {Priority 3 Name Global Value Automatic Patterns *} Priority : 3 Name : Global Value : Automatic Patterns : * EqualSpacing : 0 ForceAdjacentGrid : 0 MaximumAspectRatio : 0.0
getMappingFilterEntityCounts$mesher getMappingFilterEntityCounts ?-type filter_type? ?-includeEntities? ?-dict? |
This action matches the name of each mode entity against the mapping filter patterns in filter priority order and returns the match count for each filter. Parameters-includeEntities | This optional flag signifies that the matching entities should also be included in the return value. | -dict | This optional flag signifies that the return value should be formatted as a dictionary instead of a list. |
ReturnsThis action returns the entity match count for each filter as a list or dictionary. See AlsoaddMappingFilter, getMappingFilterDefinition NoteOnce an entity matches a mapping filter, it is removed from consideration for lower priority filters. That is, each entity is only counted once. A return list is of the form: {filtername entcnt ?entitylist? ... filtername entcnt ?entitylist?} A return dictionary is suitable for use with the dict command and is of the form: {filtername {Count entcnt ?Entities entitylist?} ... filtername {Count entcnt ?Entities entitylist?}} Filters that do not match any mode entity names are not included in the return. Mode entities that do not match any filter are included in the return in the Global filter. ExampleCode # $mesher is a DatabaseMesher mode # $dbEnts is a list of database entities
proc toNames { ents } { set ret [list] foreach ent $ents { lappend ret [$ent getName] } return $ret }
puts "All Database Entities:" puts " [toNames $dbEnts]" puts ""
$mesher addMappingFilter F1 ThinSurfaceInterpolation {quilt-4 quilt-5 {WING X*}} $mesher addMappingFilter F2 2 quilt-3 $mesher addMappingFilter F3 3 {quilt-1* quilt-2 quilt-4 !quilt-11}
# format template set fmt "| %-6.6s | %3.3s | %-30.30s | %-35.35s |" set hr [string repeat - 50]
puts "\$mesher getMappingFilterEntityCounts -includeEntities" puts [format $fmt Filter Cnt "Matched Entities" Patterns] puts [format $fmt $hr $hr $hr $hr] foreach {name entCnt ents} [$mesher getMappingFilterEntityCounts -includeEntities] { set patterns [dict get [$mesher getFilterDefinition -dict $name] Patterns] puts [format $fmt $name $entCnt [list [toNames $ents]] $patterns] }
puts "" puts "\$mesher getMappingFilterEntityCounts -dict -includeEntities" puts [format $fmt Filter Cnt "Matched Entities" Patterns] puts [format $fmt $hr $hr $hr $hr] dict for {name keyVals} [$mesher getMappingFilterEntityCounts -dict -includeEntities] { set entCnt [dict get $keyVals Count] set ents [dict get $keyVals Entities] set patterns [dict get [$mesher getFilterDefinition -dict $name] Patterns] puts [format $fmt $name $entCnt [list [toNames $ents]] $patterns] }
Output All Database Entities: body_0 quilt-1 quilt-2 quilt-3 quilt-4 quilt-5 quilt-12 {WING XL} quilt-11
$mesher getMappingFilterEntityCounts -includeEntities | Filter | Cnt | Matched Entities | Patterns | | ------ | --- | ------------------------------ | ----------------------------------- | | F1 | 3 | {quilt-4 quilt-5 {WING XL}} | quilt-4 quilt-5 {WING X*} | | F2 | 1 | quilt-3 | quilt-3 | | F3 | 3 | {quilt-1 quilt-2 quilt-12} | quilt-1* quilt-2 quilt-4 !quilt-11 | | Global | 1 | quilt-11 | * |
$mesher getMappingFilterEntityCounts -dict -includeEntities | Filter | Cnt | Matched Entities | Patterns | | ------ | --- | ------------------------------ | ----------------------------------- | | F1 | 3 | {quilt-4 quilt-5 {WING XL}} | quilt-4 quilt-5 {WING X*} | | F2 | 1 | quilt-3 | quilt-3 | | F3 | 3 | {quilt-1 quilt-2 quilt-12} | quilt-1* quilt-2 quilt-4 !quilt-11 | | Global | 1 | quilt-11 | * |
setMappingFilterPriority$mesher setMappingFilterPriority name_list |
This action sets the priority of one or more existing mapping filters. Parametersname_list | This parameter is a list of string mapping filter names. Any filters not in name_list will be prioritized after the entities in name_list. |
ReturnsThis action returns nothing. See AlsoaddMappingFilter, getMappingFilterDefinition, getMappingFilterDefinitions NoteThe relative ordering of the re-prioritized mapping filters will be maintained. ExampleCode # $mesher is a DatabaseMesher mode
proc doSetPriority { mesher names } { puts "\$mesher setMappingFilterPriority [list $names]:" if { [catch {$mesher setMappingFilterPriority $names} err] } { puts " [string trim $err]" } else { puts " [$mesher getMappingFilterNames]" } }
$mesher addMappingFilter F1 ThinSurfaceInterpolation {quilt-1*} $mesher addMappingFilter F2 2 {quilt-2*} $mesher addMappingFilter F3 3 {quilt-3*} $mesher addMappingFilter F4 4 {quilt-4*} $mesher addMappingFilter F5 5 {quilt-5*} $mesher addMappingFilter F6 6 {quilt-6*}
puts "Starting filter priority:" puts " [$mesher getMappingFilterNames]" doSetPriority $mesher {F2 F6 F4} doSetPriority $mesher F6 doSetPriority $mesher {F6 F5 F4 F3 F2 F1} puts "\nThese will fail:" doSetPriority $mesher {F4 F2 F4 F2} doSetPriority $mesher {XX YY} doSetPriority $mesher {F4 F2 F4 XX} doSetPriority $mesher {F2 Global F6 F4}
Output Starting filter priority: F1 F2 F3 F4 F5 F6 Global $mesher setMappingFilterPriority {F2 F6 F4}: F2 F6 F4 F1 F3 F5 Global $mesher setMappingFilterPriority F6: F6 F2 F4 F1 F3 F5 Global $mesher setMappingFilterPriority {F6 F5 F4 F3 F2 F1}: F6 F5 F4 F3 F2 F1 Global
These will fail: $mesher setMappingFilterPriority {F4 F2 F4 F2}: ERROR: Found duplicate filter names {F4 F2}. $mesher setMappingFilterPriority {XX YY}: ERROR: Filters {XX YY} do not exist. $mesher setMappingFilterPriority {F4 F2 F4 XX}: ERROR: Filter XX does not exist. Found duplicate filter name F4. $mesher setMappingFilterPriority {F2 Global F6 F4}: ERROR: Cannot change the Global filter priority.
setMappingFilterPatterns$mesher setMappingFilterPatterns < index | name > pattern_list |
This action sets the patterns of an existing mapping filters. Parametersindex | This parameter is the integer index of the mapping filter in the range [1, number of mapping filters]. | name | This parameter is the string mapping filter name. | patterns | The list of string patterns that will be used to match against database entity names. |
ReturnsThis action returns nothing. See AlsoaddMappingFilter, getMappingFilterDefinition, getMappingFilterDefinitions ExampleCode $mesher addMappingFilter F1 ThinSurfaceInterpolation {quilt-4 quilt-5}
puts "patterns: [dict get [$mesher getMappingFilterDefinition -dict F1] Patterns]" puts "\$mesher setMappingFilterPatterns F1 {quilt-4 quilt-5 {WING X*}}" $mesher setMappingFilterPatterns F1 {quilt-4 quilt-5 {WING X*}} puts "patterns: [dict get [$mesher getMappingFilterDefinition -dict F1] Patterns]"
# Will fail catch {$mesher setMappingFilterPatterns Global {W*}} err puts $err
Output patterns: quilt-4 quilt-5 $mesher setMappingFilterPatterns F1 {quilt-4 quilt-5 {WING X*}} patterns: quilt-4 quilt-5 {WING X*} ERROR: Cannot change the Global filter patterns.
setMappingFilterEntities$mesher setMappingFilterEntities ?-op op_type? < index | name > dbentity_list |
This action modifies mapping filter patterns as needed to guarantee that the entities in dbentity_list are captured by the specified filter. Parameters-op op_type | This optional parameter specifies the string operation type. One of < Set | Remove >. | index | This parameter is the integer index of the filter in the range [1, number of filters]. | name | This parameter is the string filter name. | dbentity_list | This parameter is a list of pw::DatabaseEntity objects, or a single pw::DatabaseEntity object. |
ReturnsThis action returns nothing. See AlsoaddMappingFilter, getMappingFilterDefinition, getMappingFilterDefinitions NoteOther mapping filters may need to be adjusted to properly fulfill the requested configure operation. For instance, to add or set entities on a mapping filter, those same entities will be removed from other mapping filters as needed so that they no longer capture those entities. ExampleCode # $mesher is a DatabaseMesher mode # $dbEnts is a list of database entities
proc toNames { ents } { set ret [list] foreach ent $ents { lappend ret [$ent getName] } return $ret }
proc dumpPatterns { mesher } { set filterCnts [$mesher getMappingFilterEntityCounts -dict -includeEntities] set fmt "| %-6.6s | %-37.37s | %-55.55s |" set hr [string repeat - 80] puts [format $fmt Filter Patterns "Matched Entities"] puts [format $fmt $hr $hr $hr] foreach name [$mesher getMappingFilterNames] { set defn [$mesher getMappingFilterDefinition -dict $name] if { [catch {dict get $filterCnts $name Entities} ents] } { set ents [list] } puts [format $fmt $name [dict get $defn Patterns] [toNames $ents]] } }
set quilts [list] set names {quilt-11 quilt-2 quilt-1} foreach name $names { lappend quilts [pw::DatabaseEntity getByName $name] }
$mesher addMappingFilter F1 ThisSurfaceInterpolation {quilt-1*} $mesher addMappingFilter F2 2 {quilt-2*} $mesher addMappingFilter F3 3 {quilt-1* quilt-3*}
puts "All Database Entities:" puts " [toNames $dbEnts]" puts "" dumpPatterns $mesher puts "" puts "\$mesher setMappingFilterEntities -op Set F2 [list $names]" $mesher setMappingFilterEntities -op Set F2 $quilts dumpPatterns $mesher puts "" puts "\$mesher setMappingFilterEntities -op Set F3 [list $names]" $mesher setMappingFilterEntities -op Set F3 $quilts dumpPatterns $mesher puts "" puts "\$mesher setMappingFilterEntities F1 [list $names]" $mesher setMappingFilterEntities F1 $quilts dumpPatterns $mesher puts "" puts "\$mesher setMappingFilterEntities -op Remove F1 [list $names]" $mesher setMappingFilterEntities -op Remove F1 $quilts dumpPatterns $mesher puts "" # Setting entities to the Global mapping filter removes them from # all other filters puts "\$mesher setMappingFilterEntities Global [list $names]" $mesher setMappingFilterEntities Global $quilts dumpPatterns $mesher puts "" puts "\$mesher setMappingFilterEntities -op Remove Global [list $names]" catch {$mesher setMappingFilterEntities -op Remove Global $quilts} err puts " [join [split [string trim $err] "\n"] "\n "]"
Output All Database Entities: body_0 quilt-1 quilt-2 quilt-3 quilt-4 quilt-5 quilt-12 {WING XL} quilt-11
| Filter | Patterns | Matched Entities | | ------ | ------------------------------------- | ------------------------------------------------------- | | F1 | quilt-1* | quilt-1 quilt-12 quilt-11 | | F2 | quilt-2* | quilt-2 | | F3 | quilt-1* quilt-3* | quilt-3 | | Global | * | quilt-4 quilt-5 {WING XL} |
$mesher setMappingFilterEntities -op Set F2 {quilt-11 quilt-2 quilt-1} | Filter | Patterns | Matched Entities | | ------ | ------------------------------------- | ------------------------------------------------------- | | F1 | quilt-1* !quilt-11 !quilt-1 | quilt-12 | | F2 | quilt-2* quilt-11 quilt-1 | quilt-1 quilt-2 quilt-11 | | F3 | quilt-1* quilt-3* | quilt-3 | | Global | * | quilt-4 quilt-5 {WING XL} |
$mesher setMappingFilterEntities -op Set F3 {quilt-11 quilt-2 quilt-1} | Filter | Patterns | Matched Entities | | ------ | ------------------------------------- | ------------------------------------------------------- | | F1 | quilt-1* !quilt-11 !quilt-1 | quilt-12 | | F2 | quilt-2* !quilt-2 | | | F3 | quilt-1* quilt-3* quilt-2 | quilt-1 quilt-2 quilt-3 quilt-11 | | Global | * | quilt-4 quilt-5 {WING XL} |
$mesher setMappingFilterEntities F1 {quilt-11 quilt-2 quilt-1} | Filter | Patterns | Matched Entities | | ------ | ------------------------------------- | ------------------------------------------------------- | | F1 | quilt-1* quilt-2 | quilt-1 quilt-2 quilt-12 quilt-11 | | F2 | quilt-2* !quilt-2 | | | F3 | quilt-1* quilt-3* quilt-2 | quilt-3 | | Global | * | quilt-4 quilt-5 {WING XL} |
$mesher setMappingFilterEntities -op Remove F1 {quilt-11 quilt-2 quilt-1} | Filter | Patterns | Matched Entities | | ------ | ------------------------------------- | ------------------------------------------------------- | | F1 | quilt-1* !quilt-11 !quilt-1 | quilt-12 | | F2 | quilt-2* !quilt-2 | | | F3 | quilt-1* quilt-3* quilt-2 | quilt-1 quilt-2 quilt-3 quilt-11 | | Global | * | quilt-4 quilt-5 {WING XL} |
$mesher setMappingFilterEntities Global {quilt-11 quilt-2 quilt-1} | Filter | Patterns | Matched Entities | | ------ | ------------------------------------- | ------------------------------------------------------- | | F1 | quilt-1* !quilt-11 !quilt-1 | quilt-12 | | F2 | quilt-2* !quilt-2 | | | F3 | quilt-1* quilt-3* !quilt-11 !quilt-1 | quilt-3 | | Global | * | quilt-1 quilt-2 quilt-4 quilt-5 {WING XL} quilt-11 |
$mesher setMappingFilterEntities -op Remove Global {quilt-11 quilt-2 quilt-1} ERROR: Cannot remove entities from the Global filter.
setMappingFilterValueThis action sets a mapping filter’s value. Parametersindex | This parameter is the integer index of the filter in the range [1, number of filters]. | name | This parameter is the string filter name. | value | The filter’s new value. The value is a string with valid values < None | Automatic | Force | ThinSurfaceInterpolation > or an integer with the range [2, infinity) representing the number of subdivisions along the short side of the mapped domain. The ‘None’ option will prevent a mapped domain from possibly being generated on the corresponding quilts. The ‘Automatic’ option is the default setting which lets the algorithm decide whether or not to generate a mapped domain. The ‘Force’ option indicates that a mapped domain should be generated on the corresponding quilts, but leaves it up to the algorithm to determine the number of subdivisions on the smaller sides of the domains. Note that this does not guarantee that mapped domains will be created -- there are still topological requirements that must be met. The ‘ThinSurfaceInterpolation’ option specifies that any domains created on the corresponding quilts should be initialized with the ‘ThinSurfaceInterpolation’ algorithm. Finally, an integer value is similar to the ‘Force’ option, but the integer value is used as the number of subdivisions to be imposed on the smaller sides of the domains. |
ReturnsThis action returns nothing. See AlsoaddMappingFilter, getMappingFilterDefinition, getMappingFilterDefinitions ExampleCode # $mesher is a DatabaseMesher mode $mesher addMappingFilter F1 ThinSurfaceInterpolation {quilt-1*}
puts "value: [dict get [$mesher getMappingFilterDefinition -dict F1] Value]" $mesher setMappingFilterValue F1 9 puts "\n\$mesher setMappingFilterValue F1 9" puts "value: [dict get [$mesher getMappingFilterDefinition -dict F1] Value]"
puts "\n\$mesher setMappingFilterValue F1 -1.0" catch {$mesher setMappingFilterValue F1 -1.0} err puts " [join [split [string trim $err] "\n"] "\n "]" puts "value: [dict get [$mesher getMappingFilterDefinition -dict F1] Value]"
puts "\n\$mesher setMappingFilterValue Q1 1.0" catch {$mesher setMappingFilterValue Q1 1.0} err puts " [join [split [string trim $err] "\n"] "\n "]"
Output value: 0.1
$mesher setMappingFilterValue F1 9 value: 0.9
$mesher setMappingFilterValue F1 -1 ERROR: value outside the range [2,infinity) ERROR: usage (argument 3): ::pw::DatabaseMesher_1 setMappingFilterValue ?-type filter_type? < index | name > value value: 0.9
$mesher setMappingFilterValue Q1 10 ERROR: Filter 'Q1' does not exist. ERROR: usage (argument 2): ::pw::DatabaseMesher_1 setMappingFilterValue ?-type filter_type? < index | name > value
setMappingFilterEqualSpacing$mesher setMappingFilterEqualSpacing < index | name > use_equal |
This action sets a mapping filter to use equal spacing. Parametersindex | This parameter is the integer index of the filter in the range [1, number of filters]. | name | This parameter is the string filter name. | use_equal | a boolean indicating whether to enable equal spacing for the filter. |
ReturnsThis action returns nothing. See AlsoaddMappingFilter, getMappingFilterDefinition, getMappingFilterDefinitions, getMappingFilterEqualSpacing ExampleCode # $mesher is a DatabaseMesher mode $mesher addMappingFilter F1 ThinSurfaceInterpolation {quilt-1*} $mesher setMappingFilterEqualSpacing true puts [$mesher getMappingFilterEqualSpacing F1]
Output 1
getMappingFilterEqualSpacing$mesher getMappingFilterEqualSpacing < name | index > |
This action returns whether a mapping filter uses equal spacing. Parametersindex | This parameter is the integer index of the filter in the range [1, number of filters]. | name | This parameter is the string filter name. |
ReturnsA boolean indicating whether equal spacing should be applied for the filter. ExampleCode Code # $mesher is a DatabaseMesher mode $mesher addMappingFilter F1 ThinSurfaceInterpolation {quilt-1*} $mesher setMappingFilterEqualSpacing F1 false puts [$mesher getMappingFilterEqualSpacing F1]
Output 0
setMappingFilterForceAdjacentGrid$mesher setMappingFilterForceAdjacentGrid < index | name > force |
This action sets a mapping filter to force adjacent grid spacing on neighboring surface grids. Parametersindex | This parameter is the integer index of the filter in the range [1, number of filters]. | name | This parameter is the string filter name. | force | a boolean indicating whether to force adjacent grid spacing for the filter. |
ReturnsThis action returns nothing. See AlsoaddMappingFilter, getMappingFilterDefinition, getMappingFilterDefinitions, getMappingFilterForceAdjacentGrid ExampleCode # $mesher is a DatabaseMesher mode $mesher addMappingFilter F1 ThinSurfaceInterpolation {quilt-1*} $mesher setMappingFilterForceAdjacentGrid F1 true puts [$mesher getMappingFilterForceAdjacentGrid F1]
Output 1
getMappingFilterForceAdjacentGrid$mesher getMappingFilterForceAdjacentGrid < name | index > |
This action returns whether a mapping filter forces adjacent grid spacing on neighboring surface grids. Parametersindex | This parameter is the integer index of the filter in the range [1, number of filters]. | name | This parameter is the string filter name. |
ReturnsA boolean indicating whether adjacent grid spacing will be forced on neighboring surface grids for the filter. See AlsoaddMappingFilter, getMappingFilterDefinition, getMappingFilterDefinitions, setMappingFilterForceAdjacentGrid ExampleCode Code # $mesher is a DatabaseMesher mode $mesher addMappingFilter F1 ThinSurfaceInterpolation {quilt-1*} $mesher setMappingFilterForceAdjacentGrid F1 true puts [$mesher getMappingFilterForceAdjacentGrid F1]
Output 1
setMappingFilterMaximumAspectRatio$mesher setMappingFilterMaximumAspectRatio < index | name > max_ratio |
This action sets a mapping filter’s maximum aspect ratio. Parametersindex | This parameter is the integer index of the filter in the range [1, number of filters]. | name | This parameter is the string filter name. | max_ratio | a float indicating the maximum aspect ratio to allow for a mapped surface grid for the filter. A value of 0.0 indicates that the filter should use the global value. A value in the range [1.0, infinity) will override the global value. Any other value will trigger an error. |
ReturnsThis action returns nothing. See Also<setMaximumAspectRatio>, addMappingFilter, getMappingFilterDefinition, getMappingFilterDefinitions, getMappingFilterMaximumAspectRatio ExampleCode # $mesher is a DatabaseMesher mode $mesher addMappingFilter F1 ThinSurfaceInterpolation {quilt-1*} $mesher setMappingFilterMaximumAspectRatio F1 10.0 puts [$mesher getMappingFilterMaximumAspectRatio F1]
Output 10.0
getMappingFilterMaximumAspectRatio$mesher getMappingFilterMaximumAspectRatio < name | index > |
This action returns the maximum aspect ratio allowed for a mapped domain. Parametersindex | This parameter is the integer index of the filter in the range [1, number of filters]. | name | This parameter is the string filter name. |
ReturnsA float indicating the maximum allowable aspect ratio for the filter. See AlsoaddMappingFilter, getMappingFilterDefinition, getMappingFilterDefinitions, setMappingFilterMaximumAspectRatio ExampleCode # $mesher is a DatabaseMesher mode $mesher setMappingFilterMaximumAspectRatio F1 10.0 puts [$mesher getMappingFilterMaximumAspectRatio F1]
Output 10.0
getMappingResult$mesher getMappingResult ?-details detailVar? domain |
This action gets whether or not a created unstructured domain was mapped to a structured domain. It also optionally provides details as to why a domain was not mapped. Parametersdomain | This argument is expected to be pw::DomainUnstructured object created by the mode. | -details | If present, this flag specifies a variable to receive details of the result. If the domain was mapped, this description will be the name of the structured domain to which the domain was mapped along with the point dimension ratio used to evaluate whether it could be mapped. If the domain was not mapped, this description will provide a brief description of why the domain was not mapped. |
ReturnsThis action returns a boolean value of true if the domain was mapped.
addBoundaryFilter$mesher addBoundaryFilter ?filter_name? |
This action adds a new boundary filter to control how stretching is applied to the matching boundaries. Parametersfilter_name | This optional parameter specifies the name of the filter. If not specified, a generated name will be automatically provided. The name should be unique. If not, an integer suffix will be added to the name. If the specified name already had an integer suffix of the form “-N”, then the integer portion will be modified to an available value in order to make the name unique. |
ReturnsThis function returns the name of the newly created boundary filter. See AlsodeleteBoundaryFilter, getBoundaryFilterNames, setBoundaryFilterDefinition, and addBoundaryFilterDefinition. ExampleCode # $mesher is a DatabaseMesher mode puts "set filter(1) \[\$mesher addBoundaryFilter\]" set filter(1) [$mesher addBoundaryFilter] puts "filter(1) is $filter(1)" puts "set filter(2) \[\$mesher addBoundaryFilter TrailingEdge\]" set filter(2) [$mesher addBoundaryFilter TrailingEdge] puts "filter(2) is $filter(2)" puts "set filter(3) \[\$mesher addBoundaryFilter TrailingEdge\]" set filter(3) [$mesher addBoundaryFilter TrailingEdge] puts "filter(3) is $filter(3)"
Output set filter(1) [$mesher addBoundaryFilter] filter(1) is bf-1 set filter(2) [$mesher addBoundaryFilter TrailingEdge] filter(2) is TrailingEdge set filter(3) [$mesher addBoundaryFilter TrailingEdge] filter(3) is TrailingEdge-2
deleteBoundaryFilter$mesher deleteBoundaryFilter filter_name |
This function deletes an existing boundary filter. Parametersfilter_name | This required parameter is the name of an existing filter to be deleted. |
ReturnsThis action returns nothing. See AlsoaddBoundaryFilter, getBoundaryFilterNames, and setBoundaryFilterName. Example Code # $mesher is a DatabaseMesher mode puts "set filter(1) \[\$mesher addBoundaryFilter\]" set filter(1) [$mesher addBoundaryFilter] puts "set filter(2) \[\$mesher addBoundaryFilter TrailingEdge\]" set filter(2) [$mesher addBoundaryFilter TrailingEdge] puts "Filter names:" foreach f [$mesher getBoundaryFilterNames] { puts " f" } puts "--" puts "\$mesher deleteBoundaryFilter \$filter(1)" $mesher deleteBoundaryFilter $filter(1) puts "\$mesher deleteBoundaryFilter \$filter(2)" $mesher deleteBoundaryFilter $filter(2) puts "Filter names:" foreach f [$mesher getBoundaryFilterNames] { puts " f" } puts "--"
Output set filter(1) [$mesher addBoundaryFilter] set filter(2) [$mesher addBoundaryFilter TrailingEdge] Filter names: bf-1 TrailingEdge -- $mesher deleteBoundaryFilter $filter(1) $mesher deleteBoundaryFilter $filter(2) Filter names: --
getBoundaryFilterNames$mesher getBoundaryFilterNames |
This function returns a list of the names of the current boundary filters. ParametersNone. ReturnsThis function returns a list of string values with each value representing the name of a boundary filter. The names are in priority order with the highest priority boundary filter listed first. See AlsoaddBoundaryFilter and deleteBoundaryFilter. ExampleCode # $mesher is a DatabaseMesher mode puts "set filter(1) \[\$mesher addBoundaryFilter\]" set filter(1) [$mesher addBoundaryFilter] puts "set filter(2) \[\$mesher addBoundaryFilter TrailingEdge\]" set filter(2) [$mesher addBoundaryFilter TrailingEdge] puts "Filter names:" foreach f [$mesher getBoundaryFilterNames] { puts " f" } puts "--"
Output set filter(1) [$mesher addBoundaryFilter] set filter(2) [$mesher addBoundaryFilter TrailingEdge] Filter names: bf-1 TrailingEdge --
setBoundaryFilterName$mesher setBoundaryFilterName old_name new_name |
This action changes the name of an existing boundary filter. The new name should be unique. If the name collides with an existing boundary filter name, the new name will be updated to be unique. Parametersold_name | This parameter is a string value representing an existing boundary filter name. | new_name | This parameter is a string value representing the desired name of the boundary filter. |
ReturnsThis action returns the actual updated name as a string value. See AlsoaddBoundaryFilter and getBoundaryFilterNames. ExampleCode # $mesher is a DatabaseMesher mode puts "set filter(1) \[\$mesher addBoundaryFilter\]" set filter(1) [$mesher addBoundaryFilter] puts "filter(1) is $filter(1)" puts "set filter(2) \[\$mesher addBoundaryFilter\]" set filter(2) [$mesher addBoundaryFilter] puts "filter(2) is $filter(2)"
puts "set filter(1) \[\$mesher setBoundaryFilterName \$filter(1) \"My Filter\"\]" set filter(1) [$mesher setBoundaryFilterName $filter(1) "My Filter"] puts "filter(1) is $filter(1)" puts "set filter(2) \[\$mesher setBoundaryFilterName \$filter(2) \"My Filter\"\]" set filter(2) [$mesher setBoundaryFilterName $filter(2) "My Filter"] puts "filter(2) is $filter(2)"
Output set filter(1) [$mesher addBoundaryFilter] filter(1) is bf-1 set filter(2) [$mesher addBoundaryFilter] filter(2) is bf-2 set filter(1) [$mesher setBoundaryFilterName $filter(1) "My Filter"] filter(1) is My Filter set filter(2) [$mesher setBoundaryFilterName $filter(2) "My Filter"] filter(2) is My Filter-2
setBoundaryFilterDefinition$mesher setBoundaryFilterDefinition filter_name pattern_list |
This action specifies the patterns used to select which quilt boundaries will have the boundary conditions applied. Parametersfilter_name | This parameter is the string boundary filter name. | pattern_list | This parameter is a list of filter patterns. A filter pattern entry must consist of a “Pattern A” element. It may optionally include a “Pattern B” element and/or a boundary classification element. See the Notes section for a description of each element. |
ReturnsThis action returns nothing. NotesFilter Entry: A boundary filter entry consists of the following parts: pattern A, pattern B, and a list of boundary classifications. Pattern A: This string can either be the name of a quilt or a pattern that can match multiple quilts. Wildcard patterns are specified with ‘*’, ‘?’, and ‘[‘ - ‘]’ pairs. A ‘*’ character matches any number (including zero) of characters. A ‘?’ character matches any single character. Brackets indicate a range of characters to match or exclude and has the following 4 available forms: “[abc]” matches one character given in the bracket, “[a-c]” matches one character from the range (inclusive) given in the bracket, “[!abc]” matches one character that is not in the bracket, and “[!a-c]” matches one character that is not in the range specified by the bracket. A backslash “\” can be used to escape any special meaning by a wildcard character. For example, “\?” will match a question mark while “?” will match any single character. Pattern B: This string follows the same syntax as ‘Pattern A’. If the B pattern is empty, then this filter entry will be applied to lamina boundaries on the quilts that match pattern A. If the B pattern is non-empty, then the filter entry will only be applied to manifold boundaries shared between quilts that match pattern A and quilts that match pattern B and are not excluded by the specified boundary classifications. If omitted, an empty string is assumed. Boundary Classifications: This list of 5 possible string values restricts the filter entry to boundaries that match the quilt patterns specified with Pattern A and Pattern B based on their classifications. The five classification options are: “All”, “None”, “Curvature”, “Convex”, and “Concave”. The “All” option indicates that all boundaries regardless of classification should be allowed. Note that “None” means boundaries that are not classified as either “Curvature”, “Convex”, or “Concave”. If the boundary classification list is not specified, “All” is assumed. See AlsoaddBoundaryFilterDefinition and getBoundaryFilterDefinition. ExampleCode # Each entry has the following meaning: # Entry 1: any boundaries between any quilt that matches "upper-*" and # any quilt that matches "lower-*" regardless of classification # will be included. # Entry 2: any convex boundaries shared between any quilt that matches # "left-*" and any quilt that matches "right-*" will be included. # Entry 3: any boundaries not classified as convex or concave shared # between any quilt that matches "forward-*" and any quilt that # matches "aft-*" will be included. # Entry 4: any lamina boundaries on a quilt that matches "inner-*" # will be included, regardless of classification. # Entry 5: any lamina boundaries not classified as curvature, convex, # or concave on any quilt that matches "outer-*-aft" will be # included. # Entry 6: any lamina boundaries not classified as curvature, convex, # or concave on any quilt that matches "fuselage-*" will be # included. # Entry 7: any manifold boundaries not classified as curvature, # convex, or concave shared between a quilt that matches # "fuselage-*" and any other quilt will be included. # Entry 8: any boundaries regardless of classification shared between # any quilt that matches "canard-upper-*" and any quilt that # matches "canard-lower-*" will be included. # Entry 9: any curvature boundaries between the quilt named # "canard-upper-inner" and "canard-lower-inner" will be excluded. # # $mesher is a DatabaseMesher mode set filter_name [$mesher addBoundaryFilter] $mesher setBoundaryFilterDefinition $filter_name [list \ {upper-* lower-*} \ {left-* right-* Convex} \ {forward-* aft-* {None Curvature}} \ {inner-*} \ {outer-*-aft None} \ {fuselage-* None} \ {fuselage-* * None} \ {canard-upper-* canard-lower-*} \ {!canard-upper-inner canard-lower-inner Curvature} \ ] puts "$filter_name elements:" foreach entry [$mesher getBoundaryFilterDefinition $filter_name] { puts " $entry" }
Output bf-1 elements: upper-* lower-* All left-* right-* Convex forward-* aft-* {None Curvature} inner-* {} All outer-*-aft {} None fuselage-* {} None fuselage-* * None canard-upper-* canard-lower-* All !canard-upper-inner canard-lower-inner Curvature
getBoundaryFilterDefinition$mesher getBoundaryFilterDefinition filter_name |
This function returns the current definition for a boundary filter. Parametersfilter_name | This parameter is the string boundary filter name. |
ReturnsThis action returns a list of boundary filter patterns. Each entry in the list will consist of 3 entries. The first entry will be “Pattern A” (see the Notes section of setBoundaryFilterDefinition). The second entry will be the “Pattern B” value, while the third entry will be the boundary classification specification. See AlsoaddBoundaryFilter and setBoundaryFilterDefinition. ExampleCode # $mesher is a DatabaseMesher mode set filter_name [$mesher addBoundaryFilter] $mesher setBoundaryFilterDefinition $filter_name [list \ {upper-* lower-*} \ {left-* right-* Convex} \ {forward-* aft-* {None Curvature}} \ {inner-*} \ {outer-*-aft None} \ {fuselage-* None} \ {fuselage-* * None} \ {canard-upper-* canard-lower-*} \ {!canard-upper-inner canard-lower-inner Curvature} \ ] puts "$filter_name elements:" foreach entry [$mesher getBoundaryFilterDefinition $filter_name] { puts " $entry" }
Output bf-1 elements: upper-* lower-* All left-* right-* Convex forward-* aft-* {None Curvature} inner-* {} All outer-*-aft {} None fuselage-* {} None fuselage-* * None canard-upper-* canard-lower-* All !canard-upper-inner canard-lower-inner Curvature
See AlsosetBoundaryFilterDefinition. Example
addBoundaryFilterDefinition$mesher addBoundaryFilterDefinition filter_name pattern_list |
This method adds a new entry to the end of a current boundary filter definition. Parametersfilter_name | This parameter is the string boundary filter name. | pattern_list | This parameter is a list of filter patterns. See setBoundaryFilterDefinition for an explanation of filter patterns. |
NoteWhile similar to setBoundaryFilterDefinition, this extends the existing filter and may remove earlier entries. This only occurs with explicit namings (no special pattern matching characters in the patterns) and only among entries after an entry that does use special pattern matching characters. For example, if a definition ends with the entry “{quilt-1 quilt-2 Curvature}” (additive entry) and this function adds “{!quilt-1 quilt-2 Curvature}” (subtractive entry), then the second entry nullifies the first entry, removing it from the list instead of adding to the list. Conversely, if a list ends with a subtractive entry and a matching additive entry is added, the subtractive entry will be removed from the list in addition to the additive entry being appended. ReturnsThis action returns nothing. See AlsosetBoundaryFilterDefinition. ExampleCode # $mesher is a DatabaseMesher mode # Set the initial definition set filter_name [$mesher addBoundaryFilter] $mesher setBoundaryFilterDefinition $filter_name [list \ {upper-* lower-*} \ {left-tail right-tail Convex} \ {canard-upper-* canard-lower-*} \ {!canard-upper-inner canard-lower-inner Curvature} \ ] puts "$filter_name elements:" foreach entry [$mesher getBoundaryFilterDefinition $filter_name] { puts " $entry" } puts "--" # Cancel the subtractive entry puts "\$mesher addBoundaryFilterDefinition \$filter_name \[list {canard-upper-inner canard-lower-inner Curvature}\]" $mesher addBoundaryFilterDefinition $filter_name [list {canard-upper-inner canard-lower-inner Curvature}] puts "$filter_name elements:" foreach entry [$mesher getBoundaryFilterDefinition $filter_name] { puts " $entry" } puts "--" # Cancel the additive entry just added puts "\$mesher addBoundaryFilterDefinition \$filter_name \[list {!canard-upper-inner canard-lower-inner Curvature}\]" $mesher addBoundaryFilterDefinition $filter_name [list {!canard-upper-inner canard-lower-inner Curvature}] puts "$filter_name elements:" foreach entry [$mesher getBoundaryFilterDefinition $filter_name] { puts " $entry" } puts "--" # Add the convex boundaries between left-tail and right-tail to # the list. Note the earlier matching subtractive entry wasn't # removed because an entry with wildcard patterns exists after it. puts "\$mesher addBoundaryFilterDefinition \$filter_name \[list {!left-tail right-tail Convex}\]" $mesher addBoundaryFilterDefinition $filter_name [list {left-tail right-tail Convex}] puts "$filter_name elements:" foreach entry [$mesher getBoundaryFilterDefinition $filter_name] { puts " $entry" }
Output bf-1 elements: upper-* lower-* All left-tail right-tail Convex canard-upper-* canard-lower-* All !canard-upper-inner canard-lower-inner Curvature -- $mesher addBoundaryFilterDefinition $filter_name [list {canard-upper-inner canard-lower-inner Curvature}] bf-1 elements: upper-* lower-* All left-tail right-tail Convex canard-upper-* canard-lower-* All canard-upper-inner canard-lower-inner Curvature -- $mesher addBoundaryFilterDefinition $filter_name [list {!canard-upper-inner canard-lower-inner Curvature}] bf-1 elements: upper-* lower-* All left-tail right-tail Convex canard-upper-* canard-lower-* All -- $mesher addBoundaryFilterDefinition $filter_name [list {!left-tail right-tail Convex}] bf-1 elements: upper-* lower-* All left-tail right-tail Convex canard-upper-* canard-lower-* All left-tail right-tail Convex
getBoundaryFilterGrowthType$mesher getBoundaryFilterGrowthType filter_name |
This action returns the growth type associated with the boundary filter. Parametersfilter_name | This parameter is the string boundary filter name. |
ReturnsThis function returns the growth type associated with this filter as a string value, either “Off”, “Angle”, “MaximumAspectRatio” or “Wall”. See AlsosetBoundaryFilterGrowthType. ExampleCode # $mesher is a DatabaseMesher mode set filter_name [$mesher addBoundaryFilter] puts "Growth type: [$mesher getBoundaryFilterGrowthType $filter_name]" puts "\$mesher setBoundaryFilterGrowthType \$filter_name Angle" $mesher setBoundaryFilterGrowthType $filter_name Angle puts "Growth type: [$mesher getBoundaryFilterGrowthType $filter_name]"
Output Growth type: Off $mesher setBoundaryFilterGrowthType $filter_name Angle Growth type: Angle
setBoundaryFilterGrowthType$mesher setBoundaryFilterGrowthType filter_name type |
This action sets the growth type associated with the boundary filter. Parametersfilter_name | This parameter is the string boundary filter name. | type | This string value represents the desired growth type. Valid values are < Off | Wall | Angle | MaximumAspectRatio >. |
ReturnsThis action returns nothing. See AlsogetBoundaryFilterGrowthType. NotesWhen using Angle or MaximumAspectRatio, use <setBoundaryFilterGrowthValue> to specify the angle or maximum aspect ratio value. ExampleCode # $mesher is a DatabaseMesher mode set filter_name [$mesher addBoundaryFilter] puts "Growth type: [$mesher getBoundaryFilterGrowthType $filter_name]" puts "\$mesher setBoundaryFilterGrowthType \$filter_name Angle" $mesher setBoundaryFilterGrowthType $filter_name Angle puts "Growth type: [$mesher getBoundaryFilterGrowthType $filter_name]"
Output Growth type: Off $mesher setBoundaryFilterGrowthType $filter_name Angle Growth type: Angle
getBoundaryFilterGrowthRate$mesher getBoundaryFilterGrowthRate filter_name |
This action gets the growth rate associated with the boundary filter. Parametersfilter_name | This parameter is the string boundary filter name. |
ReturnsThis function returns the growth rate as a float value, with a growth rate of 0.0 meaning to use the growth rate specified by the domain.
setBoundaryFilterGrowthRate$mesher setBoundaryFilterGrowthRate filter_name rate |
This action sets the growth rate associated with the boundary filter. Parametersfilter_name | This parameter is the string boundary filter name. | rate | This float parameter is the growth rate to use. A value of 0.0 allows the growth rate to be controlled by the domain. Otherwise, the value must be in the range [1.0, infinity). |
See Alsopw::DomainUnstructured.TRexGrowthProfile, pw::DomainUnstructured.TRexGrowthRate ReturnsThis action returns nothing.
getBoundaryFilterGrowthAngle$mesher getBoundaryFilterGrowthAngle filter_name |
This action gets the growth angle associated with an Angle boundary filter. Parametersfilter_name | This parameter is the string boundary filter name. |
ReturnsThis function returns the growth angle as a float value.
setBoundaryFilterGrowthAngle$mesher setBoundaryFilterGrowthAngle filter_name angle |
This action sets the growth angle associated with a boundary filter of type Angle. Parametersfilter_name | This parameter is the string boundary filter name. | angle | This parameter is the float angle to use to determine the initial layer height for a boundary of type Angle. The valid range is [0.0, 90.0], with a value of 0.0 disabling growth. |
ReturnsThis action returns nothing. InformationWhen a maximum aspect ratio limit is applied to an Angle boundary filter type, the boundary spacing may be affected.
getBoundaryFilterGrowthMaximumAspectRatio$mesher getBoundaryFilterGrowthMaximumAspectRatio filter_name |
This action gets the maximum aspect ratio associated with a boundary filter. Parametersfilter_name | This parameter is the string boundary filter name. |
ReturnsThis function returns the maximum aspect ratio as a float value. InformationMaximum aspect ratio applies to all filter types, including Angle and Wall, to limit the maximum allowable aspect ratio in the initial growth layer.
setBoundaryFilterGrowthMaximumAspectRatio$mesher setBoundaryFilterGrowthMaximumAspectRatio filter_name max_aspect_ratio |
This action sets the growth maximum aspect ratio associated with a boundary filter. Parametersfilter_name | This parameter is the string boundary filter name. | max_aspect_ratio | This parameter is the float maximum aspect ratio to allow for a boundary of type Angle, MaximumAspectRatio, or Wall. Setting this to zero for Angle or Wall filters indicates that the global maximum aspect ratio should be used. A value in the range [1.0, infinity] overrides the global value. Any other value will trigger an error. |
See Also<setMaximumAspectRatio> ReturnsThis action returns nothing.
getBoundaryFilterGrowthWallSpacing$mesher getBoundaryFilterGrowthWallSpacing filter_name |
This action gets the initial growth boundary spacing for a Wall boundary filter. Parametersfilter_name | This parameter is the string boundary filter name. |
ReturnsThis function returns the initial growth spacing as a float value. InformationWhen a maximum aspect ratio limit is applied to a Wall boundary filter type, the boundary spacing may be affected.
setBoundaryFilterGrowthWallSpacing$mesher setBoundaryFilterGrowthWallSpacing filter_name spacing |
This action sets the growth initial spacing for a Wall boundary filter. Parametersfilter_name | This parameter is the string boundary filter name. | spacing | This parameter is the float initial spacing. |
ReturnsThis action returns nothing.
getBoundaryFilterGrowthRateDelay$mesher getBoundaryFilterGrowthRateDelay filter_name |
This action gets the growth rate delay associated with the boundary filter. Parametersfilter_name | This parameter is the string boundary filter name. |
ReturnsThis function returns the growth rate delay as an integer value.
setBoundaryFilterGrowthRateDelay$mesher setBoundaryFilterGrowthRateDelay filter_name delay |
This action sets the growth rate delay associated with the boundary filter. Parametersfilter_name | This parameter is the string boundary filter name. | delay | This parameter is the number of steps of growth generated before the growth rate is applied. All steps in this range with have a same step size as the initial layer. The value should be a positive integer value in the range [0, infinity). The default is 0. |
ReturnsThis action returns nothing.
getBoundaryFilterMinimumSubdivisionLength$mesher getBoundaryFilterMinimumSubdivisionLength filter_name |
This action gets the lower limit for cell spacing along the boundaries matched by the filter. Parametersfilter_name | This parameter is the string boundary filter name. |
ReturnsThis function returns the lower limit for cell spacing as a float value. A value of 0.0 indicates that the global limit will be used.
setBoundaryFilterMinimumSubdivisionLength$mesher setBoundaryFilterMinimumSubdivisionLength filter_name spacing |
This action sets the target lower limit for cell spacing along a boundary. Parametersfilter_name | This parameter is the string boundary filter name. | spacing | This parameter is the float target lower limit for cell spacing. The default value of 0.0 disables this filter from overriding the global limit. The valid range is [0.0, infinity). |
ReturnsThis action returns nothing.
getBoundaryFilterMinimumRadiusOfCurvature$mesher getBoundaryFilterMinimumRadiusOfCurvature filter_name |
This action gets the lower limit for cell spacing along the boundaries matched by the filter. Parametersfilter_name | This parameter is the string boundary filter name. |
ReturnsThis function returns the lower limit for cell spacing as a float value. A value of 0.0 indicates that the global limit will be used. The valid range is [0.0, infinity).
setBoundaryFilterMinimumRadiusOfCurvature$mesher setBoundaryFilterMinimumRadiusOfCurvature filter_name radius |
This action sets the target lower limit for evaluating the radius of curvature along a boundary. Parametersfilter_name | This parameter is the string boundary filter name. | radius | This parameter is the float target lower limit for any radius of curvature calculations along the boundary. The default value of 0.0 disables this filter from overriding the global limit. |
ReturnsThis action returns nothing.
getBoundaryFilterSpacingFactor$mesher getBoundaryFilterSpacingFactor filter_name |
This function gets the factor used to scale the spacing of the boundaries associated with the filter. Parametersfilter_name | This parameter is the string boundary filter name. |
ReturnsThe return value is a float value with the range (0, 1], where 1 means no refinement, 0.5 means 2x refinement, etc. See AlsosetBoundaryFilterSpacingFactor, <getBoundaryCurvatureSpacingFactor>, <getBoundaryConvexSpacingFactor>, and <getBoundaryConcaveSpacingFactor>. ExampleCode # $mesher is a DatabaseMesher mode set filter_name [$mesher addBoundaryFilter] puts "Spacing value: [$mesher getBoundaryFilterSpacingFactor $filter_name]" puts "\$mesher setBoundaryFilterSpacingFactor \$filter_name 0.75" $mesher setBoundaryFilterSpacingFactor $filter_name 0.75 puts "Spacing value: [$mesher getBoundaryFilterSpacingFactor $filter_name]"
Output Spacing value: 0.5 $mesher setBoundaryFilterSpacingFactor $filter_name 0.75 Spacing value: 0.75
setBoundaryFilterSpacingFactor$mesher setBoundaryFilterSpacingFactor filter_name spacing_factor |
This function sets the factor used to scale the spacing of the boundaries associated with the filter. Parametersfilter_name | This parameter is the string boundary filter name. | spacing_factor | This parameter is the new spacing factor to be assigned to the boundary filter. It should be a float value in the range (0.0, 1.0], where 1 means no refinement, 0.5 means 2x refinement, etc. |
ReturnsThis action returns nothing. See AlsogetBoundaryFilterSpacingFactor, <setBoundaryCurvatureSpacingFactor>, <setBoundaryConvexSpacingFactor>, and <setBoundaryConcaveSpacingFactor>. ExampleCode # $mesher is a DatabaseMesher mode set filter_name [$mesher addBoundaryFilter] puts "Spacing value: [$mesher getBoundaryFilterSpacingFactor $filter_name]" puts "\$mesher setBoundaryFilterSpacingFactor \$filter_name 0.75" $mesher setBoundaryFilterSpacingFactor $filter_name 0.75 puts "Spacing value: [$mesher getBoundaryFilterSpacingFactor $filter_name]"
Output Spacing value: 0.5 $mesher setBoundaryFilterSpacingFactor $filter_name 0.75 Spacing value: 0.75
getBoundaryFilterGroups$mesher getBoundaryFilterGroups filter_name |
This action returns a list of quilt boundaries associated with a boundary filter. Parametersfilter_name | This parameter is the string boundary filter name. In addition to any boundary filters created with addBoundaryFilter, the reserved boundary filter names of Unspecified, Concave, Convex, and Curvature and be used to get the boundaries associated with those classifications. These reserved names are populated with boundary curves that were not filtered out by any of the added boundary filters. The Unspecified group will be populated with all boundary curves not filtered out and without any classification of convex, concave, or curvature. |
ReturnsThis action returns a list of quilt boundary groups, where each item of the list is a list of one or more quilt boundaries that are aliased. Each quilt boundary is specified as a two item list with the quilt as the first item and the boundary index as the second item. For example, if the third boundary of quilt A (::pw::Quilt_1) shares a boundary with the second boundary of quilt B (::pw::Quilt_2), the entry for this boundary will be {{::pw::Quilt_1 3} {::pw::Quilt_2 2}}. A lamina boundary would have just have a single boundary in the element, such as {{::pw::Quilt_1 4}}. See AlsoaddBoundaryFilter
setBoundaryFilterPriority$mesher setBoundaryFilterPriority ordered_filter_names |
This sets the priority of one or more existing boundary filters. Parametersordered_filter_names | This parameter is the ordered list of boundary filter names to make the highest priority. Any boundary filters not in ordered_filter_names will be prioritized after the specified boundary filters (preserving their same relative order). Note that only user added boundary filters can be prioritized. The default boundary filters of Curvature, Convex, and Concave remain the lowest priority boundary filters. The getBoundaryFilterNames can be used to get the current priority order. |
ReturnsThis action returns nothing. See AlsogetBoundaryFilterNames. ExampleCode # $mesher is a DatabaseMesher mode set filter(1) [$mesher addBoundaryFilter One] set filter(2) [$mesher addBoundaryFilter Two] set filter(3) [$mesher addBoundaryFilter Three] set filter(4) [$mesher addBoundaryFilter Four] puts "Filters by priority:" set n 1 foreach f [$mesher getBoundaryFilterNames] { puts " $n: $f" incr n } puts "\$mesher setBoundaryFilterPriority \[list \$filter(3) \$filter(2)\]" $mesher setBoundaryFilterPriority [list $filter(3) $filter(2)] puts "Filters by priority:" set n 1 foreach f [$mesher getBoundaryFilterNames] { puts " $n: $f" incr n }
Output Filters by priority: 1: One 2: Two 3: Three 4: Four $mesher setBoundaryFilterPriority [list $filter(3) $filter(2)] Filters by priority: 1: Three 2: Two 3: One 4: Four
|