예제 #1
0
 def __init__(self):
     # WARNING: this does not work inside the plugin
     #          unless you have the same import in paraview-vis.py
     from mpi4py import MPI
     self._node = ascent_extract.ascent_data().child(0)
     self._timeStep = -1
     self._cycle = self._node["state/cycle"]
     self._time = self._node["state/time"]
     self._domain_id = self._node["state/domain_id"]
     # topology and coords are set only if there is only one topology,
     # otherwise they are none.
     self._topology = None
     self._coords = None
     self._outputType = None
     self._extension = None
     self._comm = MPI.Comm.f2py(ascent_extract.ascent_mpi_comm_id())
     self._mpi_rank = self._comm.Get_rank()
     self._mpi_size = self._comm.Get_size()
     self._whole_extent = np.zeros(6, dtype=int)
     self._extent = np.zeros(6, dtype=int)
     self._topologies = topology_names(self._node)
     # setup VTK / ParaView global controler
     vtkComm = vtkMPI4PyCommunicator.ConvertToVTK(self._comm)
     controller = vtkMultiProcessController.GetGlobalController()
     if controller is None:
         controller = vtkMPIController()
         vtkMultiProcessController.SetGlobalController(controller)
     controller.SetCommunicator(vtkComm)
     # we have as many output ports as topologies
     VTKPythonAlgorithmBase.__init__(self,
                                     nInputPorts=0,
                                     nOutputPorts=len(self._topologies),
                                     outputType=None)
예제 #2
0
    def __init__(self):
        VTKPythonAlgorithmBase.__init__(self,
                                        nInputPorts=1,
                                        inputType='vtkPolyData',
                                        nOutputPorts=1,
                                        outputType='vtkImageData')

        self.slicer = None
예제 #3
0
 def __init__(self):
     VTKPythonAlgorithmBase.__init__(self,
                                     nInputPorts=0,
                                     nOutputPorts=1,
                                     outputType="vtkTable")
     self._filename = None
     self._subfile = None
     self.mode_names = []
 def __init__(self):
     self.Dimensions = [101, 101, 101]
     self.T = 10.0
     self.A = 0.1
     self.eps = 0.1
     VTKPythonAlgorithmBase.__init__(self,
                                     nInputPorts=0,
                                     nOutputPorts=1,
                                     outputType='vtkImageData')
예제 #5
0
 def __init__(self):
     """Set up the filter."""
     VTKPythonAlgorithmBase.__init__(
         self,
         nInputPorts=2,
         nOutputPorts=1,
         outputType="vtkUnstructuredGrid",
     )
     self._area = 0.0
     self._minN = 5
예제 #6
0
    def __init__(self):
        """ internal class Dithering
        """
        VTKPythonAlgorithmBase.__init__(self,
                                        nInputPorts=1,
                                        inputType='vtkImageData',
                                        nOutputPorts=1,
                                        outputType='vtkImageData')

        self.dith_map = DitheringEnum.FloydSteinberg.value
예제 #7
0
 def __init__(self):
     VTKPythonAlgorithmBase.__init__(
         self,
         nInputPorts=0,
         nOutputPorts=1,
         # Choosing `vtkUniformGrid` output for the following reasons:
         # - `vtkRectilinearGrid` doesn't support volume rendering
         #   (in Paraview v5.7.0 at least)
         # - The unstructured grids don't support the 'GPU Based'
         #   volume rendering mode, which can do shading and looks nice
         outputType="vtkUniformGrid",
     )
예제 #8
0
파일: openpmd.py 프로젝트: tao558/ParaView
    def __init__(self):
        VTKPythonAlgorithmBase.__init__(self,
                                        nInputPorts=0,
                                        nOutputPorts=2,
                                        outputType='vtkPartitionedDataSet')
        self._filename = None
        self._timevalues = None
        self._series = None
        self._timemap = {}

        from vtkmodules.vtkCommonCore import vtkDataArraySelection
        self._arrayselection = vtkDataArraySelection()
        self._arrayselection.AddObserver("ModifiedEvent",
                                         createModifiedCallback(self))

        self._speciesselection = vtkDataArraySelection()
        self._speciesselection.AddObserver("ModifiedEvent",
                                           createModifiedCallback(self))

        self._particlearrayselection = vtkDataArraySelection()
        self._particlearrayselection.AddObserver("ModifiedEvent",
                                                 createModifiedCallback(self))
예제 #9
0
    def __init__(self):
        VTKPythonAlgorithmBase.__init__(self, nInputPorts=0, nOutputPorts=1, outputType='vtkMultiBlockDataSet')

        r1 = vtkExodusIIReader()
        r1.SetFileName("" + str(VTK_DATA_ROOT) + "/Data/simpleamrgrid.e-s000")
        r1.SetElementBlockArrayStatus("Unnamed block ID: 12", 1)
        r1.SetElementResultArrayStatus("cell_dist", 1)
        r1.SetElementResultArrayStatus("cell_poly", 1)
        r1.SetPointResultArrayStatus("point_dist", 1)
        r1.SetPointResultArrayStatus("point_poly", 1)
        r1.Update()

        r2 = vtkExodusIIReader()
        r2.SetFileName("" + str(VTK_DATA_ROOT) + "/Data/simpleamrgrid.e-s001")
        r2.SetElementBlockArrayStatus("Unnamed block ID: 12", 1)
        r2.SetElementResultArrayStatus("cell_dist", 1)
        r2.SetElementResultArrayStatus("cell_poly", 1)
        r2.SetPointResultArrayStatus("point_dist", 1)
        r2.SetPointResultArrayStatus("point_poly", 1)
        r2.Update()

        self._dataobjects = [r1.GetOutputDataObject(0), r2.GetOutputDataObject(0)]
예제 #10
0
 def __init__(self):
     VTKPythonAlgorithmBase.__init__(self,
                                     nInputPorts=1,
                                     nOutputPorts=1,
                                     outputType="vtkPolyData")