def boundary_value_or_flux(self, symbol, discretised_child):
    '\n        Returns the boundary value or flux using the approriate expression for the\n        spatial method. To do this, we create a sparse vector \'bv_vector\' that extracts\n        either the first (for side="left") or last (for side="right") point from\n        \'discretised_child\'.\n\n        Parameters\n        -----------\n        symbol: :class:`pybamm.Symbol`\n            The boundary value or flux symbol\n        discretised_child : :class:`pybamm.StateVector`\n            The discretised variable from which to calculate the boundary value\n\n        Returns\n        -------\n        :class:`pybamm.MatrixMultiplication`\n            The variable representing the surface value.\n        '
    if any(((len(self.mesh[dom]) > 1) for dom in discretised_child.domain)):
        raise NotImplementedError('Cannot process 2D symbol in base spatial method')
    if isinstance(symbol, pybamm.BoundaryGradient):
        raise TypeError('Cannot process BoundaryGradient in base spatial method')
    n = sum((self.mesh[dom][0].npts for dom in discretised_child.domain))
    if (symbol.side == 'left'):
        left_vector = csr_matrix(coo_matrix(([1], ([0], [0])), shape=(1, n)))
        bv_vector = pybamm.Matrix(left_vector)
    elif (symbol.side == 'right'):
        right_vector = csr_matrix(coo_matrix(([1], ([0], [(n - 1)])), shape=(1, n)))
        bv_vector = pybamm.Matrix(right_vector)
    out = (bv_vector @ discretised_child)
    out.domain = []
    return out
Returns the boundary value or flux using the approriate expression for the
spatial method. To do this, we create a sparse vector 'bv_vector' that extracts
either the first (for side="left") or last (for side="right") point from
'discretised_child'.

Parameters
-----------
symbol: :class:`pybamm.Symbol`
    The boundary value or flux symbol
discretised_child : :class:`pybamm.StateVector`
    The discretised variable from which to calculate the boundary value

Returns
-------
:class:`pybamm.MatrixMultiplication`
    The variable representing the surface value.
def boundary_value_or_flux(self, symbol, discretised_child):
    '\n        Returns the boundary value or flux using the approriate expression for the\n        spatial method. To do this, we create a sparse vector \'bv_vector\' that extracts\n        either the first (for side="left") or last (for side="right") point from\n        \'discretised_child\'.\n\n        Parameters\n        -----------\n        symbol: :class:`pybamm.Symbol`\n            The boundary value or flux symbol\n        discretised_child : :class:`pybamm.StateVector`\n            The discretised variable from which to calculate the boundary value\n\n        Returns\n        -------\n        :class:`pybamm.MatrixMultiplication`\n            The variable representing the surface value.\n        '
    if any(((len(self.mesh[dom]) > 1) for dom in discretised_child.domain)):
        raise NotImplementedError('Cannot process 2D symbol in base spatial method')
    if isinstance(symbol, pybamm.BoundaryGradient):
        raise TypeError('Cannot process BoundaryGradient in base spatial method')
    n = sum((self.mesh[dom][0].npts for dom in discretised_child.domain))
    if (symbol.side == 'left'):
        left_vector = csr_matrix(coo_matrix(([1], ([0], [0])), shape=(1, n)))
        bv_vector = pybamm.Matrix(left_vector)
    elif (symbol.side == 'right'):
        right_vector = csr_matrix(coo_matrix(([1], ([0], [(n - 1)])), shape=(1, n)))
        bv_vector = pybamm.Matrix(right_vector)
    out = (bv_vector @ discretised_child)
    out.domain = []
    return out