← Back to team overview

yade-dev team mailing list archive

Re: [yade-dev] How to import material properties from ascci file

 

If you need different material properties, you should, probably, do some
modification on ymport.ascii function, like it has been done with
'wenjieFormat'.

First of all, you should add some materials to your simulation and then
create the 5-th column with 'materialID' value.

______________________________

Anton Gladkyy


2010/1/6 luc scholtes <lscholtes63@xxxxxxxxx>

> 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
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-dev<https://launchpad.net/%7Eyade-dev>
> Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-dev<https://launchpad.net/%7Eyade-dev>
> More help   : https://help.launchpad.net/ListHelp
>
>

Follow ups

References