Welcome, Guest
Username: Password: Remember me

TOPIC: New Working Paraview Plugin for telemac.

New Working Paraview Plugin for telemac. 8 years 3 weeks ago #20995

  • j_floyd
  • j_floyd's Avatar
Based on the original plugin which only worked on paraview 3.x, I have converted the code into a working plugin for V4.4 (current version).

Some coding needed to be changed, new api! Other parts needed cleanups, and inparticular the read functions needed to use int64 for keeping sync with file positioning (its the same problem as I found in the telemac v7 code).

With a functioning plugin, I am now looking at some improvements on the original. Some implemented improvements include caching of XY coords rather than re-reading each render. Definitely need to add in support for double precision floats ie SERAFIND.

The plugin code has been packaged as source code for compilation in its own location, with a reference to where the paraview source built code is located. This is a character of the paraview build process and does not allow compilation of out of source plugins without a full build system existing. I have built my version on Linux (Fedora) using g++ v5.3.

When Opentelemac transfers to a flexible code management system (eg git ... please) it can be placed there. For now here is a zip file of the source.

This current work could not have come about without the initial work provided in creating the origianl plugin.

Please try the code and pass on the experience. I have only Linux for testing - other systems need other developers (probably a problem will arise for specifying int64)!

An important question - is the file format SERAFIN or SELAFIN. Both seem to be used sometimes in the same document.

Cheers
John Floyd
Attachments:
The administrator has disabled public write access.

New Working Paraview Plugin for telemac. 8 years 1 week ago #21228

  • yugi
  • yugi's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 851
  • Thank you received: 243
Hi,

Thank you for your work.
I will integrate your work in the svn.

The official name is Serafin even though you can find both in documentation and comment in the code Serafin is used.

Cheers,
Yoann
There are 10 types of people in the world: those who understand binary, and those who don't.
The administrator has disabled public write access.

New Working Paraview Plugin for telemac. 8 years 1 week ago #21229

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3632
  • Thank you received: 1010
Hi

Thanks John for your work.
For general information, I tested this plugin of windows 7 (64 bits) with Paraview 5.0.1 and it works.
I just have to modify the file vtkSerafinReader.h to comment line 72 (int IsValidFile();)
I first had an error message undefined reference to 'vtkSerafinReader::IsValidFile()'
I'm not sure this modification was the right one but this solved the problem...


Regards
Christophe
The administrator has disabled public write access.

New Working Paraview Plugin for telemac. 8 years 1 week ago #21230

  • j_floyd
  • j_floyd's Avatar
Didn’t catch the IsValid situation (wonder what the real difference between my code and yours is). However it would be good to define a real test to ignore non-serafin files without causing segfaults etc.

The important addition is being able to read double precision serafin files. But first need a reliable way to determine if it is double or single. I would not rely on the title having the serafin tag but look at (eg) the xcoordinate dataset and compare the file record size versus the npoints variable.

Some thought also needs to go into the support filereader code to incorporate the double precision block reader without just duplicating the single precision code set. I am trying to get my head around c++ polymorphism for the read functions. For me this it means I also need to understand the paraview model better.

Thanks for the comments - it took a while but its good to see people trying it out.
The administrator has disabled public write access.

New Working Paraview Plugin for telemac. 8 years 3 days ago #21383

  • pprodano
  • pprodano's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 95
  • Thank you received: 54
Hello John,

In parserSELAFIN.py single or double precision floats are determined by the tag in the *.slf file just before the x coordinate array (method getFloatTypeFromFloat). If I understand correctly, that is how scan.py tells if a *.slf file is single or double precision.

Pat
The administrator has disabled public write access.

New Working Paraview Plugin for telemac. 7 years 11 months ago #21439

  • j_floyd
  • j_floyd's Avatar
Thankyou, I have seen this as well - which uses the record size of the xcoord with the number of nodes to define the variable size. In the paraview this can be easily done as well.

The difficulty is in changing the PV plugin code to transparently handle 4 byte or 8 byte floats easily without lots of if/then/else statements.

Cheers
John
The administrator has disabled public write access.

New Working Paraview Plugin for telemac. 7 years 11 months ago #21991

  • ykhoudar
  • ykhoudar's Avatar
Hi there, I just began using paraview.
I need to use some selafin data.
First I used sel2vtk_new, but when I tried to open it on Paraview I had the following message.

After few tries, I decided to use the plugin which allows us to read slf data directly on paraview.

Capturedu2016-06-13172723.png

I've seen the last one you posted but can you teach me quickly how to install it please ?

Thank you for your time.
The administrator has disabled public write access.

New Working Paraview Plugin for telemac - simple compilation guide. 7 years 11 months ago #21996

  • j_floyd
  • j_floyd's Avatar
Not sure what system you are working from (looks like linux) and I can only advise for linux.

The plugin needs to be compiled for the version of paraview you are running. I debugged this newest version on paraview 4.4.0. To compile the plugin you need a full development install of the paraview system. Depending on the source for your version or paraview will determine if you can do that. Otherwise you need to download and compile and install your own version.

Once you have a full development installation (which will include a number of libraries, c++ compilers, cmake etc), create your own folder (anywhere you like) with the plugin unzipped/untared in it. In the folder containing the plugin source files create a Build folder. Cd into Build and run

ccmake .. (fairly cryptic erros messages can help solve problems)

if this works then you should be able to compile the plugin with

make

If it does not work you will probably need to change the first statemetn in the CMakeLists.txt file to, point to the location of the development paraview installation. Note this can also be done on the commandline to ccmake but I cant remember the exact requirements.

The plugin can be installed in your home folder
~/.config/ParaView/ParaView-4.4/Plugins/ under linux (windows??)

where paraview will find it.

Hope this helps - I realise this is a bit cryptic - took me a while to work it out. But it does work. Paraview is not easy to set up and compile your own plugins for, but once initially done is easy to re-use. You have to get your head around c++, cmake, vtk and paraview ....

cheers and good luck
john
The administrator has disabled public write access.

New Working Paraview Plugin for telemac - simple compilation guide. 7 years 11 months ago #22003

  • ykhoudar
  • ykhoudar's Avatar
Thank you for your quick reply.

I've tried to follow your advice but I don't understand when you said " In the folder containing the plugin source files create a Build folder. Cd into Build and run". What do I have to run ? What is a build folder ?

And in your second solution, what should I point in the first statement in the CMakeMLists.txt ? The location of the paraview application ? The plugin unziped ? the folder named Build ?

Sorry if all this questions sound obvious for you but I'm fresh beginner.


Cheers
The administrator has disabled public write access.

New Working Paraview Plugin for telemac - simple compilation guide. 7 years 10 months ago #22049

  • j_floyd
  • j_floyd's Avatar
You have not indictated what system you are running (linux and the distribution, or windows) and whether you have a full paraview developement packge installed - or the full source code of paraview.

**** If you have no experience of compiling source code I would not recommend trying this unless you do an appreciable amount of reading. There are a number of things that you need to understand, firstly the cmake system , then basic compiling and installing.

Your questions

The command to run is on the next line - "ccmake .."

This requires that you have cmake package install.

Once the cmake configuration command runs successfully, you then run "make" to compile the plugin.

I will have a look at what i would need to do to compile this with a fedora installtion of paraview. I havent done this yet!

cheers
john
The administrator has disabled public write access.

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.