CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[OpenFOAM] Saving screenshot in Paraview Catalyst

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 29, 2018, 18:51
Default Saving screenshot in Paraview Catalyst
  #1
New Member
 
Join Date: Jan 2018
Posts: 11
Rep Power: 5
UchihaMadara is on a distinguished road
I am working with Paraview Catalyst on a cluster to capture images for a simple dambreak case of openfoam. what I get is a blank white screen with axis. Can someone help?
Code:


def CreateCoProcessor():
  def _CreatePipeline(coprocessor, datadescription):
    class Pipeline:

      input1 = coprocessor.CreateProducer(datadescription, "region")

      slice2 = Slice(Input=input1, guiName="Slice2", Crinkleslice=0, SliceOffsetValues=[0.0], Triangulatetheslice=1, SliceType="Plane")
      slice2.SliceType.Offset = 0.0
      slice2.SliceType.Origin = [0.5, 0.5, 0.5]
      slice2.SliceType.Normal = [0, 1, 0]

      sliceWriter = servermanager.writers.XMLPPolyDataWriter(Input=slice2)
      coprocessor.RegisterWriter(sliceWriter, filename='slice_%t.pvtp', freq=10)

      imageDataWriter1 = servermanager.writers.XMLPImageDataWriter(Input=input1)
      coprocessor.RegisterWriter(imageDataWriter1, filename='images_%t.pvti', freq=10)

      paraview.simple._DisableFirstRenderCameraReset()

      # Create a new 'Render View'
      renderView0=CreateView('RenderView')
      renderView0.ViewSize = [1920, 1080]
      renderView0.AnnotationColor=[0.0, 0.0, 0.0]
      renderView0.CameraPosition = [0.0, 0.0, 66.92130429902464]
      renderView0.CameraParallelScale = 17.320508075688775
      renderView0.Background = [1, 1, 1]

#      coprocessor.RegisterView(renderView0, filename='image_%t.png', freq=10, fittoscreen=0, magnification=1, width=868, height=781,
#                                cinema={})
#      renderView0.ViewTime = datadescription.GetTime()    
#      SetActiveView(renderView0)



# The code till above prints only blank images , with nothing in it. I've been trying to #pass data with Show(renderView0) or something similar, but was not able to make it #work.




      a1_alpha_PVLookupTable=GetLookupTableForArray("alpha.water",1,RGBPoints=[0.0,0.0,0.5,0.0,0.635,1.0,0.5,0.0], VectorMode='Magnitude',
NanColor=[0.498039,0.498039,0.498039], ColorSpace='RGB',ScalarRangeInitialized=1.0,LockScalarRange=1)

      a1_alpha_PiecewiseFunction = CreatePiecewiseFunction(Points=[0.0,0.0,0.5,0.0,0.635,1.0,0.5,0.0])


      SetActiveSource(input1)
      Datarepresentation1 = Show()
      Datarepresentation1.ColorAttributeType='CELL_DATA'
      Datarepresentation1.EdgeColor=[0.0, 0.0, 0.5]
      Datarepresentation1.SelectionCellFieldDataArrayName='alpha.water'


      Datarepresentation1.ScalarOpacityFunction=a1_alpha.PiecewiseFunction
      Datarepresentation1.ColorArrayName = ('CELL_DATA','alpha.water')
      Datarepresentation1.LookupTable = a1_alpha_PVLookupTable
      Datarepresentation1.ColorAttributeType='CELL_DATA'
      Datarepresentation1.ScalarOpacityUnitDistance = 0.004
      Datarepresentation1.ScaleFactor=0.02


      coprocessor.RegisterView(Datarepresentation1, filename='image_%t.png', freq=10, fittoscreen=0, magnification=1, width=868, height=781, cinema={})
      renderView0.ViewTime = datadescription.GetTime()



   return Pipeline()
UchihaMadara is offline   Reply With Quote

Reply

Tags
paraview 5.5, paraview catalyst

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM] Help with Paraview colormap and screenshot Joao_Z ParaView 0 November 13, 2017 10:46
[General] Paraview Freezes when Saving Screenshot bjcowen ParaView 0 October 3, 2017 00:50
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch gschaider OpenFOAM Installation 225 August 25, 2015 20:43
[OpenFOAM] Paraview 3.12 memory allocation problem while saving animation jgomez ParaView 17 September 14, 2013 18:03
paraFoam reader for OpenFOAM 1.6 smart OpenFOAM Installation 13 November 16, 2009 22:41


All times are GMT -4. The time now is 04:59.