pw::UnstructuredSolver

The unstructured solver mode type

Derives From

pw::Object pw::Mode pw::Solver

Notes

To create a mode of this type, use the pw::Application.begin command with the mode UnstructuredSolver specified, like this:

set solver [pw::Application begin UnstructuredSolver $entities]
Summary
pw::UnstructuredSolverThe unstructured solver mode type
Instance Attributes
StopWhenFullLayersNotMetThis attribute controls whether the pw::Solver.run command will stop when the requested number of full layers is not met by the solver.
AllowIncompleteThis attribute controls whether the pw::Solver.run command will throw an error if initialization produces an incomplete grid.
OversetAdaptationThis attribute controls whether the pw::Solver.run command will perform refinement based on overset assembly length scales.
Instance Actions
runThis action runs the solver.
getCurrentStageThis action gets the current stage of the unstructured solver.
getCurrentEntityThis action gets the current entity of the unstructured solver.
getCompletedTRexLayersThis action gets the number of completed T-Rex layers of the current entity of the unstructured solver.
overrideTRexMaximumLayersThis action overrides the T-Rex maximum layers setting for a given entity while it is in the current solver.
clearOverridesThis action clears any overrides previously set for the current solver.
projectThis action projects the domains in the solver to the databases.

Instance Attributes

StopWhenFullLayersNotMet

$solver get/setStopWhenFullLayersNotMet value

This attribute controls whether the pw::Solver.run command will stop when the requested number of full layers is not met by the solver.

Type

This attribute is a boolean value.

Default

The default for this attribute is False, which means the run command will not stop if the requested number of full alyers is not met.

AllowIncomplete

$solver get/setAllowIncomplete value

This attribute controls whether the pw::Solver.run command will throw an error if initialization produces an incomplete grid.  This can occur during T-Rex initialization when the isotropic tet generation failed, but the T-Rex cells were retained.

Type

This attribute is a boolean value.

Default

The default for this attribute is False, which means the pw::Solver.run command will throw an error if an incomplete block is created.

OversetAdaptation

$solver get/setOversetAdaptation value

This attribute controls whether the pw::Solver.run command will perform refinement based on overset assembly length scales.

Type

This attribute is a boolean value.

Default

The default for this attribute is False, which means the pw::Solver.run command will perform standard refinement (no overset assembly contribution).

Instance Actions

run

$solver run ?-entities ents? ?steps | method ?method_args??

This action runs the solver.

Parameters

-entities entsThis optional parameter is a subset of the entities in the solver mode to run the solver on.  If this parameter is not given the solver will be run on all the entities of the solver mode.
methodThis optional parameter is the method to run: Initialize | Refine | Decimate | Release | Smooth | Restart | PushAttributes | BoundaryAdaptation.  Not all methods may be valid for the current mode.
stepsThe optional integer number of solver steps to run; The default is 1.  The solver will run until steps is reached, a stop is requested by the user, or some other stop condition is encountered.
method_argsThe optional integer number of steps to run; The default is 1.  The solver will run until steps is reached, a stop is requested by the user, or some other stop condition is encountered.  This parameter is only valid for the pw.ExtrusionSolver, the pw.HighOrderSolver, and for the Smooth method of the pw.UnstructuredSolver for blocks.

Returns

This action returns nothing.

Information

This command supports progress updates.  Unlike most commands that support progress updates, if the user aborts this command, instead of reverting to the previous state the entities being solved will be left as is.

MethodArgs

InitializeNo additional arguments needed.
RefineNo additional arguments needed.
DecimateNo additional arguments needed.
ReleaseNo additional arguments needed.
Smooth ?steps?Optional number of WCN smoothing steps integer.  Default to 1.
RestartNo additional arguments needed.
PushAttributesNo additional arguments needed.
BoundaryAdaptationNo additional arguments needed.

Example

Code

proc putsBlkStats { solverBlks } {
    foreach blk $solverBlks {
        puts "  [$blk getName]:"
        set max [getExamineMetricMax $blk BlockMaximumAngle]
        puts "    Max included angle: $max"
        set max [getExamineMetricMax $blk BlockVolumeRatio]
        puts "    Max volume ratio  : $max"
    }
}

# Given: $solver is an UnstructuredSolver mode

set steps 50
set solverBlks [$solver getEntities]

puts "Original block stats:"
putsBlkStats $solverBlks

puts ""
puts "Setting solver attributes:"
set colxn [pw::Collection create]
$colxn set $solverBlks
foreach {attr val} {WCNSmoothConvergenceCostThreshold 0.8
                    WCNSmoothCostAngleThreshold 170
                    WCNSmoothRelaxationFactor 0.1} {
    puts "  $attr = $val"
    $colxn do setUnstructuredSolverAttribute $attr $val
}
$colxn delete
unset colxn

