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