wyldckat / cgnsToFromFoam

Port of cgnsToFoam from TurbMachinery SIG to OpenFOAM 5.x and newer
Other
13 stars 6 forks source link

foamToCGNS compilation #2

Closed SiHubb closed 6 years ago

SiHubb commented 6 years ago

Hi Bruno, I'm interested in the foamToCGNS converter. I get the following when trying to wmake it. It looks like it is unhappy with OF5x headers. I have compiled cgnsToFoam successfully, Any help much appreciated. Thanks, Simon

This is a Foundation repo install under ubuntu 16.04 LTS.

g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3  -DNoRepository -ftemplate-depth-100 -I/home/simon/OpenFOAM/OpenFOAM-5.x/src/finiteVolume/lnInclude -I/home/simon/OpenFOAM/OpenFOAM-5.x/src/meshTools/lnInclude -I/home/simon/OpenFOAM/OpenFOAM-5.x/applications/solvers/ -I/home/simon/OpenFOAM/OpenFOAM-5.x/src/transportModels -I/home/simon/OpenFOAM/OpenFOAM-5.x/src/turbulenceModels -I/home/simon/OpenFOAM/OpenFOAM-5.x/src/transportModels/incompressible/lnInclude -I/home/simon/OpenFOAM/OpenFOAM-5.x/src/turbulenceModels/RAS/incompressible/lnInclude -I/home/simon/cgnsToFromFoam/applications/utilities/postProcessing/dataConversion/foamToCGNS/../../../../../src/libcgnsoo_3.0/platforms/linux64GccDPInt32Opt/include -I/home/simon/cgnsToFromFoam/applications/utilities/postProcessing/dataConversion/foamToCGNS/../../../../../src/cgnslib_2.5/platforms/linux64GccDPInt32Opt/include -IlnInclude -I. -I/home/simon/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude -I/home/simon/OpenFOAM/OpenFOAM-5.x/src/OSspecific/POSIX/lnInclude   -fPIC -DOPENFOAM_VERSION=150 -DEXPORT_CYCLIC_BOUNDARIES -c foamToCGNS.C -o Make/linux64GccDPInt32Opt/foamToCGNS.o
In file included from /home/simon/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/setRootCase.H:9:0,
                 from foamToCGNS.C:94:
/home/simon/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/listOutput.H: In function ‘int main(int, char**)’:
/home/simon/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/listOutput.H:33:31: error: template argument 1 is invalid
         << fvPatchField<vector>::dictionaryConstructorTablePtr_->sortedToc()
                               ^
foamToCGNS.C:262:28: error: ‘endTime’ was not declared in this scope
  for (label i=startTime; i<endTime; i++)
                            ^
In file included from foamToCGNS.C:272:0:
writeCGNS.H:60:26: error: ‘Dimensional’ is not a member of ‘CGNSOO’
 cgnsBase.writeDataClass( CGNSOO::Dimensional );
                          ^
In file included from foamToCGNS.C:272:0:
writeCGNS.H:79:48: error: ‘GoverningEquationsNull’ is not a member of ‘CGNSOO’
 CGNSOO::GoverningEquationsType_t equationSet = CGNSOO::GoverningEquationsNull;
                                                ^
writeCGNS.H:88:6: error: ‘NSTurbulentIncompressible’ is not a member of ‘CGNSOO’
 case CGNSOO::NSTurbulentIncompressible:
      ^
writeCGNS.H:90:35: error: ‘TwoEquation_JonesLaunder’ is not a member of ‘CGNSOO’
  cgnsFlowEq.writeTurbulenceModel( CGNSOO::TwoEquation_JonesLaunder );
                                   ^
writeCGNS.H:92:6: error: ‘NSTurbulent’ is not a member of ‘CGNSOO’
 case CGNSOO::NSTurbulent:
      ^
writeCGNS.H:94:35: error: ‘TwoEquation_JonesLaunder’ is not a member of ‘CGNSOO’
  cgnsFlowEq.writeTurbulenceModel( CGNSOO::TwoEquation_JonesLaunder );
                                   ^
writeCGNS.H:96:6: error: ‘NSLaminar’ is not a member of ‘CGNSOO’
 case CGNSOO::NSLaminar:
      ^
writeCGNS.H:104:47: error: ‘NonTimeAccurate’ is not a member of ‘CGNSOO’
 cgnsBase.writeSimulationType( (steadyState) ? CGNSOO::NonTimeAccurate : CGNSOO::TimeAccurate );
                                               ^
