VTK
dox/Parallel/vtkPSLACReader.h
Go to the documentation of this file.
00001 // -*- c++ -*-
00002 /*=========================================================================
00003 
00004   Program:   Visualization Toolkit
00005   Module:    vtkPSLACReader.h
00006 
00007   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00016 
00017 /*-------------------------------------------------------------------------
00018   Copyright 2008 Sandia Corporation.
00019   Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00020   the U.S. Government retains certain rights in this software.
00021 -------------------------------------------------------------------------*/
00022 
00037 #ifndef __vtkPSLACReader_h
00038 #define __vtkPSLACReader_h
00039 
00040 #include "vtkSLACReader.h"
00041 
00042 class vtkMultiProcessController;
00043 
00044 class VTK_PARALLEL_EXPORT vtkPSLACReader : public vtkSLACReader
00045 {
00046 public:
00047   vtkTypeMacro(vtkPSLACReader, vtkSLACReader);
00048   static vtkPSLACReader *New();
00049   virtual void PrintSelf(ostream &os, vtkIndent indent);
00050 
00052 
00056   vtkGetObjectMacro(Controller, vtkMultiProcessController);
00057   virtual void SetController(vtkMultiProcessController *);
00059 
00060 protected:
00061   vtkPSLACReader();
00062   ~vtkPSLACReader();
00063 
00064   vtkMultiProcessController *Controller;
00065 
00066   virtual int RequestInformation(vtkInformation *request,
00067                                  vtkInformationVector **inputVector,
00068                                  vtkInformationVector *outputVector);
00069 
00070   virtual int RequestData(vtkInformation *request,
00071                           vtkInformationVector **inputVector,
00072                           vtkInformationVector *outputVector);
00073 
00074   virtual int CheckTetrahedraWinding(int meshFD);
00075   virtual int ReadConnectivity(int meshFD, vtkMultiBlockDataSet *surfaceOutput,
00076                                vtkMultiBlockDataSet *volumeOutput);
00077   virtual int ReadCoordinates(int meshFD, vtkMultiBlockDataSet *output);
00078   virtual int ReadMidpointCoordinates(int meshFD, vtkMultiBlockDataSet *output,
00079                                       MidpointCoordinateMap &map);
00080   virtual int ReadMidpointData(int meshFD, vtkMultiBlockDataSet *output,
00081                                MidpointIdMap &map);
00082   virtual int RestoreMeshCache(vtkMultiBlockDataSet *surfaceOutput,
00083                                vtkMultiBlockDataSet *volumeOutput,
00084                                vtkMultiBlockDataSet *compositeOutput);
00085   virtual int ReadFieldData(int modeFD, vtkMultiBlockDataSet *output);
00086 
00087   virtual int ReadTetrahedronInteriorArray(int meshFD,
00088                                            vtkIdTypeArray *connectivity);
00089   virtual int ReadTetrahedronExteriorArray(int meshFD,
00090                                            vtkIdTypeArray *connectivity);
00091 
00092   virtual int MeshUpToDate();
00093 
00094 //BTX
00096 
00098   virtual vtkSmartPointer<vtkDataArray> ReadPointDataArray(int ncFD, int varId);
00099 //ETX
00101 
00102 //BTX
00103   class vtkInternal;
00104   vtkInternal *Internal;
00105 //ETX
00106 
00108 
00110   int NumberOfPieces;
00111   int RequestedPiece;
00113 
00115   vtkIdType NumberOfGlobalPoints;
00116 
00118   vtkIdType NumberOfGlobalMidpoints;
00119 
00121 
00122   vtkIdType StartPointRead(int process) {
00123     return process*(this->NumberOfGlobalPoints/this->NumberOfPieces + 1);
00124   }
00125   vtkIdType EndPointRead(int process) {
00126     vtkIdType result = this->StartPointRead(process+1);
00127     if (result > this->NumberOfGlobalPoints) result=this->NumberOfGlobalPoints;
00128     return result;
00129   }
00131 
00133 
00134   int NumberOfPiecesCache;
00135   int RequestedPieceCache;
00137 
00138 private:
00139   vtkPSLACReader(const vtkPSLACReader &);       // Not implemented
00140   void operator=(const vtkPSLACReader &);       // Not implemented
00141 };
00142 
00143 #endif //__vtkPSLACReader_h