Git Product home page Git Product logo

grid2grid's Introduction

Grid2Grid

General Description

  • A wrapper program for generating the nonlinear waves in flow solver.

  • The nonlinear waves are pre-computed by Higher-Order Spectral (HOS) Method.

  • Developed by LHEEA, Ecole Centrale de Nantes(ECN).

  • The following flow information can be retrieved:

    • Wave Elevation
    • Fluid Velocity
    • Dynamic Pressure

How to Install?

Third party libraries

  • FFTW3
  • HDF5

Install FFTW3 library

Download source code

  1. FFTW3 source code can be downloaded from http://www.fftw.org/download.html.

Unzip

  1. Unzip the folder in Windows

Compilation

In Windows (PowerShell)

  1. Configure the CMake Project

    cmake -G <GENERATOR_NAME> -A <OS_ENV> -B <BUILD_DIR_PATH> -S <CMAKE_PROJECT_DIR>
    • <GENERATOR_NAME> : Generator (For example “Visual Studio 14"”)
    • <OS_ENV>: Win32 or x64
    • <BUILD_DIR_PATH>: Directory to build (For example “build”)
    • <CMAKE_PROJECT_DIR>: CMake Project Directory (For example “.”)
  2. Compile

    cmake --build <BUILD_DIR_PATH> --target ALL_BUILD --config <BUILD_MODE>
    • BUILD_MODE: Release or Debug

    For example (In x64 Environment, Release mode)

    cmake -A x64 -B "build64" -S.
    cmake --build build64 --target ALL_BUILD --config Release
    

    Then, the compiled libraries can be found as:

    image-20200826103503975

In Linux (Shell, tested in Ubuntu 18.04.4 LTS)

  1. Configure the FFTW library

    ./configure --prefix=/DOWNLOAD_PATH
  2. Compile the library

    make CFLAGS="-fPIC"
    make install

    Then, the library can be found in “lib/”

Install HDF5 library

It requires HDF5 third party library (version >= 1.8.16). You can:

In Windows (PowerShell)

  • On-going (We are sorry!)

In Linux (Shell, tested in Ubuntu 18.04.4 LTS)

  1. Download HDF5 library (Cmake, Unix) and extract source code https://support.hdfgroup.org/HDF5/release/cmakebuild.html

  2. Add following lines in a file "HDF5options.cmake"

    #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_NO_PACKAGES:BOOL=ON")
        ### Create install package with external libraries (szip, zlib)
    
        set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON")
        set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON")
        set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=ON")
        set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=ON")
  3. Compile with the following command

    ctest -S HDF5config.cmake,BUILD_GENERATOR=Unix -C Release -V -O hdf5.log
  4. Check the library exists in a following path

    ls build/bin/libhdf5.a build/bin/libhdf5_fortran.a build/bin/libszip.a build/bin/libz.a
  5. Make soft link (Optional)

     ln -s ..../Cmake-hdf5-x /usr/local/lib/hdf5
  6. Set HDF5_Library path in a "CMakeLists.txt" in Grid2Grid

    set(HDF5_LIB_PATH /usr/local/lib/hdf5/build/bin)

Install Grid2Grid

From version Grid2Grid version 2, CMake is used to compile the Grid2Grid library.

  1. Set library dependency and paths for Grid2Grid (Grid2GridOptions.cmake)

    ###... Fortran Compiler
    set(CMAKE_Fortran_COMPILER gfortran)
    
    ###... FFTW3 Library Path
    ### set(FFTW3_LIB_PATH  /home/yomy/Utility/fftw/fftw-3.3.8_GNU/lib)
    ### set(FFTW3_LIB_PATH  C:/Users/YOUNGCHOI/Choi/fftw-3.3.8/build64/Release)
    set(FFTW3_LIB_PATH  $FFTW3_LIB_PATH)
    
    ###... HDF5 Library Path
    ### set(HDF5_LIB_PATH  $HDF5_LIB_PATH)
    ### set(HDF_LIBRARY "ON")
    
    ###... Set Library Output path to be OpenFOAM Path
    ### set(BUILD_OF_LIB "ON")
  2. Configure and Compile Grid2Grid Project

    In Windows (PowerShell), (For example: x64, Release Mode)

    cmake -S. -Bbuild -A x64 
    cmake --build build --target ALL_BUILD --config Release

    In Linux (Shell, tested in Ubuntu 18.04.4 LTS)

    cmake -H. -Bbuild
    cmake --build build

grid2grid's People

Contributors

dimbert avatar guillaume4 avatar mgouin avatar naaba avatar yomychoi avatar zhaobinli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

grid2grid's Issues

Internal compiler error while trying to compile on macOS Mojave

Dear all,

I am trying to install Grid2Grid using cmake and following the instructions in this GitHub repo. I get an internal compiler error while trying to compile mfpGoemtry.f90 (see attachments). I am using the GNU gfortran 9.2.0 with fftw3 and hdf5. Any suggestion ?

Best,
George

Screen Shot 2020-01-27 at 1 57 56 PM

Screen Shot 2020-01-27 at 1 51 06 PM

installation problem

Hi, thanking very much for sharing the program for us! i got many installation problems when i tried to install gird2grid in my ubtuntu(64), following the steps wirtten in reference "Grid2Grid : HOS Wrapper Program", the main problem is as follows:
when i input the orders as follows:
7j c a5fnts c9uyou t
then it started to be wrong:
mcsp 0f w qk8 53n 0i
tb08ns l0uh7xfuu vh vd
then i typed in shown as followings:
hni zygn h4e 0 io8d00wn
to4 pnco2ix aq9 sh 9173
vw hlus x zl41 _j y24uc
..alos,if i typed in" make create "or "make createlib",it will show:
p _ew3 cuu _ ym0p49
what can i do for this ? actually,there's many problems on previous steps, but i have managered to make it anyway. i'd really appreciate it if you could help to solve this problem. Cause for my research , Grid2Grid is essential step of the start!!!
thank you very much!!

Problem to run the test program

Dear Grid2Grid developers:
I have problem to run the test subroutine in the src/libGrid2Grid/main.f90 after compiling the grid2grid library.
I can successfully compile the grid2grid library. However, when I test the surboutine testSurf2Vol() in debug mode, the program has error. The program i tested is located at src/libGrid2Grid/main.f90
The program generated the following error:
HOS Ocean Surf2Vol ...

forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
Grid2GridTest 00000000006FC43A Unknown Unknown Unknown
libpthread-2.31.s 00007FFFF7E593C0 Unknown Unknown Unknown
Grid2GridTest 00000000004944A6 Unknown Unknown Unknown
Grid2GridTest 0000000000493F06 Unknown Unknown Unknown
Grid2GridTest 00000000004A48DA Unknown Unknown Unknown
Grid2GridTest 0000000000536384 Unknown Unknown Unknown
Grid2GridTest 0000000000534E90 Unknown Unknown Unknown
Grid2GridTest 000000000054A38F Unknown Unknown Unknown
Grid2GridTest 000000000040C4B8 Unknown Unknown Unknown
Grid2GridTest 0000000000403948 Unknown Unknown Unknown
Grid2GridTest 00000000004038D2 Unknown Unknown Unknown
libc-2.31.so 00007FFFF7C790B3 __libc_start_main Unknown Unknown
Grid2GridTest 00000000004037DE Unknown Unknown Unknown

I debug the code and fund the program will have error at line #209 of hosOcean.inc:

this%nXmode_ = nint(x1) * this%dict_%getIntOrDefault("extraInterpolationNumber", 1)

It looks like %this%dict_ is not initialized and the function getIntOrDefault() can't evaluate
this%nkey method.

The tested main program is changed to run the subroutine testSurf2Vol().

The program is as followings:
Program main

Implicit None
Character(Len =100) :: inputFileName
inputFileName = "postGrid2Grid.dict"

!Call testDict()
!Call testPost(inputFileName)

 Call testSurf2Vol()

! Call testVol2Vol()

End Program

Compile/linking error

Hi!
Thank you for sharing this software open source!
I'm looking forward to trying it out in combination with HOS-ocean 😀

I've had some different issues compiling the software, but I have managed to solve a lot of them and are now stuck on what I think is the final step.
I get some linking error regarding the FFT library, and haven't been able to find any answers on google.

Here is the output/error I get:

$ cmake --build build
Scanning dependencies of target bspline
[ 4%] Building Fortran object src/libBspline/CMakeFiles/bspline.dir/src/bspline_sub_module.f90.o
[ 8%] Building Fortran object src/libBspline/CMakeFiles/bspline.dir/src/bspline_oo_module.f90.o
[ 12%] Building Fortran object src/libBspline/CMakeFiles/bspline.dir/src/bspline_module.f90.o
[ 16%] Linking Fortran static library ../../../lib/libbspline.a
[ 16%] Built target bspline
Scanning dependencies of target fymc
[ 20%] Building Fortran object src/libFyMc/CMakeFiles/fymc.dir/src/mfpGlobal.f90.o
[ 24%] Building Fortran object src/libFyMc/CMakeFiles/fymc.dir/src/general/mfpGeneral.f90.o
[ 28%] Building Fortran object src/libFyMc/CMakeFiles/fymc.dir/src/geometry/mfpGeometry.f90.o
[ 32%] Linking Fortran static library ../../../lib/libfymc.a
[ 32%] Built target fymc
Scanning dependencies of target postG2G
[ 36%] Building Fortran object src/libGrid2Grid/CMakeFiles/postG2G.dir/modGrid2GridGlobal.f90.o
[ 40%] Building Fortran object src/libGrid2Grid/CMakeFiles/postG2G.dir/HDF5/modHDF5Interface.f90.o
[ 44%] Building Fortran object src/libGrid2Grid/CMakeFiles/postG2G.dir/fftw3/modFourier_r2c_FFTW3.f90.o
[ 48%] Building Fortran object src/libGrid2Grid/CMakeFiles/postG2G.dir/surf2Vol/modSurf2Vol.f90.o
[ 52%] Building Fortran object src/libGrid2Grid/CMakeFiles/postG2G.dir/vol2Vol/modVol2Vol.f90.o
[ 56%] Building Fortran object src/libGrid2Grid/CMakeFiles/postG2G.dir/modGrid2Grid.f90.o
[ 60%] Building Fortran object src/libGrid2Grid/CMakeFiles/postG2G.dir/postGrid2Grid/modPostGrid2Grid.f90.o
[ 64%] Building Fortran object src/libGrid2Grid/CMakeFiles/postG2G.dir/main.f90.o
[ 68%] Linking Fortran executable ../../../postG2G
[ 68%] Built target postG2G
Scanning dependencies of target Grid2Grid
[ 72%] Building Fortran object src/libGrid2Grid/CMakeFiles/Grid2Grid.dir/modGrid2GridGlobal.f90.o
[ 76%] Building Fortran object src/libGrid2Grid/CMakeFiles/Grid2Grid.dir/HDF5/modHDF5Interface.f90.o
[ 80%] Building Fortran object src/libGrid2Grid/CMakeFiles/Grid2Grid.dir/fftw3/modFourier_r2c_FFTW3.f90.o
[ 84%] Building Fortran object src/libGrid2Grid/CMakeFiles/Grid2Grid.dir/surf2Vol/modSurf2Vol.f90.o
[ 88%] Building Fortran object src/libGrid2Grid/CMakeFiles/Grid2Grid.dir/vol2Vol/modVol2Vol.f90.o
[ 92%] Building Fortran object src/libGrid2Grid/CMakeFiles/Grid2Grid.dir/modGrid2Grid.f90.o
[ 96%] Building Fortran object src/libGrid2Grid/CMakeFiles/Grid2Grid.dir/postGrid2Grid/modPostGrid2Grid.f90.o
[100%] Linking Fortran shared library ../../../lib/libGrid2Grid.so
/usr/bin/ld: /usr/local/lib/libfftw3.a(f77api.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libfftw3.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
src/libGrid2Grid/CMakeFiles/Grid2Grid.dir/build.make:201: recipe for target '../lib/libGrid2Grid.so' failed
make[2]: *** [../lib/libGrid2Grid.so] Error 1
CMakeFiles/Makefile2:240: recipe for target 'src/libGrid2Grid/CMakeFiles/Grid2Grid.dir/all' failed
make[1]: *** [src/libGrid2Grid/CMakeFiles/Grid2Grid.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

All and any ideas on how to solve this are really appreciated.
Thanks!

Best Regards,
Niclas

About the wave2foam

hello

I am a beginner in computational fluid dynamics. Thank you very much for providing us with this amazing tool, GridsGrid. I am trying to compile grid2grid and wave2foam, but from the reference you provided I cannot understand how to go about building the complete calculation files .Can I trouble you to give me a simple calculation example?

Best regards

HOS packages

Hi
thanks for sharing such an interesting package.
can you please let us know which HOS solver and OpenFOAM are required?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.