CFD Online Discussion Forums

CFD Online Discussion Forums (
-   enGrid (
-   -   CGNS Export (

sebastian610 September 27, 2013 03:38

CGNS Export
Has anybody managed to export a CGNS file from engrid?

I tried to modify the engrid/src/scripts/engrid_installer_updater.cfg and changed the line


Unfortunately engrid still says that CGNS support has not been compiled.

wyldckat September 29, 2013 04:57

Greetings Sebastian,

Last time Oliver had a quick look at it, he decided it was preferable to implement the ability for exporting to SU2: :)

Anyway, his initial answer back then was this:

I haven't used that for ages ... here is what I would try:

1. Install CGNS and make sure that the headers and libraries are found by the compiler/linker
2. enable CGNS support in (DEFINES += CGNS_SUPPORT)
3. cross your fingers ;-)
I'll give it a try myself and report back if I have any success.

Best regards,

wyldckat September 29, 2013 05:52

Hi Sebastian,

I managed to get this working on Ubuntu 12.04. Steps:
  1. Apply the following changes:

    diff --git a/src/ b/src/
    index 5849203..e51ae15 100644
    --- a/src/
    +++ b/src/
    @@ -81,6 +81,9 @@ LIBS        += -lvtkRendering
     LIBS        += -lvtksys
     LIBS        += -lvtkVolumeRendering
     LIBS        += -lvtkWidgets
    +LIBS += -lcgns

     OTHER_FILES += todo.txt
    diff --git a/src/libengrid/ b/src/libengrid/
    index 6726531..a2d85df 100755
    --- a/src/libengrid/
    +++ b/src/libengrid/
    @@ -35,6 +35,7 @@ win32-msvc* {
        QMAKE_CXXFLAGS += -g
     INCLUDEPATH += ..
     INCLUDEPATH += ./libengrid-build

  2. Install the cgns development package:

    sudo apt-get install libcgns-dev
  3. Inside enGrid's folder "src", run:

    make -j4
    This should be able to (re)build with the support for CGNS.
Best regards,

sebastian610 September 29, 2013 13:49

Hello Bruno,

thanks for your suggestion. I implemented your changes as best I could, but when compiling I get an error compiling cgnswriter.cpp. I am on Fedora anyway.

This is where I have to give up. It's a pity because otherwise engrid in combination with gmsh is really great. I am a bit astonished that there is no broad acceptance and support of cgns. The NASA tools are not bad either, but do not offer much regarding data import/export.

Maybe foamToCgns could be a solution, but it is not straight out of the box either.


ogloth September 30, 2013 02:40

Hi Sebastian & Bruno,

personally I find that CGNS is not much of a standard, because there is a lot of different ways you could organise your CGNS file and it it is no way guaranteed that a given CGNS file works with a given solver.

Which error message did the complier produces when trying to compile the CGNS writer?

What exactly do you want to do? Maybe it would indeed be easier to simply write an export function for the format you need -- other than CGNS ;-)

Out of interest: Do you use Gmsh for surface meshing? Did you ever try enGrid's own surface mesher?

Kind regards,

sebastian610 September 30, 2013 06:13

Hello Oliver and Bruno,

I want to transfer data between an inhouse 1D solver and 3D CFD. CGNS appeared to me a good choice since I did not want to reinvent yet another format. With CGNS I also have some experience using the NASA tools to explore and access the data. From what I have learned so far, CGNS is not that widely accepted as a standard format for data transfer between CFD codes. This is probably the right moment to drop the idea of using CGNS. The only requirement for a data exchange standard is that it be widely understood and accepted. Maybe SU2 is an option.

The reason for using gmsh (surface) + engrid is that I have worked out how to obtain an Openfoam mesh this way. If there is an easier way using only engrid, all the better.


All times are GMT -4. The time now is 20:53.