CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [Netgen] Netgen now on Sourceforge (https://www.cfd-online.com/Forums/openfoam-meshing/61942-netgen-now-sourceforge.html)

philippose January 20, 2009 14:12

Netgen now on Sourceforge
 
Hello and a Good Evening :-)!

I just wanted to inform the OpenFOAM community, that the opensource mesher by Joachim Schoeberl and his team (Netgen) now has its own Sourceforge project entry at:

http://sourceforge.net/projects/netgen-mesher

The latest source code can be downloaded from the SVN repository:

http://netgen-mesher.svn.sourceforge.net

The version available from the repository uses "autotools" to ease compilation, but since it is still being implemented, it would be great if people could try to compile it on their machines, and provide feedback (preferably directly to the Netgen Forum on Sourceforge) when they trip up on something.

Enjoy, and have a nice day!

Philippose

philippose February 8, 2009 13:53

Hello again, A Good Day to
 
Hello again,

A Good Day to everyone :-)!

This is just to add on to the previous post, to inform the OpenFOAM Community, that now the Netgen SVN repository hosted at Sourceforge has been updated with Project files for Microsoft Visual C++ 2005 and 2008 (including the Express Editions :-)!)

The complete functionality of Netgen is now available in both Linux (simple compile via the autotools suite), and Windows.... including the support for OpenCascade (hence, STEP and IGES) files.

In addition, there have been some tweaks to the system:

1. More mesh control in STEP geometry allows the user to limit the mesh size also individually on each face by clicking on the face and specifying the local limit.

2. XDE Support for the Opencascade interface allowing the face colours of the geometry to also be imported (this is currently only cosmetic, but the first step to colour based automation of boundary patch selection)

3. Export of the mesh in the Gmsh v2 format (with suppoert for higher order elements.... though this will not be directly useful in OpenFOAM)

It would be interesting to get something like a "wishlist" from the OpenFOAM users, for improvements, additions and changes... which would be relevant in the context of Netgen as a mesher for OpenFOAM.

Have a great week ahead!

Philippose

ggruber May 11, 2009 16:03

Quote:

Originally Posted by philippose (Post 194127)

It would be interesting to get something like a "wishlist" from the OpenFOAM users, for improvements, additions and changes... which would be relevant in the context of Netgen as a mesher for OpenFOAM.

Philippose

Setting up the boundary (by selection Faces) and initial conditions (at the Run Dialog) is very easy in www.discretizer.org
It would be nice to make it as easy in netgen.

philippose September 27, 2009 04:29

Adding on to my initial posts regarding the status of Netgen, the following changes have been made over the last couple of months:

1. Netgen now has a skeletal Mediawiki webpage at Sourceforge (http://sourceforge.net/apps/mediawik...itle=Main_Page), which is intended to become the main portal for the Netgen mesher.

2. Version 4.9.11 is now available.

3. Netgen Windows binaries are available for 32-bit and 64-bit systems, including all the dependencies (The main one being 64-bit versions of the OpenCascade libraries)..... all packaged into an actually working install file (created using NSIS).

4. The API version of Netgen (Nglib) has been extended with more functionality which also includes support for Opencascade geometry (STEP/IGES), which were till now only avaliable in the stand-alone version.


Have a nice day!

Philippose

philippose September 27, 2009 04:43

I forgot to mention the following new features:

1. The maximum mesh size on individual faces can now be explicitly specified when meshing OCC Geometry (STEP/IGES) by using the "Edit Face Mesh Size" menu option under the "Geometry" menu, double clicking on a face, and specifying the allowed maximum mesh size.

2. Netgen now also allows colour based assignment of the boundary patch numbers (but currently only for STEP/IGES... because STL does not support colours).

Basically, Netgen imports any face colours available when a STEP/IGES file is opened, and once the meshing is done, these face colours can be used to automatically assign patch numbers, instead of having to manually click and assign each face.

This can be done in two ways....

a. Automated assignment - In this case, Netgen assigns all faces which did not have any colour assigned as patch number 0, and assigns patch numbers to the rest of the colours based on the number of surface mesh elements of a given colour (larger the number of surface mesh elements, higher the assigned patch number for that colour)

b. Using a user defined profile - In this case, the user specifies the patch number, and the associated (r,g,b) colour for that patch in a file called "netgen.ocf" in the netgen bin folder. This mapping is then used by Netgen to assign patch numbers.


Note.... these features are all still in development, and if anyone has any other bright (but at the same time... generic... not purely OpenFOAM specific) ideas, please feel free to let me know...

Philippose

linnemann October 14, 2009 04:31

Hi

It would be nice if Netgen had the possibility to double click the face and assign it to a BC index number, would help a lot when converting to OpenFOAM.

I know the automatic exists, but that's is not always a good approach depending on how complex the geometry is.

Best
Linnemann

philippose October 14, 2009 06:24

Hello Linnemann,

This option does exist in Netgen already.... You will find it in the following Menu:

Mesh -> Edit Boundary Conditions

It pops up a window which shows the currently selected face (or a -1 if no face is selected), and the associated boundary condition number.

A face can be selected by double clicking on the face, and then the assoicated boundary condition can be manually modified.

The automated options are good when you have a large number of boundary conditions to define, and if the colours are always "standardised".... however, as you said.... the manual method is very much required :-)!