writeCGNS.H:104:73: error: ‘TimeAccurate’ is not a member of ‘CGNSOO’
 cgnsBase.writeSimulationType( (steadyState) ? CGNSOO::NonTimeAccurate : CGNSOO::TimeAccurate );
                                                                         ^
In file included from foamToCGNS.C:272:0:
writeCGNS.H:305:8: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
   std::auto_ptr<std::vector<double> > p_data( new std::vector<double>(psf.size()) );
        ^
In file included from /usr/include/c++/5/memory:81:0,
                 from foamToCGNS.C:66:
/usr/include/c++/5/bits/unique_ptr.h:49:28: note: declared here
   template<typename> class auto_ptr;
                            ^
In file included from foamToCGNS.C:272:0:
writeCGNS.H:345:8: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
   std::auto_ptr< std::vector<double> > p_data_x( new std::vector<double>(pvf.size()) );
        ^
In file included from /usr/include/c++/5/memory:81:0,
                 from foamToCGNS.C:66:
/usr/include/c++/5/bits/unique_ptr.h:49:28: note: declared here
   template<typename> class auto_ptr;
                            ^
In file included from foamToCGNS.C:272:0:
writeCGNS.H:346:8: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
   std::auto_ptr< std::vector<double> > p_data_y( new std::vector<double>(pvf.size()) );
        ^
In file included from /usr/include/c++/5/memory:81:0,
                 from foamToCGNS.C:66:
/usr/include/c++/5/bits/unique_ptr.h:49:28: note: declared here
   template<typename> class auto_ptr;
                            ^
In file included from foamToCGNS.C:272:0:
writeCGNS.H:347:8: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
   std::auto_ptr< std::vector<double> > p_data_z( new std::vector<double>(pvf.size()) );
        ^
In file included from /usr/include/c++/5/memory:81:0,
                 from foamToCGNS.C:66:
/usr/include/c++/5/bits/unique_ptr.h:49:28: note: declared here
   template<typename> class auto_ptr;
                            ^
In file included from foamToCGNS.C:272:0:
writeCGNS.H:494:46: error: ‘Abutting1to1’ is not a member of ‘CGNSOO’
    CGNSOO::GridConnectivityType_t ctype    = CGNSOO::Abutting1to1;
                                              ^
writeCGNS.H:506:43: error: ‘PointListDonor’ is not a member of ‘CGNSOO’
    CGNSOO::PointSetType_t donorpsettype = CGNSOO::PointListDonor;
                                           ^
/home/simon/OpenFOAM/OpenFOAM-5.x/wmake/rules/General/transform:25: recipe for target 'Make/linux64GccDPInt32Opt/foamToCGNS.o' failed
make: *** [Make/linux64GccDPInt32Opt/foamToCGNS.o] Error 1
simon@SID-2905:~/cgnsToFromFoam/applications/utilities/postProcessing/dataConversion/foamToCGNS$ wmake all > wmake.foamToCGNS
In file included from /home/simon/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/setRootCase.H:9:0,
                 from foamToCGNS.C:94:
/home/simon/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/listOutput.H: In function ‘int main(int, char**)’:
/home/simon/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/listOutput.H:33:31: error: template argument 1 is invalid
         << fvPatchField<vector>::dictionaryConstructorTablePtr_->sortedToc()
                               ^
foamToCGNS.C:262:28: error: ‘endTime’ was not declared in this scope
  for (label i=startTime; i<endTime; i++)
                            ^
In file included from foamToCGNS.C:272:0:
writeCGNS.H:60:26: error: ‘Dimensional’ is not a member of ‘CGNSOO’
 cgnsBase.writeDataClass( CGNSOO::Dimensional );
                          ^
In file included from foamToCGNS.C:272:0:
writeCGNS.H:79:48: error: ‘GoverningEquationsNull’ is not a member of ‘CGNSOO’
 CGNSOO::GoverningEquationsType_t equationSet = CGNSOO::GoverningEquationsNull;
                                                ^
writeCGNS.H:88:6: error: ‘NSTurbulentIncompressible’ is not a member of ‘CGNSOO’
 case CGNSOO::NSTurbulentIncompressible:
      ^
writeCGNS.H:90:35: error: ‘TwoEquation_JonesLaunder’ is not a member of ‘CGNSOO’
  cgnsFlowEq.writeTurbulenceModel( CGNSOO::TwoEquation_JonesLaunder );
                                   ^
