CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Paraview & paraFoam

Error when trying to display mesh

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   July 26, 2012, 15:44
Default Error when trying to display mesh
  #1
New Member
 
SV
Join Date: May 2009
Posts: 15
Rep Power: 8
Soheyl is on a distinguished road
I'm trying to visualize a (rather large) mesh in ParaFoam (3.12.0), but I keep on getting this error message a few seconds after I hit the 'Apply' button:

Quote:
ERROR: In /home/opencfd/OpenFOAM/ThirdParty-2.1.x/ParaView-3.12.0/VTK/Common/vtkDataArrayTemplate.txx, line 361
vtkIdTypeArray (0x20c7bed0): Unable to allocate 74102619 elements of size 4 bytes.

Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt. You must
reimplement QApplication::notify() and catch all exceptions there.

terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted (core dumped)
I thought it might be due to insufficient memory, so I used 'top' to monitor the system resources, and it seems that when I get this message, I still have a lot of free memory. Any idea why this happens? BTW, I'm running it under a 32 bit Ubuntu 12.04.
Soheyl is offline   Reply With Quote

Old   July 26, 2012, 16:11
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,258
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings Soheyl,

Mmm... here's a few questions for trying to diagnose this issue:
  1. How many cells and points does you mesh have? Run checkMesh and see the first statistics, where it tells you how many cells and points the mesh has.
  2. And how many fields does you case have?
  3. Are you using polyhedral decomposition?
  4. Which file extension are you using? ".OpenFOAM" or ".foam"?
Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   July 26, 2012, 16:23
Default
  #3
New Member
 
SV
Join Date: May 2009
Posts: 15
Rep Power: 8
Soheyl is on a distinguished road
Bruno,

According to checkMesh:

Quote:
Mesh stats
points: 5744072
faces: 15409078
internal faces: 14514914
cells: 4852540
boundary patches: 7
point zones: 0
face zones: 0
cell zones: 0

Overall number of cells of each type:
hexahedra: 4348904
prisms: 71061
wedges: 441
pyramids: 0
tet wedges: 556
tetrahedra: 95
polyhedra: 431483
Also, all the checks are OK.

The case will have about 10 fields, but I haven't solved the case yet, and just trying to visualize the mesh. And none of them are selected in ParaFoam.

I am using scotch decomposition, and the file has an auto-generated extension of .OPENFOAM.
Soheyl is offline   Reply With Quote

Old   July 26, 2012, 16:47
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,258
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
What I meant by "polyhedral decomposition" was if you had chosen the option to do polyhedral decomposition in ParaView. It's one of the options in the "Object Inspector", which when turned on, shows the mesh as it really is.

Mmm... over 4 million cells... Last time I checked, for each million cells in OpenFOAM, it would require 1 GB of RAM. And if you're using a 32bit Ubuntu installation, then each application should not be able to allocate more than 2GB of RAM, even if you're using PAE!

Therefore, it should only be natural that you aren't able to load the mesh using a single instance of ParaView!

By the way, did you generate the mesh on that machine?
wyldckat is offline   Reply With Quote

Old   July 26, 2012, 17:57
Default
  #5
New Member
 
SV
Join Date: May 2009
Posts: 15
Rep Power: 8
Soheyl is on a distinguished road
That makes sense! I created the mesh on the same machine, but I ran snappyHexMesh on parallel on 4 cores. Well, I guess the only option might be reinstalling a 64 bit Ubuntu!

Thanks Bruno.
Soheyl is offline   Reply With Quote

Old   September 3, 2014, 10:28
Smile
  #6
New Member
 
Join Date: May 2014
Posts: 22
Rep Power: 3
CRI_CFD is on a distinguished road
Hey guys,

Have you solved your problem with memory?

I am making my script with Python-ParaView and I obtain the same error message. It looks like ParaView doesn't liberate memory (I am deleting all objects just when I don't need them).

Does anybody knows what can I do? I am working with high cell count and moreover I am using the Calculator tool. when I don't need it I do "Delete(object)".

gc.collect() is not the solution for me...

Thanks in advance.
CRI_CFD is offline   Reply With Quote

Old   September 13, 2014, 16:58
Default
  #7
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,258
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings CRI_CFD,

I believe you're stepping into a more confusing part of VTK itself, and not as much Python coding.
I say this because VTK uses its own memory management system, due to its pipeline structure.

