gemseo.problems.mdo.scalable.linear.linear_discipline module#
Dummy linear discipline.
- class LinearDiscipline(name, input_names, output_names, inputs_size=1, outputs_size=1, matrix_format=MatrixFormat.DENSE, matrix_density=0.1, matrix_free_jacobian=False, compute_jac_at_run=False)[source]#
Bases:
DisciplineA discipline that computes random outputs from inputs.
The output are computed by a product with a random matrix and the inputs. The inputs and outputs names are specified by the user. The size of inputs and outputs can be specified.
Initialize self. See help(type(self)) for accurate signature.
- Parameters:
name (str) -- The discipline name.
input_names (Sequence[str]) -- The input data names.
output_names (Sequence[str]) -- The output data names.
inputs_size (int) --
The size of input data vectors, each input data is of shape (inputs_size,).
By default it is set to 1.
outputs_size (int) --
The size of output data vectors, each output data is of shape (outputs_size,).
By default it is set to 1.
matrix_format (MatrixFormat) --
The format of the Jacobian matrix.
By default it is set to "dense".
matrix_density (float) --
The percentage of non-zero elements when the matrix is sparse.
By default it is set to 0.1.
matrix_free_jacobian (bool) --
Whether the Jacobians are casted as linear operators.
By default it is set to False.
compute_jac_at_run (bool) --
Whether to compute the Jacobian in the
_run()method.By default it is set to False.
- Raises:
ValueError -- if
input_namesoroutput_namesare empty.