VTK
dox/IO/Exodus/vtkExodusModel.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkExodusModel.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 =========================================================================*/
00015 /*----------------------------------------------------------------------------
00016  Copyright (c) Sandia Corporation
00017  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
00018 ----------------------------------------------------------------------------*/
00019 
00054 #ifndef __vtkExodusModel_h
00055 #define __vtkExodusModel_h
00056 
00057 #include "vtkIOExodusModule.h" // For export macro
00058 #include "vtkObject.h"
00059 
00060 #include "vtkModelMetadata.h"  // So those who include vtkExodusModel don't
00061                                // need to know anything about ModelMetadata
00062 
00063 class vtkIdTypeArray;
00064 class vtkUnstructuredGrid;
00065 
00066 class VTKIOEXODUS_EXPORT vtkExodusModel : public vtkObject
00067 {
00068 public:
00069   vtkTypeMacro(vtkExodusModel, vtkObject);
00070   virtual void PrintSelf(ostream &os, vtkIndent indent);
00071 
00072   static vtkExodusModel *New();
00073 
00083   int SetGlobalInformation(int fid, int compute_word_size);
00084 
00097   int AddUGridElementVariable(char *ugridVarName, char *origName, int numComponents);
00098   int RemoveUGridElementVariable(char *ugridVarName);
00099 
00100   int AddUGridNodeVariable(char *ugridVarName, char *origName, int numComponents);
00101   int RemoveUGridNodeVariable(char *ugridVarName);
00102 
00103   void SetElementVariableInfo(int numOrigNames, char **origNames,
00104             int numNames, char **names,  int *numComp, int *map);
00105   void SetNodeVariableInfo(int numOrigNames, char **origNames,
00106             int numNames, char **names,  int *numComp, int *map);
00107 
00121   int SetLocalInformation(vtkUnstructuredGrid *ugrid,
00122         int fid, int timeStep, int newGeometry, int compute_word_size);
00123 
00127   static int HasMetadata(vtkUnstructuredGrid *grid);
00128 
00131   vtkModelMetadata *GetModelMetadata();
00132   void SetModelMetadata(vtkModelMetadata *emData);
00133 
00143   int UnpackExodusModel(vtkUnstructuredGrid *grid, int deleteIt);
00144 
00149   int MergeExodusModel(vtkExodusModel *em);
00150 
00158   vtkExodusModel *ExtractExodusModel(vtkIdTypeArray *globalCellIdList,
00159                                      vtkUnstructuredGrid *grid);
00160 
00166   void PackExodusModel(vtkUnstructuredGrid *grid);
00167 
00170   void Reset();
00171 
00172 protected:
00173 
00174   vtkExodusModel();
00175   ~vtkExodusModel();
00176 
00177 private:
00178 
00179   vtkModelMetadata *CheckSetModelMetadata();
00180 
00181   static void CopyDoubleToFloat(float *f, double *d, int len);
00182 
00183   int SetLocalBlockInformation(
00184           int fid, int use_floats, int *blockIds , int *cellIds, int ncells);
00185   int SetLocalNodeSetInformation(
00186                        int fid, int use_floats, int *pointIds, int npoints);
00187   int SetLocalSideSetInformation(
00188                         int fid, int use_floats, int *cellIds, int ncells);
00189 
00190   void RemoveBeginningAndTrailingSpaces(char **names, int len);
00191 
00192   vtkModelMetadata *ModelMetadata;
00193 
00194   int GeometryCount;
00195 
00196   vtkExodusModel(const vtkExodusModel&); // Not implemented
00197   void operator=(const vtkExodusModel&); // Not implemented
00198 };
00199 #endif