VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkParticleTracerBase.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00026 #ifndef __vtkPParticleTracerBase_h 00027 #define __vtkPParticleTracerBase_h 00028 00029 #include "vtkSmartPointer.h" // For protected ivars. 00030 #include "vtkParticleTracerBase.h" 00031 00032 //BTX 00033 #include <vector> // STL Header 00034 #include <list> // STL Header 00035 //ETX 00036 00037 #include "vtkFiltersParallelFlowPathsModule.h" // For export macro 00038 00039 class VTKFILTERSPARALLELFLOWPATHS_EXPORT vtkPParticleTracerBase : public vtkParticleTracerBase 00040 { 00041 public: 00042 00043 vtkTypeMacro(vtkPParticleTracerBase,vtkParticleTracerBase); 00044 void PrintSelf(ostream& os, vtkIndent indent); 00045 00046 00048 00050 virtual void SetController(vtkMultiProcessController* controller); 00051 vtkGetObjectMacro(Controller, vtkMultiProcessController); 00053 00054 protected: 00055 struct RemoteParticleInfo 00056 { 00057 vtkParticleTracerBaseNamespace::ParticleInformation Current; 00058 vtkParticleTracerBaseNamespace::ParticleInformation Previous; 00059 vtkSmartPointer<vtkPointData> PreviousPD; 00060 }; 00061 00062 typedef std::vector<RemoteParticleInfo> RemoteParticleVector; 00063 00064 00065 vtkPParticleTracerBase(); 00066 ~vtkPParticleTracerBase(); 00067 00068 virtual int RequestUpdateExtent(vtkInformation* request, 00069 vtkInformationVector** inputVector, 00070 vtkInformationVector* outputVector); 00071 00072 // 00073 // Generate output 00074 // 00075 virtual int RequestData(vtkInformation* request, 00076 vtkInformationVector** inputVector, 00077 vtkInformationVector* outputVector); 00078 00079 // 00080 //BTX 00081 00082 virtual vtkPolyData* Execute(vtkInformationVector** inputVector); 00083 virtual bool SendParticleToAnotherProcess(vtkParticleTracerBaseNamespace::ParticleInformation & info, 00084 vtkParticleTracerBaseNamespace::ParticleInformation & previous, 00085 vtkPointData*); 00086 00088 00092 virtual void AssignSeedsToProcessors(double time, 00093 vtkDataSet *source, int sourceID, int ptId, 00094 vtkParticleTracerBaseNamespace::ParticleVector &LocalSeedPoints, 00095 int &LocalAssignedCount); 00097 00099 00101 virtual void AssignUniqueIds( 00102 vtkParticleTracerBaseNamespace::ParticleVector &LocalSeedPoints); 00104 00108 virtual void SendReceiveParticles(RemoteParticleVector &outofdomain, RemoteParticleVector &received); 00109 00110 void UpdateParticleListFromOtherProcesses(); 00111 00115 virtual bool IsPointDataValid(vtkDataObject* input); 00116 00117 00118 // 00119 //ETX 00120 // 00121 00122 // MPI controller needed when running in parallel 00123 vtkMultiProcessController* Controller; 00124 00125 // List used for transmitting between processors during parallel operation 00126 RemoteParticleVector MPISendList; 00127 00128 int Rank; 00129 int NumProcs; 00130 RemoteParticleVector Tail; //this is to receive the "tails" of traces from other processes 00131 private: 00132 vtkPParticleTracerBase(const vtkPParticleTracerBase&); // Not implemented. 00133 void operator=(const vtkPParticleTracerBase&); // Not implemented. 00134 00135 }; 00136 00137 #endif