← Back to team overview

yade-users team mailing list archive

Re: help with error debug


OK, better here.

1. Why do you create CSMat if you don't need it? Just used GranularMat
(see below, BodyMacroParameters is no loger used), unless you plan to
add something in the future, specific to your model. Your Ip2_* will
then have FUNCTOR2D(GranularMat,GranularMat), of course.

2. Don't use PhysicalParameters, use Material instead. I am sorry that
you came in the middle of those changes. Update your tree (bzr up) and
check the prototype for InteractionPhysicsEngineUnit, it takes 2
Material instances.

3. Rename BasicPM.{hpp,cpp} to something descriptive. Everything in yade
is called Simple* or like that, which doesn't mean nothing. Call it
CundallStrack.{hpp,cpp} if you want, that at least says what it is.

4. Move BasicPMTest.py to scripts/test/CundallStrack.py. Python files
have nothing to do in c++ sources.

5. CundallStrackLaw should be renamed to
Law2_Dem3Dof_CSPhys_CundallStrack or something like that... Sounds
weird, right, but it has some logic: Law2 (2-ary functor) with 2
arguments of types Dem3Dof and CSPhys, then add anything you want
(nothing, or CundallStrack to make clear what it does). Sorry, this has
become recently a de-facto (de-Vaclav ;-) ) standard and it works quite
well, so let's keep it.

6. polymorphic classes (those with createIndex at least) must have some
virtual function in the .cpp file, otherwise their vtable will not be
created and virtual functions (and dispatchers) will not work as you
need. Therefore, declare e.g. virtual ~Ip2_CSMat_CSMat_CSPhys() and put
empty implementation to the .cpp file (like
Ip2_CSMat_CSMat_CSPhys::~Ip2_CSMat_CSMat_CSPhys(){}), that is enough.

7. Add longer comment to the beginning of the .hpp file, perhaps before
CundallStrackLaw. Begin the comment with /*! (so that doxygen picks it
up) and add references to articles you took this law from, explain what
other classes it uses for, what is the intent.

8. Add e-mail to the author notice at the top of the file.

Thanks, nice work!

Cheers, Vaclav

> Thanks for the advice :).  I've just commited the contactlaw called
> BasicPM in pkg/dem/meta.  The python file is also there.
> Cheers,
> CWBoon
> ______________________________________________________________________
> New Windows 7: Find the right PC for you. Learn more.
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to     : yade-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp

Follow ups