Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Status: Answered => Solved
Kun Zeng confirmed that the question is solved:
Thanks Jan Stránský, that solved my question.
--
You received this question notification because your team yade-users is
an
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Kun Zeng posted a new comment:
Thanks Jan
--
You received this question notification because your team yade-users is
an answer contact for Yade.
___
Mailing list:
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Jan Stránský proposed the following answer:
(1) yes, the two pieces of code are equivalent, but still you use
rect(...), so I see no reason why this eorks and the previous did not
:-D
(2) as FEM part is not
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Kun Zeng posted a new comment:
Hi Jan,
Sorry to post so many comments and questions above. I changed the
NameError part in my code into this:
rects = (movables + rect((p000,p100,p110,p010)) +
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Kun Zeng posted a new comment:
Hi Jan,
You mean the file named " example2-yade-prepoc.py" ? In my simualtion, I
use this code to do preparation of the polyhedara particle layers:
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Jan Stránský proposed the following answer:
Ok, I have read the previous pssages in detail
> I would like to generate a beam by FEM and falling down on the
Polyhedra particles layers which I generated by Yade
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Kun Zeng posted a new comment:
The whole outcome is this:
Traceback (most recent call last):
File "example1.py", line 90, in
dem = YADE_API(demName)
File
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Kun Zeng posted a new comment:
Hi Jan,
I do used this code in my example1-yade.py file and it still same error:
NameError: global name 'rect' is not defined...
from libyade import yade
from yade import *
from
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Jan Stránský requested more information:
As I wrote, I have tried your code and had no problem and I don't see where
this NameError could come from, since rect is defined in the code..
please post here once
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Kun Zeng posted a new comment:
I would like to generate a beam by FEM and falling down on the Polyhedra
particles layers which I generated by Yade before this coupling(ymport
into this coupling). And when I run
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Jan Stránský requested more information:
Hi Kun,
so there must be some inconsistency. In the last code you posted there is
###
def rect(vs,**kw):
v1,v2,v3,v4 = vs
return [
yade.utils.facet((v1,v2,v3),**kw),
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Kun Zeng posted a new comment:
Hi Jan,
I run the .sh file and it still shows:
Traceback (most recent call last):
File "example1.py", line 90, in
dem = YADE_API(demName)
File
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Jan Stránský requested more information:
Thanks for the files, what is the problem now (I did not face any)?
Jan
--
You received this question notification because your team yade-users is
an answer contact for
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Kun Zeng posted a new comment:
The complete code of example1-yade.py is as below:
from libyade import yade
from yade import *
from yade import polyhedra_utils
from yade import ymport
from yade import Vector3
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Jan Stránský requested more information:
>NameError: global name 'rect' is not defined
> ...
> from yade.utils import facet
> but it shows:
> ImportError: cannot import name rect
rect is not part of yade, it is
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Kun Zeng posted a new comment:
Hi Jan, sorry for post so much questions here.
I thought i figure the facet problem by changing the code to:
yade.utils.facet((v1,v2,v3),**kw)
And I run my code it shows:
File
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Kun Zeng posted a new comment:
Thanks Jan. I add from yade import Vector3 at the top of my code. it
works. However, I changed the facet to:
def rect(vs,**kw):
v1,v2,v3,v4 = vs
return [
f =
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Jan Stránský proposed the following answer:
Similar to facet, use either
from yade import Vector3
or
yade.Vector3
cheers
Jan
--
You received this question notification because your team yade-users is
an answer
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Kun Zeng posted a new comment:
Sorry Jan, It is "NameError: name 'Vector3' is not defined" ...
--
You received this question notification because your team yade-users is
an answer contact for Yade.
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Kun Zeng posted a new comment:
I run my code again and it still shows :
sh example1.sh
Traceback (most recent call last):
File "example1.py", line 90, in
dem = YADE_API(demName)
File
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Jan Stránský requested more information:
Sorry, have not checked your code in detail, there you have indeed Vector3..
Does the error really says 'vector' is not defined? According to the error, it
considered
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Kun Zeng posted a new comment:
Hi Jan,
Yes, I use Vector3 in my code. But the error shows ' name 'vector' is
not defined ' like this: p000 = Vector3(0,0,0).
--
You received this question notification because
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Status: Open => Answered
Jan Stránský proposed the following answer:
Hello,
> NameError: global name 'facet' is not defined
if you use standalone yade, it imports a lot of stuff (like function facet) at
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Description changed to:
I change the code of the example1-yade.py file in [1] to the following
code:
from libyade import yade
from yade import polyhedra_utils
from yade import ymport
from yade import *
widthl
Question #658909 on Yade changed:
https://answers.launchpad.net/yade/+question/658909
Description changed to:
I change the code of the example1-yade.py file in [1] to the following
code:
from libyade import yade
from yade import polyhedra_utils
from yade import ymport
from yade import *
widthl
New question #658909 on Yade:
https://answers.launchpad.net/yade/+question/658909
I change the code of the example1-yade.py file in [1] to the following code:
from libyade import yade
from yade import polyhedra_utils
from yade import ymport
from yade import *
widthl = .3
widthr = .3
widthc = .3
26 matches
Mail list logo