← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 1780: 1. Set timeout on infosocket

 

------------------------------------------------------------
revno: 1780
committer: Václav Šmilauer <vaclav@flux>
branch nick: trunk
timestamp: Wed 2009-11-04 22:54:10 +0100
message:
  1. Set timeout on infosocket
  2. Add velocity bins to uniax.py example
modified:
  examples/concrete/uniax.py
  gui/py/yade-multi


--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription.
=== modified file 'examples/concrete/uniax.py'
--- examples/concrete/uniax.py	2009-10-11 11:45:19 +0000
+++ examples/concrete/uniax.py	2009-11-04 21:54:10 +0000
@@ -80,7 +80,7 @@
 O.engines=[
 	BexResetter(),
 	BoundingVolumeMetaEngine([InteractingSphere2AABB(aabbEnlargeFactor=intRadius,label='is2aabb'),MetaInteractingGeometry2AABB()]),
-	InsertionSortCollider(),
+	InsertionSortCollider(sweepLength=.05*sphereRadius,nBins=5,binCoeff=5),
 	InteractionDispatchers(
 		[ef2_Sphere_Sphere_Dem3DofGeom(distFactor=intRadius,label='ss2d3dg')],
 		[Ip2_CpmMat_CpmMat_CpmPhys(sigmaT=sigmaT,relDuctility=relDuctility,epsCrackOnset=epsCrackOnset,G_over_E=G_over_E,isoPrestress=isoPrestress)],

=== modified file 'gui/py/yade-multi'
--- gui/py/yade-multi	2009-10-21 15:22:14 +0000
+++ gui/py/yade-multi	2009-11-04 21:54:10 +0000
@@ -34,10 +34,15 @@
 			return None
 		import socket,pickle
 		s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
+		s.settimeout(2)
 		s.connect(self.infoSocket)
-		data=s.recv(2048)
-		s.close()
-		return pickle.loads(data)
+		try:
+			data=s.recv(2048)
+			s.close()
+			return pickle.loads(data)
+		except socket.timeout:
+			s.close()
+			return None
 
 	def htmlStats(self):
 		ret='<tr>'
@@ -55,7 +60,7 @@
 			ret+='<br/><nobr>%d bodies</nobr><br/><nobr>%d intrs</nobr>'%(info['numBodies'],info['numIntrs'])
 			ret+='</td>'
 		else:
-			ret+='<td> </td>'
+			ret+='<td> (no info) </td>'
 		ret+='<td>%d</td>'%self.nSlots
 		ret+='<td>%s</td>'%self.command
 		ret+='</tr>'