Re: [Yade-users] [Question #701731]: ValueError: cannot convert float to integer
Question #701731 on Yade changed: https://answers.launchpad.net/yade/+question/701731 Status: Open => Expired Launchpad Janitor expired the question: This question was expired because it remained in the 'Open' state without activity for the last 15 days. -- You received this question notification because your team yade-users is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #701731]: ValueError: cannot convert float to integer
Question #701731 on Yade changed: https://answers.launchpad.net/yade/+question/701731 Status: Needs information => Open enki gave more information on the question: Thanks Jan, >> I have edited my question format with complete error message. >> I run code line: "yade filename.py" directly in the terminal, the 3D view has nothing, the terminal shows the ValueError I mentioned above... -- You received this question notification because your team yade-users is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #701731]: ValueError: cannot convert float to integer
Question #701731 on Yade changed: https://answers.launchpad.net/yade/+question/701731 Description changed to: Hi all, I'm working on my cylinder particle case, however, when I start running my script below, the script points out a ValueError: cannot convert float Nan to integer ** Complete error message ** VaueError Traceback (most recent call last) /usr/lib/x86_64-linux-gnu/yade/py/yade/__init__.py in refreshValues(self) self.iterLabel.setText('#%ld / %ld, %.1f/s %s'% (O.iter,stopAtIter,self.iterPerSec,subStepInfor)) if t!=float('inf'): s=int(t); ms=int(t*1000)%1000; us=int(t*100)%1000; ns=int(t*10)%1000 self.virtTimeLabel.setText(u'%03ds%03dm%03d%03dn'%(s,ms,us,ns)) else: self.virtTimeLabel.setText(u'[]?!') ValueError" cannot convert float NaN to integer *: Terminal shows this error multiple times * May someone have experience for this error? ### Scripts ### from __future__ import print_function from yade.gridpfacet import * from yade import pack, plot,qt import gts, os.path, locale from numpy import arange O.periodic=True Parameters # radius of cylinder cyl_R=0.1 # length of cylinder cyl_L=0.2 # friction angle phi=30.0 # Young's modulus E=1e6 idSteel=O.materials.append(FrictMat(young=210e9,poisson=.25,frictionAngle=.8,density=7.85e3,label='steel')) # wallMask=31 >> +/-x, +/-y, -z #O.bodies.append(geom.facetBox((0,0,0),(2.5,2.5,1),wallMask=63,material="steel" )) ## create walls walls=aabbWalls([(0,0,0),(5,5,2)],thickness=0.0,material='steel') wallIds=O.bodies.append(walls) ### periodic boundary for facetBox ### #O.cell.setBox(2.5,20.0,20.0) ### set the velocity for facet ### #for id in range(6): #b = O.bodies[id] #b.state.vel = (0,0,0.5) ### create materials ### # gridConnections material gridConMat= O.materials.append(CohFrictMat(young=E, poisson=0.5, density=1500, frictionAngle=radians(phi), normalCohesion=1e10, shearCohesion=1e10, momentRotationLaw=True, label='gcMat')) # general interactions cylMat= O.materials.append(FrictMat(young=E, poisson=0.5, density=1500, frictionAngle=radians(phi), label='cMat')) ### create particles/packing: cylinders ### nodesIds=[] cylIds=[] dx=0.5 dy=0.5 nx=5 ny=5 nz=1 dz=0 for i in range(0,nx): x=0+i*dx for j in range(0,ny): y=0+j*dy for k in range(0,nz): z=0+k*dz cylinder((x,y+cyl_L,z),(x,y,z),radius=cyl_R,nodesIds=nodesIds,cylIds=cylIds, color=[1,0,0],fixed=False,intMaterial='gcMat',extMaterial='cMat') #O.bodies.appendClumped() move = TranslationEngine(translationAxis=[0,0,1],velocity=0.1,ids=[0,1]) ### Engines ### O.engines = [ ForceResetter(), InsertionSortCollider([Bo1_GridConnection_Aabb(),Bo1_PFacet_Aabb(), Bo1_Wall_Aabb()]), InteractionLoop([ Ig2_GridNode_GridNode_GridNodeGeom6D(), Ig2_GridConnection_GridConnection_GridCoGridCoGeom(), Ig2_Wall_Sphere_ScGeom(), Ig2_Sphere_Sphere_ScGeom(), Ig2_Sphere_GridConnection_ScGridCoGeom(), Ig2_GridConnection_PFacet_ScGeom(), ], [ # internal cylinder physics Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False), # physics for external interactions, i.e., cylinder-cylinder Ip2_FrictMat_FrictMat_FrictPhys() ], [ Law2_ScGeom6D_CohFrictPhys_CohesionMoment(), # contact law for "internal" cylinder forces Law2_GridCoGridCoGeom_FrictPhys_CundallStrack(), # contact law for cylinder-cylinder interaction Law2_ScGeom_FrictPhys_CundallStrack(), Law2_ScGridCoGeom_FrictPhys_CundallStrack() ] ), GlobalStiffnessTimeStepper(timestepSafetyCoefficient=0.5), NewtonIntegrator(gravity=(0., 0., -9.81), damping=0.5, label='newton'), move #TranslationEngine(translationAxis=[1,0,0],velocity=0.5,ids=[0,1,2,3,4,5]) #PyRunner(iterPeriod=1e-3,command="") ] O.dt=0.5*PWaveTimeStep() For viewing qt.View() Allows to reload the simulation O.saveTmp() -- You received
Re: [Yade-users] [Question #701731]: ValueError: cannot convert float to integer
Question #701731 on Yade changed: https://answers.launchpad.net/yade/+question/701731 Status: Open => Needs information Jan Stránský requested more information: Hello, please read [1] when it is finally working. > Additionally ... please open separate questions for separate problems ([1], point 5). According to the title, I would stick here to the error and open a new question for cylinder enlarging, a new question for yellow box and a new question for not displayed walls (well, the last two may be joined as they really are related. But e.g. the error has nothing to do with yellow box etc.) Also note that the attached script should be a MWE ([1], point 3), so e.g. for not displayed walls, cylinders and most of the code is irrelevant and a MWE for the not displayed walls should focus only on walls. (this way, often you can find the answer yourself). > the script points out a ValueError: cannot convert float Nan to integer when you get en error, please post **complete** error message ([1], point 2). Usually there is also the specific line which is very useful. > when I start running my script Also please provide information about your OS and Yade version ([1], point 4) and how you run it. I used recent yadedaily (20220504-6539~3497d6b~jammy1), run 100 iterations of your script without any error. Cheers Jan [1] https://www.yade-dem.org/wiki/Howtoask -- You received this question notification because your team yade-users is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #701731]: ValueError: cannot convert float to integer
Question #701731 on Yade changed: https://answers.launchpad.net/yade/+question/701731 Description changed to: Hi all, I'm working on my cylinder particle case, however, when I start running my script below, the cylinder particles are segmented and the whole cylinder particle extends over time. I do not know why... Additionally, the script points out a ValueError: cannot convert float Nan to integer After I create the walls via aabbWalls(), only 3 walls are shown in the 3D view, why is it not showing all 6 walls? Finally, I checked my script and there is no code to create the yellow box shown in the 3D view... So, why the 3D view show this yellow Box? May someone have experience for this error? ### Scripts ### from __future__ import print_function from yade.gridpfacet import * from yade import pack, plot,qt import gts, os.path, locale from numpy import arange O.periodic=True Parameters # radius of cylinder cyl_R=0.1 # length of cylinder cyl_L=0.2 # friction angle phi=30.0 # Young's modulus E=1e6 idSteel=O.materials.append(FrictMat(young=210e9,poisson=.25,frictionAngle=.8,density=7.85e3,label='steel')) # wallMask=31 >> +/-x, +/-y, -z #O.bodies.append(geom.facetBox((0,0,0),(2.5,2.5,1),wallMask=63,material="steel" )) ## create walls walls=aabbWalls([(0,0,0),(5,5,2)],thickness=0.0,material='steel') wallIds=O.bodies.append(walls) ### periodic boundary for facetBox ### #O.cell.setBox(2.5,20.0,20.0) ### set the velocity for facet ### #for id in range(6): #b = O.bodies[id] #b.state.vel = (0,0,0.5) ### create materials ### # gridConnections material gridConMat= O.materials.append(CohFrictMat(young=E, poisson=0.5, density=1500, frictionAngle=radians(phi), normalCohesion=1e10, shearCohesion=1e10, momentRotationLaw=True, label='gcMat')) # general interactions cylMat= O.materials.append(FrictMat(young=E, poisson=0.5, density=1500, frictionAngle=radians(phi), label='cMat')) ### create particles/packing: cylinders ### nodesIds=[] cylIds=[] dx=0.5 dy=0.5 nx=5 ny=5 nz=1 dz=0 for i in range(0,nx): x=0+i*dx for j in range(0,ny): y=0+j*dy for k in range(0,nz): z=0+k*dz cylinder((x,y+cyl_L,z),(x,y,z),radius=cyl_R,nodesIds=nodesIds,cylIds=cylIds, color=[1,0,0],fixed=False,intMaterial='gcMat',extMaterial='cMat') #O.bodies.appendClumped() move = TranslationEngine(translationAxis=[0,0,1],velocity=0.1,ids=[0,1]) ### Engines ### O.engines = [ ForceResetter(), InsertionSortCollider([Bo1_GridConnection_Aabb(),Bo1_PFacet_Aabb(), Bo1_Wall_Aabb()]), InteractionLoop([ Ig2_GridNode_GridNode_GridNodeGeom6D(), Ig2_GridConnection_GridConnection_GridCoGridCoGeom(), Ig2_Wall_Sphere_ScGeom(), Ig2_Sphere_Sphere_ScGeom(), Ig2_Sphere_GridConnection_ScGridCoGeom(), Ig2_GridConnection_PFacet_ScGeom(), ], [ # internal cylinder physics Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False), # physics for external interactions, i.e., cylinder-cylinder Ip2_FrictMat_FrictMat_FrictPhys() ], [ Law2_ScGeom6D_CohFrictPhys_CohesionMoment(), # contact law for "internal" cylinder forces Law2_GridCoGridCoGeom_FrictPhys_CundallStrack(), # contact law for cylinder-cylinder interaction Law2_ScGeom_FrictPhys_CundallStrack(), Law2_ScGridCoGeom_FrictPhys_CundallStrack() ] ), GlobalStiffnessTimeStepper(timestepSafetyCoefficient=0.5), NewtonIntegrator(gravity=(0., 0., -9.81), damping=0.5, label='newton'), move #TranslationEngine(translationAxis=[1,0,0],velocity=0.5,ids=[0,1,2,3,4,5]) #PyRunner(iterPeriod=1e-3,command="") ] O.dt=0.5*PWaveTimeStep() ### Define Functions ### For viewing qt.View() Allows to reload the simulation O.saveTmp() -- You received this question notification because your team yade-users is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp
Re: [Yade-users] [Question #701731]: ValueError: cannot convert float to integer
Question #701731 on Yade changed: https://answers.launchpad.net/yade/+question/701731 Description changed to: Hi all, I'm working on my cylinder particle case, however, when I start running my script below, the cylinder particles are segmented and the whole cylinder particle extends over time. I do not know why... Additionally, the script points out a ValueError: cannot convert float Nan to integer The newest script display nothing when I click the show 3d choice... May someone have experience for this error? ### Scripts ### from __future__ import print_function from yade.gridpfacet import * from yade import pack, plot,qt import gts, os.path, locale from numpy import arange #locale.setlocale(locale.LC_ALL, 'en_US.UTF-8') # Note: gts is locale- dependent. If, for example, german locale is used, gts.read()-function does not import floats normally Parameters # radius of cylinder cyl_R=0.2 # length of cylinder cyl_L=0.1 # friction angle phi=30.0 # Young's modulus E=1e6 idSteel=O.materials.append(FrictMat(young=210e9,poisson=.25,frictionAngle=.8,density=7.85e3,label="steel")) # wallMask=31 >> +/-x, +/-y, -z O.bodies.append(geom.facetBox((0,0,0),(2.5,2.5,1),wallMask=63,material="steel" )) ### periodic boundary for facetBox ### O.periodic=True O.cell.setBox(2.5,20.0,20.0) ### set the velocity for facet ### #for id in range(6): #b = O.bodies[id] #b.state.vel = (0,0,1) ### create materials ### # gridConnections material gridConMat= O.materials.append(CohFrictMat(young=E, poisson=0.5, density=1500, frictionAngle=radians(phi), normalCohesion=1e10, shearCohesion=1e10, momentRotationLaw=True, label='gcMat')) # general interactions cylMat= O.materials.append(FrictMat(young=E, poisson=0.5, density=1500, frictionAngle=radians(phi), label='cMat')) ### create particles/packing: cylinders ### nodesIds=[] cylIds=[] dx=0.5 dy=0.5 nx=5 ny=5 nz=1 dz=0 for i in range(0,nx): x=0+i*dx for j in range(0,ny): y=0+j*dy for k in range(0,nz): z=0+k*dz cylinder((x,y+cyl_L,z),(x,y,z),radius=cyl_R,nodesIds=nodesIds,cylIds=cylIds, color=[1,0,0],fixed=False,intMaterial='gcMat',extMaterial='cMat') move = TranslationEngine(translationAxis=[1,0,0],velocity=0.5,ids=[0,1,2,3,4,5]) ### Engines ### O.engines = [ ForceResetter(), InsertionSortCollider([Bo1_GridConnection_Aabb(),Bo1_PFacet_Aabb(), Bo1_Wall_Aabb()]), InteractionLoop([ Ig2_GridNode_GridNode_GridNodeGeom6D(), Ig2_GridConnection_GridConnection_GridCoGridCoGeom(), Ig2_Wall_Sphere_ScGeom(), Ig2_Sphere_Sphere_ScGeom(), Ig2_Sphere_GridConnection_ScGridCoGeom(), Ig2_GridConnection_PFacet_ScGeom(), ], [ # internal cylinder physics Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False), # physics for external interactions, i.e., cylinder-cylinder Ip2_FrictMat_FrictMat_FrictPhys() ], [ Law2_ScGeom6D_CohFrictPhys_CohesionMoment(), # contact law for "internal" cylinder forces Law2_GridCoGridCoGeom_FrictPhys_CundallStrack(), # contact law for cylinder-cylinder interaction Law2_ScGeom_FrictPhys_CundallStrack(), Law2_ScGridCoGeom_FrictPhys_CundallStrack() ] ), GlobalStiffnessTimeStepper(timestepSafetyCoefficient=0.5), NewtonIntegrator(gravity=(0., 0, -9.81), damping=0.5, label='newton'), move #TranslationEngine(translationAxis=[1,0,0],velocity=0.5,ids=[0,1,2,3,4,5]) #PyRunner(iterPeriod=1e-3,command="") ] O.dt=1e-06 ### Define Functions ### For viewing qt.View() Allows to reload the simulation O.saveTmp() -- You received this question notification because your team yade-users is an answer contact for Yade. ___ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp