How to visualize the results in OUTPUT_ELEME in 2D plot



I would like to know if it it is possible to visualize the results obtained in OUTPUT_ELEME excel file  using toughio in 2D plot. 

Thanks in advance

14replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • The easiest way that does not require any Python scripting is to use the command line program (see https://toughio.readthedocs.io/en/latest/cli.html#export):

    In your terminal or console (not Python IDE such as Spyder), cd to your simulation directory where your OUTPUT_ELEME.csv is located, and run:

    toughio-export OUTPUT_ELEME.csv -t int

    where `int` stands for the time step number you want to export (by default the last time step `-1`). This command will create a VTK file that you can simply drag and drop to ParaView (https://www.paraview.org/) for visualization.

    If you want all the time steps in the same file and kind of animate your results, append the option `-f xdmf`:

    toughio-export OUTPUT_ELEME.csv -f xdmf

    You can open the XDMF file in ParaView too.

    • Keurfon Luu I followed your command lines and I can obtain the VTK file and open it using Paraview as shown below, however I find a problem while exporting the results to XDMF file. The following message appears.

    • Refaat G Hashish Can you update h5py?

      pip install -U h5py
    • Keurfon Luu I have updated it, however the problem persists.

    • Refaat G Hashish Not sure what's going on here... After a quick Google search, it seems that others also have issues with h5py with Python 3.8 on Windows, so there is not much I can do on my end...

      I would recommend you to downgrade your Anaconda distribution to Python 3.7 (the one I am using).

  • Keurfon Luu said:
    not Python IDE such as Spyder

     You said that Python IDE such as Spyder can not be used. So which IDE that I can use? Can I use Matlab or Visual studio?

    • Refaat G Hashish Not an IDE. I said a terminal or console such as Windows console, Anaconda Prompt...

    • Keurfon Luu I run the command line, however I find the following error message.

    • Refaat G Hashish Do not run the command in Python. `toughio-export` is a command line script that should be run in a console or terminal (e.g. Anaconda Prompt). Open Anaconda Prompt and run the command, it should work.

    • Keurfon Luu I used Anaconda Prompt as illustrated in the attached photo. The error message indicates that toughio-export is not recogonized.

    • Refaat G Hashish What happen if you install toughio again from Anaconda Prompt?

      pip install toughio --user
    • Keurfon Luu thank you Keurfon for sharing your tools, to answer this question i want to say that the same error rises 

  • Hi,

    I have installed with by cloning despository with github prompt:

    git clone https://github.com/keurfonluu/toughio

    then miniconda with command:

    pip install .[full] --user

    then you this message

    WARNING: The scripts toughio-co2tab.exe, toughio-export.exe, toughio-extract.exe, toughio-merge.exe and toughio-save2incon.exe are installed in 'C:\Users\xx\AppData\Roaming\Python\Python38\Scripts' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

    you have to add this path in the env. variable.

  • if you install it with conda, add the variable environment in win PATH:


Like Follow
  • 7 mths agoLast active
  • 14Replies
  • 189Views
  • 4 Following