parameters: (self, timestep, new_timestep)
docstring: Create a copy of an existing timestep.
  
          This copies all information from the old timestep including values
          of global variables, node fields, element fields, node set fields and
          side set fields.
  
          Example:
          object.copy_timestep(0.0, 1.0)
docstring_summary: Create a copy of an existing timestep.
docstring_tokens: Create a copy of an existing timestep .
function: def copy_timestep(self, timestep, new_timestep):
          """
          Create a copy of an existing timestep.
  
          This copies all information from the old timestep including values
          of global variables, node fields, element fields, node set fields and
          side set fields.
  
          Example:
          object.copy_timestep(0.0, 1.0)
  
          """
          [timestep] = self._format_id_list(
              [timestep],
              self.get_timesteps(),
              'timestep',
              single=True)
          if self.timestep_exists(new_timestep):
              self._exists_warning(new_timestep, 'timestep')
              return
          # find the index at which to insert the new timestep
          new_index = self._find_new_timestep_index(new_timestep)
          # get the index of the existing timestep prior to adding the new
          # timestep
          old_index = self._get_internal_timestep_index(timestep)
          # insert the new timestep
          self.timesteps.insert(new_index, new_timestep)
          # adjust node_fields
          for field in self.node_fields.values():
              field.insert(new_index, list(field[old_index]))
          # adjust self.global_variables
          for values in self.global_variables.values():
              values.insert(new_index, values[old_index])
          # adjust self.element_blocks, self.node_sets, self.side_sets
          for thing in itertools.chain(self.element_blocks.values(),
                                       self.node_sets.values(),
                                       self.side_sets.values()):
              fields = thing[-1]
              for field in fields.values():
                  field.insert(new_index, list(field[old_index]))
function_tokens: def copy_timestep ( self , timestep , new_timestep ) : [ timestep ] = self . _format_id_list ( [ timestep ] , self . get_timesteps ( ) , 'timestep' , single = True ) if self . timestep_exists ( new_timestep ) : self . _exists_warning ( new_timestep , 'timestep' ) return # find the index at which to insert the new timestep new_index = self . _find_new_timestep_index ( new_timestep ) # get the index of the existing timestep prior to adding the new # timestep old_index = self . _get_internal_timestep_index ( timestep ) # insert the new timestep self . timesteps . insert ( new_index , new_timestep ) # adjust node_fields for field in self . node_fields . values ( ) : field . insert ( new_index , list ( field [ old_index ] ) ) # adjust self.global_variables for values in self . global_variables . values ( ) : values . insert ( new_index , values [ old_index ] ) # adjust self.element_blocks, self.node_sets, self.side_sets for thing in itertools . chain ( self . element_blocks . values ( ) , self . node_sets . values ( ) , self . side_sets . values ( ) ) : fields = thing [ - 1 ] for field in fields . values ( ) : field . insert ( new_index , list ( field [ old_index ] ) )