Re: [Yade-users] [Question #707137]: Resetting and starting simulations from the beginning

2023-06-28 Thread drasszkusz
Question #707137 on Yade changed:
https://answers.launchpad.net/yade/+question/707137

Status: Answered => Solved

drasszkusz 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 #707137]: Resetting and starting simulations from the beginning

2023-06-28 Thread drasszkusz
Question #707137 on Yade changed:
https://answers.launchpad.net/yade/+question/707137

Status: Answered => Open

drasszkusz is still having a problem:
Thank you for the general answer, but it won't solve the problem
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 #707137]: Resetting and starting simulations from the beginning

2023-06-28 Thread drasszkusz
Question #707137 on Yade changed:
https://answers.launchpad.net/yade/+question/707137

drasszkusz gave more information on the question:
Sorry, I forgot to add that I'm using Yade 20230525-7264~94b01fd~jammy1
(yadedaily) on an Ubuntu 22.04.2 LTS.

-- 
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 #707137]: Resetting and starting simulations from the beginning

2023-06-28 Thread drasszkusz
New question #707137 on Yade:
https://answers.launchpad.net/yade/+question/707137

Hello,

I would like to ask that if there is a way to run simulations like batch mode 
but without using the actual batch mode function.
In more details:
1. I would like to run a simulation which will stop at a given time. 
2. Then I would like to save a data.
3. After, I would like to reload/reset the simulation and change one thing (ie. 
density of a particle).
4. Then run the simulation again and save the same data.

I have created an MWE using the bouncing sphere example. In this example, I 
don't change any parameter. I just run the simulation for 1 sec, then I print 
the number of the current run, then reset and start again.
My problem is that the simulation won't reload and won't start automatically 
again. I have tried O.loadTmp() instead of O.reload() but had no success.

---MWE---

O.bodies.append(
[
# fixed: particle's position in space will not change (support)
sphere(center=(0, 0, 0), radius=.5, fixed=True),
# this particles is free, subject to dynamics
sphere((0, 0, 2), .5)
]
)


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.1),
PyRunner(command='stop()',realPeriod=.5)
]

O.dt = .5e-4 * PWaveTimeStep()

index=0
def stop():
   global index
   if O.time>1:
   index=index+1
   print(str(index)+'. run')
   O.reload()
   #O.loadTmp()
   O.run()

# save the simulation, so that it can be reloaded later, for experimentation
O.saveTmp()
O.run()

---End of MWE--

Thank you in advance for your help !
D

-- 
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 #695966]: VTKExporter -> exportFacets command

2021-03-10 Thread drasszkusz
Question #695966 on Yade changed:
https://answers.launchpad.net/yade/+question/695966

Status: Answered => Solved

drasszkusz confirmed that the question is solved:
Yeah, that's why i'm not 100% sure about these things. Anyway thank you
for all your help! I will be okay from now on.

D

-- 
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 #695966]: VTKExporter -> exportFacets command

2021-03-10 Thread drasszkusz
Question #695966 on Yade changed:
https://answers.launchpad.net/yade/+question/695966

drasszkusz posted a new comment:
Thank you Jan, I updated Yade and it works as dict now :) Here is an MWE for 
those who will have the same problem in the future:
###
def vtkexporter():
   vtk.exportFacets(ids=facetid, 
what=dict(vel='b.state.vel',pos='b.state.pos',dspl='b.state.displ()',coordnumber='len(b.intrs())',forceLen='O.forces.f(b.id).norm()',forceVec='O.forces.f(b.id)',stress='O.forces.f(b.id).norm()/b.shape.area'))
###

About lenForce, stress, stressLen, etc , I'm still figuring them out.
According to [5], stressLen is the sum of normal and shear stresses and
the norm of the summed value. So yes, Len is the magnitude. I don't know
if stress='O.forces.f(b.id).norm()/b.shape.area' cause it is being
retrieved from another file's algorithm with the following commands
in[5]:

##
const Vector3r& stress = bodyStates[b->getId()].normStress;
const Vector3r& shear  = bodyStates[b->getId()].shearStress;
##

I'm still searching that how are they calculated.

Cheers,
D

[5] https://gitlab.com/yade-
dev/trunk/-/blob/master/pkg/dem/VTKRecorder.cpp

-- 
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 #695966]: VTKExporter -> exportFacets command

2021-03-10 Thread drasszkusz
Question #695966 on Yade changed:
https://answers.launchpad.net/yade/+question/695966

Status: Answered => Open

drasszkusz is still having a problem:
Hi Jan!

