The unstructured solver mode type
pw::Object pw::Mode pw::Solver
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]
pw:: | The unstructured solver mode type |
Instance Attributes | |
StopWhenFullLayersNotMet | This attribute controls whether the pw::Solver.run command will stop when the requested number of full layers is not met by the solver. |
AllowIncomplete | This attribute controls whether the pw::Solver.run command will throw an error if initialization produces an incomplete grid. |
OversetAdaptation | This attribute controls whether the pw::Solver.run command will perform refinement based on overset assembly length scales. |
Instance Actions | |
run | This action runs the solver. |
getCurrentStage | This action gets the current stage of the unstructured solver. |
getCurrentEntity | This action gets the current entity of the unstructured solver. |
getCompletedTRexLayers | This action gets the number of completed T-Rex layers of the current entity of the unstructured solver. |
overrideTRexMaximumLayers | This action overrides the T-Rex maximum layers setting for a given entity while it is in the current solver. |
clearOverrides | This action clears any overrides previously set for the current solver. |
project | This action projects the domains in the solver to the databases. |
$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.
This attribute is a boolean value.
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.
$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.
This attribute is a boolean value.
The default for this attribute is False, which means the pw::Solver.run command will throw an error if an incomplete block is created.
$solver get/setOversetAdaptation value
This attribute controls whether the pw::Solver.run command will perform refinement based on overset assembly length scales.
This attribute is a boolean value.
The default for this attribute is False, which means the pw::Solver.run command will perform standard refinement (no overset assembly contribution).
$solver run ?-entities ents? ?steps | method ?method_args??
This action runs the solver.
-entities ents | This 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. |
method | This 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. |
steps | The 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_args | The 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. |
This action returns nothing.
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.
Initialize | No additional arguments needed. |
Refine | No additional arguments needed. |
Decimate | No additional arguments needed. |
Release | No additional arguments needed. |
Smooth ?steps? | Optional number of WCN smoothing steps integer. Default to 1. |
Restart | No additional arguments needed. |
PushAttributes | No additional arguments needed. |
BoundaryAdaptation | No additional arguments needed. |
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
$solver getCurrentEntity
This action gets the current entity of the unstructured solver.
This action has no parameters.
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.
$solver getCompletedTRexLayers
This action gets the number of completed T-Rex layers of the current entity of the unstructured solver.
This action has no parameters.
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.
$solver overrideTRexMaximumLayers entity layers
This action overrides the T-Rex maximum layers setting for a given entity while it is in the current solver.
entity | This parameter is a pw::Entity object that should have it’s <TRexMaximumLayers> attribute overridden with the given number of T-Rex layers. |
layers | This parameter is an integer with the range [0, infinity), where 0 means that there should be no T-Rex layers. |
This action returns nothing.
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 get/setStopWhenFullLayersNotMet value
This action runs the solver.
$solver run ?-entities ents? ?steps | method ?method_args??
This attribute controls whether the pw::Solver.run command will throw an error if initialization produces an incomplete grid.
$solver get/setAllowIncomplete value
This attribute controls whether the pw::Solver.run command will perform refinement based on overset assembly length scales.
$solver get/setOversetAdaptation value
This action runs the solver.
$solver run ?-entities ents? ?steps | method ?method_args??
This action gets the current stage of the unstructured solver.
$solver getCurrentStage
This action gets the current entity of the unstructured solver.
$solver getCurrentEntity
This action gets the number of completed T-Rex layers of the current entity of the unstructured solver.
$solver getCompletedTRexLayers
This action overrides the T-Rex maximum layers setting for a given entity while it is in the current solver.
$solver overrideTRexMaximumLayers entity layers
This action clears any overrides previously set for the current solver.
$solver clearOverrides
This action projects the domains in the solver to the databases.
$solver project
This action begins a mode in the application.
pw::Application begin ?-mode_specific_flags? mode ?entities?