Re: [Yade-users] [Question #705760]: How to get the runtime or CPU time?
Question #705760 on Yade changed: https://answers.launchpad.net/yade/+question/705760 Status: Answered => Solved Danny (Dingeman) van der Haven confirmed that the question is solved: Thank you all! Those suggestions indeed sovled my problem. -- 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 #705760]: How to get the runtime or CPU time?
New question #705760 on Yade: https://answers.launchpad.net/yade/+question/705760 Hi all! I would like to time the running time of the simulation at various stages. With this I mean the CPU time or the actual real-world time it take to run the simulation. I have tried the instructions at https://yade-dem.org/doc/prog.html#timing But I just get a message that yade.timing does not have the attribute 'timing', even after setting O.timingEnabled=True. I really just want to use yade.timing.runtime() and write its output to a file. I don't need a very precise timing or to know how long the engine takes. I just need the current CPU time. Does YADE have this option or do I need to resort to general Python functions? With kind regards, Danny -- 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 #703098]: Trying to pass on property from python to shape
Question #703098 on Yade changed: https://answers.launchpad.net/yade/+question/703098 Danny (Dingeman) van der Haven posted a new comment: I found the problem. I had given a function in YADE_CLASS_BASE_DOC_ATTRS_CTOR_PY() with .def() then same name as one of the properties and that interferred. Renaming the function solved the problem. -- 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 #703098]: Trying to pass on property from python to shape
Question #703098 on Yade changed: https://answers.launchpad.net/yade/+question/703098 Status: Answered => Open Danny (Dingeman) van der Haven is still having a problem: Hi Karol, Thank you for the suggestion. Unfortunately, it didn't work. I should have specified. But I need both properties to be available within a *.cpp file that uses the shape defined in the LevelSet.*pp files. I need to be able to access both properties from the LevelSet shape container of a given body. Basically, the Python function levelSetBody() needs to initialise my two properties for C++ to use. Pretty much in the same way that levelSetBody() does for the variables 'nSurfNodes' and 'nodesPath'. Cheers, Danny -- 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 #703098]: Trying to pass on property from python to shape
New question #703098 on Yade: https://answers.launchpad.net/yade/+question/703098 Hi all, I wasn't sure if it was best to ask this here or on the yade-dev launchpad. Anyway, the problem is the following: I have given my level set particles two additional properties by modifying LevelSet.hpp. I found a way to use these properties to speed up the calculations for the LS-DEM method I'm working on. I now want to be able to define these properties in the input python scripts for YADE. I would like to do this by, for example, saying the following when defining a new level set body: levelSetBody(""superellipsoid", extents=(rMaxVal,rMinVal,rMinVal), epsilons=(0.2,0.2), spacing=0.01, useProperty=True, property=(1,3,3)) Within YADE_CLASS_BASE_DOC_ATTRS_CTOR_PY, I have added: ((bool, useProperty, false,,"Flag whether to use property to speed up calculations.")) ((Vector3r,property,,,"The property to use to speed up calculations.")) Within the file utils.py the function levelSetBody: I added the arguments `useProperty=False,property=Vector3.Zero` to the function Inside the function, I added near the end: b.shape.hasProperty = hasProperty if hasProperty: b.shape.property = property This compiles successfully and runs without any error messages. However, the property turns out not to be defined when I run a simulation. How do I adjust my code such that the properties are correctly forwarded from Python to C++ level? I already looked whether I had to add something in _utils.cpp, but can't find the problem. Kind regards, Danny -- 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 #700213]: PeriTriaxController not initiating next stage
Question #700213 on Yade changed: https://answers.launchpad.net/yade/+question/700213 Danny (Dingeman) van der Haven posted a new comment: I agree, considering unbalancedForce() with fixed particles does not make much sense. There doesn't seem to be an option to disable the maxUnbalanced threshold though. Setting PeriTriaxController.maxUnbalanced() to zero does not appear to disable it. -- 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 #700213]: PeriTriaxController not initiating next stage
Question #700213 on Yade changed: https://answers.launchpad.net/yade/+question/700213 Status: Answered => Open Danny (Dingeman) van der Haven is still having a problem: Hi Jerome and Bruno, Thank you for your replies. I checked and the simulations always reach abs((sigma_ii - goal)/goal) < PeriTriaxController.relStressTol for the z-axis. Because stressMask = 4, only the z-axis stress should matter. On another note, PeriTriaxController.relStressTol does not allow itself to be plotted. However, I can print it and the value it has is as specified in the setup script. I can also create a boolean to check if abs((sigma_ii - goal)/goal) < PeriTriaxController.relStressTol, which becomes true near the end of the defined compression stage. If I do not fix the particles then the simulation reaches unbalanedForce() < PeriTriaxController.maxUnbalanced. The simulation advances to the next stage and completes successfully. However, this is only the case if I set the target stress to -0.8e6 or smaller absolute values. If I set the target stress to -1e6, the simulation stops the compression around sigma_zz = -0.83e6 and does not continue to the next stage but does keep iterating. (The unbalancedForce() is well below the tolerance.) Why does YADE stop the compression and how can we reach higher absolute stress values? If I fix the particles then unbalancedForce() = NaN. The target stress is reached but the simulation does not initiate the decompression stage. Likely, PeriTriaxController cannot evaluate unbalancedForce() < PeriTriaxController.maxUnbalanced due to the NaN value. Is there a way to circumvent this? I would very much like to compare fixed normal particles vs fixed level set particles. I am sure the next stage is not reached in case of fixed particles, because if I replace the next stage with def compactionFinished(): triax.maxUnbalanced = 10 the value of maxUnbalanced in PeriTriaxController (labelled 'triax') has not changed. @Bruno: If I set triax.maxStrainRate=(0,0,0) for any stage, that stage stops progressing at all. Kind regards, Danny -- 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 #700377]: Error upon trying to reach yade-dem.org
Question #700377 on Yade changed: https://answers.launchpad.net/yade/+question/700377 Status: Answered => Solved Danny (Dingeman) van der Haven confirmed that the question is solved: Thank you Karol! I had missed that. I've requested to join yade-users so I won't miss it in the future. Cheers, Danny -- 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 #700377]: Error upon trying to reach yade-dem.org
New question #700377 on Yade: https://answers.launchpad.net/yade/+question/700377 Dear developers, Since last week, whenever I try to load the yade-dem.org website, I get the error: SEC_ERROR_REVOKED_CERTIFICATE. It seems like some security certficiate expired. I can reach the website on the cellular network but my university network only seems to allow secure connections and blocks out yade-dem.org. Previously, I had no problem visiting yade-dem.org. It appears to be an error coming from the website. Please let me know if I am mistaken and the error is in our university system. With kind regards, Danny -- 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 #700308]: Compile 2022.01a against Python 3.10 Failed on Archlinux
Question #700308 on Yade changed: https://answers.launchpad.net/yade/+question/700308 Danny (Dingeman) van der Haven posted a new comment: Dear Kan Su, Currently, I am facing a similar problem trying to install YADE on CentOS 7. Of course, first make sure that you have all required packages installed (as listed on https://yade-dem.org/doc/installation.html). It seems that python has trouble finding a specific component called libboost-python. This is the same issue as I am having. My Anaconda environment has libboost_python.so, as it comes with one of the Boost or Libboost packages by default. I am now trying to figure out where CMake is looking for python libraries, suspecting that it might not see the entire Anaconda environment. (Even though it does see other packages.) Please let me know if you are using Anaconda or not and whether you have libboost_python.so available in your python environment. We might be able to solve the problem faster if we help each other. Kind regards, Danny Side note: I found that if you use the Anaconda environment, there is sometimes a bug preventing you from installing the correct packages because Anaconda incorrectly parses python version 3.10. In this case you should create an Anaconda environment with a lower python version, e.g. 3.9. -- 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 #700213]: PeriTriaxController not initiating next stage
New question #700213 on Yade: https://answers.launchpad.net/yade/+question/700213 Hello, I'm trying to do a uniaxial compression of a periodic box with a 3x3x3 grid of particles. I'm implementing periodic boundary conditions for level-set particles. I had some unexpected results (level set spheres gave a much lower density). Now I want to do a unit test by comparing a very simple simulation using analytical spheres and level-set spheres. Whenever I run the simulation (see code below), the pressure increases to the target pressure properly. However, hereafter the simulation keeps iterating but does not initiate the decompression stage defined by compactionFinished(). I have attempted to change maxUnbalanced and relStressTol to see if the issue is there but had no success. Would any of you happen to know why the next stage is not initiated by PeriTriaxController? With kind regards, Danny ### # encoding: utf-8 from __future__ import print_function sigmaIso = -1e6 ydim = 1.0 xdim = 1.0 zdim = 1.0 r = 1.0/3.0/2.0 #import matplotlib #matplotlib.use('Agg') # generate loose packing from yade import pack, qt, plot O.periodic = True O.bodies.append( [ # In xy-plane sphere(center=(r, r, r), radius=r, fixed=True), sphere(center=(3*r, r, r), radius=r, fixed=True), sphere(center=(5*r, r, r), radius=r, fixed=True), sphere(center=(r, 3*r, r), radius=r, fixed=True), sphere(center=(3*r, 3*r, r), radius=r, fixed=True), sphere(center=(5*r, 3*r, r), radius=r, fixed=True), sphere(center=(r, 5*r, r), radius=r, fixed=True), sphere(center=(3*r, 5*r, r), radius=r, fixed=True), sphere(center=(5*r, 5*r, r), radius=r, fixed=True), # Repeat in z-direction sphere(center=(r, r, 3*r), radius=r, fixed=True), sphere(center=(3*r, r, 3*r), radius=r, fixed=True), sphere(center=(5*r, r, 3*r), radius=r, fixed=True), sphere(center=(r, 3*r, 3*r), radius=r, fixed=True), sphere(center=(3*r, 3*r, 3*r), radius=r, fixed=True), sphere(center=(5*r, 3*r, 3*r), radius=r, fixed=True), sphere(center=(r, 5*r, 3*r), radius=r, fixed=True), sphere(center=(3*r, 5*r, 3*r), radius=r, fixed=True), sphere(center=(5*r, 5*r, 3*r), radius=r, fixed=True), # Repeat in z-direction sphere(center=(r, r, 5*r), radius=r, fixed=True), sphere(center=(3*r, r, 5*r), radius=r, fixed=True), sphere(center=(5*r, r, 5*r), radius=r, fixed=True), sphere(center=(r, 3*r, 5*r), radius=r, fixed=True), sphere(center=(3*r, 3*r, 5*r), radius=r, fixed=True), sphere(center=(5*r, 3*r, 5*r), radius=r, fixed=True), sphere(center=(r, 5*r, 5*r), radius=r, fixed=True), sphere(center=(3*r, 5*r, 5*r), radius=r, fixed=True), sphere(center=(5*r, 5*r, 5*r), radius=r, fixed=True) ] ) O.cell.hSize = Matrix3(xdim, 0.0, 0.0, 0.0, ydim, 0.0, 0.0, 0.0, zdim) O.engines = [ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb()]), InteractionLoop([Ig2_Sphere_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_ScGeom_FrictPhys_CundallStrack()]), PeriTriaxController( label='triax', # specify target values and whether they are strains or stresses goal=(0, 0, sigmaIso), stressMask=4, # type of servo-control dynCell=True, maxStrainRate=(0, 0, 0.005), # wait until the unbalanced force goes below this value maxUnbalanced=.05, relStressTol=1e-4, # call this function when goal is reached and the packing is stable doneHook='compactionFinished()' ), NewtonIntegrator(damping=.2), PyRunner(command='addPlotData()', iterPeriod=100), ] O.dt = .25 * PWaveTimeStep() def compactionFinished(): # set the current cell configuration to be the reference one O.cell.trsf = Matrix3.Identity # change control type: keep constant confinement in x,y, 20% compression in z triax.goal = (0, 0, .2) triax.stressMask = 3 # allow faster deformation along x,y to better maintain stresses triax.maxStrainRate = (0, 0, 0.005) # next time, call triaxFinished instead of compactionFinished triax.doneHook = 'triaxFinished()' # do not wait for stabilization before calling triaxFinished triax.maxUnbalanced = 10 def triaxFinished(): print('Finished') plot.saveDataTxt('res
Re: [Yade-users] [Question #699428]: Cannot simulate periodic box with walls
Question #699428 on Yade changed: https://answers.launchpad.net/yade/+question/699428 Danny (Dingeman) van der Haven confirmed that the question is solved: Thanks Jan Stránský, that solved my question. -- 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 #699428]: Cannot simulate periodic box with walls
Question #699428 on Yade changed: https://answers.launchpad.net/yade/+question/699428 Status: Answered => Solved Danny (Dingeman) van der Haven confirmed that the question is solved: Dear Jan, > depends on what "essential" is. > Also depends on what "some sort" is, because periodic boundary conditions > essentially are "some > sort of wall".. A wall that interacts with the particles like a physical wall is necessary for me to be able to make the comparison I mentioned in the original question. > What is the reason of stress variation? Dynamics? Gravity? Something else? > For "fast" loading yes, the stress waves should not be neglected and "wall" > loading is more realistic. > Contrary, for "slow" loading, this "periodic approach" is actually more > realistic than the loading > induced only by planes (which induce stress waves not present in reality). These are valid concerns / questions. This is why I want to do the comparison between plate compression and periodic compression. I study the compaction of pharmaceutical powders. The speed of the compression can be 0.1 mm/s (quasi-static) but also 950.00 mm/s (dynamic) for tablets with a final thickness of 4.00 mm. Gravity is not a concern, but dynamics and wall interactions are. For slow compression speeds the variation in stress along the compression axis is likely caused by interaction with the side walls. The comparison is mainly to look at the potential differences made by dynamics. > is it still freezing, or just the behavior and results are not as expected? The simulation iterates, but the behaviour is not what I was aiming for. The box stays the same size so the wall do not exert any pressure on the particles. The cell does change. > If you set homoDeform=0, you should not get the "scaling" Thank you, that option indeed disabled the scaling / shifting of particle coordinates. > b.state.blockedDOFs = "xyzXYZ” > b.state.vel = someConstantVel This solved my problem! Thank you! I created a periodic box with an extra long z-axis. Using two box-plates I can then compress the particles in the z-direction using the blockedDOFs and vel options, keeping periodicity in the x and y directions. > basically yes, you can compute stress assuming static equilibrium or you can somehow take into account inertia of the particles. So that means if dynCell = False you assume static equilibrium and if dynCell = True you take into account the inertia? > yes, it seems like a bug I filed an issue report on Gitlab. Kind regards, Danny -- 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 #699428]: Cannot simulate periodic box with walls
Question #699428 on Yade changed: https://answers.launchpad.net/yade/+question/699428 Status: Answered => Open Danny (Dingeman) van der Haven is still having a problem: Dear Jan, Thank you for your answer. Some sort of wall is essential. Correct me if I am wrong, but when the box is changed using PeriTriaxController it seems that all particle coordinates are scaled. This means that stresses will be distributed uniformly. This is not the case in real uniaxial compaction, where the stress varies depending on the height of the slice you are looking at. For this reason, I want to simulate a case where the pressure is increased using plates. Using a box as given in [2] did not work, PeriTriaxController does not scale the inserted box geometry. A hacky alternative that seems to work is to create two thin boxes (one at each end) and use those as plates. However, if I fix these plates and use PeriTriaxController the particle coordinates are still scaled. If I do not fix the plates and give them a velocity then the plates move away. How can I make the box-plates move at a constant speed (irrespective of the other forces on them)? Also, the documentation says the option dynCell determines how the imposed stress is controlled. What is meant with "packing stiffness" and "applying the laws of dynamics"? I assume the latter computers the average forces on the particles and uses that to compute a stress. Please let me know if I should add a bug report on GitLab about the problem with walls and periodic cells. Similarly, if there is a way that I can help improve the documentation on the YADE website, please let me know. I plan on implementing new features in YADE and would like to get involved with the development. With kind regards, Danny -- 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 #699428]: Cannot simulate periodic box with walls
New question #699428 on Yade: https://answers.launchpad.net/yade/+question/699428 Dear YADE users, My goal is to simulate a representative volume element under uniaxial compression. I want to compare two cases: 1) a fully periodic simulation in which the particle coordinates are scaled 2) a simulation in which the particles are compressed by walls at the top and bottom of the box, with periodicity in all other directions. Case 1 is easy to simulate, using tutorial example 06-periodic-triaxial-test.py. To simulate case 2 I used example 06-periodic-triaxial-test.py as a starting point and started integrating elements from 03-oedometric-test.py. I can insert a wall in the periodic box of example 06. However, as soon as I also add the sphere-wall interaction to the collider, the simulation no longer runs. YADE gives no error messages but refuses to iterate past iteration 1. The input script I would like to run is (note that although this script is more complicated, I already run into issues when only adding the wall and sphere-wall interactions to example 06): from __future__ import print_function sigmaIso = -1e5 sigmaMin = -1e3 #import matplotlib #matplotlib.use('Agg') # generate loose packing from yade import pack, qt, plot O.periodic = True sp = pack.SpherePack() # uniform distribution sp.makeCloud((0, 0, 0), (2, 2, 2), rMean=.1, rRelFuzz=.3, periodic=True) # setup periodic boundary, insert the packing sp.toSimulation() O.bodies.append(wall(0.0, axis=2, sense=1)) O.engines = [ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Wall_Aabb()], allowBiggerThanPeriod=True), InteractionLoop([Ig2_Sphere_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_ScGeom_FrictPhys_CundallStrack()]), NewtonIntegrator(damping=.2), PyRunner(command='checkUnbalanced()',realPeriod=2,label='checker') ] O.dt = .25 * PWaveTimeStep() def checkUnbalanced(): if O.iter < 5000: return if unbalancedForce() > 0.1: return O.bodies.append(wall(2.0, axis=2,sense=-1)) global plate plate.state.vel = (0,0,-0.01) O.engines = O.engines + [PyRunner(command='addPlotData()',iterPeriod=200)] checker.command = 'unloadPlate()' def unloadPlate(): if abs(O.forces.f(plate.id)[2]/(2*2)) > abs(sigmaIso): plate.state.vel *= -1 checker.command = 'stopUnloading()' def stopUnloading(): if abs(O.forces.f(plate.id)[2]/(2*2)) < abs(sigmaMin): plot.saveDataTxt(O.tags['d.id']+'.txt') O.pause() def addPlotData(): if not isinstance(O.bodies[-1].shape,Wall): plot.addData() return Fz = O.forces.f(plate.id)[2] plot.addData( unbalanced=unbalancedForce(), i=O.iter, sz=abs(fz)/(2*2), ev=abs(plate.state.pos[2]*2*2-2*2*2)/(2*2*2) ) # define what to plot plot.plots = {'i': ('unbalanced',),'ev': ('sz'),} # show the plot plot.plot() O.run() With kind regards, Danny van der Haven -- 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