finesse.analysis.actions.relaxation module

class finesse.analysis.actions.relaxation.Relaxation(lock_action: Action = None, other_analysis: Action = None, *, max_iterations: int = 300, output_all_steps: bool = False, show_progress: bool = True, name='relaxation')[source]

Bases: Action

Performs an iterative method to relax the model into a converged state. This relaxation method wraps solving carrier simulations and iteratively updating elements that implement the RelaxingElement interface. Each of these elements compute if the model has converged to a particular state and if not performs some update. An example of this is finding a converged steady state for thermal defects in a model. This process is not dissimilar to a process known as a lock-drag, where deformations are gradually increased until a desired state is reached. The relaxation method is more general put relies on performing some lock action at each step of the process. A additional “other” action can also be performed at each step to monitor or calculate additional information.

This action returns a RelaxationSolution object that contains the outputs of all detectors in the mode. These detector outputs can be calculated at each step or just the final step of the relaxation process. Outputing at each step allows the user to monitor the convergence and potential issues that may arise.

Parameters

lock_actionAction

The action to lock the system during each step of the relaxation

other_analysisAction, optional

An additional analysis action to be performed during relaxation.

max_iterationsint, optional

The maximum number of iterations for the relaxation process (default is 300).

namestr, optional

The name of the relaxation action (default is “thermal_relaxation”).

output_all_stepsbool, optional

If True, the outputs of all detectors are calculated at each step of the relaxation process. If False, the outputs are only calculated at the final step (default is False)

show_progressbool, optional

If True, the progress of the relaxation process is printed to the console (default is True).

Raises

TypeError

If lock_action is not an instance of Action. If other_analysis is provided and is not an instance of Action.

Methods

_do(state)

Perform the relaxation process on the given state.

_requests(model, memo, first=True)

Generate requests for the model elements that are involved in the relaxation process.

class finesse.analysis.actions.relaxation.RelaxationSolution[source]

Bases: BaseSolution

Represents a solution for thermal relaxation analysis, RelaxationSolution.

Attributes

outputsArraySolution

The outputs from all detectors that are in the model at each iteration of the relaxation process to monitor the convergence.

lock_lossbool

Indicates whether there is a lock loss in the thermal relaxation process.

iterationsint

Number of iterations performed in this relaxation process

failed_stepsint

Number of failed steps in the relaxation process, i.e. lost lock

iterations: int = None
lock_loss: bool = None
outputs: ArraySolution = None