Coder Social home page Coder Social logo

dansava / resdata Goto Github PK

View Code? Open in Web Editor NEW

This project forked from equinor/resdata

0.0 0.0 0.0 22.63 MB

Software for reading and writing the result files from the Eclipse reservoir simulator.

License: GNU General Public License v3.0

Shell 0.06% C++ 63.64% Python 28.07% C 3.34% TeX 3.41% CMake 1.33% Roff 0.16%

resdata's Introduction

resdata testing

resdata is a package for reading and writing the result files from the reservoir simulators. The file types covered are the restart, init, rft, summary and grid files. Both unified and non-unified and formatted and unformatted files are supported.

resdata is mainly developed on Linux and macOS, in addition there is a portability layer which ensures that most of the functionality is available on Windows. The main functionality is written in C/C++, and should typically be linked in in other compiled programs. resdata was initially developed as part of the Ensemble Reservoir Tool, other applications using resdata are the reservoir simulator flow and Resinsight from the OPM project.

Dependencies

Regardless of how you build resdata, it will depend on the following system-level components.

Software Debian / Ubuntu RHEL / Fedora macOS
libz zlib1g-dev zlib-devel builtin
Conan N/A N/A conan (Homebrew)
pipx (Optional) pipx pipx pipx (Homebrew)

Note: The Conan package manager is not available for most Linux systems. Conan recommends installing it via pip. If using pipx, simply pipx install conan and it'll be availabe for your user regardless if you're using a virtualenv or not.

Alternative 1: Python only

For small interactive scripts, such as forward models, the recommended way to use resdata is by installing it from PyPI. This method doesn't require setting PYTHONPATH or LD_LIBRARY_PATH environment variables:

$ pip install resdata

Alternative 2: C library only

This is for when you need to link directly with the resdata C library, but don't need the Python bindings. resdata requires a conforming C++11 or later compiler such as GNU GCC, the CMake build system and, optionally, zlib.

$ git clone https://github.com/Equinor/resdata
$ mkdir resdata/build
$ cd resdata/build
$ cmake ..
$ make
$ make install

To install resdata in a non-standard location, add -DCMAKE_INSTALL_PREFIX=/path/to/install to the first cmake command. Remember to set LD_LIBRARY_PATH=/path/to/install/lib64:$LD_LIBRARY_PATH if you do use a non-standard location for your program to find resdata.so.

If you intend to develop and change resdata you should build the tests by passing -DBUILD_TESTS=ON and run the tests with ctest.

Alternative 3: C library with Python bindings

It is also possible to install both the C library and Python bindings using CMake. Note that this alternative is incompatible with resdata installed from PyPI (Alternative 1). As before, we require a conforming C++11 or later compiler, CMake and, optionally, zlib.

$ git clone https://github.com/Equinor/resdata
$ mkdir resdata/build
$ cd resdata/build
$ pip install -r ../requirements.txt
$ cmake .. -DENABLE_PYTHON=ON
$ make
$ make install

You will most likely want to install resdata into a Python virtual environment. First activate the virtualenv, then add the argument -DCMAKE_INSTALL_PREFIX=$(python -c "import sys; print(sys.prefix)") to the cmake command when building.

Then, you must tell Python where to find the package[1]:

$ export PYTHONPATH=/path/to/install/lib/python2.7/site-packages:$PYTHONPATH
$ export LD_LIBRARY_PATH=/path/to/install/lib64:$LD_LIBRARY_PATH

Then you can fire up your Python interpreter and try it out:

>>> from resdata.summary import Summary
>>> import sys

>>> summary = Summary(sys.argv[1])
>>> fopt = summary.numpy_vector("FOPT")

The installation with Python enabled is described in a YouTube video by Carl Fredrik Berg.

[1]: The exact paths here will depend on your system and Python version. The example given is for a RedHat system with Python version 2.7.

resdata's People

Contributors

akva2 avatar andlaus avatar arielalmendral avatar berland avatar bjarneherland avatar blattms avatar bska avatar dhan16 avatar eivindjahren avatar flikka avatar galfodo avatar iloop2 avatar jensgm avatar jepebe avatar joakim-hove avatar jokva avatar lindkvis avatar magnesj avatar maninfez avatar markusdregi avatar myrseth avatar oysteoh avatar perroe avatar pgdr avatar pinkwah avatar reedonly avatar rolk avatar sondreso avatar verveerpj avatar xjules avatar

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.