If you want to really save memory, you'll have to dump the results in between pipeline steps, using specific VTK methods... let's see if I can find them... ah, it's explained in detail here: http://www.paraview.org/Wiki/VTK/FAQ...eleaseDataFlag

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   September 14, 2014, 07:51
Default
  #8
New Member
 
Join Date: May 2014
Posts: 22
Rep Power: 3
CRI_CFD is on a distinguished road
Hey wyldkat,

Thanks for your reply.

I am reviewing my Python code and I am not using VTK anywhere (no import of VTK an the beginning of the script).

I am importing my results with OpenFOAMReader.

Is Paraview using VTK classes and methods and I am not realizing?

If so, is this link still useful?

I'll check it anyway.

Thanks for your help!

Best,

CRI_CFD
CRI_CFD is offline   Reply With Quote

Old   September 14, 2014, 08:14
Default
  #9
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,258
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi CRI_CFD,

Quote:
Originally Posted by CRI_CFD View Post
I am importing my results with OpenFOAMReader.

Is Paraview using VTK classes and methods and I am not realizing?
The core reader "OpenFOAMReader" is VTK based code, therefore it will use it. Which options are you using with it?

From your description, my guess is that the problem starts right when you import the case with "OpenFOAMReader"? Or do you use any other filters after that?

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   September 14, 2014, 08:29
Default
  #10
New Member
 
Join Date: May 2014
Posts: 22
Rep Power: 3
CRI_CFD is on a distinguished road
I do it this way:

Code:
try: paraview.simple
except: from paraview.simple import *

paraview.simple._DisableFirstRenderCameraReset()

caso_foam = OpenFOAMReader( FileName='pathtofile/caso.foam' )
Then I start to import mesh regions, arrays....

All uses to run fine, except in two mainly cases:

1. Use of "Calculator filter". I try to delete it the faster I can (I guess it is taking a lot of memory resources, because this is a computation in the whole mesh), but as I said previously:

Code:
Delete(Calculator)
gc.collect()
does not seem to solve the problem.

2. When I want to import a new foam case, I do:

Code:
Delete(previouscase.foam)
gc.collect()

try: paraview.simple
except: from paraview.simple import *

paraview.simple._DisableFirstRenderCameraReset()

caso2_foam = OpenFOAMReader( FileName='pathtofile/caso2.foam' )
The error message I get is:

Code:
erminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted (core dumped)
or simply

Code:
Killed.
Do you think I can make use of your advices related to VTK with Python?

The script makes use of different filters (for example Velocity magnitude over a range of slices, streamlines, thresholds, calculators, integrate variables...) so I need a way of free memory. Mesh size is also quite big (around 6000000 cells).

Thanks again.

Last edited by wyldckat; October 12, 2014 at 12:49. Reason: Added [CODE][/CODE]
CRI_CFD is offline   Reply With Quote

Old   October 12, 2014, 13:06
Default
  #11
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,258
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi CRI_CFD,

I've finally managed to come around to check this.
From the quick tests I've done with ParaView 3.12.0 and 4.1.0, using OpenFOAM's "cavity" tutorial case, on Ubuntu 12.04, both ParaView versions are custom built along with OpenFOAM 2.2.x and 2.3.x... and I have a very bad feeling that there is a memory leak problem in ParaView/VTK.
If you try the steps you're doing manually in ParaView, using the interface and not Python, and monitor the memory occupied after loading and removing each filter and data read, you'll see that the memory occupied very rarely will decrease.

This reminds me of a known bug related to generating animations with ParaView... it's this thread: Paraview 3.12 memory allocation problem while saving animation

Therefore, there seems to be a deeper problem in ParaView, and it's not simply related to using Python.

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Reply

Tags
parafoam, paraview, ubuntu

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
3D Hybrid Mesh Errors DarrenC ANSYS Meshing & Geometry 11 August 5, 2013 06:42
Layers:problem with curvature giulio.topazio OpenFOAM Native Meshers: snappyHexMesh and Others 10 August 22, 2012 09:03
engrid -> save as .stl with boundarie codes Zymon enGrid 31 August 29, 2011 13:40
Problem to display mesh in Paraview Voyage_gui ParaView 5 August 19, 2011 04:03
basic of mesh refinement arya CFX 4 June 19, 2007 12:21


All times are GMT -4. The time now is 12:01.