Opened 3 years ago

Closed 6 months ago

#50687 closed enhancement (fixed)

netgen @5.3.1 Add nglib and occ variants

Reported by: ian.rees@… Owned by: seanfarley (Sean Farley)
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc: mbrethen, MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: netgen

Description

I've added two variants, which are meant to enable features available in the netgen configure script. The nglib variant installs a shared library for netgen, and the occ variant builds in support for the opencascade CAD kernel.

The nglib variant is a little more complex than might be expected - this is because using nglib requires some headers, which aren't installed by netgen's makefile. Those headers are installed into ${prefix}/share/netgen/libsrc following the example used in Linux distributions.

The occ variant requires a small patch, also included.

Reason for this request is to enable the finite element workbench in FreeCAD, which uses nglib for meshing. Thanks! -Ian-

Attachments (4)

patch-libsrc-occ-Partition_Loop2d.cxx.diff (376 bytes) - added by ian.rees@… 3 years ago.
Patch for netgen required by updated Portfile
ng_vol.cpp.diff (1.1 KB) - added by mbrethen 3 years ago.
changes to ng_vol.cpp for calculix
patch-nglib-ng_vol.cpp.diff (1.1 KB) - added by mbrethen 3 years ago.
Patch is required for setting a target element size using ng_vol
netgen.Portfile.diff (3.6 KB) - added by ian.rees@… 3 years ago.
Add nglib installation by default, add occ variant, reference patch-nglib-ng_vol.cpp.diff

Download all attachments as: .zip

Change History (21)

Changed 3 years ago by ian.rees@…

Patch for netgen required by updated Portfile

comment:1 Changed 3 years ago by ian.rees@…

Updated the portfile to use ${prefix}/include/netgen for the headers instead of ${prefix}/share/netgen/libsrc following discussion with another FreeCAD developer. Sorry about the quick change! -Ian-

comment:2 Changed 3 years ago by mf2k (Frank Schima)

Keywords: haspatch added
Version: 2.3.4

comment:3 Changed 3 years ago by seanfarley (Sean Farley)

Is there any reason not to always enable shared libraries? I try to make sure those are always there in my ports. The rest of it looks ok to me. I should probably add mpi to it one day.

comment:4 in reply to:  3 Changed 3 years ago by ian.rees@…

Replying to sean@…:

Is there any reason not to always enable shared libraries?

Not sure - as far as I'm concerned it's fine to turn on that option by default.

comment:5 in reply to:  3 Changed 3 years ago by ian.rees@…

Replying to sean@…:

Is there any reason not to always enable shared libraries? I try to make sure those are always there in my ports. The rest of it looks ok to me.

Apologies for the double post - should I submit another patch to add "default_variants +nglib" ? -Ian-

comment:6 Changed 3 years ago by seanfarley (Sean Farley)

No worries, I can fix it in flight when I get back next week.

comment:7 Changed 3 years ago by seanfarley (Sean Farley)

Owner: changed from macports-tickets@… to sean@…
Status: newassigned

comment:8 Changed 3 years ago by mbrethen

Cc: mark.brethen@… added

Cc Me!

Changed 3 years ago by mbrethen

Attachment: ng_vol.cpp.diff added

changes to ng_vol.cpp for calculix

comment:9 Changed 3 years ago by mbrethen

I have attached a diff file of the additions to ng_vol from the calculix distro. Note: this was NetGen 5.1. cgx uses “ng_vol“ to allow for tet meshing with a target element size.

Update: I finished Test C “mesh“ – Tet-Meshing With Netgen Binary “ng_vol” in the cgx install guide and passed all tests. So I conclude that the current build of netgen works with calculix -- no patch is necessary.

Last edited 3 years ago by mbrethen (previous) (diff)

comment:10 Changed 3 years ago by ian.rees@…

Do we need to get this merged before the Calculix ccx and cgx Port then?

My personal goal is FEM working in FreeCAD for people who use MacPorts. For that use case, we need both ccx and nglib before we get FreeCAD FEM, but there's no dependency between ccx and nglib AFAICT.

comment:11 Changed 3 years ago by mbrethen

I tested ng_vol with calculix and it is working so the ng_vol.cpp.diff can be discarded. Netgen is a run dependency but you can also use gmsh with calculix. You wouldn't need to merge the nglib and occ variants before the calculix release.

Changed 3 years ago by mbrethen

Attachment: patch-nglib-ng_vol.cpp.diff added

Patch is required for setting a target element size using ng_vol

comment:12 Changed 3 years ago by mbrethen

After further testing this afternoon I have determined that element target size wasn't working. Add patch-nglib-ng_vol.cpp.diff​ to files directory and revise portfile to include patch. This will need to be merged before the Calculix port, otherwise you will not be able to control element size when meshing with netgen.

comment:13 Changed 3 years ago by seanfarley (Sean Farley)

I've lost some context here but do we really need this as a variant? Why not just build it all the time?

comment:14 Changed 3 years ago by mbrethen

The ng_vol.cpp patch should build all the time.

Changed 3 years ago by ian.rees@…

Attachment: netgen.Portfile.diff added

Add nglib installation by default, add occ variant, reference patch-nglib-ng_vol.cpp.diff

comment:15 Changed 3 years ago by ian.rees@…

Have updated the Portfile diff, I think the current state of attachments to this ticket is:

patch-libsrc-occ-Partition_Loop2d.cxx.diff - Added to netgen's files

ng_vol.cpp.diff - Discard this

patch-nglib-ng_vol.cpp.diff - Added to netgen's files

netgen.Portfile.diff - Patch to be applied against the Portfile

Thanks! -Ian-

Last edited 3 years ago by ian.rees@… (previous) (diff)

comment:16 Changed 6 months ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Cc: MarcusCalhoun-Lopez added

comment:17 Changed 6 months ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: fixed
Status: assignedclosed

In 933a1b346a89cf644cb6b467b9301958b56676ab/macports-ports (master):

netgen/ngsolve: update version 5.3.1/5.1->6.2.1808

Fixes #50687

Note: See TracTickets for help on using tickets.