Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #ifndef ALBANY_CATALYST_GRID
00008 #define ALBANY_CATALYST_GRID
00009
00010 #include "vtkObject.h"
00011
00012 #include "vtkMappedUnstructuredGrid.h"
00013
00014 #include "Albany_Catalyst_Decorator.hpp"
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
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
00038
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 &);
00052 void operator=(const GridImplementation &);
00053
00054 const Decorator *Discretization;
00055
00056 int DegreesOfFreedom;
00057
00058
00059 typedef Teuchos::ArrayRCP<Teuchos::ArrayRCP<Teuchos::ArrayRCP<
00060 Teuchos::ArrayRCP<int> > > > WsElLid2NodeT;
00061 WsElLid2NodeT NodeLookup;
00062
00063
00064 const WsLIDList *ElementsWsLid;
00065
00066
00067 int ElementOffset;
00068
00069
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 }
00081 }
00082
00083 #endif // ALBANY_CATALYST_GRID