← Back to team overview

yade-dev team mailing list archive

Re: [Bug 1229783] Re: Loading clumps takes too much time

 

Zitat von Bruno Chareyre <bruno.chareyre@xxxxxxxxxxx>:

Thanks Christian for comments.
Is that possible to use the same method as before, where the inertia was
just the total inertia of members? We should really keep that option
even if the default is now to compute inertia automaticaly. Reasons are
that sometimes we want something fast and we don't care about physical
correctness, or someone may want to define inertia his own way.
It is not nice if appendClumped() is forcing a round of
updateProperties() when overlaps are present.

it already would have been implemented this way, but c++ is not my language ...


For the TODO, it seems to me that the best way is to add arguments to
clump() and other functions, and give them default values.
Body::id_t clump(vector<Body::id_t> ids,unsigned int discretization,
bool updateProp){
...
.def("clump",&pyBodyContainer::clump,(python::arg("discretization")=5,
python::arg("updateProp")=true),"Clump given bodies together...

ok, i tried for testing getRoundness() method, which needs a python list as argument, so i tried:

1.)
.def("getRoundness",&pyBodyContainer::getRoundness,(python::arg("excludeList")=python::list),"Returns ...

-> /home/me/YADE/trunk/py/wrapper/yadeWrapper.cpp:868: error: expected primary-expression before ')' token

2.)
.def("getRoundness",&pyBodyContainer::getRoundness,(python::arg("excludeList")),"Returns ...

-> compilation ok, but running replaceByClumps-example.py said:

ArgumentError: Python argument types in
    BodyContainer.getRoundness(BodyContainer)
did not match C++ signature:
    getRoundness(pyBodyContainer {lvalue}, boost::python::list excludeList)

while using getRoundness() instead of getRoundness([])

hmpf!





Follow ups

References