argiope/mesh.py
def set_elements(self, elabels = None, 
                         types = None, 
                         stypes = "", 
                         conn = None, 
                         esets = {}, 
                         surfaces = {}, 
                         materials = "",
                         **kwargs):
    """
    Sets the element data.
    
    :arg elabels: element labels. Items be strictly positive and int typed 
                  in 1D array-like with shape :math:`(N_e)`.
    :type elabels: 1D uint typed array-like
    :arg types: element types chosen among argiope specific element types. 
    :type types: str typed array-like 
    :arg stypes: element types chosen in solver (depends on the chosen solver) specific element types. 
    :type stypes: str typed array-like 
    :arg conn: connectivity table. In order to deal with non rectangular tables, :math:`0` can be used to fill missing data. 
    :type conn: uint typed array-like
    :arg esets: element sets. Contains boolean array-like of shape :math:`(N_e)`.
    :type esets: dict  
    :arg surfaces: surfaces. Contains boolean array-like of shape :math:`(N_e, N_s )` with :math:`N_s` being the maximum number of faces on a single element. 
    :type surfaces: dict   
    :arg materials: material keys. Any number a of materials can be used.
    :type materials: str typed array-like 
     
      
      
           
    """
    # COLUMNS BUILDING
    if elabels is None:
       warnings.warn(
       "Since no element labels where provided, no elements where created", 
       Warning)
       self.elements = None
    else:   
      columns = pd.MultiIndex.from_tuples([("type", "argiope", "")])
      self.elements = pd.DataFrame(data = types,
                                   columns = columns,
                                   index = elabels)
      self.elements.index.name = "element"
      self.elements.loc[:, ("type", "solver", "")] = stypes
      # Connectivity 
      c = pd.DataFrame(conn, index = elabels)
      c.fillna(0, inplace = True)
      c[:] = c.values.astype(np.int32)
      c.columns = pd.MultiIndex.from_product([["conn"], 
                                              ["n{0}".format(n) for 
                                               n in np.arange(c.shape[1])], 
                                              [""]])
      self.elements = self.elements.join(c)
      # Sets
      for k, v in esets.items(): self.elements[("sets", k, "")] = v
      self.elements["sets", "all", ""] = True  
      # Surfaces
      for k, v in surfaces.items():
        for fk, vv in v.items():
          self.elements[("surfaces", k, "s{0}".format(fk))] = vv
      # Materials
      self.elements[("materials", "", "") ] = materials
      self.elements.sort_index(axis = 1, inplace = True)
def set_elements(self, elabels = None, 
                         types = None, 
                         stypes = "", 
                         conn = None, 
                         esets = {}, 
                         surfaces = {}, 
                         materials = "",
                         **kwargs):
    """
    Sets the element data.
    
    :arg elabels: element labels. Items be strictly positive and int typed 
                  in 1D array-like with shape :math:`(N_e)`.
    :type elabels: 1D uint typed array-like
    :arg types: element types chosen among argiope specific element types. 
    :type types: str typed array-like 
    :arg stypes: element types chosen in solver (depends on the chosen solver) specific element types. 
    :type stypes: str typed array-like 
    :arg conn: connectivity table. In order to deal with non rectangular tables, :math:`0` can be used to fill missing data. 
    :type conn: uint typed array-like
    :arg esets: element sets. Contains boolean array-like of shape :math:`(N_e)`.
    :type esets: dict  
    :arg surfaces: surfaces. Contains boolean array-like of shape :math:`(N_e, N_s )` with :math:`N_s` being the maximum number of faces on a single element. 
    :type surfaces: dict   
    :arg materials: material keys. Any number a of materials can be used.
    :type materials: str typed array-like 
     
      
      
           
    """
    # COLUMNS BUILDING
    if elabels is None:
       warnings.warn(
       "Since no element labels where provided, no elements where created", 
       Warning)
       self.elements = None
    else:   
      columns = pd.MultiIndex.from_tuples([("type", "argiope", "")])
      self.elements = pd.DataFrame(data = types,
                                   columns = columns,
                                   index = elabels)
      self.elements.index.name = "element"
      self.elements.loc[:, ("type", "solver", "")] = stypes
      # Connectivity 
      c = pd.DataFrame(conn, index = elabels)
      c.fillna(0, inplace = True)
      c[:] = c.values.astype(np.int32)
      c.columns = pd.MultiIndex.from_product([["conn"], 
                                              ["n{0}".format(n) for 
                                               n in np.arange(c.shape[1])], 
                                              [""]])
      self.elements = self.elements.join(c)
      # Sets
      for k, v in esets.items(): self.elements[("sets", k, "")] = v
      self.elements["sets", "all", ""] = True  
      # Surfaces
      for k, v in surfaces.items():
        for fk, vv in v.items():
          self.elements[("surfaces", k, "s{0}".format(fk))] = vv
      # Materials
      self.elements[("materials", "", "") ] = materials
      self.elements.sort_index(axis = 1, inplace = True)
