#NEWLINE# def add_vector( self , name , vector ) : #NEWLINE# #INDENT# '\n        Add a :class:`Vector` and bind to `name`.\n        Returns the added vector.\n\n        name: string\n            Name for the added array.\n\n        vector: :class:`Vector`\n            Vector data.\n        ' #NEWLINE# if hasattr ( self , name ) : #NEWLINE# #INDENT# raise ValueError ( ( 'name %r is already bound' % name ) ) #NEWLINE# #UNINDENT# shape = self . real_shape #NEWLINE# if ( shape and ( vector . real_shape != shape ) ) : #NEWLINE# #INDENT# raise ValueError ( ( 'vector real shape %s != existing real shape %s' % ( vector . real_shape , shape ) ) ) #NEWLINE# #UNINDENT# setattr ( self , name , vector ) #NEWLINE# self . _vectors . append ( vector ) #NEWLINE# vector . ghosts = self . ghosts #NEWLINE# return vector