CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   enGrid (http://www.cfd-online.com/Forums/engrid/)
-   -   How to include CGNS during build.bash compilation? (http://www.cfd-online.com/Forums/engrid/112127-how-include-cgns-during-build-bash-compilation.html)

aerothermal January 22, 2013 14:18

How to include CGNS during build.bash compilation?
 
Dear engriders,

I folllowed the link below to install engrid:
http://engits.eu/wiki/index.php/Installation

It is a good work. Thanks!

However it did not install CGNS.
Could you tell me how to reconfigure and rebuild for CGNS?

Regards,

Aerothermal

ogloth January 22, 2013 15:03

Hello,

I haven't used CGNS for quite some time now. Generally it boils down to downloading CGNS and installing it. Afterwards you update the enGrid *.pro files such that the include files and libraries can be found.

Which code do you want to use? It might be easier to add an export function for your code, rather than hassling around with CGNS. CGNS allows many different ways of organising a file and not every way is understood by every software.

Cheers,
Oliver

aerothermal January 22, 2013 15:17

Dear Oliver,

I tried to use CGNS option in Engrid menu and it told me that CGNS was not compiled.

Actually I am trying to use Engrid as a translation tool from OpenFoam to CGNS.
CGNS is a format that is common to CFD++ and OpenFoam.

Other formats may be VGRID, UGRID/AFLR, Plot3D, UNSFast, Fluent, STARCD.

I already used foamToCgns and cgnsToFoam in OF1.5 and it works but I am looking for an alternative.

Regards,

ogloth January 22, 2013 15:26

In enGrid there is currently only an export function to CGNS and I don't think that an import function is likely to be implemented soonish. It might, however, happen that import/export functionality for Fluent will be implemented -- it depends a bit on commercial demand, but it appears as if there could be some ...

If you still want to try:
Put "DEFINES += CGNS_SUPPORT" into the libengrid.pro file (src/libengrid/libengrid.pro).

You also need to make sure that the headers and the libraries can be found
LIBS += ...
INCLUDEPATH += ...

Take a look at engrid.pro.app to see some usage examples.

'hope this helps,
Oliver

aerothermal January 22, 2013 15:36

Hi,

Thank you Oliver.

See that I am using Ubuntu 12.10.

Some questions:

1) in which section (or line) I should include DEFINES += CGNS_SUPPORT?
2) should LIBS and INCLUDEPATH be place in same file? Where?

After changing libengrid.pro, what I need to do? Just run? Do I need to make? What are the commands next?

Regards,

Aerothermal

ogloth January 22, 2013 15:40

INCLUDEPATH is probably needed in libengrid.pro
LIBS will probably be needed in engrid.pro.app

The DEFINES += line can go to the top of the file.

afterwards run
qmake engrid.pro
make (-j4)

Of course you have to figure out where the headers and libraries are -- unless they are in a standard place in which case you might not have to add anythin, apart from the DEFINES statement.

aerothermal January 22, 2013 15:55

OK. I did that.

But the compilation now did not pass the vtk.

Quote:

In file included from geometrytools.cpp:23:0:
geometrytools.h:31:33: fatal error: vtkUnstructuredGrid.h: No such file or directory
It does not matter whether or not I change the code.

aerothermal January 22, 2013 16:17

That error was gone by coding
Quote:

cd src
source scripts/setup_pathes.bash
cd libengrid
qmake libengrid.pro
make -j16
So it found the VTK and compiled OK without CGNS.
However, when CGNS lines are included in libengrid.pro the compilation stops at,

Quote:

g++ -c -m64 -pipe -Wall -Wno-deprecated -fno-omit-frame-pointer -g -O2 -D_REENTRANT -Wall -W -fPIC -DQT_WEBKIT -DCGNS_SUPPORT -DQT_NO_DEBUG -DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtXml -I/usr/include/qt4 -I.. -I./libengrid-build -I../netgen_svn/netgen-mesher/netgen/nglib -I../netgen_svn/netgen-mesher/netgen/libsrc/general -I/usr/include/vtk-5.8 -I/usr/X11R6/include -Irelease -I. -o release/qrc_engrid.o release/qrc_engrid.cpp
make[1]: *** [release/cgnswriter.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/home/ats4i/ats4iFiles/Software/engrid/src/libengrid'
make: *** [release] Error 2

aerothermal January 22, 2013 16:27

What I need to include here?

Quote:

LIBS += ...
INCLUDEPATH += ...
I suppose that INCLUDEPATH is the path to the place where the HEADERS of cgns are located. Is it correct?

And LIBS? What should I specify there? Is it a path? Or which library?

ogloth January 22, 2013 16:30

yes, for example:
INCLUDEPATH += /usr/local/cgns/include

LIBS is probably something like
LIBS += -lcgns
or
LIBS += -L/usr/local/cgns/lib
LIBS += -lcgns

Just guessing, you have to look what the real locations and file names are!

aerothermal January 22, 2013 17:01

not working yet.

libengrid compiled
now engrid is not.

Quote:

g++ -c -m64 -pipe -Wall -Wno-deprecated -fno-omit-frame-pointer -g -O2 -D_REENTRANT -Wall -W -fPIC -DQT_WEBKIT -DCGNS_SUPPORT -DQT_NO_DEBUG -DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtXml -I/usr/include/qt4 -I.. -I./libengrid-build -I../netgen_svn/netgen-mesher/netgen/nglib -I../netgen_svn/netgen-mesher/netgen/libsrc/general -I/usr/include/vtk-5.8 -I/usr/X11R6/include -Irelease -I. -o release/moc_guinormalextrusion.o release/moc_guinormalextrusion.cpp
cgnswriter.cpp: In member function ‘void CgnsWriter::writeGrid()’:
cgnswriter.cpp:62:43: error: ‘Unstructured’ was not declared in this scope
cgnswriter.cpp:85:36: error: ‘RealDouble’ was not declared in this scope
cgnswriter.cpp:94:36: error: ‘RealDouble’ was not declared in this scope
cgnswriter.cpp:103:36: error: ‘RealDouble’ was not declared in this scope
cgnswriter.cpp:147:46: error: ‘TETRA_4’ was not declared in this scope
cgnswriter.cpp:172:48: error: ‘PYRA_5’ was not declared in this scope
cgnswriter.cpp:198:46: error: ‘PENTA_6’ was not declared in this scope
cgnswriter.cpp:226:45: error: ‘HEXA_8’ was not declared in this scope
cgnswriter.cpp:249:49: error: ‘TRI_3’ was not declared in this scope
cgnswriter.cpp:273:45: error: ‘QUAD_4’ was not declared in this scope
cgnswriter.cpp: In member function ‘void CgnsWriter::writeBcs()’:
cgnswriter.cpp:303:66: error: ‘BCTypeNull’ was not declared in this scope
cgnswriter.cpp:303:78: error: ‘ElementList’ was not declared in this scope
cgnswriter.cpp: In member function ‘virtual void CgnsWriter::operate()’:
cgnswriter.cpp:320:42: error: ‘MODE_WRITE’ was not declared in this scope

wyldckat November 30, 2013 17:23

Greetings to all!

Just to let you know that this has been fixed in this commit: https://github.com/wyldckat/engrid/c...9463040bd3da33 - as reported here: https://github.com/enGits/engrid/issues/42

Best regards,
Bruno


All times are GMT -4. The time now is 19:47.