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