def set_elements ( self , elabels = None , types = None , stypes = "" , conn = None , esets = { } , surfaces = { } , materials = "" , * * kwargs ) : # COLUMNS BUILDING if elabels is None : warnings . warn ( "Since no element labels where provided, no elements where created" , Warning ) self . elements = None else : columns = pd . MultiIndex . from_tuples ( [ ( "type" , "argiope" , "" ) ] ) self . elements = pd . DataFrame ( data = types , columns = columns , index = elabels ) self . elements . index . name = "element" self . elements . loc [ : , ( "type" , "solver" , "" ) ] = stypes # Connectivity  c = pd . DataFrame ( conn , index = elabels ) c . fillna ( 0 , inplace = True ) c [ : ] = c . values . astype ( np . int32 ) c . columns = pd . MultiIndex . from_product ( [ [ "conn" ] , [ "n{0}" . format ( n ) for n in np . arange ( c . shape [ 1 ] ) ] , [ "" ] ] ) self . elements = self . elements . join ( c ) # Sets for k , v in esets . items ( ) : self . elements [ ( "sets" , k , "" ) ] = v self . elements [ "sets" , "all" , "" ] = True # Surfaces for k , v in surfaces . items ( ) : for fk , vv in v . items ( ) : self . elements [ ( "surfaces" , k , "s{0}" . format ( fk ) ) ] = vv # Materials self . elements [ ( "materials" , "" , "" ) ] = materials self . elements . sort_index ( axis = 1 , inplace = True )
Sets the element data.
    
    :arg elabels: element labels. Items be strictly positive and int typed 
                  in 1D array-like with shape :math:`(N_e)`.
    :type elabels: 1D uint typed array-like
    :arg types: element types chosen among argiope specific element types. 
    :type types: str typed array-like 
    :arg stypes: element types chosen in solver (depends on the chosen solver) specific element types. 
    :type stypes: str typed array-like 
    :arg conn: connectivity table. In order to deal with non rectangular tables, :math:`0` can be used to fill missing data. 
    :type conn: uint typed array-like
    :arg esets: element sets. Contains boolean array-like of shape :math:`(N_e)`.
    :type esets: dict  
    :arg surfaces: surfaces. Contains boolean array-like of shape :math:`(N_e, N_s )` with :math:`N_s` being the maximum number of faces on a single element. 
    :type surfaces: dict   
    :arg materials: material keys. Any number a of materials can be used.
    :type materials: str typed array-like
Sets the element data . : arg elabels : element labels . Items be strictly positive and int typed in 1D array - like with shape : math : ( N_e ) . : type elabels : 1D uint typed array - like : arg types : element types chosen among argiope specific element types . : type types : str typed array - like : arg stypes : element types chosen in solver ( depends on the chosen solver ) specific element types . : type stypes : str typed array - like : arg conn : connectivity table . In order to deal with non rectangular tables : math : 0 can be used to fill missing data . : type conn : uint typed array - like : arg esets : element sets . Contains boolean array - like of shape : math : ( N_e ) . : type esets : dict : arg surfaces : surfaces . Contains boolean array - like of shape : math : ( N_e N_s ) with : math : N_s being the maximum number of faces on a single element . : type surfaces : dict : arg materials : material keys . Any number a of materials can be used . : type materials : str typed array - like