About netgen integration

Asked by burak er

Dear Yade-Dev,

I want to integrate Netgen functionality into yade. Therefore I try to
use netgen interface. But I could not be able to properly do this.
I need help on netgen interface integraity on yade.

Anyone experienced using nginterface.h header(nglib has not enough functions) and linking
corresponding shared library with any program?

Thank you in advance.

Burak ER

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
burak er
Solved:
Last query:
Last reply:
Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#1

Hi Burak, the question sounds more relevant for tetgen forums, isn't it?

Revision history for this message
Anton Gladky (gladky-anton) said :
#2

To integrate netgen to yade properly, you need to get FindNetgen.cmake,
include it like for example cgal or gl2ps [1], [2] and then link.

How to use netgen, it is better to read corresponding DOCS or ask netgen-forum,
like Bruno suggested.

[1] https://github.com/yade/trunk/blob/master/CMakeLists.txt#L35
[1] https://github.com/yade/trunk/blob/master/CMakeLists.txt#L268

Anton

2013/10/29 burak er <email address hidden>:
> I want to integrate Netgen functionality into yade. Therefore I try to
> use netgen interface. But I could not be able to properly do this.
> I need help on netgen interface integraity on yade.
>
> Anyone experienced using nginterface.h header(nglib has not enough functions) and linking
> corresponding shared library with any program?

Revision history for this message
burak er (burak-er) said :
#3

Hi Anton,

I have found a way to integrate netgen but i have to compile complete netgen into a shared library. This is because sub components of netgen decleares so many extern variables and functions that are defined in other modules. Therefore, adding modules individually is impossible.

I want to ask if it is suitable to integrate complete netgen(licensed under LGPL) into yade for compilation? It has the advantage of having a roboust gui which lets user to mesh on the netgen gui, then, import it into yade. That is far better than dividing domain into tetraherons in yade with CGAL .

Also, I should mention that If i add netgen into yade, the compilation becomes very slow.

Thank you in advance.

Revision history for this message
Anton Gladky (gladky-anton) said :
#4

Hi,

please, read about shared libraries [1]. You do not need neither
compile it, nor to include the whole source into the Yade. Netgen
is provided as a separate package including shared library [2] and
some tools (probably with GUI) [3].

We are trying to get rid of all 3-rd party sources from Yade, so including
some more of them is a really bad idea.

> sub components of netgen decleares so many extern variables and
> functions that are defined in other modules.

Hmm, I am not sure, that I understand, what you mean here. Netgen requires
additional dependencies?

[1] http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
[2] http://packages.debian.org/sid/amd64/libnglib-4.9.13/filelist
[3] http://packages.debian.org/sid/amd64/netgen/filelist

Anton

2013/11/1 burak er <email address hidden>:
> Question #238297 on Yade changed:
> https://answers.launchpad.net/yade/+question/238297
>
> Status: Answered => Open
>
> burak er is still having a problem:
> Hi Anton,
>
> I have found a way to integrate netgen but i have to compile complete
> netgen into a shared library. This is because sub components of netgen
> decleares so many extern variables and functions that are defined in
> other modules. Therefore, adding modules individually is impossible.
>
> I want to ask if it is suitable to integrate complete netgen(licensed
> under LGPL) into yade for compilation? It has the advantage of having a
> roboust gui which lets user to mesh on the netgen gui, then, import it
> into yade. That is far better than dividing domain into tetraherons in
> yade with CGAL .
>
> Also, I should mention that If i add netgen into yade, the compilation
> becomes very slow.
>
> Thank you in advance.
>
> --
> You received this question notification because you are a member of
> yade-users, which 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
burak er (burak-er) said :
#5

Hi Anton,

After a month I want to answer you. Netgen library should be compiled as a whole because of the variables that are defined with the "extern" keyword. The externally defined variables require to be in another executable part, therefore, if you do not add that executable(shared library in this case) the linker will complain and refuse to link. You should have all the shared libraries where your extern variables are defined. In Netgen nearly all modules have external variables. Which makes it impossible to use individual Netgen components.

I have also give up trying to use external meshing libraries. I just use their gui to create mesh and then import by reading the mesh file in python.

Thank you for your answers.

Revision history for this message
Anton Gladky (gladky-anton) said :
#6

If you mean this bug [1], than it should be fixed already [2].
Please, provide somewhere your code, so we can check it
out.

[1] http://bugs.debian.org/648047
[2] http://lists.alioth.debian.org/pipermail/debian-science-maintainers/2013-December/021656.html

Cheers,

Anton

2013/12/9 burak er <email address hidden>:
> After a month I want to answer you. Netgen library should be compiled as
> a whole because of the variables that are defined with the "extern"
> keyword. The externally defined variables require to be in another
> executable part, therefore, if you do not add that executable(shared
> library in this case) the linker will complain and refuse to link. You
> should have all the shared libraries where your extern variables are
> defined. In Netgen nearly all modules have external variables. Which
> makes it impossible to use individual Netgen components.