• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

Albany_Catalyst_Grid.hpp

Go to the documentation of this file.
00001 //*****************************************************************//
00002 //    Albany 2.0:  Copyright 2013 Kitware Inc.                     //
00003 //    This Software is released under the BSD license detailed     //
00004 //    in the file "license.txt" in the top-level Albany directory  //
00005 //*****************************************************************//
00006 
00007 #ifndef ALBANY_CATALYST_GRID
00008 #define ALBANY_CATALYST_GRID
00009 
00010 #include "vtkObject.h"
00011 
00012 #include "vtkMappedUnstructuredGrid.h" // For mapped unstructured grid wrapper
00013 
00014 #include "Albany_Catalyst_Decorator.hpp" // For decorator class
00015 
00016 namespace Albany {
00017 namespace Catalyst {
00018 
00019 class GridImplementation: public vtkObject
00020 {
00021 public:
00022   static GridImplementation *New();
00023   virtual void PrintSelf(ostream &os, vtkIndent indent);
00024   vtkTypeMacro(GridImplementation, vtkObject)
00025 
00026   bool SetDecorator(Decorator *decorator);
00027 
00028   // API for vtkMappedUnstructuredGrid's implementation.
00029   vtkIdType GetNumberOfCells();
00030   int GetCellType(vtkIdType cellId);
00031   void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds);
00032   void GetPointCells(vtkIdType ptId, vtkIdList *cellIds);
00033   int GetMaxCellSize();
00034   void GetIdsOfCellsOfType(int type, vtkIdTypeArray *array);
00035   int IsHomogeneous();
00036 
00037   // This container is read only -- these methods do nothing but print a
00038   // warning.
00039   void Allocate(vtkIdType numCells, int extSize = 1000);
00040   vtkIdType InsertNextCell(int type, vtkIdList *ptIds);
00041   vtkIdType InsertNextCell(int type, vtkIdType npts, vtkIdType *ptIds);
00042   vtkIdType InsertNextCell(int type, vtkIdType npts, vtkIdType *ptIds,
00043                            vtkIdType nfaces, vtkIdType *faces);
00044   void ReplaceCell(vtkIdType cellId, int npts, vtkIdType *pts);
00045 
00046 protected:
00047   GridImplementation();
00048   ~GridImplementation();
00049 
00050 private:
00051   GridImplementation(const GridImplementation &); // Not implemented.
00052   void operator=(const GridImplementation &);   // Not implemented.
00053 
00054   const Decorator *Discretization;
00055 
00056   int DegreesOfFreedom;
00057 
00058   // Nested ArrayRCPs -- lookup [wsId][wsElLid][elNodeInd][] / DOF = node id
00059   typedef Teuchos::ArrayRCP<Teuchos::ArrayRCP<Teuchos::ArrayRCP<
00060             Teuchos::ArrayRCP<int> > > > WsElLid2NodeT;
00061   WsElLid2NodeT NodeLookup;
00062 
00063   // Map of all elements, global element id -> struct { int ws, int lid }
00064   const WsLIDList *ElementsWsLid;
00065 
00066   // Offset of the keys in ElementsWsLid:
00067   int ElementOffset;
00068 
00069   // Indexed by workset:
00070   std::vector<const CellTopologyData *> TopologyLookup;
00071   std::vector<VTKCellType> CellTypeLookup;
00072   static VTKCellType TopologyToCellType(const CellTopologyData *ctd);
00073   static vtkIdType GetCellSize(VTKCellType cellType);
00074   void GetWorksetFromCellId(vtkIdType cellId, int &ws, int &lid);
00075   VTKCellType GetCellTypeFromWorkset(int ws);
00076 };
00077 
00078 vtkMakeMappedUnstructuredGrid(Grid, GridImplementation)
00079 
00080 } // end namespace Catalyst
00081 } // end namespace Albany
00082 
00083 #endif // ALBANY_CATALYST_GRID

Generated on Wed Mar 26 2014 18:36:36 for Albany: a Trilinos-based PDE code by  doxygen 1.7.1