parameters: (datadescription)
docstring: Callback to do co-processing for current timestep
docstring_summary: Callback to do co-processing for current timestep
docstring_tokens: Callback to do co - processing for current timestep
function: 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.
      #if not coprocessor.__PipelineCreated:
      coprocessor.UpdateProducers(datadescription)
  
      # tell the particle path filter how far to integrate in time (i.e. our current time)
      coprocessor.Pipeline.particlePath1.TerminationTime = datadescription.GetTime()
  
      # specify reinjection frequency manually so that reinjection
      # occurs based on the simulation time step to avoid restart issues since
      # the particle path filter only knows how many time steps
      # it has been updated. this is the same when the simulation has not been
      # restarted.
      timestep = datadescription.GetTimeStep()
      if timestep % reinjectionfrequency == 0:
        coprocessor.Pipeline.particlePath1.ForceReinjectionEveryNSteps = 1
      else:
        coprocessor.Pipeline.particlePath1.ForceReinjectionEveryNSteps = timestep+1
  
      coprocessor.Pipeline.particlePath1.UpdatePipeline()
  
      # 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)
function_tokens: def DoCoProcessing ( datadescription ) : 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. #if not coprocessor.__PipelineCreated: coprocessor . UpdateProducers ( datadescription ) # tell the particle path filter how far to integrate in time (i.e. our current time) coprocessor . Pipeline . particlePath1 . TerminationTime = datadescription . GetTime ( ) # specify reinjection frequency manually so that reinjection # occurs based on the simulation time step to avoid restart issues since # the particle path filter only knows how many time steps # it has been updated. this is the same when the simulation has not been # restarted. timestep = datadescription . GetTimeStep ( ) if timestep % reinjectionfrequency == 0 : coprocessor . Pipeline . particlePath1 . ForceReinjectionEveryNSteps = 1 else : coprocessor . Pipeline . particlePath1 . ForceReinjectionEveryNSteps = timestep + 1 coprocessor . Pipeline . particlePath1 . UpdatePipeline ( ) # 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 )