puts ""
puts "run all for ${steps}..."
$solver run Smooth $steps
putsBlkStats $solverBlks

set blk0 [lindex $solverBlks 0]
$blk0 setUnstructuredSolverAttribute WCNSmoothCostAngleThreshold 130
puts ""
puts "Setting WCNSmoothCostAngleThreshold 130 for [$blk0 getName]"

puts ""
puts "run [$blk0 getName] for ${steps}..."
$solver run -entities $blk0 Smooth $steps
putsBlkStats $solverBlks

Output

Original block stats:
  UnsIsoBlk-1:
    Max included angle: 164.0576313943714
    Max volume ratio  : 3.8617996452146452
  UnsTRexBlk-1:
    Max included angle: 177.40447357096951
    Max volume ratio  : 14.042823061362142

Setting solver attributes:
  WCNSmoothConvergenceCostThreshold = 0.8
  WCNSmoothCostAngleThreshold = 170
  WCNSmoothRelaxationFactor = 0.1

run all for 50...
  UnsIsoBlk-1:
    Max included angle: 164.0576313943714
    Max volume ratio  : 3.8617996452146452
  UnsTRexBlk-1:
    Max included angle: 172.90386524033556
    Max volume ratio  : 14.042823061362142

Setting WCNSmoothCostAngleThreshold 130 for UnsIsoBlk-1

run UnsIsoBlk-1 for 50...
  UnsIsoBlk-1:
    Max included angle: 147.95440366197928
    Max volume ratio  : 5.084085202065618
  UnsTRexBlk-1:
    Max included angle: 172.90386524033556
    Max volume ratio  : 14.042823061362142

getCurrentStage

$solver getCurrentStage

This action gets the current stage of the unstructured solver.

Parameters

This action has no parameters.

Returns

This action returns the current stage; None | PushAttributes | TRex | Isotropic

getCurrentEntity

$solver getCurrentEntity

This action gets the current entity of the unstructured solver.

Parameters

This action has no parameters.

Returns

This action returns a pw::Entity object that is currently being solved on.  It is only valid if the current stage is TRex or Isotropic.

getCompletedTRexLayers

$solver getCompletedTRexLayers

This action gets the number of completed T-Rex layers of the current entity of the unstructured solver.

Parameters

This action has no parameters.

Returns

This action returns the integer number of completed T-Rex layers of the current entity.  It is only valid if the current stage is TRex or Isotropic.

overrideTRexMaximumLayers

$solver overrideTRexMaximumLayers entity layers

This action overrides the T-Rex maximum layers setting for a given entity while it is in the current solver.

Parameters

entityThis parameter is a pw::Entity object that should have it’s <TRexMaximumLayers> attribute overridden with the given number of T-Rex layers.
layersThis parameter is an integer with the range [0, infinity), where 0 means that there should be no T-Rex layers.

Returns

This action returns nothing.

clearOverrides

$solver clearOverrides

This action clears any overrides previously set for the current solver.

Parameters

This action has no parameters.

Returns

This action returns nothing.

project

$solver project

This action projects the domains in the solver to the databases.

Parameters

This action has no parameters.

Returns

This action returns nothing.

$solver get/setStopWhenFullLayersNotMet value
This attribute controls whether the pw::Solver.run command will stop when the requested number of full layers is not met by the solver.
$solver run ?-entities ents? ?steps | method ?method_args??
This action runs the solver.
$solver get/setAllowIncomplete value
This attribute controls whether the pw::Solver.run command will throw an error if initialization produces an incomplete grid.
$solver get/setOversetAdaptation value
This attribute controls whether the pw::Solver.run command will perform refinement based on overset assembly length scales.
$solver run ?-entities ents? ?steps | method ?method_args??
This action runs the solver.
$solver getCurrentStage
This action gets the current stage of the unstructured solver.
$solver getCurrentEntity
This action gets the current entity of the unstructured solver.
$solver getCompletedTRexLayers
This action gets the number of completed T-Rex layers of the current entity of the unstructured solver.
$solver overrideTRexMaximumLayers entity layers
This action overrides the T-Rex maximum layers setting for a given entity while it is in the current solver.
$solver clearOverrides
This action clears any overrides previously set for the current solver.
$solver project
This action projects the domains in the solver to the databases.
Base type for all glyph types
The mode base type
The solver mode type
pw::Application begin ?-mode_specific_flags? mode ?entities?
This action begins a mode in the application.
A boolean is represented as a 0 or 1, with 0 being false and 1 being true.
An integer is a whole number.
The extrusion solver mode type
The high order solver mode type
The unstructured solver mode type
Entity type
Close