MOAB: Mesh Oriented datABase
(version 5.2.1)
|
00001 #ifndef __smoab_detail_ReduceSpectralMesh_h 00002 #define __smoab_detail_ReduceSpectralMesh_h 00003 00004 #include "SimpleMoab.h" 00005 #include "vtkCellType.h" 00006 00007 #include <algorithm> 00008 #include <vector> 00009 00010 namespace smoab{ namespace detail{ 00011 00012 00013 class ReduceSpectralMesh 00014 { 00015 public: 00016 ReduceSpectralMeshReduceHighOrderCell(smoab::Range const& cells, moab::Interface* moab): 00017 LinearCellConnectivity(), 00018 HighOrderCellConnectivity() 00019 { 00020 int count = 0; 00021 const std::size_t cellSize=cells.size(); 00022 while(count != cellSize) 00023 { 00024 EntityHandle* connectivity; 00025 int numVerts=0, iterationCount=0; 00026 //use the highly efficent calls, since we know that are of the same dimension 00027 moab->connect_iterate(cells.begin()+count, 00028 cells.end(), 00029 connectivity, 00030 numVerts, 00031 iterationCount); 00032 //if we didn't read anything, break! 00033 if(iterationCount == 0) 00034 { 00035 break; 00036 } 00037 00038 //identify the cell type that we currently have, 00039 //store that along with the connectivity in a temp storage vector 00040 const moab::EntityType type = moab->type_from_handle(*cells.begin()+count); 00041 00042 //instead of storing the connectivity in a single array, 00043 //what my goal is to have multiple vectors. The first vector 00044 //will hold all the linear cells, while the second vector 00045 //will hold the high order cells. 00046 00047 //Since connect_iterate returns the number of cells of a given 00048 //type that we have read we can also store the RunLegthInfo 00049 //for all the cells allowing us to apply transformations to the 00050 //high order cells efficently in bulk. 00051 00052 //while all these cells are contiously of the same type, 00053 //quadric hexs in vtk have 20 points, but moab has 21 so we 00054 //need to store this difference 00055 } 00056 } 00057 00058 private: 00059 std::vector<EntityHandle> LinearCellConnectivity; 00060 std::vector<EntityHandle> HighOrderCellConnectivity; 00061 00062 std::vector<detail::ContinousCellInfo> LinearCellInfo; 00063 std::vector<detail::ContinousCellInfo> HighOrderCellInfo; 00064 00065 00066 } } //namespace smoab::detail 00067 00068 #endif