← Back to team overview

yade-dev team mailing list archive

Re: r1667 & utils.*_v2

 

Sega, congrats for the color scale!

I found a few new *_v2 functions in utils, are they necessary? I am not
sure exactly why you created those, but if that is for physical
parameters that don't define young, poissons, frictionAngle (not derived
from BodyMacroParameters), one could just test if those attributes are
provided in the requested class, and not assign them if they are not,
something like:

physParams={'se3':[center[0],center[1],center[2],1,0,0,0],'refSe3':[center[0],center[1],center[2],1,0,0,0],'mass':V*density,'inertia':[inert,inert,inert]}
physParams.update({'young':30e6,'poisson':.2})
s.phys=PhysicalParameters(ppClass)
for k in [attr in physParams.keys() if attr in s.phys.keys()]:
   s.phys[k]=physParams[k]

(or more readable)

for k in physParams.keys():
    if k in s.phys.keys(): s.phys[k]=physParams[k]

Whould you agree to do it in this way?

Best, Vaclav



Follow ups

References