Skip to content

Commit

Permalink
New module - PVDWriter
Browse files Browse the repository at this point in the history
  • Loading branch information
imirzov committed Oct 21, 2019
1 parent 0885345 commit ed719c7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,28 @@ 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.

<br/><br/>



# 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
Expand Down
2 changes: 1 addition & 1 deletion ccx2paraview.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
2 changes: 1 addition & 1 deletion tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit ed719c7

Please sign in to comment.