1

I have OpenFOAM solution file obtained on HPC (cluster computer system) in which I have no GUI access. I have Python code that works on Python Shell of ParaView without any problem but I need to open ParaView to use the code. I want to run this Python code on HPC and calculate some parameters using ParaView Python ability. Is it possible to do this without activating GUI of ParaView?

mantrasuser3
  • 99
  • 2
  • 12

1 Answers1

1

Yes of course. You can generate a python trace in ParaView (Tools-> Start Trace). This will help you find out what code you are missing :

from paraview.simple import * 

casefoam = OpenFOAMReader(FileName='/path/to/case.foam')
casefoam.MeshRegions = ['internalMesh']
casefoam.CellArrays = ['U']
casefoam.CaseType = 'Decomposed Case'

etc....

Then you can use the pvbatch utility to run this. However, if you are going to run it on a cluster environment where the nodes don't have access to X then you need to make sure pvbatch was compiled with off-screen rendering capability using either EGL or OSMesa.

Jackpap
  • 7,314
  • 5
  • 18
  • 12