Re: [Yade-users] [Question #689434]: How to generate many polyhedra randomly without specific data in Potential Blocks code?
Question #689434 on Yade changed: https://answers.launchpad.net/yade/+question/689434 Status: Answered => Open weijie is still having a problem: Hi Vasileios, and thank you again. I zoomed in and found that some of the converted particles have some overlapping parts, which seems to be a problem with the conversion. I changed the size of the particles generated in makeCloud and found that the smaller the particles, the more serious the problem. Could you please help to see what went wrong? Best regards, Jie ## from yade import polyhedra_utils,pack,plot,utils,qt import random import numpy as np #--- #Material n = PolyhedraMat(young=7.2e7,poisson=.2,density=2.5e3) O.materials.append(FrictMat(young=-1,poisson=-1,frictionAngle=radians(0.0),density=2500,label='frictionless')) #--- #Dimensions meanSize = 0.05 wallThickness = 0.5*meanSize distanceToCentre = 0.01 lengthOfBase = 5*meanSize heightOfBase = 12*meanSize #--- #Make Cloud sp=pack.SpherePack() mn,mx=Vector3(-0.5*(lengthOfBase-wallThickness),0.5*meanSize,-0.5*(lengthOfBase-wallThickness)),Vector3(0.5*(lengthOfBase-wallThickness),0.5*heightOfBase,0.5*(lengthOfBase-wallThickness)) #R=sqrt(3.0)*distanceToCentre #sp.makeCloud(mn,mx,R,0,-1,False) sp.makeCloud(mn,mx,psdSizes=[distanceToCentre,2*distanceToCentre],psdCumm=(0.1,1),num=200) def dvalue(vecn1,pp1): dd1=1*(vecn1[0]*pp1[0]+vecn1[1]*pp1[1]+vecn1[2]*pp1[2]) return dd1 for center,radius in sp: # Generate polyhedra color=Vector3(random.random(),random.random(),random.random()) b=polyhedra_utils.polyhedra(material=n,size=(2*radius,radius,radius),color=color) b.state.pos = center #s[0] stores center b.state.ori = Quaternion((random.random(),random.random(),random.random()),random.random()) #s[2] O.bodies.append(b) # Generate PBs aa=[] bb=[] cc=[] dd=[] vs=b.shape.v face2=b.shape.GetSurfaces() id1=0 while id12: vec1=vs[face11[2]]-vs[face11[1]]; vec1.normalize() vec2=vs[face11[0]]-vs[face11[1]]; vec2.normalize() #Normalize this object in-place. vects=vec1.cross(vec2); vects.normalize() dvalue2=dvalue(vects,vs[face11[0]]) aa.append(vects[0]) bb.append(vects[1]) cc.append(vects[2]) dd.append(dvalue2) id1=id1+1 chosenR=min(dd)/2 bbb=Body() bbb.aspherical=True wire=False highlight=True bbb.shape=PotentialBlock(k=0.0, r=chosenR, R=0.0, a=aa, b=bb, c=cc, d=np.array(dd)-chosenR, color=b.shape.color) utils._commonBodySetup(bbb, bbb.shape.volume, bbb.shape.inertia,material='frictionless', pos=bbb.shape.position, fixed=False) bbb.state.ori= b.state.ori bbb.state.pos = b.state.pos+Vector3(lengthOfBase,0,0) O.bodies.append(bbb) # Count number of bodies with b.shape=Polyhedra countPol=0 for b in O.bodies: if isinstance(b.shape,Polyhedra): countPol=countPol+1 print("number of Polyhedra = ", countPol) # Count number of bodies with b.shape=PotentialBlock countPBs=0 for b in O.bodies: if isinstance(b.shape,PotentialBlock): countPBs=countPBs+1 print("number of PotentialBlocks = ", countPBs) from yade import qt v=qt.View() v.ortho=True # I activate orthotropic projection, to make visual comparisons easier 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 #690925]: corrupted double-linked list
Question #690925 on Yade changed: https://answers.launchpad.net/yade/+question/690925 Status: Needs information => Answered Anton Gladky proposed the following answer: Smells like a heap corruption. Please create an issue on gitlab with the script which reproduces the problem. Thanks. -- 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 #689434]: How to generate many polyhedra randomly without specific data in Potential Blocks code?
Question #689434 on Yade changed: https://answers.launchpad.net/yade/+question/689434 Status: Open => Answered Vasileios Angelidakis proposed the following answer: Hi, To convert all the polyhedra into PBs, you have to define the generation of PBs inside the loop. You are currently creating only the last polyhedron. Then, for the newly created PBs, you have to assign the same orientation and position as the one of the polyhedral particles. Below I generate the PBs shifted by Vector3(lengthOfBase,0,0), so that you can compare the polyhedra (on the left) and the PBs (on the right). Also, I choose different "r=chosenR" for each body, depending on their individual dd values. I see some faces are still not rendered properly in the PBs, but this is only a visualisation issue. #Best Regards, #Vasileios # from yade import polyhedra_utils,pack,plot,utils,qt import random import numpy as np #--- #Material n = PolyhedraMat(young=7.2e7,poisson=.2,density=2.5e3) O.materials.append(FrictMat(young=-1,poisson=-1,frictionAngle=radians(0.0),density=2500,label='frictionless')) #--- #Dimensions meanSize = 0.05 wallThickness = 0.5*meanSize distanceToCentre = 0.01 lengthOfBase = 5*meanSize heightOfBase = 12*meanSize #--- #Make Cloud sp=pack.SpherePack() mn,mx=Vector3(-0.5*(lengthOfBase-wallThickness),0.5*meanSize,-0.5*(lengthOfBase-wallThickness)),Vector3(0.5*(lengthOfBase-wallThickness),0.5*heightOfBase,0.5*(lengthOfBase-wallThickness)) R=sqrt(3.0)*distanceToCentre sp.makeCloud(mn,mx,R,0,-1,False) def dvalue(vecn1,pp1): dd1=1*(vecn1[0]*pp1[0]+vecn1[1]*pp1[1]+vecn1[2]*pp1[2]) return dd1 for s in sp: # Generate polyhedra color=Vector3(random.random(),random.random(),random.random()) b=polyhedra_utils.polyhedra(material=n,size=(2*distanceToCentre,distanceToCentre,distanceToCentre),color=color) b.state.pos = s[0] #s[0] stores center b.state.ori = Quaternion((random.random(),random.random(),random.random()),random.random()) #s[2] O.bodies.append(b) # Generate PBs aa=[] bb=[] cc=[] dd=[] vs=b.shape.v face2=b.shape.GetSurfaces() id1=0 while id12: vec1=vs[face11[2]]-vs[face11[1]]; vec1.normalize() vec2=vs[face11[0]]-vs[face11[1]]; vec2.normalize() #Normalize this object in-place. vects=vec1.cross(vec2); vects.normalize() dvalue2=dvalue(vects,vs[face11[0]]) aa.append(vects[0]) bb.append(vects[1]) cc.append(vects[2]) dd.append(dvalue2) id1=id1+1 chosenR=min(dd)/2 bbb=Body() bbb.aspherical=True wire=False highlight=True bbb.shape=PotentialBlock(k=0.0, r=chosenR, R=0.0, a=aa, b=bb, c=cc, d=np.array(dd)-chosenR, color=b.shape.color) utils._commonBodySetup(bbb, bbb.shape.volume, bbb.shape.inertia,material='frictionless', pos=bbb.shape.position, fixed=False) bbb.state.ori= b.state.ori bbb.state.pos = b.state.pos+Vector3(lengthOfBase,0,0) O.bodies.append(bbb) # Count number of bodies with b.shape=Polyhedra countPol=0 for b in O.bodies: if isinstance(b.shape,Polyhedra): countPol=countPol+1 print("number of Polyhedra = ", countPol) # Count number of bodies with b.shape=PotentialBlock countPBs=0 for b in O.bodies: if isinstance(b.shape,PotentialBlock): countPBs=countPBs+1 print("number of PotentialBlocks = ", countPBs) from yade import qt v=qt.View() v.ortho=True # I activate orthotropic projection, to make visual comparisons easier 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 #690928]: How to efficiently convert polyhedrons to potential blocks in batches?
Question #690928 on Yade changed: https://answers.launchpad.net/yade/+question/690928 Status: Open => Invalid Vasileios Angelidakis rejected the question: Hi Jie, Hope you don't mind; I reject this question as duplicate to [1]. I will answer under the original question, to keep continuity for future readers. Best Regards, Vasileios [1] https://answers.launchpad.net/yade/+question/689434 -- 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 #690872]: Adding a method in the yade class files associated to a new contact law
Question #690872 on Yade changed: https://answers.launchpad.net/yade/+question/690872 Status: Open => Answered Jan Stránský proposed the following answer: > concerning the class computeNewAlfa it is a method/function, not class :-) > How do i precise ... however you want / your model needs.. > phys->alfa = alfa + om->dt *( ... ) > How do i precise ... that OldAlfa is equal to NewAlfa for the previous time > step depnding on the formulation, e.g. you can do it like in the original post, just the "phys->alfa = alfa + om->dt *( ... )" is defined in computeNewAlfa function (which can be composed of several other functions, like computeTerm1(...) etc.) bool Law2_ScGeom_VsmPhys_Vsm::go(...) { VsmPhys::computeAnything(phys->alfa); // phys->alfa is "oldAlfa" ... phys->alfa = computeNewAlfa(phys->alfa,...); // phys->alfa argument is "oldAlfa", phys->alfa result is "newAlfa" } or if you want the code being more "self-explanatory", the same can be rewritten as: bool Law2_ScGeom_VsmPhys_Vsm::go(...) { Real oldAlfa = phys->alfa; computeAnything(oldAlfa); ... Real newAlfa = VsmPhys::computeNewAlfa(oldAlfa,...); // now you can do computations with both oldAlfa and newAlfa if needed phys->alfa = newAlfa; } / > corresponding to a specific interaction being member of IPhys = corresponding to a specific interaction > how is the value of NewAlfa stored between two time steps... ?) as phys->alfa (??) if you need values in two time steps (current and previous), you can store two values in IPhys 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
Re: [Yade-users] [Question #690872]: Adding a method in the yade class files associated to a new contact law
Question #690872 on Yade changed: https://answers.launchpad.net/yade/+question/690872 Status: Answered => Open Rioual is still having a problem: Yes, jan, thanks, this helps me a lot. But concerning the class computeNewAlfa, i have a further question: How do i precise in the formulation (hpp and cpp files) that OldAlfa is equal to NewAlfa for the previous time step corresponding to a specific interaction (how is the value of NewAlfa stored between two time steps... ?).. I hope i am clear, Thank you for your précisions, Best V. -- 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 #690948]: Making a sphere layer with certain orientation
Question #690948 on Yade changed: https://answers.launchpad.net/yade/+question/690948 Status: Open => Answered Jan Stránský proposed the following answer: yes, thanks. So basically: 1) create the aligned layer 2) rotate it ### MWE from yade import pack # "aligned" layer layer = pack.regularOrtho(pack.inAlignedBox((0,0,0),(20,20,5)),1,0) # rotation (can be also any other transformation, like shift, scale etc.) center = Vector3(0,0,0) # center of rotation rotation = Quaternion((1,0,0),.25*pi) # Quaternion(rotationAxis,rotationAngle) for b in layer: # apply the transformation for each sphere of the layer b.state.pos = center + rotation * (b.state.pos - center) O.bodies.append(layer) ### 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
Re: [Yade-users] [Question #690948]: Making a sphere layer with certain orientation
Question #690948 on Yade changed: https://answers.launchpad.net/yade/+question/690948 Status: Needs information => Open Chien-Cheng Hung gave more information on the question: Hi Jan, Thanks for your quick reply! > - what "sphere layer" is I should say a "granular" layer instead of a sphere layer. It means a layer composed of several spheres. > - if / what you have tried / thought of, why it did not work... Currently, I'm using the function makeCloud [1] to generate a random loose packing of spheres, and then I would apply the isotropic compaction to make a dense packing (I call it a granular layer). But in this function, I can only assign a vector to minCorner and maxCorner so that the length of generated loose packing is always parallel to the X-, Y-, Z-axis. What I would like to do is to generate a random packing in which its length can be oriented to the axis with certain degrees. Is this clear to you? Thanks again! Cheers, Chien-Cheng [1] https://yade- dem.org/doc/yade.pack.html?highlight=makecloud#yade._packSpheres.SpherePack.makeCloud -- 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 #690946]: What does O.energy['nonviscdamping'] account for ?
Question #690946 on Yade changed: https://answers.launchpad.net/yade/+question/690946 Status: Open => Answered Jan Stránský proposed the following answer: Hello, > O.energy['nonviscdamping'] (in the question text) > O.energy['nonviscDamp'] (in the code) please be consistent and correct. > it corresponds to the energy dissipated with the damping given in the NewtonIntegrator. yes [1] > My results seems to show that the energy 'nonviscdamping' is related to the energies linked to a contact (so here elastic and plastic energies but not gravity) ... please do not use ... while asking question, then it is not clear if it is a problem, a question, a not important note.. > Could you enlighten me about what is saved under O.energy['nonviscdamping'] ? > I can't find any answer in the Yade Doc. the source code itself is also a valuable source of information [1] cheers Jan [1] https://gitlab.com/yade- dev/trunk/-/blob/master/pkg/dem/NewtonIntegrator.cpp#L62 -- 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 #690948]: Making a sphere layer with certain orientation
Question #690948 on Yade changed: https://answers.launchpad.net/yade/+question/690948 Status: Open => Needs information Jan Stránský requested more information: Hello, > Is it possible to do this in Yade? yes, of course. Just create spheres with desired size at desired position to form desired sphere layer. To get a better answer, please provide more info: - what "sphere layer" is - if / what you have tried / thought of, why it did not work... 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 #690948]: Making a sphere layer with certain orientation
New question #690948 on Yade: https://answers.launchpad.net/yade/+question/690948 Dear all, I am trying to generating a sphere layer with a certain orientation. For example, I would like to generate a layer intersecting Z-axis with 45 degrees (taking X-axis as the front). Is it possible to do this in Yade? Thanks! Cheers, Chien-Cheng -- 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 #690946]: What does O.energy['nonviscdamping'] account for ?
New question #690946 on Yade: https://answers.launchpad.net/yade/+question/690946 Hello, I have done several tests with the two bouncing balls simulation, which I modified a little for the saving of the energies. I wanted to see the behaviour of the energy saved under O.energy['nonviscdamping'], and if it corresponds to the energy dissipated with the damping given in the NewtonIntegrator. My results seems to show that the energy 'nonviscdamping' is related to the energies linked to a contact (so here elastic and plastic energies but not gravity) ... Could you enlighten me about what is saved under O.energy['nonviscdamping'] ? I can't find any answer in the Yade Doc. Thanks in advance ! The script : # basic simulation showing sphere falling ball gravity, # bouncing against another sphere representing the support from yade import plot # DATA COMPONENTS file_name='BB_d0.001' # add 2 particles to the simulation # they the default material (utils.defaultMat) O.bodies.append([sphere(center=(0,0,0),radius=.5,fixed=True),sphere((0,0,2),.5)]) O.trackEnergy=True # FUNCTIONAL COMPONENTS # simulation loop -- see presentation for the explanation O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom()],# collision geometry [Ip2_FrictMat_FrictMat_FrictPhys()], # collision "physics" [Law2_ScGeom_FrictPhys_CundallStrack()] # contact law -- apply forces ), # Apply gravity force to particles. damping: numerical dissipation of energy. NewtonIntegrator(gravity=(0,0,-9.81),damping=0.001), PyRunner(command='addData()',iterPeriod=100) ] def addData(): #print 'Ee : %.5f'%(O.energy['elastPotential']) plot.addData(i=O.iter,time=O.time,pos=O.bodies[1].state.pos[2], vel=O.bodies[1].state.vel[2],Ec=O.energy['kinetic'], Eg=O.energy['gravWork'],Ee=O.energy['elastPotential'], Damp=O.energy['nonviscDamp']) if O.iter>3*10**6: plot.saveDataTxt(file_name+'.txt') O.pause() # set timestep to a fraction of the critical timestep # the fraction is very small, so that the simulation is not too fast # and the motion can be observed O.dt=5*10**-5 # save the simulation, so that it can be reloaded later, for experimentation 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 #690942]: Concrete cube dimension, aggregate particle and peri3dController
Question #690942 on Yade changed: https://answers.launchpad.net/yade/+question/690942 Jan Stránský proposed the following answer: Hello, > I am new to YADE welcome :-) > There are some of the questions ... next time please open separate "ask a question" for each question [1] > 1... > peri3dController > How to determine the dimensions of the concrete cube > there is an initial size = 1.2, but apparently, this is not the cube > dimension. there is no "cube", the simulation is periodic, simulating infinite space. To get dimension of a periodic cell (which is in no way related to physical dimensions - as it is infinite), you can use O.cell.size [2]. The initSize is passed to randomPeriPack. It creates a loose packing using makeCloud using the initSize size, then compress it. The parameter basically control number of particles in the simulation. Have a look at yade/examples/concrete [5] for simulation of "physical" samples. > 2. How to determine the variation of aggregate granules if specified; It is not possible "as is", randomPariPack [3] just supports uniform distribution (defined by radius and rRelFuzz parameters). To use defined particle size distribution, one option is to "rewrite" the randomPeriPack function [4] with adjusted makeCloud call. > in YADE Book (pg.280) it is better to use links to online documentation, like [6] > 3. How to determine the value (goal, xxPath, yyPath, zzPath, zxPath, xyPath), I'm confused with the determination of the numbers . I have read it in YADE Book (pg.280), but i dont understand about it. Please describe more what you do not understand. The path arguments are just a list of (time,value) pair, i.e. what value is prescribed at what time/iter. In certain cases, the values may be relative (e.g. the time on scale [0,1], internally rescaling the values with nSteps argument) The prescribed value is linearly interpolated between these defined points. Have a look at comments in the example you have posted and compare them with the simulation results. A note about modeling of concrete using periodic simulations: in case of strain localization, the periodicity has influence on cracks/strain localized area and therefore influence on overall response. Which is not a problem "by default", one just need to (should) have this in mind while using it. cheers Jan [1] https://www.yade-dem.org/wiki/Howtoask [2] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Cell.size [3] https://yade-dem.org/doc/yade.pack.html#yade.pack.randomPeriPack [4] https://gitlab.com/yade-dev/trunk/-/blob/master/py/pack/pack.py#L566 [5] https://gitlab.com/yade-dev/trunk/-/tree/master/examples/concrete [5] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Peri3dController.xxPath -- 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 #690925]: corrupted double-linked list
Question #690925 on Yade changed: https://answers.launchpad.net/yade/+question/690925 Robert Caulk requested more information: >Yade model is small (8000 particles), the code works well. But when the same model has 100 particles, I get the following error: Please provide the system specs and the installation method [1]. FlowEngine is already pushing workstation limits with GPU acceleration around 300k particles [2][3]. So, I suspect you don't have the necessary hardware to decompose a matrix with 7 million DOFS :-). [1]https://www.yade-dem.org/wiki/Howtoask [2]https://www.sciencedirect.com/science/article/pii/S0010465519303340 [3]https://yade-dem.org/doc/GPUacceleration.html -- 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 #690925]: corrupted double-linked list
Question #690925 on Yade changed: https://answers.launchpad.net/yade/+question/690925 Status: Open => Needs information Jan Stránský requested more information: Hello, what is the output of catchsegv ... (where ... is how you run the script) thanks 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
Re: [Yade-users] [Question #690942]: Concrete cube dimension, aggregate particle and peri3dController
Question #690942 on Yade changed: https://answers.launchpad.net/yade/+question/690942 Status: Open => Answered Bruno Chareyre proposed the following answer: Hi, > there is an initial size = 1.2, but apparently, this is not the cube dimension Why not? > How to determine the value (goal, xxPath, yyPath, zzPath, zxPath, xyPath) Could you explain the loading path you would like to impose? Then maybe understanding this part will be easier. Regards Bruno -- 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 #690935]: makeVideo
Question #690935 on Yade changed: https://answers.launchpad.net/yade/+question/690935 Status: Answered => Open Paolo is still having a problem: Thank you guys, I'm making progress. I succeeded in collecting snapshots both from the simulation and the addData graph. I eventually downloaded mencoder and now everything works well. Just one last thing. It happens that sometimes, during the simulation, the following error appears and stops the evolution of the plotted graph. The simulation goes on and I can collect the snapshots from it correctly, but the graph remains stuck. I cannot understand what it means. In [1]: Unhandled exception in thread started by --- ValueErrorTraceback (most recent call last) /usr/lib/x86_64-linux-gnu/yade/py/yade/plot.py in liveUpdate(timestamp) 506 for ax in axes: 507 try: --> 508 ax.relim() # recompute axes limits 509 ax.autoscale_view() 510 except RuntimeError: pass # happens if data are being updated and have not the same dimension at the very moment /usr/lib/python2.7/dist-packages/matplotlib/axes/_base.pyc in relim(self, visible_only) 1936 for line in self.lines: 1937 if not visible_only or line.get_visible(): -> 1938 self._update_line_limits(line) 1939 1940 for p in self.patches: /usr/lib/python2.7/dist-packages/matplotlib/axes/_base.pyc in _update_line_limits(self, line) 1799 Figures out the data limit of the given line, updating self.dataLim. 1800 """ -> 1801 path = line.get_path() 1802 if path.vertices.size == 0: 1803 return /usr/lib/python2.7/dist-packages/matplotlib/lines.pyc in get_path(self) 955 """ 956 if self._invalidy or self._invalidx: --> 957 self.recache() 958 return self._path 959 /usr/lib/python2.7/dist-packages/matplotlib/lines.pyc in recache(self, always) 665 y = self._y 666 --> 667 self._xy = np.column_stack(np.broadcast_arrays(x, y)).astype(float) 668 self._x, self._y = self._xy.T # views 669 /usr/lib/python2.7/dist-packages/numpy/lib/stride_tricks.pyc in broadcast_arrays(*args, **kwargs) 247 args = [np.array(_m, copy=False, subok=subok) for _m in args] 248 --> 249 shape = _broadcast_shape(*args) 250 251 if all(array.shape == shape for array in args): /usr/lib/python2.7/dist-packages/numpy/lib/stride_tricks.pyc in _broadcast_shape(*args) 182 # use the old-iterator because np.nditer does not handle size 0 arrays 183 # consistently --> 184 b = np.broadcast(*args[:32]) 185 # unfortunately, it cannot handle 32 or more arguments directly 186 for pos in range(32, len(args), 31): ValueError: shape mismatch: objects cannot be broadcast to a single shape Thanks for helping me! Cheers Paolo -- 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 #690942]: Concrete cube dimension, aggregate particle and peri3dController
New question #690942 on Yade: https://answers.launchpad.net/yade/+question/690942 Dear All, I am new to YADE. I have studied some code from this forum. There are some of the questions related to concrete cube testing. 1. How to determine the dimensions of the concrete cube (150x150mm) in the modeling? In the code, there is an initial size = 1.2, but apparently, this is not the cube dimension. 2. How to determine the variation of aggregate granules if specified; a. 0-4mm: 40% b. 4-8 mm: 22% c. 8-16mm: 38% 3. How to determine the value (goal, xxPath, yyPath, zzPath, zxPath, xyPath), I'm confused with the determination of the numbers . I have read it in YADE Book (pg.280), but i dont understand about it. goal=(20e-4,-6e-4,0, -2e6,3e-4,2e6) # the prescribed path (step,value of stress/strain) can be defined in absolute values xxPath=[(465,5e-4),(934,-5e-4),(1134,10e-4)], # or in relative values yyPath=[(2,4),(7,-2),(11,0),(14,4)], # if the goal value is 0, the absolute stress/strain values are always considered (step values remain relative) zzPath=[(5,-1e7),(10,0)], # if ##Path is not explicitly defined, it is considered as linear function between (0,0) and (nSteps,goal) # as in yzPath and xyPath # the relative values are really relative (zxPath gives the same - except of the sign from goal value - result as yyPath) zxPath=[(4,2),(14,-1),(22,0),(28,2)], xyPath=[(1,1),(2,-1),(3,1),(4,-1),(5,1)], Could you please help me with this?. I'm writing a thesis and paper using YADE. Regards, Faqih Ma’arif the complete code as follows: # peri3dController_example1.py # script, that explains funcionality and input parameters of Peri3dController import string from yade import pack, plot from yade import plot,qt from yade.pack import * # create some material #O.materials.append(CpmMat(neverDamage=True,young=25e9,frictionAngle=.7,poisson=.2,sigmaT=3e6,epsCrackOnset=1e-4,relDuctility=30)) O.materials.append(CpmMat(neverDamage=True,young=25e9,frictionAngle=.7,poisson=.2,sigmaT=3e6,epsCrackOnset=1e-4,relDuctility=30)) # create periodic assembly of particles initSize=1.2 #old sp=pack.randomPeriPack(radius=.05,initSize=Vector3(initSize,initSize,initSize),memoizeDb='/tmp/packDb.sqlite') sp.toSimulation() # plotting #plot.live=False plot.plots={'progress':('sx','sy','sz','syz','szx','sxy',),'progress_':('ex','ey','ez','eyz','ezx','exy',)} def plotAddData(): plot.addData( progress=p3d.progress,progress_=p3d.progress, sx=p3d.stress[0],sy=p3d.stress[1],sz=p3d.stress[2], syz=p3d.stress[3],szx=p3d.stress[4],sxy=p3d.stress[5], ex=p3d.strain[0],ey=p3d.strain[1],ez=p3d.strain[2], eyz=p3d.strain[3],ezx=p3d.strain[4],exy=p3d.strain[5], ) # in how many time steps should be the goal state reached nSteps=4000 #new O.dt=PWaveTimeStep()/2 EnlargeFactor=1.5 EnlargeFactor=1.0 O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=EnlargeFactor,label='bo1s')]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=EnlargeFactor,label='ig2ss')], [Ip2_CpmMat_CpmMat_CpmPhys()],[Law2_ScGeom_CpmPhys_Cpm()]), NewtonIntegrator(), Peri3dController( goal=(20e-4,-6e-4,0, -2e6,3e-4,2e6), # Vector6 of prescribed final values (xx,yy,zz, yz,zx,xy) stressMask=0b101100, # prescribed ex,ey,sz,syz,ezx,sxy; e..strain; s..stress nSteps=nSteps, # how many time steps the simulation will last # after reaching nSteps do doneHook action doneHook='print "Simulation with Peri3dController finished."; O.pause()', # the prescribed path (step,value of stress/strain) can be defined in absolute values xxPath=[(465,5e-4),(934,-5e-4),(1134,10e-4)], # or in relative values yyPath=[(2,4),(7,-2),(11,0),(14,4)], # if the goal value is 0, the absolute stress/strain values are always considered (step values remain relative) zzPath=[(5,-1e7),(10,0)], # if ##Path is not explic