From d9568a4b564d722b36e03f172d70e4ac3aa9f792 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Sun, 24 Jun 2018 15:50:50 +0200 Subject: [PATCH] SUBMODULE: updates for catalyst - SIGFPE handling, cmake configuration CONFIG: adjust for simplified Catalyst channel naming - no sub-channels, select volField output based in the (internal | boundary) dictionary switches instead --- etc/caseDicts/insitu/catalyst/writeAll.py | 5 +- etc/caseDicts/insitu/catalyst/writeMesh.py | 78 ------------------- etc/caseDicts/insitu/catalyst/writePatches.py | 78 ------------------- modules/catalyst | 2 +- .../twoSimpleRotors/system/catalyst | 5 +- .../system/scripts/pressure.py | 6 +- .../system/scripts/vorticity.py | 7 +- 7 files changed, 15 insertions(+), 166 deletions(-) delete mode 100644 etc/caseDicts/insitu/catalyst/writeMesh.py delete mode 100644 etc/caseDicts/insitu/catalyst/writePatches.py diff --git a/etc/caseDicts/insitu/catalyst/writeAll.py b/etc/caseDicts/insitu/catalyst/writeAll.py index 658ae6e554..7d59b56b85 100644 --- a/etc/caseDicts/insitu/catalyst/writeAll.py +++ b/etc/caseDicts/insitu/catalyst/writeAll.py @@ -4,6 +4,9 @@ from paraview import coprocessing # The frequency to output everything outputfrequency = 5 +# Padding for files +fileNamePadding = 0 + # This is largely identical to the Catalyst allinputsgridwriter.py example # but only handle vtkMultiBlockDataSet, since that is what we generate @@ -18,7 +21,7 @@ def CreateCoProcessor(): grid = input.GetClientSideObject().GetOutputDataObject(0) if grid.IsA('vtkMultiBlockDataSet'): writer = servermanager.writers.XMLMultiBlockDataWriter(Input=input) - coprocessor.RegisterWriter(writer, filename=name+'_%t.vtm', freq=outputfrequency) + coprocessor.RegisterWriter(writer, filename=name+'_%t.vtm', freq=outputfrequency, paddingamount=fileNamePadding) return Pipeline() diff --git a/etc/caseDicts/insitu/catalyst/writeMesh.py b/etc/caseDicts/insitu/catalyst/writeMesh.py deleted file mode 100644 index a8517e26bb..0000000000 --- a/etc/caseDicts/insitu/catalyst/writeMesh.py +++ /dev/null @@ -1,78 +0,0 @@ -from paraview.simple import * -from paraview import coprocessing - -# The frequency to output everything -outputfrequency = 5 - -# As per writeAll, but only for "/mesh" sub-channels. - -# ----------------------- CoProcessor definition ----------------------- - -def CreateCoProcessor(): - def _CreatePipeline(coprocessor, datadescription): - class Pipeline: - for i in range(datadescription.GetNumberOfInputDescriptions()): - name = datadescription.GetInputDescriptionName(i) - if not name.endswith('/mesh'): - continue - input = coprocessor.CreateProducer(datadescription, name) - grid = input.GetClientSideObject().GetOutputDataObject(0) - if grid.IsA('vtkMultiBlockDataSet'): - writer = servermanager.writers.XMLMultiBlockDataWriter(Input=input) - coprocessor.RegisterWriter(writer, filename=name+'_%t.vtm', freq=outputfrequency) - - return Pipeline() - - class CoProcessor(coprocessing.CoProcessor): - def CreatePipeline(self, datadescription): - self.Pipeline = _CreatePipeline(self, datadescription) - - return CoProcessor() - -#-------------------------------------------------------------- -# Global variables that will hold the pipeline for each timestep -# Creating the CoProcessor object, doesn't actually create the ParaView pipeline. -# It will be automatically setup when coprocessor.UpdateProducers() is called the -# first time. -coprocessor = CreateCoProcessor() - -#-------------------------------------------------------------- -# Enable Live-Visualizaton with ParaView -coprocessor.EnableLiveVisualization(False) - - -# ---------------------- Data Selection method ---------------------- - -def RequestDataDescription(datadescription): - "Callback to populate the request for current timestep" - global coprocessor - if datadescription.GetForceOutput() == True or datadescription.GetTimeStep() % outputfrequency == 0: - # We are just going to request all fields and meshes from the simulation - # code/adaptor. - for i in range(datadescription.GetNumberOfInputDescriptions()): - datadescription.GetInputDescription(i).AllFieldsOn() - datadescription.GetInputDescription(i).GenerateMeshOn() - return - - # setup requests for all inputs based on the requirements of the - # pipeline. - coprocessor.LoadRequestedData(datadescription) - -# ------------------------ Processing method ------------------------ - -def DoCoProcessing(datadescription): - "Callback to do co-processing for current timestep" - global coprocessor - - # Update the coprocessor by providing it the newly generated simulation data. - # If the pipeline hasn't been setup yet, this will setup the pipeline. - coprocessor.UpdateProducers(datadescription) - - # Write output data, if appropriate. - coprocessor.WriteData(datadescription); - - # Write image capture (Last arg: rescale lookup table), if appropriate. - coprocessor.WriteImages(datadescription, rescale_lookuptable=False) - - # Live Visualization, if enabled. - coprocessor.DoLiveVisualization(datadescription, "localhost", 22222) diff --git a/etc/caseDicts/insitu/catalyst/writePatches.py b/etc/caseDicts/insitu/catalyst/writePatches.py deleted file mode 100644 index 404267de18..0000000000 --- a/etc/caseDicts/insitu/catalyst/writePatches.py +++ /dev/null @@ -1,78 +0,0 @@ -from paraview.simple import * -from paraview import coprocessing - -# The frequency to output everything -outputfrequency = 5 - -# As per writeAll, but only for "/patches" sub-channels. - -# ----------------------- CoProcessor definition ----------------------- - -def CreateCoProcessor(): - def _CreatePipeline(coprocessor, datadescription): - class Pipeline: - for i in range(datadescription.GetNumberOfInputDescriptions()): - name = datadescription.GetInputDescriptionName(i) - if not name.endswith('/patches'): - continue - input = coprocessor.CreateProducer(datadescription, name) - grid = input.GetClientSideObject().GetOutputDataObject(0) - if grid.IsA('vtkMultiBlockDataSet'): - writer = servermanager.writers.XMLMultiBlockDataWriter(Input=input) - coprocessor.RegisterWriter(writer, filename=name+'_%t.vtm', freq=outputfrequency) - - return Pipeline() - - class CoProcessor(coprocessing.CoProcessor): - def CreatePipeline(self, datadescription): - self.Pipeline = _CreatePipeline(self, datadescription) - - return CoProcessor() - -#-------------------------------------------------------------- -# Global variables that will hold the pipeline for each timestep -# Creating the CoProcessor object, doesn't actually create the ParaView pipeline. -# It will be automatically setup when coprocessor.UpdateProducers() is called the -# first time. -coprocessor = CreateCoProcessor() - -#-------------------------------------------------------------- -# Enable Live-Visualizaton with ParaView -coprocessor.EnableLiveVisualization(False) - - -# ---------------------- Data Selection method ---------------------- - -def RequestDataDescription(datadescription): - "Callback to populate the request for current timestep" - global coprocessor - if datadescription.GetForceOutput() == True or datadescription.GetTimeStep() % outputfrequency == 0: - # We are just going to request all fields and meshes from the simulation - # code/adaptor. - for i in range(datadescription.GetNumberOfInputDescriptions()): - datadescription.GetInputDescription(i).AllFieldsOn() - datadescription.GetInputDescription(i).GenerateMeshOn() - return - - # setup requests for all inputs based on the requirements of the - # pipeline. - coprocessor.LoadRequestedData(datadescription) - -# ------------------------ Processing method ------------------------ - -def DoCoProcessing(datadescription): - "Callback to do co-processing for current timestep" - global coprocessor - - # Update the coprocessor by providing it the newly generated simulation data. - # If the pipeline hasn't been setup yet, this will setup the pipeline. - coprocessor.UpdateProducers(datadescription) - - # Write output data, if appropriate. - coprocessor.WriteData(datadescription); - - # Write image capture (Last arg: rescale lookup table), if appropriate. - coprocessor.WriteImages(datadescription, rescale_lookuptable=False) - - # Live Visualization, if enabled. - coprocessor.DoLiveVisualization(datadescription, "localhost", 22222) diff --git a/modules/catalyst b/modules/catalyst index ae48c4a44e..1670901942 160000 --- a/modules/catalyst +++ b/modules/catalyst @@ -1 +1 @@ -Subproject commit ae48c4a44ec2ec14c57944fb83b01ef4d9d53815 +Subproject commit 1670901942291d87a37b87c7c705ab5c4585fdb1 diff --git a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/catalyst b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/catalyst index 9dd9712604..17fd25d8f3 100644 --- a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/catalyst +++ b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/catalyst @@ -8,13 +8,16 @@ catalyst ( "/scripts/pressure.py" // "/scripts/vorticity.py" - // "/caseDicts/insitu/catalyst/writeMesh.py" + // "/caseDicts/insitu/catalyst/writeAll.py" ); inputs { region { + // No boundary, otherwise we have funny lines in the slice. + boundary false; + // Selected fields (words or regex). fields ( U p ); } diff --git a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/scripts/pressure.py b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/scripts/pressure.py index 571bc31d02..1fb023fc18 100644 --- a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/scripts/pressure.py +++ b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/scripts/pressure.py @@ -65,10 +65,10 @@ def CreateCoProcessor(): # create a new 'XML MultiBlock Data Reader' # create a producer from a simulation input - regionmesh = coprocessor.CreateProducer(datadescription, 'region/mesh') + region = coprocessor.CreateProducer(datadescription, 'region') # create a new 'Slice' - slice1 = Slice(Input=regionmesh) + slice1 = Slice(Input=region) slice1.SliceType = 'Plane' slice1.SliceOffsetValues = [0.0] @@ -166,7 +166,7 @@ def CreateCoProcessor(): coprocessor = CoProcessor() # these are the frequencies at which the coprocessor updates. - freqs = {'region/mesh': [1, 1, 1]} + freqs = {'region': [1, 1, 1]} coprocessor.SetUpdateFrequencies(freqs) return coprocessor diff --git a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/scripts/vorticity.py b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/scripts/vorticity.py index 743da93805..3706e508b4 100644 --- a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/scripts/vorticity.py +++ b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/scripts/vorticity.py @@ -1,4 +1,3 @@ - from paraview.simple import * from paraview import coprocessing @@ -67,10 +66,10 @@ def CreateCoProcessor(): # create a new 'XML MultiBlock Data Reader' # create a producer from a simulation input - regionmesh = coprocessor.CreateProducer(datadescription, 'region/mesh') + region = coprocessor.CreateProducer(datadescription, 'region') # create a new 'Slice' - slice1 = Slice(Input=regionmesh) + slice1 = Slice(Input=region) slice1.SliceType = 'Plane' slice1.SliceOffsetValues = [0.0] @@ -179,7 +178,7 @@ def CreateCoProcessor(): coprocessor = CoProcessor() # these are the frequencies at which the coprocessor updates. - freqs = {'region/mesh': [1, 1, 1]} + freqs = {'region': [1, 1, 1]} coprocessor.SetUpdateFrequencies(freqs) return coprocessor