|
[Sponsors] |
March 3, 2014, 15:21 |
Ensight byte order
|
#1 |
Member
D L
Join Date: Jun 2012
Posts: 49
Rep Power: 13 |
I've got an ensight data set written out by a 3rd party in Little Endian order.
However, when I read it into Paraview, it seems to pass both the Little Endian and Big Endian tests. According to the vtkEnsight binary reader source code Code:
// Just a sanity check. (0, 0 occurs often). // This condition would only occur for some really large files. if (tmpLE > 0 && tmpBE > 0) { vtkWarningMacro("Byte order is ambiguous."); } // If they are both valid, use the larger one. Because I can't get the data in Ensight Gold Format I'm stuck dealing with this vtkEnsight6BinaryReader. Does anybody have any recommendations or suggestions? |
|
March 4, 2014, 05:54 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Greetings Andy,
Which exact ParaView version are you using? ---- edit: I've done a very quick test in ParaView 4.1.0, but without a small test case, I'm unable to double check this. The test was to use Python code to load the data directly with VTK: Code:
import vtk e = vtk.vtkEnSight6Reader() e.SetByteOrderToLittleEndian I'm going to do some other tests with the ParaView Data sample, which provides EnSight Gold data and try to figure out how to use a Programmable Source to do a VTK data loading. ---- Best regards, Bruno Last edited by wyldckat; March 4, 2014 at 06:35. Reason: see "edit:" |
|
March 4, 2014, 06:50 |
|
#3 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
OK, here's what I've done with some success:
I'll update this post, if I can find some non-Gold EnSight file... hopefully VTK has got one or two... --------- edit: OK, found a test case in VTK 5.8's data package. The following code mostly worked, although it gave be an intriguing error message: Code:
import vtk en = vtk.vtkEnSight6BinaryReader() en.SetFilePath('/home/user/VTKData/Data/EnSight') en.SetCaseFileName('office6_bin.case') #en.SetByteOrderToLittleEndian() en.Update() print en.GetByteOrderAsString() self.GetOutput().ShallowCopy(en.GetOutput()) Code:
vtkSMPVRepresentationProxy (0x54e60c0): Could not determine array range. If we uncomment the LittleEndian line, it won't load the data, as it's wrongly ordered. The "print" line will let us known which mode it is using for loading the data. Last edited by wyldckat; March 4, 2014 at 07:15. Reason: see "edit:" |
|
March 4, 2014, 10:17 |
|
#4 |
Member
D L
Join Date: Jun 2012
Posts: 49
Rep Power: 13 |
Thanks for the reply Bruno,
I'm testing with version 4.1 on CentOS I tried your example case with and without the en.SetByteOrderToLittleEndian() Without it: I get the same warning and then the Segmentation Fault With it: I just get Segmentation Fault In both cases it appears that it doesn't get past line 6 because I get no output from either Paraview nor my CLI telling me the Endianness |
|
March 4, 2014, 10:29 |
|
#5 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Strange... are you using:
Code:
en = vtk.vtkEnSight6BinaryReader() en.SetFilePath('/home/user/VTKData/Data/EnSight') en.SetCaseFileName('office6_bin.case') Perhaps the data is in EnSight 5? Have you tried using the free version of EnSight? It's suppose to be limited, but perhaps it can help to either convert the data formats or at least validate if the data can in fact be loaded or not. |
|
March 4, 2014, 11:09 |
|
#6 |
Member
D L
Join Date: Jun 2012
Posts: 49
Rep Power: 13 |
Yes I was using the code you quoted above
I also tried importing as both MultiBlock and as Unstructured Data I have similar data sets generated from the same source that read in fine; same solver, same analysis just a slight geometry change. So I don't think it's a matter of Ensight version. The frustrating part is that I can read the data into other Ensight viewers but all my post Processing scripts are set up in ParaView and it's not trivial to port them over to something else. Edit: I don't have sys-admin privileges so can't install the free version of Ensight on my own |
|
March 4, 2014, 11:33 |
|
#7 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Mmm... it's possible that something is somewhat broken in the code that generates the EnSight data files.
Possibly the original data generation binaries are in 32 bit and ParaView is in 64 bit, leading to some array incorrect sizing or interpretation. Do you know the array dimensions that are meant to be loaded on each case? Namely a good case vs a bad case? It's possible that one of them is over 2GiB integer value, leading to bad pointing issues. Because the only other thing that comes to mind is to write an Endian converter for those data files edit: By the way, what happens when you comment out the last line, namely the one that starts with "self"? Last edited by wyldckat; March 4, 2014 at 11:35. Reason: see "e |
|
March 4, 2014, 18:52 |
|
#8 |
Member
D L
Join Date: Jun 2012
Posts: 49
Rep Power: 13 |
Well the Ensight files read fine into Meta PostCFD and it's been confirmed to open in Ensight as well (not by me) so I don't think it's something with the generation of the Ensight file. And I'm pretty sure everything I've been dealing with is 64-bit.
I don't follow what you mean by array dimensions. Is there a quick way to check? I'm hoping not to have to delve into an Endian converter. I tried playing with quick one-liners such as dd conv=swab but honestly I don't know what I'm doing there. From what I've read, I need more in depth knowledge about the structure of the binary file in order to do a proper Endian conversion. Also when I comment out the last line beginning with "self" I get the same thing namely because the Segmentation Fault happens during the input portion of the code therefore it doesn't even get a chance to read that line. BTW when I try that code with a "good" ensight data set, it throws errors if I leave in the line "en.SetByteOrderToLittleEndian()" Code:
vtkEnSight6BinaryReader (0x2fbeb30): Invalid number of unstructured points; check that ByteOrder is set correctly. Have I been misinformed? Are my data sets in fact Big Endian? |
|
March 5, 2014, 14:36 |
|
#9 | ||||||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Quote:
What about asking the person who opened in EnSight to export into Gold format? As long as it's practical, that is... or at the very least, you can figure out if it's a lost cause or not, in case ParaView can't even open in Gold format. Quote:
Quote:
Quote:
Quote:
Worst case scenario: the big data might be in BigEndian, but certain details might be in LittleEndian. In the tests I made, when using the incorrect Endian, it did not crash, but it also did not properly load the data for rendering. So essentially, nothing was rendered. I did another quick look for any more hints that might be in the code documentation and I spotted this today: http://www.vtk.org/doc/nightly/html/...r.html#details Quote:
Beyond this, the only somewhat practical idea that comes to mind is to build VTK 6.0 or 6.1 from source code in Debug mode and to diagnose the issue more up-close in the VTK code. Or use a release version of VTK and build a modified version of this class... Of course that for such it would be useful to have a really small test case that reproduces the problem. Such a test case would still be needed for submitting a bug report in the VTK bug tracker, in case you prefer to defer the issue to the developers. Contacting Kitware directly for paid support is also a possibility, but I don't know if it's practical for you (your company) or not. |
|||||||
March 7, 2014, 15:46 |
|
#10 |
Member
D L
Join Date: Jun 2012
Posts: 49
Rep Power: 13 |
Regarding array sizes, the case has 22M points and 39M cells.
I think I might just have to abandon my scripts for this case and manually post-process the data in metaPost CFD. If I happen across an installation of Ensight, I'll give the import/export a try and see if Paraview can read the new data. Thanks for your help Bruno but it looks like this one will remain unresolved for some time. |
|
April 3, 2014, 21:55 |
|
#11 |
Member
D L
Join Date: Jun 2012
Posts: 49
Rep Power: 13 |
Hi Bruno,
So it turns out, the code you provided was on the correct path. A colleague of mine, who is much better versed in Python, was able to take your code and make it work/load the corrupted files into paraview. In short, it turns out the files were in fact Big Endian, and that most of the datasets had a header that specified Big Endian. But in a few cases, it actually lacked this information, and thus Paraview struggled with it. I'm a little surprised because the source code for the vtkEnsight Binary reader is supposed to default to Big Endian if the byte order is ambiguous. Honestly I can't really explain it any better because my python scripting is terrible. But for anyone else who has a similar problem I think the points Bruno brought up are a good starting point. |
|
April 4, 2014, 15:39 |
|
#12 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Hi Andy,
I'm glad your colleague managed to use my broken Python code to get things working! And I hope you've documented this on your side, otherwise you might trigger the same issue in a few months from now and no longer have a working solution for it . Best regards, Bruno |
|
February 22, 2015, 22:03 |
Paraview 4.3.1, CFX and Ensight format
|
#13 |
Member
Ndong-Mefane Stephane Boris
Join Date: Nov 2013
Location: Kawasaki (JAPAN)
Posts: 53
Rep Power: 12 |
Hello,
I've been trying to open CfX results converted into ensight gold binaries into paraview without success. The conversion is made using a tool in ANSYS CFX. I also tried Ascii format and other conversion options without success. I am using ANSYS 15 I get the following error: p, li { white-space: pre-wrap; } ERROR: In C:\DBD\pvs-x32\paraview\src\paraview\VTK\IO\EnSight\vtkEnSigh tReader.cxx, line 299 vtkEnSightGoldReader (12D308D0): error reading geometry file ERROR: In C:\DBD\pvs-x32\paraview\src\paraview\VTK\Common\ExecutionMode l\vtkExecutive.cxx, line 784 vtkCompositeDataPipeline (12AC26D8): Algorithm vtkEnSightGoldReader(12D308D0) returned failure for request: vtkInformation (12AD8880) Debug: Off Modified Time: 211191 Reference Count: 1 Registered Events: (none) Request: REQUEST_DATA ALGORITHM_AFTER_FORWARD: 1 FORWARD_DIRECTION: 0 FROM_OUTPUT_PORT: 0 Any suggestion??? |
|
February 23, 2015, 01:15 |
|
#14 |
Member
Ndong-Mefane Stephane Boris
Join Date: Nov 2013
Location: Kawasaki (JAPAN)
Posts: 53
Rep Power: 12 |
Ok, I found the source of the problem: There were spaces included in the filename.
Changing the filename solved everything. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
upwind finite volume order of accuracy less than one ?? | dgfem | Main CFD Forum | 7 | June 1, 2015 04:02 |
How to active "3rd Order Upwind Monotonicity Preserving" ? | wind | FLOW-3D | 1 | February 21, 2012 10:16 |
OpenFOAM - 2nd order of discretization? | makaveli_lcf | OpenFOAM Running, Solving & CFD | 0 | November 12, 2009 07:15 |
Unstable flow simpleFoam 2nd order | Valle | OpenFOAM | 0 | August 26, 2009 08:12 |
1st order temporal & 2nd order spatial | Prateep Chatterjee | FLUENT | 0 | January 19, 2003 00:31 |