yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #28585
Re: [Question #703717]: How to select the BCs in the uniax example
Question #703717 on Yade changed:
https://answers.launchpad.net/yade/+question/703717
Status: Open => Answered
Jan Stránský proposed the following answer:
> I can't understand the following code
please be more specific, what you do not understand, what is not clear, ...
Also, you ask help concerning "faces", but most of the code concerns cross section area..
> can you explain how to use uniaxialTestFeatures with an more simple
example if it is possible?
no, nothing simpler than
###
bb=uniaxialTestFeatures()
negIds,posIds=bb['negIds'],bb['posIds']
###
is possible.
"bb" is the result of uniaxialTestFeatures, so it is a dictionary of computed features [3].
Then you extract "negIds" and "posIds" values as the "faces" and store them in negIds and posIds variables
You can make it more verbose (and perhaps more clear) as:
###
bb = uniaxialTestFeatures()
negIds = bb['negIds']
posIds = bb['posIds']
###
Once more, note, that you can define the "face" particles (negIds,
posIds) completely yourself, without uniaxialTestFeatures, based on your
own condition
Also, you can experiment a bit yourself, e.g.
###
# create your packing
features = uniaxialTestFeatures()
negIds,posIds=features['negIds'],features['posIds']
for b in O.bodies: b.shape.color = (0,0,1)
for id in negIds: O.bodies[id].shape.color = (1,0,0)
for id in posIds: O.bodies[id].shape.color = (0,1,0)
# 3D view
###
Cheers
Jan
--
You received this question notification because your team yade-users is
an answer contact for Yade.