2 .. module:: false_connections.py
3 :synopsis: Checks for false connections between fractures in upscaled mesh
4 .. moduleauthor:: Jeffrey Hyman <jhyman@lanl.gov>
20 name of the pickled dictionary of mesh and fracture intersections
24 num_false_connections : int
25 number of false connections
27 number of Voronoi cells with false connections
28 false_connections : list
29 list of tuples of false connections created by upscaling
33 map2continuum and upscale must be run first to create the fracture/mesh intersection
34 dictionary. Thus must be run in the main job directory which contains connectivity.dat
38 print(
"--> Checking for false connections in the upscaled mesh.")
40 files = [
"connectivity.dat",
"left.dat",
"right.dat",
"fracture_info.dat"]
43 os.symlink(path + f, f)
45 print(f
"--> Warning!!! Unable to make symbolic link to {path+f}")
49 G = self.create_graph(
"fracture",
"left",
"right")
56 for u, v
in H.edges():
60 print(
"--> Loading mesh intersection information")
61 fmc = pickle.load(open(
"connections.p",
"rb"))
64 cells = [key
for key
in fmc.keys()]
68 cell_false = [
False] * len(cells)
69 for i, cell
in enumerate(cells):
70 num_conn = len(fmc[cell])
75 for j
in range(num_conn):
77 for k
in range(j + 1, num_conn):
83 print(
"--> Checking for false connections")
84 false_connections = []
85 for u, v,
in H.edges():
86 if not G.has_edge(u, v):
87 print(f
"--> False connection between fractures {u} and {v}")
88 false_connections.append((u, v))
90 if len(false_connections) > 0:
91 num_false_connections = len(false_connections)
93 f
"--> There are {num_false_connections} false connections between fractures"
95 num_false_cells = sum(cell_false)
96 print(f
"--> These occur in {num_false_cells} Voronoi cells")
98 print(f
"--> No false connections found")
100 num_false_connections = 0
102 return (num_false_connections, num_false_cells, false_connections)
def check_false_connections(self, path="../")