#NEWLINE# def extend( self , axis , delta , npoints ) : #NEWLINE# #INDENT# "\n        Construct a new :class:`FlowSolution` by replication.\n        The existing ghosts/rind planes specification is retained.\n\n        axis: 'i', 'j', or 'k'\n            Index axis to extend.\n\n        delta: float.\n            Direction. A negative value adds points before the current\n            zero-index of `axis`. \n\n        npoints: int > 0\n            Number of points to add in `axis` dimension.\n        " #NEWLINE# if ( not delta ) : #NEWLINE# #INDENT# raise ValueError ( 'delta must be non-zero' ) #NEWLINE# #UNINDENT# if ( axis < 1 ) : #NEWLINE# #INDENT# raise ValueError ( 'npoints must be >= 1' ) #NEWLINE# #UNINDENT# i = len ( self . shape ) #NEWLINE# if ( i == 3 ) : #NEWLINE# #INDENT# if ( axis not in ( 'i' , 'j' , 'k' ) ) : #NEWLINE# #INDENT# raise ValueError ( 'axis must be i, j, or k' ) #NEWLINE# #UNINDENT# return self . _extend_3d ( axis , delta , npoints ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( i == 2 ) : #NEWLINE# #INDENT# if ( axis not in ( 'i' , 'j' ) ) : #NEWLINE# #INDENT# raise ValueError ( 'axis must be i or j' ) #NEWLINE# #UNINDENT# return self . _extend_2d ( axis , delta , npoints ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( i == 1 ) : #NEWLINE# #INDENT# if ( axis != 'i' ) : #NEWLINE# #INDENT# raise ValueError ( 'axis must be i' ) #NEWLINE# #UNINDENT# return self . _extend_1d ( delta , npoints ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise RuntimeError ( 'FlowSolution is empty!' )