Feedback on the the usage of Netgen in connection with OpenFOAM would be great :-)!

Have a nice day!

Philippose

linnemann October 14, 2009 06:52

1 Attachment(s)
Hi

Thx for clearing that, the problem is that i have a propeller geometry which consists of many faces (<600, see attached) and I would like to select the faces that aren't associated with the propeller (bounding box) and put them in a separate BC's. All the faces of the propeller would then be associated with BC 0.

So at import have a BC that has all faces and as you assign the boundingbox faces to other BC's they will be deselected in BC 0.

Also using the "quad dominated" option in the mesh generates really nice surface mesh, but when doing the volume meshing nothing happens, any idea? This is also the case with Salome (netgen plugin) if I have quads on some of the faces then netgen volume just uses alot of cpu power but no output (ran for 48 hours).

Regards

linnemann October 14, 2009 07:10

Ok found the solution to the first problem.

Just assign all faces to a BC number and then reassign the others to their own.

The problem with quads on faces and volume mesh generation is although still an open issue.

Also is it possible to assign faces which should be "quad dominated"?

Regards

philippose October 14, 2009 14:45

Hello again Linnemann,

A Good Evening to you :-)!

Great to see that you were able to solve your problem regarding the boundary conditions.... after posting the message I remembered that I should have also mentioned something about the "all" button which assigns the same BC number to all the faces in the mesh :-)! However.... looks like you found it anyway :-)!

As for the issue with Quad Dominated...... as of now (and I think also for the foreseeable future), the option "Quad dominated" only works for either 2D geometry... or for surface meshes..... it is not possible to create a Volume mesh using a Quad dominated surface mesh.

I guess we should be considering disabling that option when the geometry is 3D and when volume meshing is selected....

I dont know if you have seen it yet.... in the "Meshing Options" menu, you can select which steps Netgen should do when it meshes the geometry....:

1. Surface Meshing
2. (1) + Surface Mesh Optimisation
3. (2) + Volume Meshing
4. (3) + Volume Mesh Optimisation

So, if you select only Surface Mesh or Surface Mesh and Mesh Optimisation, you can use the option "Quad Dominated"..... but not with volume meshing.

Netgen is basically intended to be an automatic "tetrahedral" mesh generator.

Personally I prefer using the Netgen GUI rather than the Netgen meshing library available in Salomé.... the standalone version provides a much larger array of mesh controls.

I am very sorry that the documentation for Netgen is extremely skeletal..... its just that..... the main developer is the head of the computational mathematics department at the RWTH-Aachen...... and I work full-time in the R&D department of a hydraulic company..... hence.... Netgen development necessarily takes priority over Netgen documentation due to lack of free time.

If you have any questions regarding Netgen, the best option would be to post it in the "Help" forum of the Netgen Sourceforge website:

http://sourceforge.net/projects/netgen-mesher


Hope this helps!

Have a nice day ahead!

Philippose

alberto October 14, 2009 15:45

Just a short note for openSUSE users. Some time ago Andrea Florio (anubisg1) and I packaged some CFD tools for openSUSE. Netgen and Engrid are among these, and are available for all the supported versions of openSUSE:

Netgen: http://software.opensuse.org/search?...L&p=1&q=netgen
Engrid: http://software.opensuse.org/search?...L&p=1&q=engrid

Best,

linnemann October 15, 2009 02:09

Hi philippose

Thx for the help.