Thank you for your answer! It works now. :)
Sorry, I forgot [3], I'm using Yade installed from source code 10 months ago.
Could you help me in how to export coordnumber, forceLen, forceVec, stressLen, 
stressVec, torqueLen, torqueVec  using 'what' subcommand?

Thank you!
D

-- 
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 #695966]: VTKExporter -> exportFacets command

2021-03-10 Thread drasszkusz
New question #695966 on Yade:
https://answers.launchpad.net/yade/+question/695966

Hi all!

I have a question about VTKExporter exportFacet command. The main goal is to 
export specified facets and forces, stresses, etc acting on them.  I could 
export facets to vtk and open in paraview, but without the forces, stresses, 
etc. Here is the MWE:

#
vtk = export.VTKExporter(vtksave+'file-')
def vtkexporter():
   vtk.exportFacets(ids=facetid)
#

Also a PyRunner is running in engines:

#
PyRunner(command='vtkexporter()',virtPeriod=vtksampling)
#

It works fine, but I have problem when i need to specify the what [1] command:

#
vtk.exportFacets(ids=facetid, what=dict(velocity='b.state.vel'))
#

The manual refers to see exportSpheres() [2], but its not very helpfull, cause 
I'm getting this error:
/home/dem/Yade/install/lib/x86_64-linux-gnu/yade-2020-04-23.git-6c442b0/py/yade/export.pyc
 in exportFacets(self, ids, what, comment, numLabel)
489 outFile.write("\nCELL_DATA %d"%(nBodies))
490 # see exportSpheres for explanation of this code block
--> 491 for name,command in what:
492 test = eval(command)
493 if isinstance(test,Matrix3):

ValueError: too many values to unpack

So what are the exact expressions that I have to use to save everything 
(coordnumber, forceLen, forceVec, stressLen, stressVec, torqueLen, torqueVec) 
like VTKRecorder do?

Thank you for your help!
D

--
[1] 
https://yade-dem.org/doc/yade.export.html?highlight=exportfacets#yade.export.VTKExporter.exportFacets
[2] 
https://yade-dem.org/doc/yade.export.html?highlight=vtkexporter#yade.export.VTKExporter.exportSpheres


-- 
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 #688945]: Compiled Yade plot error in batch mode on Ubuntu 18.04

2020-02-24 Thread drasszkusz
Question #688945 on Yade changed:
https://answers.launchpad.net/yade/+question/688945

Status: Answered => Solved

drasszkusz confirmed that the question is solved:
Thanks Bruno Chareyre, 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 #688945]: Compiled Yade plot error in batch mode on Ubuntu 18.04

2020-02-23 Thread drasszkusz
Question #688945 on Yade changed:
https://answers.launchpad.net/yade/+question/688945

drasszkusz posted a new comment:
> Hello, how do you expect to see plots in batch mode? I mean, it makes little 
> sense to pop up an arbitrary number of graphical
> windows, expecting one to watch and close them while the batch proceeds. What 
> do you really need?

Sorry for the confusion. I meant that when I open the progress via web
browser (localhost:9080) [1].

> Oh wait, isn't it just a change in different matplotlib versions? I've seen
> such things. Try with a simple pyplot to confirm it is related to yade?

On Ubuntu 16.04 the version of matplotlib is 1.5.1 and on Ubuntu 18.04 it is 
2.1.1, so it is a change in versions.
Could you lend me some instructions about the confirm by simple pyplot, please?
If it is the problem because of the different versions, is there a workaround 
or I have to force install the older version?

Thanks,
Daniel

[1] https://yade-dem.org/doc/user.html?highlight=batch#http-overview

-- 
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 #688945]: Compiled Yade plot error in batch mode on Ubuntu 18.04

2020-02-23 Thread drasszkusz
New question #688945 on Yade:
https://answers.launchpad.net/yade/+question/688945

Hi all!

I just compiled Yade from source code on a fresh Ubuntu 18.04. The problem is 
that in batch mode I have plot error and thus I can not see any plots. In not 
batch mode, plotting works fine. I tried it on another computer with a freshly 
installed Ubuntu 18.04 on it and it is the same. Am I missing something, like a 
not installed package? On Ubuntu 16.04 it works fine.

Thanks,
Daniel

Here are the error messages:

Traceback (most recent call last):
  File 
"/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/remote.py",
 line 36, in plot
fig=plot.plot(subPlots=True,noShow=True)
  File 
"/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/plot.py",
 line 594, in plot
createPlots(subPlots=subPlots)
  File 
