user_defined.py#
Define the LinearUserDefined class.
- class openmdao.solvers.linear.user_defined.LinearUserDefined(solve_function=None, **kwargs)[source]
Bases:
LinearSolverLinearUserDefined solver.
This is a solver that wraps a user-written linear solve function.
- Parameters:
- solve_functionfunction
Custom function containing the solve_linear function. The default is None, which means the name defaults to “solve_linear”.
- **kwargsdict
Options dictionary.
- Attributes:
- solve_functionfunction
Custom function containing the solve_linear function. The default is None, which means the name defaults to “solve_linear”.
Methods
add_recorder(recorder)Add a recorder to the solver's RecordingManager.
can_solve_cycle()Return True if this solver can solve groups with cycles.
check_config(logger)Perform optional error checks.
cleanup()Clean up resources prior to exit.
does_recursive_applies()Return False.
get_outputs_dir(*subdirs[, mkdir])Get the path under which all output files of this solver are to be placed.
get_reports_dir()Get the path to the directory where the report files should go.
preferred_sparse_format()Return the preferred sparse format for the dr/do matrix of a split jacobian.
record_iteration(**kwargs)Record an iteration of the current Solver.
report_failure(msg)Report a failure that has occurred.
solve(mode[, rel_systems])Solve the linear system for the problem in self._system().
use_relevance()Return True if relevance should be active.
- SOLVER = 'LN: USER'
- __init__(solve_function=None, **kwargs)[source]
Initialize all attributes.
- solve(mode, rel_systems=None)[source]
Solve the linear system for the problem in self._system().
The full solution vector is returned.
- Parameters:
- modestr
Derivative mode, can be ‘fwd’ or ‘rev’.
- rel_systemsset of str
Set of names of relevant systems based on the current linear solve. Deprecated.