← Back to team overview

yade-users team mailing list archive

Re: [Question #688837]: calculate the mass of the particles

 

Question #688837 on Yade changed:
https://answers.launchpad.net/yade/+question/688837

    Status: Answered => Open

Estefany Carmona Alvarez is still having a problem:
Jan !! Help...

It seemed an easy function to use, but despite defining the function
that stops the simulation in relation to the reduction of force, the
simulation continues without showing me the results.

I included the following code in the simulation


####
O.engines=[
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb(),
				Bo1_Facet_Aabb(),
				Bo1_Cylinder_Aabb(),
				Bo1_Wall_Aabb()
	]),
	InteractionLoop(
		# handle sphere+sphere and facet+sphere collisions
		[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()],
		[Ip2_FrictMat_FrictMat_FrictPhys()],
		[Law2_ScGeom_FrictPhys_CundallStrack()]
	),
	#GravityEngine(gravity=(0,0,-9.81)),	
	NewtonIntegrator(gravity=(0,0,-9.81),damping=0.4),
	PyRunner(command="checkUnbalanced()"),
	PyRunner(command='isBodyInCylinder()'),
	PyRunner(command='masses()')
]
O.dt=PWaveTimeStep()

def checkUnbalanced():
	if unbalancedForce<0.05: O.pause()


def isBodyInCylinder(body,center,radius):

	d=body.state.pos-center
	d[2]=0
	distance=d.norm()
	return distance<radius


def masses():
	mass1=mass2=0.0
	center1=(xp1,yp1,0)
	center2=(-xp2,yp2,0)
	for b in O.bodies:
		print(mass1,mass2)
		if not isinstance(b.shape,Sphere): continue
		if isBodyInCylinder(b,center1,radius):
			mass1+=b.state.mass
		if isBodyInCylinder(b,center2,radius):
			mass2+=b.state.mass
		return mass1,mass2

###
According to what I understand, this function causes the simulation to stop when the equilibrium force of the particles is less than 0.05, but although the particles visually no longer interact, the simulation continues and in the script there is no result of mass.

Thanks for the documents, they were very necessary ... I hope that with
the development of this project I can contribute something very
interesting to the Yade community ...

It seems easy to use this software, but it has become an excellent
professional challenge ...


thanks Jan!

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.