Coupling LBM code wirtten on c++ with Yade

Asked by Ataollah Nateghi

Hello
I am trying to couple my 3-D LBM(Lattice Boltzmann Method) code, written on c++, with yade. I am beginner in yade and I tried to find some examples in manual for coupling problem however I couldn't. It would be appreciated if you can give some recommendation about starting point. Is there any example or chapter that I can use it for getting the Idea about coupling my code?
Thanks in advance.
Ata

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

Revision history for this message
Jérôme Duriez (jduriez) said :
#1

Hi,

You have one short example here: https://yade-dem.org/doc/FEMxDEM.html.

In this case, use is made of a common Python interface to couple YADE with another code. From my understanding, this is maybe the most convenient way to do things, at least from the YADE's side.

One possibility then would be to embed your LBM C++ code into Python, following the Python standard [1] and/or the dedicated Boost library [2] (by the way, this is how YADE "turns" from C++ to Python)

Maybe not an easy/small task to do, depending on your coding skills.

Jérôme

[1] https://docs.python.org/2.7/c-api/index.html#c-api-index
[2] https://www.boost.org/doc/libs/1_67_0/libs/python/doc/html/index.html

Revision history for this message
Ataollah Nateghi (anateghi) said :
#3

Thanks Jérôme Duriez, that solved my question.

Revision history for this message
Chareyre (bruno-chareyre-9) said :
#4

Hi,
Coupling via python will make it more flexible and most likely less
efficient.
Integrating your code regardless of python is not something to disregard.
I'm not pushing in any particular direction, just pointing out that there
are various viable options which should be considered.
Bruno

Le mar. 24 juil. 2018 16:38, Ataollah Nateghi <
<email address hidden>> a écrit :

> Question #671074 on Yade changed:
> https://answers.launchpad.net/yade/+question/671074
>
> Status: Answered => Solved
>
> Ataollah Nateghi confirmed that the question is solved:
> Thanks Jérôme Duriez, that solved my question.
>
> --
> 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 : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Ataollah Nateghi (anateghi) said :
#5

Bruno
Thank you so much for you response. May I get more information about Integrating the code regardless of python.

Revision history for this message
Chareyre (bruno-chareyre-9) said :
#6

FlowEngine is a fluid solver which is part of yade and does not communicate
through python at any point, yet reading it is not an easy thing.
The first step for c++ integration is to understand the logic of yade
engines. I'll be glad to help if you have more questions on this.
B

Le ven. 27 juil. 2018 22:47, Ataollah Nateghi <
<email address hidden>> a écrit :

> Question #671074 on Yade changed:
> https://answers.launchpad.net/yade/+question/671074
>
> Status: Solved => Open
>
> Ataollah Nateghi is still having a problem:
> Bruno
> Thank you so much for you response. May I get more information about
> Integrating the code regardless of python.
>
> --
> 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 : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>
>

Revision history for this message
Ataollah Nateghi (anateghi) said :
#7

Bruno
Thank you for kindness, I will get more help from you.
Regards.

Can you help with this problem?

Provide an answer of your own, or ask Ataollah Nateghi for more information if necessary.

To post a message you must log in.