

from openmdao.solvers.solver import LinearSolver


class {class_name}(LinearSolver):
    """
    {class_name} solver.

    Describe the solver here...
    """

    SOLVER = 'LN: ????'  # replace ???? with an abbreviated solver name

    def __init__(self, **kwargs):
        """
        Initialize all attributes.

        Parameters
        ----------
        **kwargs : dict
            Options dictionary.
        """
        super().__init__(**kwargs)

        # initialize needed atributes here...

    def _setup_solvers(self, system, depth):
        """
        Assign system instance, set depth, and optionally perform setup.

        Parameters
        ----------
        system : <System>
            pointer to the owning system.
        depth : int
            depth of the current system (already incremented).
        """
        super()._setup_solvers(system, depth)

        # perform any necessary setup here...

    def _declare_options(self):
        """
        Declare options before kwargs are processed in the init method.
        """
        super()._declare_options()

        # for example...
        # self.options.declare('cs_reconverge', types=bool, default=True,
        #                      desc='When True, when this driver solves under a complex step, nudge '
        #                      'the Solution vector by a small amount so that it reconverges.')

    def solve(self, vec_names, mode, rel_systems=None):
        """
        Solve the linear system for the problem in self._system().

        The full solution vector is returned.

        Parameters
        ----------
        vec_names : list
            list of vector names.
        mode : string
            Derivative mode, can be 'fwd' or 'rev'.
        rel_systems : set of str
            Set of names of relevant systems based on the current linear solve.
        """
        # solver the linear system here...
        pass