← Back to team overview

yade-users team mailing list archive

Re: [Question #696060]: How to make some stress plates consist of 3 circles (that have radius gradually (0.5, 1, 2)?

 

Question #696060 on Yade changed:
https://answers.launchpad.net/yade/+question/696060

Jan Stránský posted a new comment:
> AttributeError: 'ScGeom' object has no attribute 'area1'

the error message should be clear.
Always try to get rid of errors in the very first place. The rest of the function (getBottomStress) has no meaning if you have error at the very beginning of it.
As discussed, in DEM (D = discrete), everything is discrete, so interaction.geom.area (area being not so much discrete) is likely not to be available (which actually is the case).

> if (i.geom.area1).norm()

even i.geom.area1 exists (if assuming area, why area1 and not area?),
what would be the meaning of "area.norm()"? And what "if area.norm()",
which would always evaluate to True?

> with that syntax

apart from syntax, code has some context and semantics. First, try to
understand the code before modifying it.

> I thought ...

you can always put some prints to see what the variables are (in case of
no errors, of course).


Have a try. But as discussed, this is a "crude" approach, I **personally** would add some "smoothing".
###
def getBottomStress(center,radius):
    # center ... center of the stress circle
    # radius ... radius of the circle
    interactions = bottom.intrs()
    interactions = [i for i in interactions if (i.geom.contactPoint-center).norm() < radius]
    fns = [i.phys.normalForce for i in interactions]
    fnTot = sum(fn.norm() for fn in fns)
    area = pi * radius**2
    stress = fnTot / area
    return stress
    # TODO shear stress?
###

cheers
Jan

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.