finesse.element_workspace module

class finesse.element_workspace.BaseCValues[source]

Bases: object

Base class that elements should use for storing their parameter values. This contains a generic method for storing a pointers to the double parameter values, which is intialised using setup().

Each Parameter of an element should result in a double. This won’t handle any other types of data.

class finesse.element_workspace.ElementValues[source]

Bases: object

Standard Python object which is used to store an Elements Parameter values. This is used in the default case where no optimised C class is provided.

class finesse.element_workspace.ElementWorkspace(sim, owner, values=None)[source]

Bases: object

This is the most basic workspace for a model element. It keeps track of the owner element and its parameter values in the self.values object.

compile_cy_exprs(self) int
owner
owner_id

owner_id: ‘int’

sim
update_parameter_values(self)[source]

Updates the self.values container which holds the latest values of this elements parameters.

values
class finesse.element_workspace.RelaxingWorkspace[source]

Bases: ElementWorkspace

RelaxingWorkspace is an abstract base class that represents a workspace for relaxation processes.

This class inherits from ElementWorkspace and ABC (Abstract Base Class) and defines the following abstract methods:

  • status: Get the status of the relaxation process for the user

  • converged: Check if the relaxation process has converged.

  • update_step: Update the state of the model before the next solution is found

  • end_step: Finalizes the update of the relaxation process, to process at the end of a step

Methods

status() -> str

Abstract method to get the status of the relaxation process to show to the user regarding how close the convergence is.

converged() -> bool

Abstract method to check if the relaxation process has converged.

update_step(stepint)

Abstract method to update the state of the relaxation process.

on_failed_step(stepint)

Abstract method to handle a failed step of the relaxation process, this will be called if a LockLoss happens. Should revert states back to last known working point, ie the previous values.

end_step(stepint)

Abstract method to finalize the this step of the relaxation process.

converged(self) bool
end_step(self, int step)[source]
on_failed_step(self, int step)[source]
status(self) str
update_step(self, int step)[source]
class finesse.element_workspace.TemporalQuasiStaticWorkspace[source]

Bases: ElementWorkspace

A class representing a temporal quasi-static workspace for elements. This should be used in conjunction with the analyses in finesse.analysis.actions.time.

Methods

status() -> str

Returns the status of the workspace.

time() -> float

Returns the current time of the workspace.

set_time_step(dt: float) -> float

Sets the time step for the workspace.

initialise()

Initialises the workspace.

update_before_step()

Updates the workspace before stepping forward.

step_forward()

Advances the workspace by one time step.

get_state()

Return the current time state of the element

get_state(self)[source]
initialise(self)[source]
set_time_step(self, float dt) float
status(self) str
step_forward(self)[source]
time(self) float
update_before_step(self)[source]