Re: [Yade-users] [Question #697523]: When adding O.wait(), the graphical interface is black
Question #697523 on Yade changed: https://answers.launchpad.net/yade/+question/697523 Jan Stránský posted a new comment: Both approaches (schreenshot x vtk/paraview) have pros and cons. E.g. Some visualizations are easier in Yade (e.g. bounding boxes). I **personally** prefer the approach to save data and postprocess them separately*, just because if you want something else from the data, you can easily adjust it. Or e.g. just different view angle. With a screenshot, this is not possible. *separately does not necessarily mean not Yade. You can O.save your simulation and then do the screenshot in Yade. Or export.text() particles, ymport.text them and screenshot. Cheers Jan -- 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
[Yade-users] [Question #697526]: CHOLMOD warning: matrix not positive definite
New question #697526 on Yade: https://answers.launchpad.net/yade/+question/697526 Hello, I reinstalled Yade from the source code,the version is yade-2021-06-08.git-4852d56, and the version of Ubuntu is 18.04. I tried to delete the particles. There is no problem with the FlowEngine, but the PeriodicFlowEngine will give the following warning. CHOLMOD warning: matrix not positive definite. file: ../Supernodal/t_cholmod_super_numeric.c line: 911 something went wrong in Cholesky factorization, use LDLt as fallback this time1 Does it matter to the simulation? Here is my code: ##__ First section, generate sample_ from __future__ import print_function from yade import pack, qt, plot from math import * nRead=readParamsFromTable( ## model parameters num_spheres=1000, targetPorosity= .4, confiningPressure=-10, ## material parameters compFricDegree=15,#contact friction during the confining phase finalFricDegree=30,#contact friction during the deviatoric loading young=2e8, poisson=.2, density=2600, alphaKr=7.5, alphaKtw=0, competaRoll=.22, finaletaRoll=.22, etaTwist=0, normalCohesion=0, shearCohesion=0, ## fluid parameters fluidDensity=1000, dynamicViscosity=.001, ## control parameters damp=0, stabilityThreshold=.001, ## output specifications filename='suffusion', unknowOk=True ) from yade.params.table import * O.periodic=True O.cell.hSize=Matrix3(1,0,0, 0,1,0, 0,0,1) # create materials for spheres #shear strength is the sum of friction and adhesion, so the momentRotationLaw=True O.materials.append(CohFrictMat(alphaKr=alphaKr,alphaKtw=alphaKtw,density=density,etaRoll=competaRoll,etaTwist=etaTwist,frictionAngle=radians(compFricDegree),momentRotationLaw=True,normalCohesion=normalCohesion,poisson=poisson,shearCohesion=shearCohesion,young=young,label='spheres')) # generate particles packing sp=pack.SpherePack() sp.makeCloud((0,0,0),(1,1,1),-1,0.,num_spheres,False, 0.95,seed=1) sp.toSimulation(material='spheres') O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom6D()], [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label='contact',setCohesionNow=False,setCohesionOnNewContacts=False)], [Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,always_use_moment_law=True)], ), PeriodicFlowEngine(dead=1,label="flow"),#introduced as a dead engine for the moment, see 2nd section GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8), PeriTriaxController(label='triax', # specify target values and whether they are strains or stresses goal=(confiningPressure,confiningPressure,confiningPressure), stressMask=7, # type of servo-control, the strain rate isn't determined, it shloud check the unbalanced force dynCell=True,maxStrainRate=(10,10,10), # wait until the unbalanced force goes below this value maxUnbalanced=stabilityThreshold,relStressTol=1e-3, doneHook='compactionFinished()' ), NewtonIntegrator(damping=0) ] import sys def compactionFinished(): # after sample preparation, save the state O.save('compactedState'+filename+'.yade.gz') print('Compacted state saved', 'porosity', porosity()) # next time, called python command triax.doneHook='' O.pause() O.run() O.wait() #B. Activate flow engine and set boundary conditions in order to get permeability flow.dead=0 flow.defTolerance=-1 flow.meshUpdateInterval=-1 flow.useSolver=3 flow.permeabilityFactor=1 flow.viscosity=10 flow.bndCondIsPressure=[0,0,1,1,0,0] flow.bndCondValue=[0,0,1,0,0,0] flow.boundaryUseMaxMin=[0,0,0,0,0,0] O.run(1,1) csdList=flow.getConstrictionsFull() print(len(O.bodies),len(csdList),'finished') flow.dead=1 print(O.bodies[10].shape.radius) for i in range(10,50): O.bodies.erase(i) print(len(O.bodies)) O.run(1000,True) flow.dead=0 flow.updateTriangulation=True O.run(1,1) csdList1=flow.getConstrictionsFull() print(len(csdList1)) -- 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
[Yade-users] [Question #697524]: When I run my code, MatplotlibDeprecationWarning appears
New question #697524 on Yade: https://answers.launchpad.net/yade/+question/697524 When I run my code, the following warning appears: /usr/lib/python3/dist-packages/matplotlib/__init__.py:831: MatplotlibDeprecationWarning: axes.color_cycle is deprecated and replaced with axes.prop_cycle; please use the latter. mplDeprecation) /usr/lib/python3/dist-packages/matplotlib/__init__.py:801: MatplotlibDeprecationWarning: axes.color_cycle is deprecated and replaced with axes.prop_cycle; please use the latter. mplDeprecation) Why does this happen? Here is my code: ##__ First section, generate sample_ from __future__ import print_function from yade import pack, qt, plot from math import * nRead=readParamsFromTable( ## model parameters num_spheres=100, targetPorosity= .387, confiningPressure=-10, ## material parameters compFricDegree=15,#contact friction during the confining phase finalFricDegree=30,#contact friction during the deviatoric loading young=2e8, poisson=.2, density=2600, alphaKr=7.5, alphaKtw=0, competaRoll=.22, finaletaRoll=.22, etaTwist=0, normalCohesion=0, shearCohesion=0, ## fluid parameters fluidDensity=1000, dynamicViscosity=.001, ## control parameters damp=0, stabilityThreshold=.001, ## output specifications filename='suffusion', unknowOk=True ) from yade.params.table import * O.periodic=True O.cell.hSize=Matrix3(.001,0,0, 0,.001,0, 0,0,.001) # create materials for spheres #shear strength is the sum of friction and adhesion, so the momentRotationLaw=True O.materials.append(CohFrictMat(alphaKr=alphaKr,alphaKtw=alphaKtw,density=density,etaRoll=competaRoll,etaTwist=etaTwist,frictionAngle=radians(compFricDegree),momentRotationLaw=True,normalCohesion=normalCohesion,poisson=poisson,shearCohesion=shearCohesion,young=young,label='spheres')) # generate particles packing sp=pack.SpherePack() sp.makeCloud((0,0,0),(.001,.001,.001),psdSizes=[0.8,0.000125,0.0001592,0.0002003,0.0003153,0.000399,0.000502,0.0005743],psdCumm=[0.0,0.00628,0.0565,0.198,0.721,0.915,0.991,1.0],num=num_spheres,seed=1) sp.toSimulation(material='spheres') O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom6D()], [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label='contact',setCohesionNow=False,setCohesionOnNewContacts=False)], [Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,always_use_moment_law=True)], ), PeriodicFlowEngine(dead=1,label="flow"),#introduced as a dead engine for the moment, see 2nd section GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8), PeriTriaxController(label='triax', # specify target values and whether they are strains or stresses goal=(confiningPressure,confiningPressure,confiningPressure), stressMask=7, # type of servo-control, the strain rate isn't determined, it shloud check the unbalanced force dynCell=True,maxStrainRate=(10,10,10), # wait until the unbalanced force goes below this value maxUnbalanced=stabilityThreshold,relStressTol=1e-3, doneHook='compactionFinished()' ), NewtonIntegrator(damping=0) ] qt.View() # enable energy tracking in the code O.trackEnergy=True # define function to record history def history(): plot.addData(unbalanced=unbalancedForce(),i=O.iter,exx=-triax.strain[0], eyy=-triax.strain[1], ezz=-triax.strain[2], sxx=-triax.stress[0],syy=-triax.stress[1],szz=-triax.stress[2], ev=-triax.strain[0]-triax.strain[1]-triax.strain[2], porosity=porosity(),Etot=O.energy.total(),**O.energy# save all available energy data ) O.engines=O.engines+[PyRunner(command='history()', iterPeriod=20)] # define what to plot plot.plots={'i':('unbalanced','porosity'),'i ':('sxx','syy','szz'),' i':('exx','eyy','ezz'),' i ':('Etot')} plot.live=True plot.setLiveForceAlwaysUpdate(True) # show the plot plot.plot() import sys def compactionFinished(): #check the current porosity # if the current porosity is lager than target Porosity and comFricDegree is lager than 10, # then we decrease friction value and apply it to all the bodies and contacts, # else we decrease rolling friction value. global compFricDegree, competaRoll if porosity()>targetPorosity and compFricDegree>5: # we decrease friction value and apply it to all the bodies and contacts compFricDegree=0.95*compFricDegree setContactFriction(radians(compFricDegree)) print('Friction:', compFricDegree,'porosity:', porosity()) # python syntax, make each step printout
Re: [Yade-users] [Question #697523]: When adding O.wait(), the graphical interface is black
Question #697523 on Yade changed: https://answers.launchpad.net/yade/+question/697523 Status: Answered => Solved Zhicheng Gao confirmed that the question is solved: Thanks, Jan. I just want to make a video about the process by capturing screen output. According to your answer, I will change my way and use the VTKRecorder for visualization. -- 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 #697523]: When adding O.wait(), the graphical interface is black
Question #697523 on Yade changed: https://answers.launchpad.net/yade/+question/697523 Status: Open => Answered Jan Stránský proposed the following answer: Hello, black GUI while O.wait-ing is currently expected behavior. Maybe it could be changed (??). I see a few scenarios how to use "GUI", depending why you want/need GUI and O.wait at the same time. Why you want/need GUI and O.wait at the same time? Just "it would be nice to see the progress"? Or "some visual condition is needed for the rest of the simulation"? Or ... ? a) To use the GUI interactively, do not use O.wait() and run your script "interactively", too: - O.run() from command line or "play button" in GUI - "the later Python code" can be run from command line. E.g. it can be put into functions and you run only these few functions in the command line b) Use O.wait, but periodically save the state/some data and view the simulation in separate Yade run/in Paraview/... > Another question, ... Please, open another question for another question [1] 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 #697313]: Facing problem in stabilizing the DEM simulation sample when using Hertz-mindlin contact model
Question #697313 on Yade changed: https://answers.launchpad.net/yade/+question/697313 Jan Stránský posted a new comment: Hello, > I am facing problem please be more specific [1]. Do you get errors? Does it take too much time? The target cannot be reached? ... ? > when I am using Hertz-mindlin contact model with other model(s) it is ok or not? (like why you mention explicitly "using Hertz-Mindlin model"). > Please run the code please describe the problem such that running the code is not the primary source of information [1]. 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 #697313]: Facing problem in stabilizing the DEM simulation sample when using Hertz-mindlin contact model
Question #697313 on Yade changed: https://answers.launchpad.net/yade/+question/697313 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
[Yade-users] [Question #697523]: When adding O.wait(), the graphical interface is black
New question #697523 on Yade: https://answers.launchpad.net/yade/+question/697523 I set a target porosity as a stop criterion and used O.run() to run simulation. In order to avoid the influence of the later Python code, I added O.wait(). However, after adding this command, the graphical interface will be black until it reaches the stop criterion. Is there any way to make the graphical interface display graphics. Another question, when I run my code, the following warning appears: /usr/lib/python3/dist-packages/matplotlib/__init__.py:831: MatplotlibDeprecationWarning: axes.color_cycle is deprecated and replaced with axes.prop_cycle; please use the latter. mplDeprecation) /usr/lib/python3/dist-packages/matplotlib/__init__.py:801: MatplotlibDeprecationWarning: axes.color_cycle is deprecated and replaced with axes.prop_cycle; please use the latter. mplDeprecation) Why does this happen? Here is my code: ##__ First section, generate sample_ from __future__ import print_function from yade import pack, qt, plot from math import * nRead=readParamsFromTable( ## model parameters num_spheres=100, targetPorosity= .387, confiningPressure=-10, ## material parameters compFricDegree=15,#contact friction during the confining phase finalFricDegree=30,#contact friction during the deviatoric loading young=2e8, poisson=.2, density=2600, alphaKr=7.5, alphaKtw=0, competaRoll=.22, finaletaRoll=.22, etaTwist=0, normalCohesion=0, shearCohesion=0, ## fluid parameters fluidDensity=1000, dynamicViscosity=.001, ## control parameters damp=0, stabilityThreshold=.001, ## output specifications filename='suffusion', unknowOk=True ) from yade.params.table import * O.periodic=True O.cell.hSize=Matrix3(.001,0,0, 0,.001,0, 0,0,.001) # create materials for spheres #shear strength is the sum of friction and adhesion, so the momentRotationLaw=True O.materials.append(CohFrictMat(alphaKr=alphaKr,alphaKtw=alphaKtw,density=density,etaRoll=competaRoll,etaTwist=etaTwist,frictionAngle=radians(compFricDegree),momentRotationLaw=True,normalCohesion=normalCohesion,poisson=poisson,shearCohesion=shearCohesion,young=young,label='spheres')) # generate particles packing sp=pack.SpherePack() sp.makeCloud((0,0,0),(.001,.001,.001),psdSizes=[0.8,0.000125,0.0001592,0.0002003,0.0003153,0.000399,0.000502,0.0005743],psdCumm=[0.0,0.00628,0.0565,0.198,0.721,0.915,0.991,1.0],num=num_spheres,seed=1) sp.toSimulation(material='spheres') O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom6D()], [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label='contact',setCohesionNow=False,setCohesionOnNewContacts=False)], [Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,always_use_moment_law=True)], ), PeriodicFlowEngine(dead=1,label="flow"),#introduced as a dead engine for the moment, see 2nd section GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8), PeriTriaxController(label='triax', # specify target values and whether they are strains or stresses goal=(confiningPressure,confiningPressure,confiningPressure), stressMask=7, # type of servo-control, the strain rate isn't determined, it shloud check the unbalanced force dynCell=True,maxStrainRate=(10,10,10), # wait until the unbalanced force goes below this value maxUnbalanced=stabilityThreshold,relStressTol=1e-3, doneHook='compactionFinished()' ), NewtonIntegrator(damping=0) ] qt.View() # enable energy tracking in the code O.trackEnergy=True # define function to record history def history(): plot.addData(unbalanced=unbalancedForce(),i=O.iter,exx=-triax.strain[0], eyy=-triax.strain[1], ezz=-triax.strain[2], sxx=-triax.stress[0],syy=-triax.stress[1],szz=-triax.stress[2], ev=-triax.strain[0]-triax.strain[1]-triax.strain[2], porosity=porosity(),Etot=O.energy.total(),**O.energy# save all available energy data ) O.engines=O.engines+[PyRunner(command='history()', iterPeriod=20)] # define what to plot plot.plots={'i':('unbalanced','porosity'),'i ':('sxx','syy','szz'),' i':('exx','eyy','ezz'),' i ':('Etot')} plot.live=True plot.setLiveForceAlwaysUpdate(True) # show the plot plot.plot() import sys def compactionFinished(): #check the current porosity # if the current porosity is lager than target Porosity and comFricDegree is lager than 10, # then we decrease friction value and apply it to all the bodies and contacts, # else we decrease rolling friction value. global compFricDegree,
Re: [Yade-users] [Question #697433]: Instantiating a new FlowEngine after removing does not work
Question #697433 on Yade changed: https://answers.launchpad.net/yade/+question/697433 Status: Solved => Open Zhicheng Gao is still having a problem: Dear Robert, I reinstalled Yade from the source code,the version is yade-2021-06-08.git-4852d56, and the version of Ubuntu is 18.04.I tried to delete the particles. There is no problem for the FlowEngine, but the PeriodicFlowEngine will give the following warning. CHOLMOD warning: matrix not positive definite. file: ../Supernodal/t_cholmod_super_numeric.c line: 911 something went wrong in Cholesky factorization, use LDLt as fallback this time1 Does it matter to the simulation? Here is my code: ##__ First section, generate sample_ from __future__ import print_function from yade import pack, qt, plot from math import * nRead=readParamsFromTable( ## model parameters num_spheres=1000, targetPorosity= .4, confiningPressure=-10, ## material parameters compFricDegree=15,#contact friction during the confining phase finalFricDegree=30,#contact friction during the deviatoric loading young=2e8, poisson=.2, density=2600, alphaKr=7.5, alphaKtw=0, competaRoll=.22, finaletaRoll=.22, etaTwist=0, normalCohesion=0, shearCohesion=0, ## fluid parameters fluidDensity=1000, dynamicViscosity=.001, ## control parameters damp=0, stabilityThreshold=.001, ## output specifications filename='suffusion', unknowOk=True ) from yade.params.table import * O.periodic=True O.cell.hSize=Matrix3(1,0,0, 0,1,0, 0,0,1) # create materials for spheres #shear strength is the sum of friction and adhesion, so the momentRotationLaw=True O.materials.append(CohFrictMat(alphaKr=alphaKr,alphaKtw=alphaKtw,density=density,etaRoll=competaRoll,etaTwist=etaTwist,frictionAngle=radians(compFricDegree),momentRotationLaw=True,normalCohesion=normalCohesion,poisson=poisson,shearCohesion=shearCohesion,young=young,label='spheres')) # generate particles packing sp=pack.SpherePack() sp.makeCloud((0,0,0),(1,1,1),-1,0.,num_spheres,False, 0.95,seed=1) sp.toSimulation(material='spheres') O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom6D()], [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label='contact',setCohesionNow=False,setCohesionOnNewContacts=False)], [Law2_ScGeom6D_CohFrictPhys_CohesionMoment(useIncrementalForm=True,always_use_moment_law=True)], ), PeriodicFlowEngine(dead=1,label="flow"),#introduced as a dead engine for the moment, see 2nd section GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8), PeriTriaxController(label='triax', # specify target values and whether they are strains or stresses goal=(confiningPressure,confiningPressure,confiningPressure), stressMask=7, # type of servo-control, the strain rate isn't determined, it shloud check the unbalanced force dynCell=True,maxStrainRate=(10,10,10), # wait until the unbalanced force goes below this value maxUnbalanced=stabilityThreshold,relStressTol=1e-3, doneHook='compactionFinished()' ), NewtonIntegrator(damping=0) ] import sys def compactionFinished(): # after sample preparation, save the state O.save('compactedState'+filename+'.yade.gz') print('Compacted state saved', 'porosity', porosity()) # next time, called python command triax.doneHook='' O.pause() O.run() O.wait() #B. Activate flow engine and set boundary conditions in order to get permeability flow.dead=0 flow.defTolerance=-1 flow.meshUpdateInterval=-1 flow.useSolver=3 flow.permeabilityFactor=1 flow.viscosity=10 flow.bndCondIsPressure=[0,0,1,1,0,0] flow.bndCondValue=[0,0,1,0,0,0] flow.boundaryUseMaxMin=[0,0,0,0,0,0] O.run(1,1) csdList=flow.getConstrictionsFull() print(len(O.bodies),len(csdList),'finished') flow.dead=1 print(O.bodies[10].shape.radius) for i in range(10,50): O.bodies.erase(i) print(len(O.bodies)) O.run(1000,True) flow.dead=0 flow.updateTriangulation=True O.run(1,1) csdList1=flow.getConstrictionsFull() print(len(csdList1)) -- 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