| 1 |
############################################################# |
| 2 |
## ## |
| 3 |
## Copyright (c) 2007-2017 by The University of Queensland ## |
| 4 |
## Centre for Geoscience Computing ## |
| 5 |
## http://earth.uq.edu.au/centre-geoscience-computing ## |
| 6 |
## ## |
| 7 |
## Primary Business: Brisbane, Queensland, Australia ## |
| 8 |
## Licensed under the Open Software License version 3.0 ## |
| 9 |
## http://www.apache.org/licenses/LICENSE-2.0 ## |
| 10 |
## ## |
| 11 |
############################################################# |
| 12 |
|
| 13 |
from __future__ import division |
| 14 |
from gengeo import * |
| 15 |
|
| 16 |
size = 50.0 |
| 17 |
ntry = 1000 |
| 18 |
rmin_sand = 0.5 |
| 19 |
rmin_clay = 0.2 |
| 20 |
rmax_clay = 0.5 |
| 21 |
|
| 22 |
sand_layer_thickness = 0.425*size |
| 23 |
clay_layer_thickness = 0.15*size |
| 24 |
center_box_dim = 0.05*size |
| 25 |
|
| 26 |
mntable = CircMNTable2D (Vector3(0,0,0), Vector3(size,size,0),2.5,1) |
| 27 |
|
| 28 |
sand_packer = HexAggregateInsertGenerator2D (rmin_sand, 1.0, ntry, 1000, 1.0e-6) |
| 29 |
|
| 30 |
clay_packer = InsertGenerator2D(rmin_clay, rmax_clay, ntry, 1000, 1.0e-6) |
| 31 |
|
| 32 |
clay_layer_min=sand_layer_thickness |
| 33 |
clay_layer_max=clay_layer_min+clay_layer_thickness |
| 34 |
clay_box_min = clay_layer_min - rmax_clay |
| 35 |
clay_box_max = clay_layer_max + rmax_clay |
| 36 |
|
| 37 |
ClayBox = BoxWithLines2D(Vector3(clay_layer_min,0.0,0.0),Vector3(clay_layer_max,size,0.0)) |
| 38 |
|
| 39 |
ClayBox.addLine(Line2D(Vector3(clay_layer_min,0.0,0.0),Vector3(clay_layer_max,0.0,0.0))) |
| 40 |
ClayBox.addLine(Line2D(Vector3(clay_layer_max,size,0.0),Vector3(clay_layer_min,size,0.0))) |
| 41 |
ClayBox.addLine(Line2D(Vector3(clay_layer_max,size,0.0),Vector3(clay_layer_max,0.0,0.0))) |
| 42 |
ClayBox.addLine(Line2D(Vector3(clay_layer_min,size,0.0),Vector3(clay_layer_max,size,0.0))) |
| 43 |
|
| 44 |
clay_packer.generatePacking(ClayBox,mntable,0,2) |
| 45 |
|
| 46 |
cbox_layer_minx=sand_layer_thickness-center_box_dim |
| 47 |
cbox_layer_maxx=sand_layer_thickness+clay_layer_thickness+center_box_dim |
| 48 |
cbox_layer_miny=0.5*size-center_box_dim |
| 49 |
cbox_layer_maxy=0.5*size+center_box_dim |
| 50 |
|
| 51 |
CenterBox = BoxWithLines2D(Vector3(cbox_layer_minx,cbox_layer_miny,0.0), Vector3(cbox_layer_maxx,cbox_layer_maxy,0.0)) |
| 52 |
|
| 53 |
CenterBox.addLine(Line2D(Vector3(cbox_layer_minx,cbox_layer_miny,0.0), Vector3(cbox_layer_maxx,cbox_layer_miny,0.0))) |
| 54 |
|
| 55 |
CenterBox.addLine(Line2D(Vector3(cbox_layer_maxx,cbox_layer_maxy,0.0), Vector3(cbox_layer_minx,cbox_layer_maxy,0.0))) |
| 56 |
|
| 57 |
CenterBox.addLine(Line2D(Vector3(cbox_layer_maxx,cbox_layer_maxy,0.0), Vector3(cbox_layer_maxx,cbox_layer_miny,0.0))) |
| 58 |
|
| 59 |
CenterBox.addLine(Line2D(Vector3(cbox_layer_minx,cbox_layer_maxy,0.0), Vector3(cbox_layer_maxx,cbox_layer_maxy,0.0))) |
| 60 |
|
| 61 |
clay_packer.generatePacking(CenterBox,mntable,0,2) |
| 62 |
|
| 63 |
sand_layer_min1=0 |
| 64 |
sand_layer_max1=sand_layer_thickness |
| 65 |
sand_box_min1=sand_layer_min1-rmin_sand |
| 66 |
sand_box_max1=sand_layer_max1+rmin_sand |
| 67 |
|
| 68 |
SandBox1 = BoxWithLines2D(Vector3(sand_box_min1,0.0,0.0),Vector3(sand_box_max1,size,0.0)) |
| 69 |
|
| 70 |
SandBox1.addLine(Line2D(Vector3(sand_layer_min1,size,0.0),Vector3(sand_layer_min1,0.0,0.0))) |
| 71 |
|
| 72 |
SandBox1.addLine(Line2D(Vector3(sand_layer_min1,0.0,0.0),Vector3(sand_layer_max1,0.0,0.0))) |
| 73 |
|
| 74 |
SandBox1.addLine(Line2D(Vector3(sand_layer_max1,size,0.0),Vector3(sand_layer_max1,0.0,0.0))) |
| 75 |
|
| 76 |
SandBox1.addLine(Line2D(Vector3(sand_layer_min1,size,0.0),Vector3(sand_layer_max1,size,0.0))) |
| 77 |
|
| 78 |
SandBox1.addLine(Line2D(Vector3(0.0,size/2.0,0.0),Vector3(size,size/2.0,0.0))) |
| 79 |
|
| 80 |
sand_packer.generatePacking(SandBox1,mntable,0,1) |
| 81 |
|
| 82 |
sand_layer_min2=sand_layer_thickness+clay_layer_thickness |
| 83 |
sand_layer_max2=size |
| 84 |
sand_box_min2=sand_layer_min2-rmin_sand |
| 85 |
sand_box_max2=sand_layer_max2+rmin_sand |
| 86 |
|
| 87 |
SandBox2 = BoxWithLines2D(Vector3(sand_box_min2,0.0,0.0),Vector3(sand_box_max2,size,0.0)) |
| 88 |
|
| 89 |
SandBox2.addLine(Line2D(Vector3(sand_layer_min2,size,0.0),Vector3(sand_layer_min2,0.0,0.0))) |
| 90 |
SandBox2.addLine(Line2D(Vector3(sand_layer_min2,0.0,0.0),Vector3(sand_layer_max2,0.0,0.0))) |
| 91 |
SandBox2.addLine(Line2D(Vector3(sand_layer_max2,size,0.0),Vector3(sand_layer_max2,0.0,0.0))) |
| 92 |
SandBox2.addLine(Line2D(Vector3(sand_layer_min2,size,0.0),Vector3(sand_layer_max2,size,0.0))) |
| 93 |
|
| 94 |
SandBox2.addLine(Line2D(Vector3(0.0,size/2.0,0.0),Vector3(size,size/2.0,0.0))) |
| 95 |
|
| 96 |
sand_packer.generatePacking(SandBox2,mntable,0,1) |
| 97 |
|
| 98 |
mntable.generateBondsWithMask(0,1.0e-6,0,1,1) |
| 99 |
|
| 100 |
top_line = Line2D(Vector3(0.0,size,0.0),Vector3(size,size,0.0)) |
| 101 |
bottom_line = Line2D(Vector3(0.0,0.0,0.0),Vector3(size,0.0,0.0)) |
| 102 |
|
| 103 |
mntable.tagParticlesAlongLineWithMask(top_line,0.5,4,4,0) |
| 104 |
mntable.tagParticlesAlongLineWithMask(bottom_line,0.5,8,8,0) |
| 105 |
|
| 106 |
mntable.write("temp/geo_layered.vtu",2) |