So far things are working ok, although I have a minor program problem which I posted info about on the sourceforge site.

Regards

philippose October 15, 2009 12:49

Hello Alberto,

A Good Evening to you!

Thanks a lot for having created a Netgen package for OpenSUSE. I was discussing with Prof. Joachim last night, and he told me that they use OpenSUSE on their institute systems at RWTH-Aachen.... and that he has seen the Netgen package.

However, he told me that the package uses Netgen-4.9.9. Is there some way of easily repackaging it with the latest version of Netgen? And.... how can one maintain this package so that its always updated? Is it too much work to maintain packages? I have no experience with Linux software deployment....

Or... Are you or maybe Andrea Florio willing to maintain the package for OpenSUSE?

Currently I handle the Windows installer.... and since I am a Fedora user, I was wondering if I should also look into creating RPMs....

Do you use Netgen regularly by any chance?

Have a nice day!

Philippose

alberto October 15, 2009 13:22

Quote:

Originally Posted by philippose (Post 232785)
Hello Alberto,

A Good Evening to you!

Thanks a lot for having created a Netgen package for OpenSUSE. I was discussing with Prof. Joachim last night, and he told me that they use OpenSUSE on their institute systems at RWTH-Aachen.... and that he has seen the Netgen package.

However, he told me that the package uses Netgen-4.9.9. Is there some way of easily repackaging it with the latest version of Netgen? And.... how can one maintain this package so that its always updated? Is it too much work to maintain packages? I have no experience with Linux software deployment....

Or... Are you or maybe Andrea Florio willing to maintain the package for OpenSUSE?

Currently I handle the Windows installer.... and since I am a Fedora user, I was wondering if I should also look into creating RPMs....

Do you use Netgen regularly by any chance?

Have a nice day!

Philippose

The idea is to maintain the package for openSUSE, which makes it quite easy thanks to the openSUSE Build Service (we could potentially build for fedora and other distributions too, but I did not look into that).

Andrea or I will update it shortly, and I'll inform you of the update. We did not notice a new release came out! Sorry about that.

Best,

alberto October 16, 2009 12:55

You find the updated netgen package here :D:

http://software.opensuse.org/search?...1&p=1&q=netgen

philippose October 16, 2009 13:40

Hello Alberto,

A Great (but uncomfortably cold) evening to you :-)!

Wow... that was fast :-)! Thank you very much for the update to 4.9.11!! And I was overjoyed to see that the corresponding "_x64" RPM also exists :-)!! Really cool !!

I hope this helps all those linux users who fall into the category of "linux users" rather than the default expected "linux tinkerers" or "linux developers"!!

I was looking into the RPM build guide for OpenSUSE, and they have also mentioned ways of making "Cross distribution" RPM packages.... which will work for more than one flavour of Linux....

Do you have any experience with this concept?

I shall see if I can find some time to look into it too.... would be very interesting to have one RPM which works on all popular linux distributions....


By the way... one question..... who do I need to contact if I want the link to the Netgen project on the OpenFOAM-Wiki to be updated?

Have a wonderful weekend and thanks once again :-)!

Philippose

alberto October 16, 2009 17:00

Quote:

Originally Posted by philippose (Post 232950)
Hello Alberto,

A Great (but uncomfortably cold) evening to you :-)!

Wow... that was fast :-)! Thank you very much for the update to 4.9.11!! And I was overjoyed to see that the corresponding "_x64" RPM also exists :-)!! Really cool !!

Hehe, power of the openSUSE buildservice: one .spec file for all :D

Quote:

I hope this helps all those linux users who fall into the category of "linux users" rather than the default expected "linux tinkerers" or "linux developers"!!
Oh I'm lazy myself. I choose the distribution that provides me what I need, not the one that makes me work harder :cool:

Quote:

I was looking into the RPM build guide for OpenSUSE, and they have also mentioned ways of making "Cross distribution" RPM packages.... which will work for more than one flavour of Linux....

Do you have any experience with this concept?
It is basically very simple from what I know. You need to write the .spec file to build the RPM using macros instead than hardcoding names, paths and other information. Once that is done, the buildservice will take care of everything.

For example, with one .spec file we build for all the openSUSE versions with a simple click on the distributions we want to build against, as long as all the dependencies are satisfied. If a build fails for one distribution, the others are untouched.

Quote:

