#NEWLINE# def add_boundary_pores( self , pores , offset , apply_label = 'boundary' ) : #NEWLINE# #INDENT# "\n        This method uses ``clone_pores`` to clone the input pores, then shifts\n        them the specified amount and direction, then applies the given label.\n\n        Parameters\n        ----------\n        pores : array_like\n            List of pores to offset.  If no pores are specified, then it\n            assumes that all surface pores are to be cloned.\n\n        offset : 3 x 1 array\n            The distance in vector form which the cloned boundary pores should\n            be offset.  If no spacing is provided, then the spacing is inferred\n            from the Network.\n\n        apply_label : string\n            This label is applied to the boundary pores.  Default is\n            'boundary'.\n\n        Examples\n        --------\n        >>> import OpenPNM as op\n        >>> pn = op.Network.Cubic(shape=[5, 5, 5])\n        >>> print(pn.Np)  # Confirm initial Network size\n        125\n        >>> Ps = pn.pores('top')  # Select pores on top face\n        >>> pn.add_boundary_pores(pores=Ps, offset=[0, 0, 1])\n        >>> print(pn.Np)  # Confirm addition of 25 new pores\n        150\n        >>> 'pore.boundary' in pn.labels()  # Default label is created\n        True\n        " #NEWLINE# Ps = sp . array ( pores , ndmin = 1 ) #NEWLINE# if ( Ps . dtype is bool ) : #NEWLINE# #INDENT# Ps = self . toindices ( Ps ) #NEWLINE# #UNINDENT# if ( sp . size ( pores ) == 0 ) : #NEWLINE# #INDENT# return sp . array ( [ ] , dtype = sp . int64 ) #NEWLINE# #UNINDENT# self . clone_pores ( pores = Ps ) #NEWLINE# newPs = self . pores ( 'pore.clone' ) #NEWLINE# del Ps [ 'pore.clone' ] #NEWLINE# self [ 'pore.coords' ] [ newPs ] += offset #NEWLINE# label = apply_label . split ( '.' ) [ ( - 1 ) ] #NEWLINE# label = ( 'pore.' + label ) #NEWLINE# logger . debug ( ( ( "The label '" + label ) + "' has been applied" ) ) #NEWLINE# self [ label ] = False #NEWLINE# self [ label ] [ newPs ] = True