예제 #1
0
]

#Generate a spiral
Ne = 200
for i in range(0, Ne):
    omega = 60.0 / float(Ne)
    hy = 0.10
    hz = 0.15
    px = float(i) * (omega / 60.0)
    py = sin(float(i) * omega) * hy
    pz = cos(float(i) * omega) * hz
    px2 = float(i + 1.) * (omega / 60.0)
    py2 = sin(float(i + 1.) * omega) * hy
    pz2 = cos(float(i + 1.) * omega) * hz
    utils.chainedCylinder(begin=Vector3(pz, py, px),
                          radius=0.005,
                          end=Vector3(pz2, py2, px2),
                          color=Vector3(0.6, 0.5, 0.5))


def outp(id=1):
    for i in O.interactions:
        if i.id1 == 1:
            print i.phys.shearForce
            print i.phys.normalForce
            return i


O.bodies[Ne - 1].state.blockedDOFs = 'xyzXYZ'
woo.qt.View()

#plot some results
예제 #2
0
]

# Generate a spiral
Ne = 200
for i in range(0, Ne):
    omega = 60.0 / float(Ne)
    hy = 0.10
    hz = 0.15
    px = float(i) * (omega / 60.0)
    py = sin(float(i) * omega) * hy
    pz = cos(float(i) * omega) * hz
    px2 = float(i + 1.0) * (omega / 60.0)
    py2 = sin(float(i + 1.0) * omega) * hy
    pz2 = cos(float(i + 1.0) * omega) * hz
    utils.chainedCylinder(
        begin=Vector3(pz, py, px), radius=0.005, end=Vector3(pz2, py2, px2), color=Vector3(0.6, 0.5, 0.5)
    )


def outp(id=1):
    for i in O.interactions:
        if i.id1 == 1:
            print i.phys.shearForce
            print i.phys.normalForce
            return i


O.bodies[Ne - 1].state.blockedDOFs = "xyzXYZ"
woo.qt.View()

예제 #3
0
    dyj = abs(float(j)) * dy
    dxj = abs(float(j)) * dx
    dzj = float(j) * dz
    for i in range(0, Ne):
        omega = 20 / float(Ne)
        hy = 0.0
        hz = 0.05
        hx = 1.5
        px = float(i) * hx / float(Ne) - 0.8 + dxj
        py = sin(float(i) * omega) * hy + dyj
        pz = cos(float(i) * omega) * hz + dzj
        px2 = float(i + 1.) * hx / float(Ne) - 0.8 + dxj
        py2 = sin(float(i + 1.) * omega) * hy + dyj
        pz2 = cos(float(i + 1.) * omega) * hz + dzj
        utils.chainedCylinder(begin=Vector3(pz, py, px),
                              radius=0.02,
                              end=Vector3(pz2, py2, px2),
                              color=Vector3(0.6, 0.5, 0.5),
                              material='cylindermat')
        if (i == Ne - 1):  #close the chain with a node of size 0
            print "closing chain"
            b = utils.chainedCylinder(begin=Vector3(pz2, py2, px2),
                                      radius=0.02,
                                      end=Vector3(pz2, py2, px2),
                                      color=Vector3(0.6, 0.5, 0.5),
                                      material='cylindermat')
            b.state.blockedDOFs = ['x', 'y', 'z', 'rx', 'ry', 'rz']
    ChainedState.currentChain = ChainedState.currentChain + 1

O.saveTmp()
예제 #4
0
	),
	## Apply gravity
	GravityEngine(gravity=[1,-9.81,0],label='gravity'),
	## Motion equation
	NewtonIntegrator(damping=0.05,label='newton'),
]

#Assemble cylinders in sinusoidal shapes
O.materials.append(CohFrictMat(young=young,poisson=poisson,density=3.0*density,frictionAngle=frictionAngle3,normalCohesion=1e40,shearCohesion=1e40,momentRotationLaw=True,label='cylindermat'))
Ne=30
dy=0.03
dx=0.2
dz=0.2
Nc=1 #nb. of additional chains
for j in range(-Nc, Nc+1):
	dyj = abs(float(j))*dy
	dxj = abs(float(j))*dx
	dzj = float(j)*dz
	for i in range(0, Ne):
		omega=20/float(Ne); hy=0.0; hz=0.05; hx=1.5;
		px=float(i)*hx/float(Ne)-0.8+dxj; py=sin(float(i)*omega)*hy+dyj; pz=cos(float(i)*omega)*hz+dzj;
		px2=float(i+1.)*hx/float(Ne)-0.8+dxj; py2=sin(float(i+1.)*omega)*hy+dyj; pz2=cos(float(i+1.)*omega)*hz+dzj;
		utils.chainedCylinder(begin=Vector3(pz,py,px), radius=0.02,end=Vector3(pz2,py2,px2),color=Vector3(0.6,0.5,0.5),material='cylindermat')
		if (i == Ne-1): #close the chain with a node of size 0
			print "closing chain"
			b=utils.chainedCylinder(begin=Vector3(pz2,py2,px2), radius=0.02,end=Vector3(pz2,py2,px2),color=Vector3(0.6,0.5,0.5),material='cylindermat')
			b.state.blockedDOFs=['x','y','z','rx','ry','rz']
	ChainedState.currentChain=ChainedState.currentChain+1

O.saveTmp()