parameters: (self,
                          element_block_id='auto',
                          extents=1.0,
                          divisions=3)
docstring: Create an element block in the shape of a cuboid.
  
          Extent defines the extent of the block in the form
          '[[minx, maxx], [miny, maxy], [minz, maxz]]'.  If only one value per
          dimension is given, the minimum is assumed to be zero.  If a single
          value is given, it is assumed a cube with that edge length, with min=0
          for all dimensions.
  
          Divisions is the number of divisions per dimension.  This can be
          defined as a single number for all dimensions or as a list of
          3 numbers.
docstring_summary: Create an element block in the shape of a cuboid.
docstring_tokens: Create an element block in the shape of a cuboid .
function: def build_hex8_cube(self,
                          element_block_id='auto',
                          extents=1.0,
                          divisions=3):
          """
          Create an element block in the shape of a cuboid.
  
          Extent defines the extent of the block in the form
          '[[minx, maxx], [miny, maxy], [minz, maxz]]'.  If only one value per
          dimension is given, the minimum is assumed to be zero.  If a single
          value is given, it is assumed a cube with that edge length, with min=0
          for all dimensions.
  
          Divisions is the number of divisions per dimension.  This can be
          defined as a single number for all dimensions or as a list of
          3 numbers.
  
          """
          # process shortcuts on arguments
          if element_block_id == 'auto':
              element_block_id = self._new_element_block_id()
          if not isinstance(extents, list):
              self._input_check(extents, [float])
              extents = [[0.0, float(extents)]] * 3
          else:
              for i, x in enumerate(extents):
                  if not isinstance(x, list):
                      self._input_check(x, [float])
                      extents[i] = [0.0, float(x)]
          if isinstance(divisions, int):
              divisions = [divisions] * 3
          # verify the input
          self._input_check(extents, [list, 3, list, 2, float])
          self._input_check(divisions, [list, 3, int])
          dimx, dimy, dimz = divisions
          [[minx, maxx], [miny, maxy], [minz, maxz]] = extents
          # create the nodes
          new_nodes = []
          node_offset = len(self.nodes)
          for k in range(dimz + 1):
              z = minz + (maxz - minz) * float(k) / dimz
              for j in range(dimy + 1):
                  y = miny + (maxy - miny) * float(j) / dimy
                  for i in range(dimx + 1):
                      x = minx + (maxx - minx) * float(i) / dimx
                      new_nodes.append([x, y, z])
          del i, j, k
          del x, y, z
          # create the connectivity matrix
          connectivity = []
          formula = [0, 1, 1 + (dimx + 1), (dimx + 1)]
          formula.extend([x + (dimx + 1) * (dimy + 1) for x in formula])
          formula = [x + node_offset for x in formula]
          for i in range(dimx):
              for j in range(dimy):
                  for k in range(dimz):
                      first = (k * (dimy + 1) + j) * (dimx + 1) + i
                      connectivity.extend(first + x for x in formula)
          del i, j, k
          # now create the actual nodes
          self.create_nodes(new_nodes)
          # now create the actual block
          self.create_element_block(element_block_id,
                                    ['hex8', dimx * dimy * dimz, 8, 0],
                                    connectivity=connectivity)
function_tokens: def build_hex8_cube ( self , element_block_id = 'auto' , extents = 1.0 , divisions = 3 ) : # process shortcuts on arguments if element_block_id == 'auto' : element_block_id = self . _new_element_block_id ( ) if not isinstance ( extents , list ) : self . _input_check ( extents , [ float ] ) extents = [ [ 0.0 , float ( extents ) ] ] * 3 else : for i , x in enumerate ( extents ) : if not isinstance ( x , list ) : self . _input_check ( x , [ float ] ) extents [ i ] = [ 0.0 , float ( x ) ] if isinstance ( divisions , int ) : divisions = [ divisions ] * 3 # verify the input self . _input_check ( extents , [ list , 3 , list , 2 , float ] ) self . _input_check ( divisions , [ list , 3 , int ] ) dimx , dimy , dimz = divisions [ [ minx , maxx ] , [ miny , maxy ] , [ minz , maxz ] ] = extents # create the nodes new_nodes = [ ] node_offset = len ( self . nodes ) for k in range ( dimz + 1 ) : z = minz + ( maxz - minz ) * float ( k ) / dimz for j in range ( dimy + 1 ) : y = miny + ( maxy - miny ) * float ( j ) / dimy for i in range ( dimx + 1 ) : x = minx + ( maxx - minx ) * float ( i ) / dimx new_nodes . append ( [ x , y , z ] ) del i , j , k del x , y , z # create the connectivity matrix connectivity = [ ] formula = [ 0 , 1 , 1 + ( dimx + 1 ) , ( dimx + 1 ) ] formula . extend ( [ x + ( dimx + 1 ) * ( dimy + 1 ) for x in formula ] ) formula = [ x + node_offset for x in formula ] for i in range ( dimx ) : for j in range ( dimy ) : for k in range ( dimz ) : first = ( k * ( dimy + 1 ) + j ) * ( dimx + 1 ) + i connectivity . extend ( first + x for x in formula ) del i , j , k # now create the actual nodes self . create_nodes ( new_nodes ) # now create the actual block self . create_element_block ( element_block_id , [ 'hex8' , dimx * dimy * dimz , 8 , 0 ] , connectivity = connectivity )