"/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/plot.py",
 line 372, in createPlots
figs=set([l.line.get_axes().get_figure() for l in currLineRefs]) # get all 
current figures
AttributeError: 'Line2D' object has no attribute 'get_axes'
Error updating plots:
Traceback (most recent call last):
  File 
"/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/remote.py",
 line 36, in plot
fig=plot.plot(subPlots=True,noShow=True)
  File 
"/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/plot.py",
 line 594, in plot
createPlots(subPlots=subPlots)
  File 
"/home/user/dem/install/lib/x86_64-linux-gnu/yade-2019-10-11.git-e66c03c/py/yade/plot.py",
 line 372, in createPlots
figs=set([l.line.get_axes().get_figure() for l in currLineRefs]) # get all 
current figures
AttributeError: 'Line2D' object has no attribute 'get_axes'


-- 
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 #687861]: GlobalStiffnessTimeStepper viscEl background

2020-01-13 Thread drasszkusz
Question #687861 on Yade changed:
https://answers.launchpad.net/yade/+question/687861

Status: Answered => Solved

drasszkusz confirmed that the question is solved:
Dear Jérôme and Robert,

thank you for your responses.

>> Maybe you can try starting from Raphael's PhD Thesis, § 2.1.3 of
[Maurin2015PhD, *]...

Yes, it confirms the same as it is in the GlobalStiffnessTimestepper
manual. The references in that study were also a dead end.

>>  The timestep associated with viscoelastic dampers-case is estimated
using identical logic to the stiffness-only case.
GlobalStiffnessTimestepper computes both and uses the smallest one. This
is apparent by working backwards from [1], and is confirmed by Jérôme's
link on page 18.

In that case I have to reengineer the formula of the viscous part from
the source code or search the internet for other studies. Because the
references you provided only describe the elastic parts and just mention
the viscous critical time step. Only the elastic formula can be found
written down.

Cheers,
D

-- 
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 #687861]: GlobalStiffnessTimeStepper viscEl background

2020-01-12 Thread drasszkusz
Question #687861 on Yade changed:
https://answers.launchpad.net/yade/+question/687861

Status: Answered => Open

drasszkusz is still having a problem:
Dear Robet,

Thank you for your reply.

>> Can you please link to the materials/constitutive laws/parameters you
are referring to? We have a class reference for this very purpose [1].

I understand the minimum eigen-period for elastic contribution (spring
only), but with viscEl=True in globalstiffnesstimestepper [1], the
viscous contribution is also considered (dashpot part) when calculating
minimum (critical) timestep for Law2_ScGeom_ViscElPhys_Basic [2].

>>Please link to the the the location you are referring to.

The source code can be found here [3].

>> See "Stability Considerations" of the Yade manual [2] which also
points to Abul Hosn et al. 2017 [3].

As I can see, there are no dashpots used in that study [4], so there is
nothing about viscous stability cosiderations there. Also I could not
find anything in Yade manual about critical timestep considering  mass-
spring-viscous dampers (only mass-spring).

Cheers,
D

[1] 
http://yade-dem.org/doc/yade.wrapper.html?highlight=globalstiffness#yade.wrapper.GlobalStiffnessTimeStepper.viscEl
[2] 
https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Law2_ScGeom_ViscElPhys_Basic
[3] 
https://gitlab.com/yade-dev/trunk/blob/master/pkg/dem/GlobalStiffnessTimeStepper.cpp
[4] http://yade-dem.org/publi/AboulHosn_GRMA_2017.pdf

-- 
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 #687861]: GlobalStiffnessTimeStepper viscEl background

2020-01-08 Thread drasszkusz
New question #687861 on Yade:
https://answers.launchpad.net/yade/+question/687861

Hi all!

I would like to ask about the GlobalStiffnessTimeStepper.
How does it calculate the timestep in case of elasctic and viscoelastic 
(viscEl=True) cases? I can see the sourcecode, but is there any paper which 
describes the mathematical background of the minimum eigen-period for the 
viscous contribution and which can be referenced? I have not found much in the 
Yade manual.

Thanks,
D

-- 
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 #685836]: CohesionMoment

2019-11-13 Thread drasszkusz
Question #685836 on Yade changed:
https://answers.launchpad.net/yade/+question/685836

drasszkusz posted a new comment:
Sorry, wrong link for [3]. It is page 272-282 at
https://congress.cimne.com/particles2019/frontal/doc/Ebook_Particles_2019.pdf

-- 
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 #685836]: CohesionMoment

2019-11-13 Thread drasszkusz
Question #685836 on Yade changed:
https://answers.launchpad.net/yade/+question/685836

Status: Open => Answered

drasszkusz proposed the following answer:
Hello,

> In [2], it asks to go to ''CohFrictPhys.cohesionDisablesFriction''
[3], it says "is shear strength the sum of friction and adhesion or only
adhesion? '' and the default value of [3] is false, does it mean that
when set it as false, the shear strength is the sum of friction and
adhesion?

Yes, if false, the shear strength is the sum of friction and adhesion.

> 3. Refer to ''CohFrictPhys.momentRotationLaw'' [4], [4] asks to go to 
> ''Law2_ScGeom6D_CohFrictPhys_CohesionMoment::always_use_moment_law'' [5],
I choose false (defalt value) for the purpose of computing moments only for 
cohesive contacts. However, in ''Law2_ScGeom6D_CohFrictPhys_CohesionMoment'' 
[1], it says that ''Cohesive -type moment may also be included in the future'', 
it gives the feeling that Cohesive -type moment can not be achieved in this 
model currently, which makes me confused.

If false, it computes the rolling and twisting moments (controlled by
rolling and twisting resistance/friction coefficents aka etaRoll and
etaTwist) in case of active cohesive bonds between particles. This way
you can control the movement of the rolling  and twisting of particles
on/to each other. If it set to true, then it always calculates the
moments also if there is no cohesive connection between particles. This
way the particle shapes can be considered in numerical way, if the real
particles are not perfectly spherical. [1]

>By the way, I also reviewed some papers which worked based on
Law2_ScGeom6D_CohFrictPhys_CohesionMoment. In general, they didn't
consider cohesion and moment at the same time. This has deepened my
doubt about if cohesion and moment can be taken into at the same time in
terms of Law2_ScGeom6D_CohFrictPhys_CohesionMoment.

There are some papers considering both at the same time [2] [3]. In the
[3], you can find the mathematical background (equations) which are from
the source code.

Daniel

[1] https://www.sciencedirect.com/science/article/pii/S0020768318302567
[2] https://www.sciencedirect.com/science/article/pii/S0168169918316429
[3] page 272-282 
https://mercurylab.co.uk/dem8/wp-content/uploads/sites/4/2019/07/263.pdf

-- 
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 #679180]: Additional options when compiling Yade from source

2019-03-13 Thread drasszkusz
Question #679180 on Yade changed:
https://answers.launchpad.net/yade/+question/679180

drasszkusz posted a new comment:
Hi Jan!

Yes, sorry. I meant that I know these functions and I'm sure that I need
them. :)

cheers,
Daniel

-- 
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 #679180]: Additional options when compiling Yade from source

2019-03-13 Thread drasszkusz
New question #679180 on Yade:
https://answers.launchpad.net/yade/+question/679180

Hi all!

There are additional options when compiling Yade from source:
Odeint VTK OpenMP GTS GUI-Qt5 CGAL LINSOLV GL2PS LBMFLOW PFVFLOW CHOLMOD_GPU 
TWOPHASEFLOW SPH DEFORM LIQMIGRATION MASK_ARBITRARY THERMAL PROFILING 
PotentialParticles PotentialBlocks
Some of them are turned OFF by default.
 
My questions are:
1. Are the  package versions (yade, yadedaily) made with the same additional 
options enabled/disabled as if Yade compiled from source with default settings 
or not? If not, then which additional options are enabled?

2. I would like to use ViscEL and ViscElCap contact models only. Which 
additional options should be enabled only? (I would like to speed up make 
progress. I know that OpenMP, GUI-Qt5, VTK are needed, but what about the 
others?)
As I have seen in the source code, DEFORM and LIQMIGRATION are called in the 
contact models if they are enabled, but I'm not sure that they are enabled by 
default in the package versions of Yade.

Thanks,
Daniel

-- 
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 #671141]: Positioning a cylinder

2018-07-26 Thread drasszkusz
Question #671141 on Yade changed:
https://answers.launchpad.net/yade/+question/671141

Status: Answered => Solved

drasszkusz confirmed that the question is solved:
Theory tested, thanks Jan! :)

Daniel

-- 
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 #671141]: Positioning a cylinder

2018-07-26 Thread drasszkusz
Question #671141 on Yade changed:
https://answers.launchpad.net/yade/+question/671141

Description changed to:
Hi all!

I would like to make a rotary drum. My first idea was to make it with
facet.Cylinder command.

My questions are:
1. How can I make that the center line of the drum to be parallel to the x-axis 
not z-axis?
2. I would like to lift one end, so the drum's axis close some angle with 
x-axis. How should I do it?
3. Should I use a different command for making a cylinder?

Thanks,
Daniel

Here is a simple code:

from yade import pack, qt

readParamsFromTable(n=1,dens=2092,frict=40.3,E=4e5,coh=1e4,eta=.05)
from yade.params.table import *

#szemcses anyag adatai
particlematerial=CohFrictMat(young=E,poisson=.2,density=dens,frictionAngle=radians(frict),normalCohesion=coh,shearCohesion=coh,momentRotationLaw=True,etaRoll=eta,etaTwist=eta)
O.materials.append(particlematerial)

#sampling
sampling=.01 #second

omega=2*pi*n

#rotary drum material
id_Mater=O.materials.append(FrictMat(young=200e9,poisson=.3,density=7750,frictionAngle=.7))
Mater=O.materials[id_Mater]

#rotary drum geometry
drum=O.bodies.append(geom.facetCylinder((0,0,0),radius=1,height=2,orientation=Quaternion((1,0,0),0),segmentsNumber=10,wallMask=4,color=(.3,.3,.3)))

#generating particles
sp=pack.SpherePack()
sp.makeCloud((-.1,-.1,.1),(.1,.1,.6),rMean=.02,rRelFuzz=0)
sp.toSimulation(material=particlematerial, color=(1,1,1))

#Engines
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Facet_Sphere_ScGeom()],


[Ip2_FrictMat_FrictMat_FrictPhys(),Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label="cohesiveIp")],

[Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom6D_CohFrictPhys_CohesionMoment(
useIncrementalForm=True,
always_use_moment_law=True,
label='cohesiveLaw')]
),
   NewtonIntegrator(gravity=(0,0,-9.81),damping=.5),
   
RotationEngine(rotateAroundZero=True,zeroPoint=(0,0,0),rotationAxis=(0,0,1),angularVelocity=omega,
 ids = drum),
   PyRunner(command='start()',realPeriod=2,label='checker'),

]

O.dt=.001*PWaveTimeStep()
O.step()

def start():
   if O.iter<1: return
   O.engines[2].lawDispatcher.functors[1].always_use_moment_law = True
   O.engines[2].physDispatcher.functors[1].setCohesionOnNewContacts = True
   checker.command='stop()'

def stop():
if O.time<10: return
O.pause()


O.saveTmp()
v=qt.View()
v.eyePosition=(0,-3,.5);v.upVector=(0,0,1);v.viewDir=(0,3,.5)

-- 
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 #671141]: Positioning a cylinder

2018-07-26 Thread drasszkusz
Question #671141 on Yade changed:
https://answers.launchpad.net/yade/+question/671141

drasszkusz 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 #671141]: Positioning a cylinder

2018-07-26 Thread drasszkusz
Question #671141 on Yade changed:
https://answers.launchpad.net/yade/+question/671141

drasszkusz gave more information on the question:
1. and 2. and 3. questions solved. Not really understood quaternion before.
drum=O.bodies.append(geom.facetCylinder((0,0,0),radius=1,height=2,orientation=Quaternion((1,0,0),pi/2),segmentsNumber=10,wallMask=4,color=(.3,.3,.3)))
RotationEngine(rotateAroundZero=True,zeroPoint=(0,0,0),rotationAxis=(0,1,0),angularVelocity=omega,
 ids = drum)

One question remained, if I use orientation=Quaternion((1,0,0),pi/4)
then how to calculate the rotation axis of the Rotation engine?

Thanks,
Daniel

-- 
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 #671141]: Positioning a cylinder

2018-07-26 Thread drasszkusz
New question #671141 on Yade:
https://answers.launchpad.net/yade/+question/671141

Hi all!

I would like to make a rotary drum. My first idea was to make it with 
facet.Cylinder command.

My questions are:
1. How can I make that the center line of the drum to be parallel to the x-axis 
not z-axis?
2. I would like to lift one end, so the drum's axis close some angle with 
x-axis. How should I do it?
3. Should I use a different command for making a cylinder?

Thanks,
Daniel

Here is a simple code:

from yade import pack, qt

readParamsFromTable(n=1,dens=2092,frict=40.3,E=4e5,coh=1e4,eta=.05)
from yade.params.table import *

#szemcses anyag adatai
particlematerial=CohFrictMat(young=E,poisson=.2,density=dens,frictionAngle=radians(frict),normalCohesion=coh,shearCohesion=coh,momentRotationLaw=True,etaRoll=eta,etaTwist=eta)
O.materials.append(particlematerial)

#sampling
sampling=.01 #second

#keveres parameterei
omega=2*pi*n

#rotary drum material
id_Mater=O.materials.append(FrictMat(young=200e9,poisson=.3,density=7750,frictionAngle=.7))
Mater=O.materials[id_Mater]

#rotary drum geometry
drum=O.bodies.append(geom.facetCylinder((0,0,0),radius=1,height=2,orientation=Quaternion((1,0,0),0),segmentsNumber=10,wallMask=4,color=(.3,.3,.3)))

#generating particles
sp=pack.SpherePack()
sp.makeCloud((-.1,-.1,.1),(.1,.1,.6),rMean=.02,rRelFuzz=0)
sp.toSimulation(material=particlematerial, color=(1,1,1))

#Engines
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Facet_Sphere_ScGeom()],


[Ip2_FrictMat_FrictMat_FrictPhys(),Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label="cohesiveIp")],

[Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom6D_CohFrictPhys_CohesionMoment(
useIncrementalForm=True,
always_use_moment_law=True,
label='cohesiveLaw')]
),
   NewtonIntegrator(gravity=(0,0,-9.81),damping=.5),
   
RotationEngine(rotateAroundZero=True,zeroPoint=(0,0,0),rotationAxis=(0,0,1),angularVelocity=omega,
 ids = drum),
   PyRunner(command='start()',realPeriod=2,label='checker'),

]

O.dt=.001*PWaveTimeStep()
O.step()

def start():
   if O.iter<1: return
   O.engines[2].lawDispatcher.functors[1].always_use_moment_law = True
   O.engines[2].physDispatcher.functors[1].setCohesionOnNewContacts = True
   checker.command='stop()'

def stop():
if O.time<10: return
O.pause()



O.saveTmp()
v=qt.View()
v.eyePosition=(0,-3,.5);v.upVector=(0,0,1);v.viewDir=(0,3,.5)

-- 
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 #633480]: CohFrictPhys model, setCohesionNow orsetCohesionOnNewContacts=True crashes simulation

2017-05-23 Thread drasszkusz
Question #633480 on Yade changed:
https://answers.launchpad.net/yade/+question/633480

Status: Open => Solved

drasszkusz confirmed that the question is solved:
Changing coh.setCohesionNow=True to
   O.engines[2].lawDispatcher.functors[1].always_use_moment_law = True
   O.engines[2].physDispatcher.functors[1].setCohesionNow = True

solved my problem!

Thanks,
Daniel

-- 
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 #633480]: CohFrictPhys model, setCohesionNow orsetCohesionOnNewContacts=True crashes simulation

2017-05-22 Thread drasszkusz
Question #633480 on Yade changed:
https://answers.launchpad.net/yade/+question/633480

Status: Needs information => Open

drasszkusz gave more information on the question:
Hi Jan!

We are both using the latest yadedaily (2017.01a-55-24e4703~xenial) on Ubuntu 
16.04 LTS.
I have tried to change the timestep and I have reinstalled Ubuntu, but it 
didn't help.

In the meantime I have written a very simple gravity deposition in a
facetBox with the same engine and that works very well. No crash, both
setCohesionNow and setCohesionOnNewContacts work perfectly. But the
original code still doesn't work.

Thanks,
Daniel

-- 
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 #633480]: CohFrictPhys model, setCohesionNow orsetCohesionOnNewContacts=True crashes simulation

2017-05-21 Thread drasszkusz
New question #633480 on Yade:
https://answers.launchpad.net/yade/+question/633480

Hi all!

I have a problem with CohFrictPhys model. When I turn setCohesionNow=True or 
setCohesionOnNewContacts=True then my simulation crashes. I tried one of my 
friend's code, he used the same options and it works very well. Does anyone 
know a solution?
Thanks!


My code:
from yade import pack, plot, qt
from datetime import datetime

suruseg=1338
surszog=42.2
E=2e6
nyiroszil=6.0529e3
normalszil=6e3
etagord=0.1
#etacsav=0.1

#sphere material
anyag=CohFrictMat(young=E,poisson=.2,density=suruseg,frictionAngle=radians(surszog),normalCohesion=normalszil,shearCohesion=nyiroszil,momentRotationLaw=True,etaRoll=etagord)
O.materials.append(anyag)

#box material
id_Mater=O.materials.append(FrictMat(young=200e9,poisson=.3,density=7750,frictionAngle=.7))
Mater=O.materials[id_Mater]

#faceBunker
adagolo=O.bodies.append(geom.facetBunker((0,0,.06),dBunker=0.3,dOutput=.025,hBunker=0,hOutput=.2382,hPipe=0,segmentsNumber=20,wallMask=4,material=Mater))

#nyitofedel
fedel=O.bodies.append(geom.facetBox((0,0,.07),(.015,.015,.01),wallMask=16,material=Mater))
fed1=O.bodies[40]
fed2=O.bodies[41]

#alap
alap=O.bodies.append(geom.facetBox((0,0,.03),(0.375,0.375,.03),wallMask=16,material=Mater))

sp=pack.SpherePack()
sp.makeCloud((-.03,-.03,.11),(.03,.03,.2),rMean=.00085,rRelFuzz=.0001,num=1)
sp.toSimulation(material=anyag)

O.engines=[
   ForceResetter(),
   # sphere, facet
   InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
   InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
  
[Ip2_FrictMat_FrictMat_FrictPhys(),Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label='coh')],
  
[Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom6D_CohFrictPhys_CohesionMoment(
useIncrementalForm=True, #useIncrementalForm is turned 
on as we want plasticity on the contact moments
always_use_moment_law=True #if we want "rolling" 
friction even if the contact is not cohesive (or cohesion is broken), we will 
have to turn this true somewhere
)]
   ),
   NewtonIntegrator(gravity=(0,0,-9.81),damping=.4),
   PyRunner(command='Unbalanced()',realPeriod=2,label='checker'),
   PyRunner(command='addPlotData()',iterPeriod=200),
]
O.dt=2*PWaveTimeStep()
O.step()

def Unbalanced():
   if O.iter<1: return
   coh.setCohesionNow=True
   fed1.state.vel=(0,10,0)
   fed2.state.vel=(0,10,0)

def addPlotData():
   Fz=abs(sum(O.forces.f(id)[2] for id in alap))
   plot.addData(Fz=Fz,t=O.time,unbalanced=unbalancedForce(),i=O.iter)

plot.plots={'i':('unbalanced'),'t':('Fz',)}
plot.plot()


O.saveTmp()
v=qt.View()
v.eyePosition=(.5,0,0);v.upVector=(0,0,1);v.viewDir=(-1,0,0)