I shall see if I can find some time to look into it too.... would be very interesting to have one RPM which works on all popular linux distributions....
We do not do that with the openSUSE buildservice. We provide different RPM's for each distribution. You can use the build service to build packages for openSUSE, fedora, ubuntu, SLES, RHEL, CentOS, debian and ubuntu.

Best,
Alberto

ericnutsch October 19, 2009 01:55

Netgen4.9.11 from SourceForge wont run...
 
I have been using netgen4.4 on windows xp

I downloaded the discussed version of netgen at:
http://sourceforge.net/projects/netg...2.exe/download

I installed Netgen-4.9.11_Win32.exe sucessfully, however it will not run.

The error says:
__________________________________________________
C:\Program Files\Netgen-4.9.11_Win32\bin\netgen.exe

This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.
__________________________________________________

Thoughts? How do I configure it?

Thanks guys!

philippose October 20, 2009 17:16

Hello there :-)!

A Good Evening to you!!

This error usually comes up when you dont have the Microsoft Visual C++ runtime libraries installed.... you need to install both the MSVC++ 2005 and MSVC++ 2008 runtime libraries....

You can find them by either searching on:

http://www.microsoft.com/downloads/en/default.aspx

Or my googling "MSVC++ runtime libraries 2008" and "..... 2005"

Have a nice day!

Philippose

ericnutsch October 26, 2009 16:05

Fixed
 
Your awesome philippose!


That fixed it. Thanks! These are the direct links to the downloads for everyones info:
http://www.microsoft.com/downloads/d...d-074b9f2bc1bf
http://www.microsoft.com/downloads/d...9-220b62a191ee


Now all i have to do is learn how to use it... :)

philippose November 1, 2009 09:44

Hello a a Good day :-)!

Its grey and definitely moving towards winter here :-O :-)!

Just wanted to inform people who use Netgen for creating meshes for use in OpenFOAM....

The current SVN Version of Netgen available from the sourceforge project website allows meshes to be exported into the OpenFOAM 1.5 format directly from within the GUI :-)!

After creating a mesh, choose "OpenFOAM 1.5+ Format" as the Export filetype in the "File -> Export Filetype" menu, and subsequently, export the mesh using the "File -> Export Mesh..." menu.

Netgen will ask for a folder to be specified (which in our case would be typically the case folder). It then creates the sub-folders "constant" and "polyMesh" if they dont already exist, and writes the OpenFOAM mesh files into it.

As of now, the patch names use the format: "patch<bc_num>" where "bc_num" are the boundary condition numbers specified for each of the boundaries in Netgen.


It would be great if people could use the feature, and let me know if there is anything lacking, and what could be improved...

For example....

1. Does Netgen need to ask the user to put in a scaling factor for the x, y and z directions while exporting? Or is the extra step of using the OpenFOAM utility: "transformPoints" ok?

2. Patch names.... should there be a means of specifying that within Netgen itself, or is it ok to manually alter them later in the "boundary" file?

etc...etc...

Have a wonderful Sunday :-)!

Philippose

linnemann November 2, 2009 01:51

Hi Philippose

Great news.

I'll definitely be using this feature.

One feature I might want to request which isn't related to this feature is the possibility to record a journal/macro of the steps I take within Netgen.

This way its much faster to create new meshes for almost identical geometries.

regarding OF features, I personally don't need either of the two proposed since I do it all in bash scripts. I will report back when I get it built and generate some meshes.

Best

linnemann November 2, 2009 02:04

Hi again

When downloading the SVN the configure script and makefile.in is missing in different folders am I supposed to use the ones from the 4.9.11?

Best

philippose November 2, 2009 06:21

Hello Linnemann,

A Good Afternoon to you :-)!

When you download a version of Netgen direct from the SVN Repositories, always make sure that you run the following command in order to regenerate the configure files:

autoreconf --install

This command should be run in the main folder of the Netgen sourcecode and should be done before running "./configure".

Dont use the configure files from older versions, because if there have been any changes you will miss them out, resulting in probable build failures...

Hope this helps!

Have a nice day ahead :-)!

Philippose

linnemann November 2, 2009 06:49

Hi it helped somewhat but now I'm getting this while running autoreconf --install

Code:

You should update your `aclocal.m4' by running aclocal.
libtoolize: `config.guess' exists: use `--force' to overwrite
libtoolize: `config.sub' exists: use `--force' to overwrite
libtoolize: `ltmain.sh' exists: use `--force' to overwrite
doc/Makefile.am:1: `dist_doc_DATA' is used but `docdir' is undefined
autoreconf: automake failed with exit status: 1

