| 1 |
#!/bin/sh |
| 2 |
# autopkgtest check |
| 3 |
# (C) 2014 Anton Gladky |
| 4 |
|
| 5 |
set -e |
| 6 |
|
| 7 |
cd "$AUTOPKGTEST_TMP" |
| 8 |
|
| 9 |
cat <<EOF > box.py |
| 10 |
from gengeo import * |
| 11 |
import sys |
| 12 |
|
| 13 |
xdim=float(sys.argv[1]) |
| 14 |
ydim=xdim*2.0 |
| 15 |
zdim=xdim |
| 16 |
|
| 17 |
maxRadius=1.0 |
| 18 |
minPoint=Vector3(0.0,0.0,0.0) |
| 19 |
maxPoint=Vector3(xdim,ydim,zdim) |
| 20 |
|
| 21 |
box=BoxWithPlanes3D ( |
| 22 |
minPoint=minPoint, |
| 23 |
maxPoint=maxPoint |
| 24 |
) |
| 25 |
|
| 26 |
box.addPlane(Plane(minPoint,Vector3(1.0,0.0,0.0))) |
| 27 |
box.addPlane(Plane(minPoint,Vector3(0.0,1.0,0.0))) |
| 28 |
box.addPlane(Plane(minPoint,Vector3(0.0,0.0,1.0))) |
| 29 |
box.addPlane(Plane(minPoint,Vector3(-1.0,0.0,0.0))) |
| 30 |
box.addPlane(Plane(minPoint,Vector3(0.0,-1.0,0.0))) |
| 31 |
box.addPlane(Plane(minPoint,Vector3(0.0,0.0,-1.0))) |
| 32 |
|
| 33 |
mntable=MNTable3D ( |
| 34 |
minPoint=minPoint, |
| 35 |
maxPoint=maxPoint, |
| 36 |
gridSize=2.5*maxRadius, |
| 37 |
numGroups=1 |
| 38 |
) |
| 39 |
|
| 40 |
packer=InsertGenerator3D( |
| 41 |
minRadius=0.2, |
| 42 |
maxRadius=maxRadius, |
| 43 |
insertFails=1000, |
| 44 |
maxIterations=1000, |
| 45 |
tolerance=1.0e-6, |
| 46 |
seed=1 |
| 47 |
) |
| 48 |
|
| 49 |
packer.generatePacking ( |
| 50 |
volume=box, |
| 51 |
ntable=mntable, |
| 52 |
groupID=0 |
| 53 |
) |
| 54 |
|
| 55 |
mntable.generateBonds ( |
| 56 |
groupID=0, |
| 57 |
tolerance=1.0e-5, |
| 58 |
bondID=0 |
| 59 |
) |
| 60 |
|
| 61 |
mntable.write("box"+str(ydim)+".geo",1) |
| 62 |
mntable.write("box"+str(ydim)+".vtu",2) |
| 63 |
|
| 64 |
EOF |
| 65 |
|
| 66 |
python3 box.py 15.0 |
| 67 |
echo "run: OK" |