yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #02955
[yade-dev] How to import material properties from ascci file
Hi all,
Is there a way to allow the ascii() function defined in yade.ymport to
determine some bodies properties from the same ascii file? By now, the ascii
files contains spheres positions (row[0], [1] and [2]) as well as radius
(row[3]), and would like to define some additional rows for some material
properties like the friction angle for example. I am able to save the
corresponding customized ascii file from a small modification of the
sphereToFile() function, but, unfortunately, I cannot find how to import
these features. It is definitely not the good way, but it should be
something like this
def asciiMaterial(filename,scale=1.,***kw*):
from yade.utils import sphere
o=Omega( )
ret=[ ]
for l in open(filename):
ss=[float(i) for i in l.split()]
ret.append(sphere([scale*ss[0],scale*ss[1],scale*ss[2]],scale*ss[3],material=GranularMat(frictionAngle=ss[4]))
return ret
I am still confused with how to deal with the **kw arguments. If you have
any suggestions, it would be very helpful ( I saw the _commonBodySetup()
function...)
Luc
Follow ups