Re: [Yade-users] [Question #665341]: iterations in c++

2018-03-09 Thread JOHN
Question #665341 on Yade changed:
https://answers.launchpad.net/yade/+question/665341

Status: Open => Solved

JOHN confirmed that the question is solved:
nevermind, i compiled the yade trunk myself and i was able to link with
the correct hpp files

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #665341]: iterations in c++

2018-03-07 Thread JOHN
Question #665341 on Yade changed:
https://answers.launchpad.net/yade/+question/665341

JOHN gave more information on the question:
So i just want a way to iterate through a yade body from a c++ file I
wrote without using the yade source files or recompiling

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #665341]: iterations in c++

2018-03-07 Thread JOHN
Question #665341 on Yade changed:
https://answers.launchpad.net/yade/+question/665341

Status: Needs information => Open

JOHN gave more information on the question:
I have explained what i wanted very badly, let me try again.

I have a library  (so)  of c++ helper functions with the approporiate boost 
wrappers to python.
Ideally, i would like to include there all the yade parts that require 
iteration through all  the Yadebodies component. Like this function
def checkAndDelete(boundaries):

 for b in O.bodies:

  if isinstance(b.shape,Sphere):

   x,y,z = b.state.pos

   if (xboundaries[1] or yboundaries[3] or zboundaries[5]): # modify this
condition to your needs

  loc2glob.remove(b.id)

O.bodies.erase(b.id)


then i would ideally like to import the library to the yade script and instead 
of calling a python function call something like 
helper.searchanddelete(O.bodies)


Unfortunately, to do this i need to somehow define what a body is.  I searched 
my computer for the body.cpp etc, but since i installed it using sudo-apt-get 
install i didnt get the git content but rather some library and python files. 
I then tried downloading the core folder from git and used the following very 
simple c++ code to see if i can import the cpp files.


#include
#include

using namespace std;

int main(){
cout<<"imported"<

Re: [Yade-users] [Question #665341]: iterations in c++

2018-03-07 Thread Jan Stránský
Question #665341 on Yade changed:
https://answers.launchpad.net/yade/+question/665341

Status: Open => Needs information

Jan Stránský requested more information:
if you want to modify source code, you will need compilation from source
[1].

To get better answer, please be more specific on what you have done so
far (i.e. the part "just download them form git and call them as any
other file")

cheers
Jan

[1] https://yade-dem.org/doc/installation.html#source-code

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #665341]: iterations in c++

2018-03-07 Thread JOHN
Question #665341 on Yade changed:
https://answers.launchpad.net/yade/+question/665341

Status: Needs information => Open

JOHN gave more information on the question:
Hello, 
I apologise for the vagueness , I meant a yade object

Unfortunately, I installed yade through sudo-apt get install and cant find any 
of the cpp or hpp files needed to be included. And when i try to just download 
them form git and call them as any other file i get
/usr/include/boost/python/detail/wrap_python.hpp:50:23: fatal error: 
pyconfig.h: No such file or directory
compilation terminated.

which i think exists, as yade runs correctly.

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #665341]: iterations in c++

2018-03-07 Thread Jan Stránský
Question #665341 on Yade changed:
https://answers.launchpad.net/yade/+question/665341

Status: Open => Needs information

Jan Stránský requested more information:
Hello John,

please soecify more what "a body in c++" is. A body of a function? Yade
Body? ...?

you can have a look at e.g. PWaveTimeStep [1,2,3,4] to see how it is
written. In py/_utils.cpp and pkde/dem/Shop* there are plenty of similar
functions.

cheers
Jan 

[1] https://github.com/yade/trunk/blob/master/py/_utils.cpp#L41
[2] https://github.com/yade/trunk/blob/master/py/_utils.cpp#L459
[3] https://github.com/yade/trunk/blob/master/pkg/dem/Shop.hpp#L62
[4] https://github.com/yade/trunk/blob/master/pkg/dem/Shop_01.cpp#L410

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp