1
#############################################################
3
## Copyright (c) 2007-2011 by The University of Queensland ##
4
## Earth Systems Science Computational Centre (ESSCC) ##
5
## http://www.uq.edu.au/esscc ##
7
## Primary Business: Brisbane, Queensland, Australia ##
8
## Licensed under the Open Software License version 3.0 ##
9
## http://www.opensource.org/licenses/osl-3.0.php ##
11
#############################################################
15
#An example python script to generate a bonded rectangle of particles with a discrete fracture network included
19
# Define region extremities:
20
minPoint = Vector3(0.0,0.0,0.0)
21
maxPoint = Vector3(width,height,0.0)
23
# Define the geometrical constraints for packing
24
# (e.g. lines bordering a rectangular region in 2D)
25
# QUESTION: Is there a particular order for defining endpoints of lines?
27
startPoint = Vector3(width,0.0,0.0),
31
bottom_line = Line2D (
32
startPoint = maxPoint,
33
endPoint = Vector3(0.0,height,0.0)
37
startPoint = Vector3(width,0.0,0.0),
42
startPoint = minPoint,
43
endPoint = Vector3(0.0,height,0.0)
46
# Define the Volume to be filled with spheres:
47
# (e.g. a BoxWithLines2D)
48
box = BoxWithLines2D (
54
box.addLine(bottom_line)
55
box.addLine(left_line)
56
box.addLine(right_line)
59
# Create a multi-group neighbour table to contain the particles:
66
# Fill the volume with particles:
67
packer = InsertGenerator2D (
71
maxIterations = 10000,
75
packer.generatePacking( volume = box, ntable = mntable, tag = 0)
77
# create bonds between neighbouring particles:
78
mntable.generateBonds(
83
#Add a discrete fracture network
84
brkLine = LineSegment2D (
85
startPoint = Vector3(0.4*width,0.4*height,0.0),
86
endPoint = Vector3(0.6*width,0.6*height,0.0)
89
mntable.breakBondsAlongLineSegment(
90
lineSegment = brkLine,
95
# write a geometry file
97
fileName = "temp/geo_crack.geo",
102
fileName = "temp/geo_crack.vtu",