ymport.textClumps "TypeError"

Asked by Weimin Song

Dear all

         Some clump particles were first generated and exported using export.textClumps, the clumps will be used in another test. When I use export.textClumps to import the clumps to a new test, the following error appears:

TypeError: No registered converter was able to produce a C++ rvalue of type boost::shared_ptr<Body> from this Python object of type tuple

        How should I solve this problem?

       The scripts is here https://www.dropbox.com/sh/l87orgnmxlgf582/AAACFqU2No4qOSyD29r6lfhWa?dl=0

      Thanks in advance!

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Weimin Song (wsong8) said :
#1

Thanks in advance.

Revision history for this message
Weimin Song (wsong8) said :
#2

Just a mistake. The question still need answers.

Revision history for this message
Best Jan Stránský (honzik) said :
#3

Hi Weimin,
have a look at doc [1], the loaded particles are already O.bodies.appended

########### some test
...
print len(O.bodies)
clumps = ymport.textClumps("spheres.dat")
print len(O.bodies)
# print clumps # is not "list of spheres" as the docs says, but rather list of (clumpID,[member1ID,member2ID...]), as returned by O.bodies.appendClumped
###########

cheers
Jan

[1] When I use export.textClumps to import the clumps

Revision history for this message
Weimin Song (wsong8) said :
#4

Thanks Jan Stránský, that solved my question.