Giter Site home page Giter Site logo

arthurx70 / ccx2paraview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from calculix/ccx2paraview

0.0 0.0 0.0 294.88 MB

CalculiX to Paraview converter (frd to vtk/vtu). Converts CalculiX FRD file to view and postprocess analysis results in Paraview. Generates Mises and Principal components for stress and strain tensors.

License: GNU General Public License v3.0

Python 100.00%

ccx2paraview's Introduction

© Ihor Mirzov, 2019-2020
Distributed under GNU General Public License v3.0




Downloads | How to use | Screenshots | Your help | For developers | TODO




CalculiX to Paraview converter (frd to vtk/vtu)

Converts CalculiX ASCII .frd-file to view and postprocess analysis results in Paraview. Generates von Mises and principal components for stress and strain tensors.

Creates separate file for each output interval - it makes possible to animate time history. Caution! If you have 300 time steps in the FRD, there will be 300 Paraview files. If you need one file - write output only for one step in your CalculiX model.

Converter is tested on CalculiX examples. Here is how some test log looks like.

FRD reader is tested to reduce processing time as much as possible. Now it's quite optimized and fast, but Python itself is slower than C/C++. Here we can do nothing, so, for example, Calmed converter must be faster - another question is if it's able to read and convert any CalculiX results.



How to use

Please, pay attention to .frd-file type - it should be ASCII, not binary! Use keywords *NODE FILE, *EL FILE and *CONTACT FILE in your INP model to get results in ASCII format.

Running this software from source is not recommended, because sources are under development and may contain bugs. So, first, download released binaries, unpack them and allow to be executed (give permissions).

Run binary with command:

in Linux:       ./ccx2paraview yourjobname.frd vtu
                ./ccx2paraview yourjobname.frd vtk
in Windows:     ccx2paraview.exe yourjobname.frd vtu
                ccx2paraview.exe yourjobname.frd vtk

Also you can pass both formats to convert .frd to .vtk and .vtu at once.

It is recommended to convert .frd to modern XML .vtu format - its contents are compressed. If you have more than one time step there will be additional XML file created - the PVD file. Open it in Paraview to read data from all time steps (all VTU files) at ones.

Starting from ccx2paraview v3.0.0 legacy .vtk format is also fully supported - previously there were problems with component names.

Attention! While developing this converter I'm using latest Python3, latest VTK and latest Paraview. If you have problems with opening conversion results in Paraview - update it.



Screenshots

Converted von Mises stress field with Turbo colormap:
baffle

Converted translations field with Viridis colormap:
blades



Your help

Please, you may:

  • Simply use this software and ask questions.
  • Share your models and screenshots.
  • Report problems by posting issues.



For developers

To run this converter from source you'll need Python 3 with numpy and vtk. Install all with command:

pip3 install numpy vtk ccx2paraview

In your code use ccx2paraview package in this way:

import logging
import ccx2paraview
logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(message)s')
c = ccx2paraview.Converter(frd_file_name, ['vtu'])
c.run()

If you have Python version >= 3.8 create binary with nuitka:

pip3 install nuitka

In Windows:
set CC=C:\\MinGW64\\mingw64\\bin\\gcc.exe
python3 -m nuitka --follow-imports --mingw64 __init__.py

In Linux:
python3 -m nuitka --follow-imports __init__.py

If you have Python version < 3.8 create binary with pyinstaller:

pip3 install pyinstaller
pyinstaller __init__.py --onefile

Read here about how to create packages for pypi.org:

python3 -m pip install --user --upgrade setuptools wheel twine
python3 setup.py sdist bdist_wheel
twine upload dist/*

Read about VTK file formats and VTK unstructured grid. Remember that FRD file is node based, so element results are also stored at nodes after extrapolation from the integration points.



TODO

Multiprocessing for tests.

Paraview programmable filter for tensor principal directions (eigenvectors).

Read binary .frd files.

Read DAT files: it would be a killer feature if Paraview could visualize results in gauss points.

Contribute to meshio. Use meshio XDMF writer: calculix#6

ccx2paraview's People

Contributors

imirzov 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.