From ed719c7d8847a8d7e970b1ba023efdd3b645bf31 Mon Sep 17 00:00:00 2001 From: imirzov Date: Mon, 21 Oct 2019 20:19:08 +0200 Subject: [PATCH] New module - PVDWriter --- README.md | 18 +++++++++--------- ccx2paraview.py | 2 +- tests.py | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 39af76da..60693c9e 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,11 @@ I'm testing the script and trying to reduce processing time as much as possible. # Download -Download Linux and Windows binaries from the [releases page](https://github.com/imirzov/ccx2paraview/releases). Binaries don't need to be installed. +Download binaries from the [releases page](https://github.com/imirzov/ccx2paraview/releases). Binaries don't need to be installed. + +For the latest version use the source code. See below how to use. + +Dear users, from now there will be no Windows binary since I'm not using this OS anymore.

@@ -27,20 +31,16 @@ Download Linux and Windows binaries from the [releases page](https://github.com/ # How to use -You'll need [Python 3](https://www.python.org/downloads/) with *numpy* to use this converter: +To run this converter from source you'll need [Python 3](https://www.python.org/downloads/) with *numpy*: pip3 install numpy -The main script is [ccx2paraview.py](ccx2paraview.py). Also you'll need: -- [frd2vtk.py](frd2vtk.py) -- [FRDParser.py](FRDParser.py) -- [VTKWriter.py](VTKWriter.py) -- [VTUWriter.py](VTUWriter.py) - -It is recommended to convert .frd to modern XML .vtu format: +The main script is [ccx2paraview.py](ccx2paraview.py). It is recommended to convert .frd to modern XML .vtu format: python3 ccx2paraview.py jobname.frd vtu +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. + To convert .frd to legacy ASCII .vtk format, use command: python3 ccx2paraview.py jobname.frd vtk diff --git a/ccx2paraview.py b/ccx2paraview.py index 5a4bff69..e2eff4fd 100644 --- a/ccx2paraview.py +++ b/ccx2paraview.py @@ -63,7 +63,7 @@ VTUWriter.writeVTU(p, file_name, s) # Write ParaView Data (PVD) for series of VTU files. - if len(times) > 1: + if len(times) > 1 and args.format == 'vtu': PVDWriter.writePVD(p.file_name.replace('.frd', '.pvd'), times, names) diff --git a/tests.py b/tests.py index b66183b5..41b7a018 100644 --- a/tests.py +++ b/tests.py @@ -51,7 +51,7 @@ def listAllFiles(startFolder, ext): # Convert calculation results for filename in listAllFiles('./tests/users', '.frd'): - # subprocess.run('python3 ccx2paraview.py ' + filename + ' vtk', shell=True) + subprocess.run('python3 ccx2paraview.py ' + filename + ' vtk', shell=True) subprocess.run('python3 ccx2paraview.py ' + filename + ' vtu', shell=True) # break # one file only