yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #11499
Re: About Shop01 - Shop02 - _utils .cpp
Ok, thank you ! It allowed me to modify getStress() as I want, by the way it's commited now. (*)
For the record, there should be still the issue of doc hyperlinks. Regarding a private answer from Jan, hyperlinks such as :yref:`yade._utils.PWaveTimeStep` do not work, they send to URL like yade._utils.html#yade._utils.PWaveTimeStep (two underscores).
Correct URL is yade.utils.html#yade._utils.PWaveTimeStep (only one underscore).
Jerome
(*) https://github.com/yade/trunk/commit/05599b23808991dbfef6b85400c7ddd32be594e0
________________________________________
From: Anton Gladky [gladky.anton@xxxxxxxxx]
Sent: October 14, 2014 9:56 AM
To: Jerome Duriez
Cc: yade-dev@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Yade-dev] About Shop01 - Shop02 - _utils .cpp
Hi Jerome,
thanks for pointing that out. There were really architecture problems
in _utils.cpp.
This commit [1] moves function declarations into _utils.hpp as well as
aabbExtrema() was moved into Shop.
Please test it and check whether it fixes your problems.
Cheers
[1] https://github.com/yade/trunk/commit/b732cee24be703f59528bac48903b0b29a79b3fd
Anton
2014-10-11 0:46 GMT+02:00 Jerome Duriez <Jerome.Duriez@xxxxxxxxxxx>:
> Hi, let me first explain how I was getting to the question, and after asking
> the question
>
> I was trying to change a little get the behaviour of python getStress
> function, so that it takes into account the "real" (according to
> aabbExtrema() ) volume in non periodic case, rather than considering
> arbitrarily 1. This might avoid silly lost minutes....
> So, as I did for porosity in Shop01.cpp, I wanted to change some code about
> getStress() in Shop02.cpp, using aabbExtrema() from _utils.cpp. Basically, I
> need then to include _utils.cpp both in Shop01.cpp or Shop02.cpp
>
> * the most logical would maybe to include _utils.cpp from Shop.hpp, but
> _utils.cpp itself includes Shop.hpp...
> * So, I included _utils.cpp both from Shop01.cpp and Shop02.cpp. This leads
> to "multiple definition" compilation errors, even if I add an inclusion
> guard (currently not existing) in _utils.cpp. Apparently, this should not be
> a surprize, and there might be solutions to this problem [1]
>
> But before I really understand this, here is my main question :
> - where does the need of an _utils.cpp file come from ? Apparently there is,
> at the end of the file, lines that allow to define python functions
> corresponding to c++ functions (e.g. from Shop). Would it be possible to
> define this elsewhere ?
>
> Furthermore, this _utils.cpp is quite annoying for hyperlinks in sphinx doc.
> See e.g. the link towards utils.PWaveTimeStep in [2] that is broken and that
> I do not know how to fix because PWaveTimeStep() is defined in _utils.cpp
> and not in utils.py
>
> Hoping that you will find some interesting point in this question, or at
> least a solution to the initial problem, happy Thanksgiving !
>
> Jerome
>
>
> [1]
> http://stackoverflow.com/questions/14909997/why-arent-my-include-guards-preventing-recursive-inclusion-and-multiple-symbol
> [2]
> https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.GlobalStiffnessTimeStepper.defaultDt
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-dev
> Post to : yade-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-dev
> More help : https://help.launchpad.net/ListHelp
>
References