parameters: (self,
                               element_block_ids,
                               delete_orphaned_nodes=True)
docstring: Delete one or more element blocks.
  
          This will also delete any references to elements in that block in
          side sets.
  
          By default, this will delete any nodes that become unused as a result
          of deleting the element blocks.  To prevent this, set
          'delete_orphaned_nodes=False'.
  
          Examples:
          >>> model.delete_element_block(1)
          >>> model.delete_element_block([1, 3, 4])
docstring_summary: Delete one or more element blocks.
docstring_tokens: Delete one or more element blocks .
function: def delete_element_block(self,
                               element_block_ids,
                               delete_orphaned_nodes=True):
          """
          Delete one or more element blocks.
  
          This will also delete any references to elements in that block in
          side sets.
  
          By default, this will delete any nodes that become unused as a result
          of deleting the element blocks.  To prevent this, set
          'delete_orphaned_nodes=False'.
  
          Examples:
          >>> model.delete_element_block(1)
          >>> model.delete_element_block([1, 3, 4])
  
          """
          element_block_ids = self._format_element_block_id_list(
              element_block_ids)
          # if we're not deleting anything, skip some computations.
          if not element_block_ids:
              return
          # find unreferenced nodes
          if delete_orphaned_nodes:
              unreferenced_nodes = self._get_unreferenced_nodes()
          # delete the element blocks and associated data
          for element_block_id in element_block_ids:
              # delete the element block itself
              del self.element_blocks[element_block_id]
              # delete faces of that element block from side set
              for side_set_id in self.get_side_set_ids():
                  members = self.get_side_set_members(side_set_id)
                  fields = self._get_side_set_fields(side_set_id)
                  # find indices to delete
                  deleted_indices = []
                  for index, (id_, _, _) in enumerate(members):
                      if id_ == element_block_id:
                          deleted_indices.append(index)
                  # delete them from members
                  for index in reversed(deleted_indices):
                      del members[index]
                  # delete them from the fields
                  for all_values in fields.values():
                      for values in all_values:
                          for index in reversed(deleted_indices):
                              del values[index]
          # now find the new unreferenced nodes
          if delete_orphaned_nodes:
              new_unreferenced_nodes = self._get_unreferenced_nodes()
              nodes_to_delete = sorted(set(new_unreferenced_nodes) -
                                       set(unreferenced_nodes))
              if nodes_to_delete:
                  self._delete_nodes(nodes_to_delete)
function_tokens: def delete_element_block ( self , element_block_ids , delete_orphaned_nodes = True ) : element_block_ids = self . _format_element_block_id_list ( element_block_ids ) # if we're not deleting anything, skip some computations. if not element_block_ids : return # find unreferenced nodes if delete_orphaned_nodes : unreferenced_nodes = self . _get_unreferenced_nodes ( ) # delete the element blocks and associated data for element_block_id in element_block_ids : # delete the element block itself del self . element_blocks [ element_block_id ] # delete faces of that element block from side set for side_set_id in self . get_side_set_ids ( ) : members = self . get_side_set_members ( side_set_id ) fields = self . _get_side_set_fields ( side_set_id ) # find indices to delete deleted_indices = [ ] for index , ( id_ , _ , _ ) in enumerate ( members ) : if id_ == element_block_id : deleted_indices . append ( index ) # delete them from members for index in reversed ( deleted_indices ) : del members [ index ] # delete them from the fields for all_values in fields . values ( ) : for values in all_values : for index in reversed ( deleted_indices ) : del values [ index ] # now find the new unreferenced nodes if delete_orphaned_nodes : new_unreferenced_nodes = self . _get_unreferenced_nodes ( ) nodes_to_delete = sorted ( set ( new_unreferenced_nodes ) - set ( unreferenced_nodes ) ) if nodes_to_delete : self . _delete_nodes ( nodes_to_delete )