moab
SpectralMeshTool.hpp
Go to the documentation of this file.
00001 #ifndef SPECTRALMESHTOOL_HPP
00002 #define SPECTRALMESHTOOL_HPP
00003 
00004 #include "moab/Interface.hpp" // needs to be here to support inline query_interface
00005 #include "moab/Error.hpp" // needs to be here to support inline query_interface
00006 #include <vector>
00007 
00008 namespace moab {
00009 
00021 class SpectralMeshTool
00022 {
00023 public:
00024 
00029   SpectralMeshTool(Interface *impl, int order = 0);
00030 
00033   ~SpectralMeshTool();
00034 
00041   Tag spectral_vertices_tag(const bool create_if_missing = false);
00042   
00047   Tag spectral_order_tag(const bool create_if_missing = false);
00048   
00054   ErrorCode convert_to_fine(EntityHandle spectral_set);
00055   
00064   ErrorCode convert_to_coarse(int order = 0, EntityHandle spectral_set = 0);
00065 
00077   template <class T>
00078   ErrorCode create_spectral_elems(const T *conn, int num_fine_elems, int dim, 
00079                                   Range &output_range, int start_idx = 0, Range *local_gids = NULL);
00080   
00084   void spectral_order(int order) {spectralOrder = order; spectralOrderp1 = order+1;}
00085   
00089   int spectral_order() {return spectralOrder;}
00090 /*
00091   struct ConnMap 
00092   {
00093     const short a[16];
00094   };
00095   */
00096   static const short int permute_array[];
00097   
00098   static const short int lin_permute_array[];
00099   
00100 private:
00101 
00103   Interface* mbImpl;
00104 
00106   Error *mError;
00107   
00109   Tag svTag;
00110   
00112   Tag soTag;
00113 
00115   int spectralOrder;
00116 
00118   int spectralOrderp1;
00119 };
00120 
00121 inline SpectralMeshTool::SpectralMeshTool(Interface *impl, int order) 
00122         : mbImpl(impl), svTag(0), soTag(0), spectralOrder(order), spectralOrderp1(order+1)
00123 {
00124   impl->query_interface(mError);
00125 }
00126     
00127 inline SpectralMeshTool::~SpectralMeshTool() 
00128 {}
00129 
00130 } // namespace moab 
00131 
00132 #endif
00133 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines