Can I control the seed in randomdensepack?
Hello to everyone,
I am trying to make a simulation of cutting of a synthetic sample (i will post the code above).
I am creating the sample with randomdensepack, but every time i am making the simulation , i take different diagramm of the force. This is due to the seed, that is in randomdensepack (which i can control).
My question is: If i want to put a constant value of the seed number, how i do it?
I haven't build yade from trunk, i install it via < sudo ....>
My ubuntu distribution is Bionic 18.04.
Thanks a lot.
The code is:
!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import division
from yade import plot,pack,timing, utils, geom
import time, sys, os, copy
# default parameters or from table
readParamsFromT
density = 2674.3,
frictionAngle= 44, #frictionAngle
tensileStrength = 65e6, #Tensile Strength
poisson=.20,
cohesion = 65e6, #Shear Strength
young = 60e9,
intRadius=1.00, # to set initial contacts to larger neighbours
dtSafety=.8,
damping=0.6,
# Characteristic of sample:
x = 75e-3, #75e-3
y = 27e-3,
z= 6.35e-3, # edw to exoume balei na einai idio me to platos tou koptikou
# Characteristic of shperes
sphereRadius=1e-3, #0.35e-3
rRelFuzz=.34,
#characteristic of cutter
x_cutter = 5e-3, # mhkos kata ton x-axona
y_cutter = 1e-3, # ipsos koptikou (y-axona)
z_cutter = 6.35e-3, # platos koptikou
DOC = 5e-3, #Bathos kopis
)
from yade.params.table import *
if 'description' in O.tags.keys(): O.tags[
#material properties
sample = O.materials.
sps=SpherePack()
sp=pack.
sp.toSimulation
#kataskeuh koptikou
bx = geom.facetBox(
O.bodies.append(bx)
for facet in bx:
facet.
facet.
O.dt=dtSafety*
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Law2_
),
GlobalStiff
VTKRecorder
NewtonInteg
PyRunner(
PyRunner(
]
def addPlotData():
global Fx
global dx
Fx = 0.0
Fx = abs(sum(
plot.addData(i = O.iter , Fx=Fx, dx = bx[0].state.pos[0], tc=interactionL
plot.
def StopSimulation():
if bx[0].state.pos[0] >= 0.0:
O.pause()
plot.plots=
plot.plot()
print " Number of particles: %s" %(len(O.bodies))
print " Number of Interactions per Particle: %s" %(utils.
print " Porosity of sample is: %s" %(utils.porosity())
print "\n"
O.step()
is2aabb.
ss2sc.interacti
print " Number of particles: %s" %(len(O.bodies))
print " Number of Interactions per Particle: %s" %(utils.
print " Porosity of sample is: %s" %(utils.porosity())
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jan Stránský
- Solved:
- Last query:
- Last reply: