Smooth Transition Controller¶
- class pyrefine.controller.smooth_transition.ControllerSmoothTransition(project_name, pbs=None)¶
Bases:
ControllerBase
A controller to smoothly transition between complexity levels instead of increasing the complexity by complexity_multiplier over a single adaptation cycle. This smoother transition can help maintain solver robustness on cases where flow features like shocks may move as the mesh refines.
An example of the complexity schedule with the default parameters of
steps_per_complexity=5
,complexity_multiplier=2
, andsteps_per_transition = 4
: the first 5 steps will have the initial complexity. Over the next 4 steps, the complexity will gradually increase. For step 10, the complexity will be double the initial complexity. This pattern of 5 fixed complexity steps and doubling over 4 transition steps will continue until the adaptation is stopped.- Parameters
project_name (
str
) – The root name of the project (without any mesh numbers)pbs (
PBS
) – PBS queue helper
- steps_per_complexity¶
The number of meshes at constant complexity.
- Type
int
- complexity_multiplier¶
The multiplicative factor to mutiple the complexity by
- Type
float
- steps_per_transition¶
The number of meshes used to transition to the next complexity
- Type
int
- compute_complexity(istep, current_complexity)¶
- Parameters
istep (
int
) – Adaptation step numbercurrent_complexity (
float
) – The current complexity in the driver. If doing a restart, the current complexity will be None
- Return type
complexity