argiope/mesh.py
def node_set_to_surface(self, tag):
    """
    Converts a node set to surface.
    """
    # Create a dummy node with label 0
    nodes = self.nodes.copy()
    dummy = nodes.iloc[0].copy()
    dummy["coords"] *= np.nan
    dummy["sets"] = True
    nodes.loc[0] = dummy
    # Getting element surfaces
    element_surfaces= self.split("surfaces").unstack()
    # killer hack !
    surf = pd.DataFrame(
             nodes.sets[tag].loc[element_surfaces.values.flatten()]
                   .values.reshape(element_surfaces.shape)
                   .prod(axis = 1)
                   .astype(np.bool),
             index = element_surfaces.index).unstack().fillna(False)
    for k in surf.keys():
      self.elements["surfaces", tag, "f{0}".format(k[1]+1) ] = surf.loc[:, k]
def node_set_to_surface(self, tag):
    """
    Converts a node set to surface.
    """
    # Create a dummy node with label 0
    nodes = self.nodes.copy()
    dummy = nodes.iloc[0].copy()
    dummy["coords"] *= np.nan
    dummy["sets"] = True
    nodes.loc[0] = dummy
    # Getting element surfaces
    element_surfaces= self.split("surfaces").unstack()
    # killer hack !
    surf = pd.DataFrame(
             nodes.sets[tag].loc[element_surfaces.values.flatten()]
                   .values.reshape(element_surfaces.shape)
                   .prod(axis = 1)
                   .astype(np.bool),
             index = element_surfaces.index).unstack().fillna(False)
    for k in surf.keys():
      self.elements["surfaces", tag, "f{0}".format(k[1]+1) ] = surf.loc[:, k]
def node_set_to_surface ( self , tag ) : # Create a dummy node with label 0 nodes = self . nodes . copy ( ) dummy = nodes . iloc [ 0 ] . copy ( ) dummy [ "coords" ] *= np . nan dummy [ "sets" ] = True nodes . loc [ 0 ] = dummy # Getting element surfaces element_surfaces = self . split ( "surfaces" ) . unstack ( ) # killer hack ! surf = pd . DataFrame ( nodes . sets [ tag ] . loc [ element_surfaces . values . flatten ( ) ] . values . reshape ( element_surfaces . shape ) . prod ( axis = 1 ) . astype ( np . bool ) , index = element_surfaces . index ) . unstack ( ) . fillna ( False ) for k in surf . keys ( ) : self . elements [ "surfaces" , tag , "f{0}" . format ( k [ 1 ] + 1 ) ] = surf . loc [ : , k ]
Converts a node set to surface.
Converts a node set to surface .