Topological Material Analysis 0.5
Analyse the structures of materials using tools from TDA
Loading...
Searching...
No Matches
reeb_graph.Reeb_Graph Class Reference
Inheritance diagram for reeb_graph.Reeb_Graph:

Public Member Functions

 __init__ (self, inputfile=None, backbone=None, flow=None, radii=None, M=None, m=None, grid_size=50, t_step=50, PREV_DATA=(None, None, None, None), periodic=True, fat_radius=1, covering=np.array([-1, 1]), reeb_stride=1, swap_res_grid_and_balls=False, transform_points=None, relax_z_axis=None, verbose=False, MP=False, save_RAM=True, stride=1)
 setup_grid (self, balls_centres=None, balls_radii=None, M=None, m=None)
 transform_backbone (self, balls_centres=None, balls_radii=None, M=None, m=None)
 affine_transform (self, points, radii, V, v, M, m)
 produce_res_grid (self, balls_centres=None, balls_radii=None, M=None, m=None)
 make_reeb_graph (self, axis=-1, old=False, plot=False)
 reeb_graph (self, grid, axis=-1, D_=None)
 reeb_graph_old (self, grid, axis=-1, D_=None)
 build_graph (self, E, weights, fun, emb)
 compute_max_flow (self, D_=None)
 compute_tunnels (self, n=10, D_=None, independent=False, plot=False)
 plot_reeb (self)
 plot_tunnel (self, path, D)
 network_plot_3D (self, fun, D=None)
 plot_res_grid (self, three_d=False, heights_=None, axis=-1)
 plot_path_connected_comp (self, comps, three_d=False, boundaries=False, plot_reeb=False, plot_sorrounding=True)
 make_tunnel_matrix (self)
 compute_bottlenecks (self, D_=None, plot=False, col_thresh=-0.001, plot_thresh=400, include_deadlocks=False)
 compute_sorrounding_structure (self, path, boundaries=False)

Public Attributes

 radii = radii
 t_step = t_step
 M = M
 m = m
 grid_size = grid_size
 axes = np.array([0,1])
int dim = 3
 backbone = backbone
 flow = flow
 distances_to_balls_aux = None
 atoms_kinds_aux = None
 periodic = periodic
 fat_radius = fat_radius
 reeb_stride = reeb_stride
 covering = covering
 swap_res_grid_and_balls = swap_res_grid_and_balls
 transform_points = transform_points
bool simply_connected_top_bottom = False
 relax_z_axis = np.array([self.covering[-1]+1,-1])
 verbose = verbose
 save_RAM = save_RAM
 stride = stride
 MP = MP
 nx
 ny
tuple nz = (self.grid_size, self.grid_size, self.grid_size)
 x = np.linspace(self.m[0], self.M[0], self.nx+tmp)[:-1]
 y = np.linspace(self.m[1], self.M[1], self.ny+tmp)[:-1]
 z = np.linspace(self.m[2], self.M[2], self.nz+tmp)[:-1]
 d_x = self.x[1]-self.x[0]
 d_y = self.y[1]-self.y[0]
 d_z = self.z[1]-self.z[0]
float r_graph = np.sqrt(self.d_x**2 + self.d_y**2 + self.d_z**2)*1.001*self.fat_radius
 grid = np.zeros((self.nx*self.ny*self.nz,self.dim))
 N = len(self.grid)
 unit_3d = np.prod(self.M-self.m)/self.N
 unit_2d = np.prod(self.M[:-1]-self.m[:-1])/(self.nx*self.ny)
 z_0 = z[0]+self.d_z*k
 z_1 = z[-1]-self.d_z*k
 distances_to_balls = np.inf*np.ones_like(self.grid[:,0])
int atoms_kinds = -1*np.ones_like(self.grid[:,0]).astype(int)
tuple idxs = (idxs + aux_top + aux_bottom)>0
 balls_centres = self.grid[self.idxs]
 balls_radii = np.ones_like(self.idxs)*r
 res_grid = self.grid[self.idxs]
 graph = csr_matrix((np.ones_like(A[:,0]), (A[:,0],A[:,1])), shape=(N, N))
 G = self.build_graph(E, weights, fun, emb)
 measure_path_comp = fun
 axis = axis