FIXED, Needed to install new versions of autoconf automake and libtool as the std CentOS 5 versions are too old.

Best

linnemann November 3, 2009 02:16

Just FIY.

I've built Netgen 4.9.11 and 4.9.12-svn for CentOS 5 with OpenCASCADE support.

The prebuilt binaries including needed libraries can be found on

https://sourceforge.net/projects/centfoam/

I will try and keep it updated regularly.

Best

philippose November 3, 2009 15:40

Hello Linnemann,

A Good Evening to you :-)!

Thanks a lot for maintaining binary releases of Netgen for CentOS :-)! I am sure it provide more people access to the tool....!

I have been thinking about an RPM for Fedora for a while. Alberto and his colleague have created RPMs for OpenSuse too :-)! If I am not mistaken, the OpenSuse online RPM tools can also generate RPMs for other distributions of Linux.... just need to take some time out and see how to get it working!

Have a great day!

Philippose

alberto November 3, 2009 15:51

Hi,

you are right. The openSUSE buildservice can build packages for all the major linux distributions, debian and ubuntu included.
For RPM-based distributions, it is relatively easy, since you need to create only one .spec file, and then build against all the targets you want (assuming they have the dependencies). I have no experience in using the build service for debian-based systems, but the team is supportive.

Best,

AndreF November 20, 2009 09:31

Hi guys, really sorry to post this here but although I've searched here and on the internet I can't seem to find it.

I'm having trouble installing correctly the togl package that netgen needs. I haven't found a installationg guide detailed enough for me to install it succesfully. If you could point me in the right direction it would be great.

Thanks in advance
Andre

philippose January 6, 2010 11:07

Hello Alberto,

A Happy New Year to you :-)!

I have been trying to create RPM packages for Netgen-4.9.11 for Fedora 12 on my system since last evening, with only limited success...

Would it be possible for you to let me have a peek at the spec file you used for creating the Netgen OpenSUSE RPM packages?

Have a nice evening!

Philippose

alberto January 6, 2010 11:19

Sure. I have to say most of the work on netgen was done by Andrea Florio.

You can download the .spec from the src.rpm (file-roller opens it) from here: http://software.opensuse.org/search?...t=ALL&q=netgen

Code:

# norootforbuild

Name: netgen
Summary: NETGEN is an automatic 3d tetrahedral mesh generator
Version: 4.9.11
Release: 1.0
License: LGPL
Group:  Productivity/Graphics/3D Editors
URL:    http://www.hpfem.jku.at/netgen/
Source0: %name-%version.tar.bz2
Source1: netgen.sh
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: make autoconf automake gcc gcc-c++
BuildRequires: Togl metis-devel OpenCASCADE-devel tcl-devel tk-devel
BuildRequires: Mesa-devel glibc-devel libjpeg-devel lam-devel
%if %suse_version > 1020
BuildRequires: fdupes
%endif

%description
NETGEN is an automatic 3d tetrahedral mesh generator.
It accepts input from constructive solid geometry (CSG)
or boundary representation (BRep) from STL file format.
The connection to a geometry kernel allows the handling
of IGES and STEP files. NETGEN contains modules for mesh
optimization and hierarchical mesh refinement. Netgen is
open source based on the LGPL license.
It is available for Unix/Linux and Windows.

%package devel
Summary: Netgen headers for development
Requires: %name
Requires: Togl metis-devel OpenCASCADE-devel tcl-devel tk-devel
Requires: Mesa-devel glibc-devel libjpeg-devel lam-devel
Group: Development/Libraries/C and C++

%description devel
NETGEN is an automatic 3d tetrahedral mesh generator.
It accepts input from constructive solid geometry (CSG)
or boundary representation (BRep) from STL file format.
The connection to a geometry kernel allows the handling
of IGES and STEP files. NETGEN contains modules for mesh
optimization and hierarchical mesh refinement. Netgen is
open source based on the LGPL license.
It is available for Unix/Linux and Windows.


%prep
%setup -q