Error message:
 *** Error in `/usr/bin/python': double free or corruption (!prev): 
0x7f9a8d4f4e40 ***
=== Backtrace: =
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f9af25b27e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x7fe0a)[0x7f9af25bae0a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f9af25be98c]
/usr/lib/x86_64-linux-gnu/yadedaily/libyade.so(+0x1b8e86a)[0x7f9aef8c286a]
/usr/lib/x86_64-linux-gnu/yadedaily/libyade.so(_ZN11Interaction5resetEv+0xe5)[0x7f9aef8c2a75]
/usr/lib/x86_64-linux-gnu/yadedaily/libyade.so(+0x2476994)[0x7f9af01aa994]
/usr/lib/x86_64-linux-gnu/libgomp.so.1(GOMP_parallel+0x3f)[0x7f9ae7527cbf]
/usr/lib/x86_64-linux-gnu/yadedaily/libyade.so(_ZN15InteractionLoop6actionEv+0x35b)[0x7f9af01ab43b]
/usr/lib/x86_64-linux-gnu/yadedaily/libyade.so(_ZN5Scene18moveToNextTimeStepEv+0x4e2)[0x7f9aef86df22]
/usr/lib/x86_64-linux-gnu/yadedaily/libyade.so(_ZN14SimulationFlow12singleActionEv+0x33)[0x7f9aef8c21b3]
/usr/lib/x86_64-linux-gnu/yadedaily/libyade.so(_ZN12ThreadWorker16callSingleActionEv+0x66)[0x7f9aef8c6db6]
/usr/lib/x86_64-linux-gnu/yadedaily/libyade.so(_ZN12ThreadRunner4callEv+0x51)[0x7f9aef8c43c1]
/usr/lib/x86_64-linux-gnu/yadedaily/libyade.so(_ZN12ThreadRunner3runEv+0x58)[0x7f9aef8c46a8]
/usr/lib/x86_64-linux-gnu/yadedaily/libyade.so(_ZN5boost6detail11thread_dataINS_9function0IvEEE3runEv+0x32)[0x7f9aef8c62a2]
/usr/lib/x86_64-linux-gnu/libboost_thread.so.1.58.0(+0x115d5)[0x7f9aecba95d5]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f9af290b6ba]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f9af264182d]
=== Memory map: 
0040-006ea000 r-xp  08:05 934433 
/usr/bin/python2.7
008e9000-008eb000 r--p 002e9000 08:05 934433 
/usr/bin/python2.7
008eb000-00962000 rw-p 002eb000 08:05 934433 
/usr/bin/python2.7
00962000-00985000 rw-p  00:00 0 
0135c000-07181000 rw-p  00:00 0  [heap]
7f9a8c00-7f9a8d555000 rw-p  00:00 0 
7f9a8d555000-7f9a9000 ---p  00:00 0 
7f9a9400-7f9a94021000 rw-p  00:00 0 
7f9a94021000-7f9a9800 ---p  00:00 0 
7f9a984a1000-7f9a984a9000 rw-s 

Re: [Yade-users] [Question #599692]: How to plot the generated z direction force on facet

2017-03-30 Thread drasszkusz
Question #599692 on Yade changed:
https://answers.launchpad.net/yade/+question/599692

drasszkusz 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 #599692]: How to plot the generated z direction force on facet

2017-03-30 Thread drasszkusz
Question #599692 on Yade changed:
https://answers.launchpad.net/yade/+question/599692

Status: Answered => Solved

drasszkusz confirmed that the question is solved:
I'm sorry Jan for bothering you, but you were right at the first time. I
just slipped over or I don't know, but "fSumZ = sum(O.forces.f(id)[2]
for id in ring)" works perfectly.

Thanks for your help!

Daniel

PS: The generated IDs of the cylinder like 449, 444 are changing every
time I change the code itself, so that's why it didn't work.

-- 
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 #599692]: How to plot the generated z direction force on facet

2017-03-29 Thread drasszkusz
Question #599692 on Yade changed:
https://answers.launchpad.net/yade/+question/599692

Status: Solved => Open

drasszkusz is still having a problem:
I'm sorry for writing an other question here, but it's strongly
connected to this topic.

I have found the ids of the bottom of the cylinder. They are 449, 446, 443,...
I have changed 'something' to these numbers like: bottomID = 
ring[449,446,443...], but Yade says that they are tuples, not integers. Okay, I 
get that. So I thought that I will name all of them alone, but before that I 
tried to write only one number in the [], then it says:

   bottomID=ring[449]
IndexError: list index out of range

I'm sure they are the right ids, because I tracked them in qt -> Display
-> the id option on.

What should I do?

-- 
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 #599692]: How to plot the generated z direction force on facet

2017-03-29 Thread drasszkusz
Question #599692 on Yade changed:
https://answers.launchpad.net/yade/+question/599692

drasszkusz 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 #599692]: How to plot the generated z direction force on facet

2017-03-29 Thread drasszkusz
Question #599692 on Yade changed:
https://answers.launchpad.net/yade/+question/599692

Status: Answered => Solved

drasszkusz confirmed that the question is solved:
Hi Jan!

Thank you for your fast respond! :)
As I see it will work, now I just have to figure out how to determine the id of 
the ring. But that will be the easy part. :)

Thanks,
Daniel

-- 
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 #599692]: How to plot the generated z direction force on facet

2017-03-29 Thread drasszkusz
Question #599692 on Yade changed:
https://answers.launchpad.net/yade/+question/599692

Description changed to:
Hi!

First of all I'm new to Yade and sorry if my problem is very simple, but i have 
no idea how to do it.
I'm making a gravity deposition and I want to plot the z direction force that 
generates on the ground facet.
How should I do it? Because facets don't have ids. :(
Thanks!

My code:

from yade import pack, plot, qt

sp=pack.SpherePack()
sp.makeCloud((-.7,-.7,6),(.7,.7,10),rMean=.1,rRelFuzz=.2)
sp.toSimulation()

ring=O.bodies.append(geom.facetCylinder((0,0,0),radius=3,height=3,wallMask=6))

O.engines=[
   ForceResetter(),
   # sphere, facet
   InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
   InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()]
   ),
   NewtonIntegrator(gravity=(0,0,-9.81),damping=0.5),
   PyRunner(command='addPlotData()',iterPeriod=200),
]
O.dt=.5*PWaveTimeStep()
O.step()

def addPlotData():
   Fz=O.forces.f(ring.id)[1]  #the problem is here
   plot.addData(Fz=Fz,t=O.time,unbalanced=unbalancedForce(),i=O.iter)

plot.plots={'i':('unbalanced'),'t':('Fz',)}
plot.plot()

O.saveTmp()
v=qt.View()
v.eyePosition=(10,0,-1);v.upVector=(0,0,1);v.viewDir=(-9.5,0,0)

-- 
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