float delta = 1.001*delta
tuple norm = ((self.delta*np.max(self.covering))//(self.d_z*self.reeb_stride)) + 1
int REEB_GRAPH = -1*np.ones((grid.shape[0],reeb_size)).astype(int)
int n = len(emb)-1
 E = E
 D_reeb_w = np.zeros((len(emb),len(emb)))
 reeb_connected = np.multiply(D_0,D_1)
 max_flow = maximum_flow(graph,0,N)
 D_flow = self.max_flow.flow
list PATHS = []
list MIN = []
list VOL = []
 m_x
 m_y
 m_z
 DIV = np.zeros((self.n+1,))
 z_axis_boundaries
 inputfile

Detailed Description

Reeb Graph Class

Constructor & Destructor Documentation

◆ __init__()

reeb_graph.Reeb_Graph.__init__ ( self,
inputfile = None,
backbone = None,
flow = None,
radii = None,
M = None,
m = None,
grid_size = 50,
t_step = 50,
PREV_DATA = (None,None,None,None),
periodic = True,
fat_radius = 1,
covering = np.array([-1,1]),
reeb_stride = 1,
swap_res_grid_and_balls = False,
transform_points = None,
relax_z_axis = None,
verbose = False,
MP = False,
save_RAM = True,
stride = 1 )
LEGEND
radii  -> vector or real value determining the radius around the atoms of the backbone, inducing the void region;
axes -> the axis along which keep the boundary conditions. The remaining axis is "unrolled";
PREV_DATA -> use to pass from previous calculations the distances between grid and backbone;
simply_connected_top_bottom -> consider top and bottom layer as simply connected, 
                               ignoring the forbidden region in such sets;
swap_res_grid_and_balls -> swap forbidden region and residual grid;
fat_radius -> scalar saying how many times the diamater of a cell is multiplied to obtain a neighborhood of the graph;
reeb_stride -> the stride along the axis to make the Reeb graph;
covering -> e.g. [-1,0] or [-1,1] determine the thickness of the "level sets": (v-delta,v) or (v-delta,v+delta). 
            Other values different from -1,1 can be tried but can cause topological errors in the graph;
relax_z_axis -> [a,-b] puts the first a layers of the cube on top of it and the last b on the bottom: less or equal than a, 
         greater then -b;
transform_points -> change atoms location with affine transformation Vxpts+v
stride -> the stride to subdivide the calculations of the distances between backbone and the grid

Member Function Documentation

◆ affine_transform()

reeb_graph.Reeb_Graph.affine_transform ( self,
points,
radii,
V,
v,
M,
m )

◆ build_graph()

reeb_graph.Reeb_Graph.build_graph ( self,
E,
weights,
fun,
emb )

◆ compute_bottlenecks()

reeb_graph.Reeb_Graph.compute_bottlenecks ( self,
D_ = None,
plot = False,
col_thresh = -0.001,
plot_thresh = 400,
include_deadlocks = False )

◆ compute_max_flow()

reeb_graph.Reeb_Graph.compute_max_flow ( self,
D_ = None )

◆ compute_sorrounding_structure()

reeb_graph.Reeb_Graph.compute_sorrounding_structure ( self,
path,
boundaries = False )
path -> a subset of the vertices of the reeb graph (not the indexes! the actual vertices!)

◆ compute_tunnels()

reeb_graph.Reeb_Graph.compute_tunnels ( self,
n = 10,
D_ = None,
independent = False,
plot = False )

◆ make_reeb_graph()

reeb_graph.Reeb_Graph.make_reeb_graph ( self,
axis = -1,
old = False,
plot = False )

◆ make_tunnel_matrix()

reeb_graph.Reeb_Graph.make_tunnel_matrix ( self)

◆ network_plot_3D()

reeb_graph.Reeb_Graph.network_plot_3D ( self,
fun,
D = None )

◆ plot_path_connected_comp()

reeb_graph.Reeb_Graph.plot_path_connected_comp ( self,
comps,
three_d = False,
boundaries = False,
plot_reeb = False,
plot_sorrounding = True )
comps -> a set of path connected components, indexed as the vertices of the reeb graph

◆ plot_reeb()

reeb_graph.Reeb_Graph.plot_reeb ( self)

◆ plot_res_grid()

reeb_graph.Reeb_Graph.plot_res_grid ( self,
three_d = False,
heights_ = None,
axis = -1 )

◆ plot_tunnel()

reeb_graph.Reeb_Graph.plot_tunnel ( self,
path,
D )

◆ produce_res_grid()

reeb_graph.Reeb_Graph.produce_res_grid ( self,
balls_centres = None,
balls_radii = None,
M = None,
m = None )

◆ reeb_graph()

reeb_graph.Reeb_Graph.reeb_graph ( self,
grid,
axis = -1,
D_ = None )

◆ reeb_graph_old()

reeb_graph.Reeb_Graph.reeb_graph_old ( self,
grid,
axis = -1,
D_ = None )

◆ setup_grid()

reeb_graph.Reeb_Graph.setup_grid ( self,
balls_centres = None,
balls_radii = None,
M = None,
m = None )

◆ transform_backbone()

reeb_graph.Reeb_Graph.transform_backbone ( self,
balls_centres = None,
balls_radii = None,
M = None,
m = None )

Member Data Documentation

◆ atoms_kinds

reeb_graph.Reeb_Graph.atoms_kinds = -1*np.ones_like(self.grid[:,0]).astype(int)

◆ atoms_kinds_aux

reeb_graph.Reeb_Graph.atoms_kinds_aux = None

◆ axes

reeb_graph.Reeb_Graph.axes = np.array([0,1])

◆ axis

reeb_graph.Reeb_Graph.axis = axis

◆ backbone

reeb_graph.Reeb_Graph.backbone = backbone

◆ balls_centres

reeb_graph.Reeb_Graph.balls_centres = self.grid[self.idxs]

◆ balls_radii

reeb_graph.Reeb_Graph.balls_radii = np.ones_like(self.idxs)*r

◆ covering

reeb_graph.Reeb_Graph.covering = covering

◆ D_flow

reeb_graph.Reeb_Graph.D_flow = self.max_flow.flow

◆ D_reeb_w

reeb_graph.Reeb_Graph.D_reeb_w = np.zeros((len(emb),len(emb)))

◆ d_x

reeb_graph.Reeb_Graph.d_x = self.x[1]-self.x[0]

◆ d_y

reeb_graph.Reeb_Graph.d_y = self.y[1]-self.y[0]

◆ d_z

reeb_graph.Reeb_Graph.d_z = self.z[1]-self.z[0]

◆ delta

float reeb_graph.Reeb_Graph.delta = 1.001*delta

◆ dim

int reeb_graph.Reeb_Graph.dim = 3

◆ distances_to_balls

reeb_graph.Reeb_Graph.distances_to_balls = np.inf*np.ones_like(self.grid[:,0])

◆ distances_to_balls_aux

reeb_graph.Reeb_Graph.distances_to_balls_aux = None

◆ DIV

reeb_graph.Reeb_Graph.DIV = np.zeros((self.n+1,))

◆ E

reeb_graph.Reeb_Graph.E = E

◆ fat_radius

reeb_graph.Reeb_Graph.fat_radius = fat_radius

◆ flow

reeb_graph.Reeb_Graph.flow = flow

◆ G

reeb_graph.Reeb_Graph.G = self.build_graph(E, weights, fun, emb)

◆ graph

reeb_graph.Reeb_Graph.graph = csr_matrix((np.ones_like(A[:,0]), (A[:,0],A[:,1])), shape=(N, N))

◆ grid

reeb_graph.Reeb_Graph.grid = np.zeros((self.nx*self.ny*self.nz,self.dim))

◆ grid_size

reeb_graph.Reeb_Graph.grid_size = grid_size

◆ idxs

tuple reeb_graph.Reeb_Graph.idxs = (idxs + aux_top + aux_bottom)>0

◆ inputfile

reeb_graph.Reeb_Graph.inputfile

◆ M

reeb_graph.Reeb_Graph.M = M

◆ m

reeb_graph.Reeb_Graph.m = m

◆ m_x

reeb_graph.Reeb_Graph.m_x

◆ m_y

reeb_graph.Reeb_Graph.m_y

◆ m_z

reeb_graph.Reeb_Graph.m_z

◆ max_flow

reeb_graph.Reeb_Graph.max_flow = maximum_flow(graph,0,N)

◆ measure_path_comp

reeb_graph.Reeb_Graph.measure_path_comp = fun

◆ MIN

list reeb_graph.Reeb_Graph.MIN = []

◆ MP

reeb_graph.Reeb_Graph.MP = MP

◆ N

reeb_graph.Reeb_Graph.N = len(self.grid)

◆ n

reeb_graph.Reeb_Graph.n = len(emb)-1

◆ norm

reeb_graph.Reeb_Graph.norm = ((self.delta*np.max(self.covering))//(self.d_z*self.reeb_stride)) + 1

◆ nx

reeb_graph.Reeb_Graph.nx

◆ ny

reeb_graph.Reeb_Graph.ny

◆ nz

tuple reeb_graph.Reeb_Graph.nz = (self.grid_size, self.grid_size, self.grid_size)

◆ PATHS

reeb_graph.Reeb_Graph.PATHS = []

◆ periodic

reeb_graph.Reeb_Graph.periodic = periodic

◆ r_graph

float reeb_graph.Reeb_Graph.r_graph = np.sqrt(self.d_x**2 + self.d_y**2 + self.d_z**2)*1.001*self.fat_radius

◆ radii

reeb_graph.Reeb_Graph.radii = radii

◆ reeb_connected

reeb_graph.Reeb_Graph.reeb_connected = np.multiply(D_0,D_1)

◆ REEB_GRAPH

int reeb_graph.Reeb_Graph.REEB_GRAPH = -1*np.ones((grid.shape[0],reeb_size)).astype(int)

◆ reeb_stride

reeb_graph.Reeb_Graph.reeb_stride = reeb_stride

◆ relax_z_axis

reeb_graph.Reeb_Graph.relax_z_axis = np.array([self.covering[-1]+1,-1])

◆ res_grid

reeb_graph.Reeb_Graph.res_grid = self.grid[self.idxs]

◆ save_RAM

reeb_graph.Reeb_Graph.save_RAM = save_RAM

◆ simply_connected_top_bottom

bool reeb_graph.Reeb_Graph.simply_connected_top_bottom = False

◆ stride

reeb_graph.Reeb_Graph.stride = stride

◆ swap_res_grid_and_balls

reeb_graph.Reeb_Graph.swap_res_grid_and_balls = swap_res_grid_and_balls

◆ t_step

reeb_graph.Reeb_Graph.t_step = t_step

◆ transform_points

reeb_graph.Reeb_Graph.transform_points = transform_points

◆ unit_2d

reeb_graph.Reeb_Graph.unit_2d = np.prod(self.M[:-1]-self.m[:-1])/(self.nx*self.ny)

◆ unit_3d

reeb_graph.Reeb_Graph.unit_3d = np.prod(self.M-self.m)/self.N

◆ verbose

reeb_graph.Reeb_Graph.verbose = verbose

◆ VOL

list reeb_graph.Reeb_Graph.VOL = []

◆ x

reeb_graph.Reeb_Graph.x = np.linspace(self.m[0], self.M[0], self.nx+tmp)[:-1]

◆ y

reeb_graph.Reeb_Graph.y = np.linspace(self.m[1], self.M[1], self.ny+tmp)[:-1]

◆ z

reeb_graph.Reeb_Graph.z = np.linspace(self.m[2], self.M[2], self.nz+tmp)[:-1]

◆ z_0

reeb_graph.Reeb_Graph.z_0 = z[0]+self.d_z*k

◆ z_1

reeb_graph.Reeb_Graph.z_1 = z[-1]-self.d_z*k

◆ z_axis_boundaries

reeb_graph.Reeb_Graph.z_axis_boundaries

The documentation for this class was generated from the following file: