Model.set_in_use#

Model.set_in_use()[source]#

Set the in_use attribute. Called at the end of System.collect_ref.

This function is overloaded by models with BackRef to disable calls when no model is referencing. Models with no back references will have internal variable addresses assigned but external addresses being empty.

For internal equations that have external variables, the row indices will be non-zeros, while the col indices will be empty, which causes an error when updating Jacobians.

Setting self.in_use to False when len(back_ref_instance.v) == 0 avoids this error. See COI.