%build
export CFLAGS="$RPM_OPT_FLAGS"
export CXXFLAGS="$RPM_OPT_FLAGS"
export LDFLAGS="-L/opt/OpenCASCADE/%_lib/opencas"
  %configure  \
    --bindir=%_bindir/netgen \
    --enable-occ \
    --with-occ=/opt/OpenCASCADE/ \
    --enable-nglib \
    --enable-jpeglib
# need a patch, make fail if that option is enable
#    --enable-parallel \

%__make %{?jobs:-j%{jobs}}

%install
%makeinstall

%__rm %buildroot/%_libdir/libnglib.la
%__rm %buildroot/%_datadir/doc/netgen/ng4.pdf

%__ln_s %_libdir/libnglib.so %buildroot/%_libdir/libng.so

%__cp %SOURCE1 %buildroot/%_bindir/
chmod +x %buildroot/%_bindir/netgen.sh

%if %suse_version > 1020
%fdupes -s %{buildroot}
%endif

%clean
rm -fr %buildroot

%files
%defattr(-,root,root)
%doc doc/ng4.pdf
%_bindir/netgen.sh
%dir %_bindir/netgen
%_bindir/netgen/*
%_libdir/libnglib.so                     
%_libdir/libng.so
%dir %_datadir/netgen
%_datadir/netgen/*

%files devel
%defattr(-,root,root)
%_includedir/*

%changelog
* Thu Oct 15 2009 albert.passalacqua@gmail.com
- new upstream version
* Wed Jun 10 2009 andrea@opensuse.org
- new upstream version


philippose January 6, 2010 12:09

Hi again :-)

Thanks a lot Alberto... that was amazingly fast :-)!

Had a look at the spec file, and I think we might have some issues.... The same issues I have been literally battling with so far....

Basically, it looks like the Netgen system is not yet designed with installation (in a linux standard manner) in mind. Here are some of the problems I came across, and I am wondering how best these could be solved:

1. Netgen currently stores all the TCL script files also in the "bin" folder. A standard installation of Netgen using the RPM as it is built now, would end up copying all these TCL files along with the netgen executable into the "/usr/bin/netgen" folder, which is not a typical linux install

2. If the environment variable "NETGENDIR" is not set, netgen assumes that the TCL files are located in the same folder as the netgen executable.... hence the reason why a script file "netgen.sh" was used to change directory to "/usr/bin/netgen"

3. Netgen also uses an environment variable "NETGEN_USER_DIR" used as the location where the "ini" file with the recently used files are saved, as well as the user settings when the user selects "save options" in the "file" menu. In case this environment variable does not exist, it uses the current folder as the user directory.

4. During operation, Netgen typically creates two files "gmon.out" and "netgen.prof" as debug files. These files are written into the "NETGEN_USER_DIR"

5. I dont think the folder "/usr/bin/netgen" is writable by a normal user.... which implies, that all the files which netgen tries to write in points (3) and (4) will be denied access.


I am wondering how to modify Netgen so that these issues can be solved in a more standardised manner.... anyway.... just wanted to let you know that there might be some unexpected behaviour by Netgen when installed using via the RPM.

Just for the sake of completeness, here is a copy of my current spec file..... it creates a relocatable RPM, which by default installs into "/opt/netgen-4.9.11", and so far, the install and uninstall procedures seem to work without leaving anything else broken....

Code:

Name:          netgen
Version:        4.9.11
Release:        1.1%{?dist}
Summary:        An automatic mesh generation tool for 2D and 3D meshes

Prefix:        /opt/%{name}-%{version}


Group:          Applications/Engineering
License:        LGPL
URL:            http://sourceforge.net/projects/netgen-mesher
Source0:        http://sourceforge.net/projects/netgen-mesher/files/netgen-mesher/%{version}/netgen-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  tcl-devel >= 8.5 tk-devel >= 8.5 tix-devel >= 8.4 Togl-devel = 1.7
Requires:      tcl >= 8.5 tk >= 8.5 tix >= 8.5 Togl = 1.7

%define        _instloc /opt/%{name}-%{version}

%description
Netgen is a multi-platform automatic mesh generation tool written in C++ capable of
generating meshes in two and three dimensions. The program is open source, and is
distributed under the conditions of the LGPL. Netgen is available for the Unix/Linux,
Windows NT/XP/Vista as well as the MacOS platforms for both 32-bit and 64-bit
architectures, and comes in two primary forms:

* A Stand-alone Program with its own Graphical User Interface (GUI) implemented using Tcl/Tk.
* A C++ library (Nglib) which can be linked into other applications functioning as the backend
mesh generation kernel.

Netgen generates triangular or quadrilateral meshes in 2D, and tetrahedral meshes in 3D.
The input for 2D is described by spline curves, and the input for 3D problems can be
defined by Constructive Solid Geometry (CSG), the standard STL file format, or via Boundary
Representations (BRep/IGES/STEP) when compiled with OpenCascade support.


%package        devel
Summary:        Headers and Libraries for building applications that use the Netgen meshing kernel
Group:          Development/Libraries


%description    devel
This package contains headers and libraries required to build applications that
use the Netgen-%{version} meshing kernel.

Netgen is a multi-platform automatic mesh generation tool written in C++ capable of
generating meshes in two and three dimensions. The program is open source, and is
distributed under the conditions of the LGPL. Netgen is available for the Unix/Linux,
Windows NT/XP/Vista as well as the MacOS platforms for both 32-bit and 64-bit
architectures, and comes in two primary forms:

* A Stand-alone Program with its own Graphical User Interface (GUI) implemented using Tcl/Tk.
* A C++ library (Nglib) which can be linked into other applications functioning as the backend
mesh generation kernel.

Netgen generates triangular or quadrilateral meshes in 2D, and tetrahedral meshes in 3D.
The input for 2D is described by spline curves, and the input for 3D problems can be
defined by Constructive Solid Geometry (CSG), the standard STL file format, or via Boundary
Representations (BRep/IGES/STEP) when compiled with OpenCascade support.


%prep
%setup -q


%build
autoreconf --install

CFLAGS="${CFLAGS:--O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables}" ; export CFLAGS ;
CXXFLAGS="${CXXFLAGS:--O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables}" ; export CXXFLAGS ;
FFLAGS="${FFLAGS:--O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -I/usr/lib/gfortran/modules}" ; export FFLAGS ;

./configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu \
            --target=i686-redhat-linux-gnu \
            --prefix=%{_instloc}

make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%dir %{_instloc}
%dir %{_instloc}/share
%dir %{_instloc}/share/doc
%docdir %{_instloc}/share/doc
%{_instloc}/share/doc/%{name}
%{_instloc}/bin
%exclude %{_instloc}/bin/ng_stl
%exclude %{_instloc}/bin/ng_vol
%{_instloc}/share/%{name}


%files devel
%defattr(-,root,root,-)
%dir %{_instloc}
%dir %{_instloc}/bin
%dir %{_instloc}/share
%dir %{_instloc}/share/doc
%docdir %{_instloc}/share/doc
%{_instloc}/share/doc/%{name}
%{_instloc}/lib
%{_instloc}/include
%{_instloc}/bin/ng_stl
%{_instloc}/bin/ng_vol
%{_instloc/share/%{name}


%changelog
* Tue Jan 5 2010 Philippose Rajan <philippose.rajan@gmail.com> 4.9.11-1.1
- Initial RPM release
- OpenCascade support excluded for initial testing

Shall get back to you if I get some cool ideas, or if I make some modifications....

Thanks again

Philippose

ndavey January 7, 2010 07:09

netgen 4.9.12-dev on WinXP
 
Quote:

Originally Posted by philippose (Post 234766)
Just wanted to inform people who use Netgen for creating meshes for use in OpenFOAM....

Netgen will ask for a folder to be specified (which in our case would be typically the case folder). It then creates the sub-folders "constant" and "polyMesh" if they dont already exist, and writes the OpenFOAM mesh files into it.

I've just built 4.9.12-dev (rev 266) on Windows XP, using VC++ Express 2008, with Windows 7 SDK installed and OCC

I also have OpenFOAM for windows (http://sourceforge.net/projects/openfoam-mswin/files/) installed..

After a little kicking and screaming (The SolutionDir macro didn't work for some reason, had to redo all include and library includes..) netgen built without any problems...

I loaded up an iges file, generated a mesh and went to export as OpenFOAM mesh using the above menu option..

Export spat the dummy with errors, bit of digging, something to do with c_str method, as path name comes out as:

Code:

Export mesh to file C:/cfd/simtest.... Please Wait!
 Export mesh to file C:/cfd/simtest, format is OpenFOAM 1.5+ Format
Write OpenFOAM 1.5+ Mesh Files....
Writing OpenFOAM 1.5+ Mesh files to case: C:/cfd/simtest

You then see an error:

Code:

The syntax of the command is incorrect.
because the '/'s should be a '\'s in the path name..

I added a horrible hack to fix it (not good at cpp), but it now does work for me...
That is, it creates the files.. have not looked at them yet..

Quote:

Originally Posted by philippose (Post 234766)
It would be great if people could use the feature, and let me know if there is anything lacking, and what could be improved...

For example....

1. Does Netgen need to ask the user to put in a scaling factor for the x, y and z directions while exporting? Or is the extra step of using the OpenFOAM utility: "transformPoints" ok?

2. Patch names.... should there be a means of specifying that within Netgen itself, or is it ok to manually alter them later in the "boundary" file?

I have not loaded up an export yet to look at scaling issues..
If you generate the mesh from say an iges file, will the output mesh for OpenFOAM be scaled the same?

From the very quick play I've done so far.. it would be nice to do the boundary names in Netgen.. not critical, just nice..

Regards
Neil Davey

openfoam_user January 8, 2010 10:27

Hi,

where can I get complete tutorials of netgen ?

Regards,

Stephane.

philippose January 10, 2010 16:43

Hello Neil,

A Good Evening to you, and apologies for the delay in replying!

Great to see that you were able to compile Netgen on Windows.... and specially, to see that it also worked with the Windows 7 SDK.... maybe I should install that too....

I wonder why you had a problem with "SolutionDir"... since you worked with Visual Studio 2008 Express, I expect the behaviour to have been the same on your system as it was on mine. Was this variable not defined at all? Or was it something different?

About the issue with the back-slash / forward-slash in Windows.... again, its surprising that you had a problem, because so far I have not had any issues... did you browse to the folder you wanted to export into via the window that TCL popped up, or did you type out the path yourself in the box?

Anyway, I shall look deeper into this as soon as I get back on to my system tomorrow evening.

The idea of specifying the names of the patches directly in Netgen is something that I am also toying around with, and has been on my To-Do list for a while. Just looking for an elegent and efficient way of integrating it into Netgen.

Thanks a lot for testing out Netgen, and ofcourse, you can always post problems or ideas at the Netgen Sourceforge website (look for Netgen sourceforge) in Google... should be the first result.

Have a great Sunday and a good week ahead!

Philippose

philippose January 10, 2010 16:47

Hello Stephane,

A set of complete tutorials for Netgen does not exist yet, but if you install Netgen (either windows or linux), or look into the sourcecode, you will see one PDF file in the "doc" directory called "ng4.pdf" if I remember right...

This is the only actual documentation for Netgen.... I am sorry that the Mediawiki website for Netgen on Sourceforge has not been updated yet.... I have been meaning to get on to this for a while now, but havent been able to start on it yet....

If you have any specific questions, please feel free to either post here, or in the Netgen forums available on the Sourceforge project page.

Have a nice day!

Philippose

ggruber January 11, 2010 12:24

Netgen manual
 
Hello Philippose,

Netgen is quite a good mesher !

But the manual at the svn Repository is not very actual.
I get a manual from Joachim Schöberl long time ago, but it is more detailed, especially at the chapter "Using the Graphical User Interface" and i have the source manual as well.

Please send me an E-mail and i will send it to you.

I hope you will check it in at the svn Repository at sourceforge, so it can be further developed.

Ggruber

philippose January 11, 2010 13:20

Hello Gruber,

A Good and snowy evening to you :-)!

It would be great to have a more detailed version of the User Manual... its surprising that Joachim Schöberl has not checked this into the SVN already... shall talk to him about this.

In the meantime, it would be nice if you could send me the PDF and the latex sources if you have those too.... my email address is: philippose.rajan (at) gmail (dot) com.

I think I need to try and spend some time on the documentation... the PDF as well as the Mediawiki website.... hmmm... lets see how I can squeeze this into my usual work - home schedule.... :-)!

Have a great evening ahead!

Philippose

openfoam_user January 12, 2010 02:55

Hello Gruber,

Could you, please, send me the manual of Netgen.

My email address is stephane_sanchi (at) hotmail (dot) com

Best regards,

Stephane

juanjo January 13, 2010 11:56

Hello Gruber,

Could you, please, send me the manual of Netgen.

My email address is rivera(at)epsem(dot)upc(dot)edu

Best regards,


juanjo


All times are GMT -4. The time now is 17:01.