writeCGNS.H:92:6: error: ‘NSTurbulent’ is not a member of ‘CGNSOO’
 case CGNSOO::NSTurbulent:
      ^
writeCGNS.H:94:35: error: ‘TwoEquation_JonesLaunder’ is not a member of ‘CGNSOO’
  cgnsFlowEq.writeTurbulenceModel( CGNSOO::TwoEquation_JonesLaunder );
                                   ^
writeCGNS.H:96:6: error: ‘NSLaminar’ is not a member of ‘CGNSOO’
 case CGNSOO::NSLaminar:
      ^
writeCGNS.H:104:47: error: ‘NonTimeAccurate’ is not a member of ‘CGNSOO’
 cgnsBase.writeSimulationType( (steadyState) ? CGNSOO::NonTimeAccurate : CGNSOO::TimeAccurate );
                                               ^
writeCGNS.H:104:73: error: ‘TimeAccurate’ is not a member of ‘CGNSOO’
 cgnsBase.writeSimulationType( (steadyState) ? CGNSOO::NonTimeAccurate : CGNSOO::TimeAccurate );
                                                                         ^
In file included from foamToCGNS.C:272:0:
writeCGNS.H:305:8: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
   std::auto_ptr<std::vector<double> > p_data( new std::vector<double>(psf.size()) );
        ^
In file included from /usr/include/c++/5/memory:81:0,
                 from foamToCGNS.C:66:
/usr/include/c++/5/bits/unique_ptr.h:49:28: note: declared here
   template<typename> class auto_ptr;
                            ^
In file included from foamToCGNS.C:272:0:
writeCGNS.H:345:8: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
   std::auto_ptr< std::vector<double> > p_data_x( new std::vector<double>(pvf.size()) );
        ^
In file included from /usr/include/c++/5/memory:81:0,
                 from foamToCGNS.C:66:
/usr/include/c++/5/bits/unique_ptr.h:49:28: note: declared here
   template<typename> class auto_ptr;
                            ^
In file included from foamToCGNS.C:272:0:
writeCGNS.H:346:8: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
   std::auto_ptr< std::vector<double> > p_data_y( new std::vector<double>(pvf.size()) );
        ^
In file included from /usr/include/c++/5/memory:81:0,
                 from foamToCGNS.C:66:
/usr/include/c++/5/bits/unique_ptr.h:49:28: note: declared here
   template<typename> class auto_ptr;
                            ^
In file included from foamToCGNS.C:272:0:
writeCGNS.H:347:8: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
   std::auto_ptr< std::vector<double> > p_data_z( new std::vector<double>(pvf.size()) );
        ^
In file included from /usr/include/c++/5/memory:81:0,
                 from foamToCGNS.C:66:
/usr/include/c++/5/bits/unique_ptr.h:49:28: note: declared here
   template<typename> class auto_ptr;
                            ^
In file included from foamToCGNS.C:272:0:
writeCGNS.H:494:46: error: ‘Abutting1to1’ is not a member of ‘CGNSOO’
    CGNSOO::GridConnectivityType_t ctype    = CGNSOO::Abutting1to1;
                                              ^
writeCGNS.H:506:43: error: ‘PointListDonor’ is not a member of ‘CGNSOO’
    CGNSOO::PointSetType_t donorpsettype = CGNSOO::PointListDonor;
                                           ^
make: *** [Make/linux64GccDPInt32Opt/foamToCGNS.o] Error 1
wyldckat commented 6 years ago

Hi Simon,

I've made a small edit to your original post, by adding the markers for the code block, so that the output would be easier to read.

I've taken a look into this and have gotten it to build with OpenFOAM 5.x on Ubuntu 16.04, but I have not tested if it works properly or not.

You will have to do the following commands to get the updated source code, do a clean up of the previous build and rebuild it again:

git pull

rm src/libcgnsoo_3.0/platforms/linux64GccDPInt32Opt/lib/libcgnsoo3.a
wclean all src
wclean all applications

wmake all -j src
wmake all -j applications

Please let me know if this is working as intended, so that I can update the README.md file.

Best regards, Bruno

SiHubb commented 6 years ago

Hi Bruno,

Thank you for taking a look and for the code snippet formatting. I've rebuilt it and have tested it going from cgns->foam->cgns successfully.

Much appreciated,

Simon.

wyldckat commented 6 years ago

Hi Simon,

Many thanks for the request and feedback!

I've updated the README.md file accordingly in commit 87599b4e85fb6c2355408bb4500c720b3145df47. This way everyone should now be able to build both utilities!

Best regards, Bruno