moab
Core.hpp
Go to the documentation of this file.
00001 
00016 #ifndef MOAB_IMPL_GENERAL_HPP
00017 #define MOAB_IMPL_GENERAL_HPP
00018 
00019 #include "moab/Interface.hpp"
00020 #include "moab/ReaderIface.hpp"
00021 #include <map>
00022 #include <list>
00023 
00024 namespace moab {
00025 
00026 class WriteUtil;
00027 class ReadUtil;
00028 class ScdInterface;
00029 class AEntityFactory;
00030 class SequenceManager;
00031 class Error;
00032 class HomCoord;
00033 class ReaderWriterSet;
00034 class EntitySequence;
00035 class FileOptions;
00036 class SetIterator;
00037 
00038 #ifdef XPCOM_MB
00039 
00040 #define MBCORE_CID \
00041 { 0x7cb5b7a0, 0x7d7, 0x11d3, { 0xba, 0xb2, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } }
00042 
00043 #define MBCORE_CONTRACTID "@sandia.gov/MB;1"
00044 
00045 #endif
00046 
00047 
00054 class Core : public Interface 
00055 {
00056 
00057 public:
00058 
00059   friend class SetIterator;
00060 
00062   MB_DLL_EXPORT Core();
00063 
00065   MB_DLL_EXPORT Core( int rank, int num_cpu );
00066 
00068   MB_DLL_EXPORT ~Core();
00069   
00072   virtual ErrorCode query_interface_type( const std::type_info& iface_type, void*& iface );
00073  
00075   virtual ErrorCode release_interface_type( const std::type_info& iface_type, void* iface );
00076 
00077 #if defined(XPCOM_MB)
00078   // this macro expands to all the nsISupports interface functions
00079   NS_DECL_ISUPPORTS
00080 #endif
00081 
00082   virtual int QueryInterface (const MBuuid& uuid, UnknownInterface** iface );
00083 
00085 
00089   virtual float impl_version(std::string *version_string = NULL);
00090 
00092   virtual EntityType type_from_handle(const EntityHandle handle) const;
00093   
00095   virtual EntityID id_from_handle(const EntityHandle handle) const;
00096   
00098   virtual ErrorCode handle_from_id(const EntityType type, 
00099                                       const EntityID id, 
00100                                       EntityHandle& handle) const;
00101   
00102   virtual int dimension_from_handle( const EntityHandle ) const;
00103 
00106   virtual ErrorCode load_mesh(const char *file_name,
00107                                  const int *active_block_id_list = NULL,
00108                                  const int num_blocks = 0);
00109 
00111   virtual ErrorCode load_file( const char* file_name,
00112                                  const EntityHandle* file_set = 0,
00113                                  const char* options = 0,
00114                                  const char* set_tag_name = 0,
00115                                  const int* set_tag_values = 0,
00116                                  int num_set_tag_values = 0 );
00117 
00119   ErrorCode serial_load_file( const char* file_name,
00120                               const EntityHandle* file_set,
00121                               const FileOptions& opts,
00122                               const ReaderIface::SubsetList* subset_list = 0,
00123                               const Tag* file_id_tag = 0 );
00124                          
00125   ErrorCode serial_read_tag( const char* file_name,
00126                              const char* tag_name,
00127                              const FileOptions& opts,
00128                              std::vector<int>& tag_vals,
00129                              const ReaderIface::SubsetList* subset_list = 0 );
00130   
00131   virtual ErrorCode write_mesh(const char *file_name,
00132                                   const EntityHandle *output_list = NULL,
00133                                   const int num_sets = 0);
00135   virtual ErrorCode write_file( const char* file_name,
00136                                   const char* file_type = 0,
00137                                   const char* options = 0,
00138                                   const EntityHandle* output_sets = 0,
00139                                   int num_output_sets = 0,
00140                                   const Tag* tag_list = 0,
00141                                   int num_tags = 0 );
00142 
00144   virtual ErrorCode write_file( const char* file_name,
00145                                   const char* file_type,
00146                                   const char* options,
00147                                   const Range& output_sets,
00148                                   const Tag* tag_list = 0,
00149                                   int num_tags = 0 );
00150 
00152   virtual ErrorCode delete_mesh();
00153 
00155   virtual ErrorCode get_dimension(int &dim) const;
00156 
00158 
00161   virtual ErrorCode set_dimension(const int dim);
00162 
00164 
00166   virtual ErrorCode get_vertex_coordinates(std::vector<double> &coords) const;
00167 
00169   virtual ErrorCode coords_iterate(Range::const_iterator iter,
00170                                    Range::const_iterator end,
00171                                    double*& xcoords_ptr,
00172                                    double*& ycoords_ptr,
00173                                    double*& zcoords_ptr,
00174                                    int& count);
00175   
00178   virtual ErrorCode  get_coords(const Range &entity_handles, 
00179                                    double *coords) const;
00180   
00181   virtual ErrorCode  get_coords(const EntityHandle *entity_handles, 
00182                                    const int num_entities, 
00183                                    double *coords) const;
00184   
00185   virtual ErrorCode  get_coords(const EntityHandle entity_handle, 
00186                                    const double *& x, const double *& y, const double *& z) const;
00187  
00188   virtual ErrorCode get_coords( const Range& entity_handles,
00189                                   double* x_coords,
00190                                   double* y_coords,
00191                                   double* z_coords ) const;
00192 
00195   virtual ErrorCode  set_coords( const EntityHandle *entity_handles, 
00196                                    const int num_entities,
00197                                    const double *coords);
00198 
00201   virtual ErrorCode  set_coords(Range entity_handles,
00202                                   const double *coords);
00203 
00205 
00207     virtual ErrorCode get_connectivity_by_type(const EntityType type, 
00208                                                   std::vector<EntityHandle> &connect) const;
00209 
00211   virtual ErrorCode connect_iterate(Range::const_iterator iter,
00212                                     Range::const_iterator end,
00213                                     EntityHandle *&connect,
00214                                     int &verts_per_entity,
00215                                     int& count);
00216   
00218 
00230     virtual ErrorCode  get_connectivity(const EntityHandle *entity_handles, 
00231                                         const int num_handles,
00232                                         std::vector<EntityHandle> &connectivity, 
00233                                         bool corners_only = false,
00234                                         std::vector<int> *offsets = NULL) const;
00235  
00237 
00239   virtual ErrorCode  get_connectivity(const EntityHandle *entity_handles, 
00240                                         const int num_handles,
00241                                         Range &connectivity, 
00242                                         bool corners_only = false) const;
00243 
00245 
00247   virtual ErrorCode get_connectivity( const Range& entity_handles, 
00248                                         Range &connectivity, 
00249                                         bool corners_only = false) const;
00250  
00252 
00274     virtual ErrorCode  get_connectivity( const EntityHandle entity_handle, 
00275                                            const EntityHandle *&connectivity, 
00276                                            int &num_nodes, 
00277                                            bool corners_only = false,
00278                                            std::vector<EntityHandle>* storage = 0
00279                                           ) const;
00280 
00282 
00293     virtual ErrorCode  set_connectivity(const EntityHandle entity_handle, 
00294                                           EntityHandle *connect,
00295                                           const int num_connect);
00296 
00298 
00314     virtual ErrorCode get_adjacencies(const EntityHandle *from_entities,
00315                                          const int num_entities,
00316                                          const int to_dimension,
00317                                          const bool create_if_missing,
00318                                          std::vector<EntityHandle>& adj_entities,
00319                                          const int operation_type = Interface::INTERSECT);
00320 
00321     virtual ErrorCode get_adjacencies(const EntityHandle *from_entities,
00322                                         const int num_entities,
00323                                          const int to_dimension,
00324                                          const bool create_if_missing,
00325                                          Range &adj_entities,
00326                                          const int operation_type = Interface::INTERSECT);
00327 
00328     virtual ErrorCode get_adjacencies(const Range &from_entities,
00329                                          const int to_dimension,
00330                                          const bool create_if_missing,
00331                                          Range &adj_entities,
00332                                          const int operation_type = Interface::INTERSECT);
00333 
00347   ErrorCode adjacencies_iterate(Range::const_iterator iter,
00348                                 Range::const_iterator end,
00349                                 const std::vector<EntityHandle> **& adjs_ptr,
00350                                 int& count);
00351   
00359     virtual ErrorCode get_vertices( const Range& from_entities,
00360                                       Range& vertices );
00361 
00363 
00369     virtual ErrorCode add_adjacencies(const EntityHandle from_handle, 
00370                                          const EntityHandle *to_handles,
00371                                          const int num_handles,
00372                                          bool both_ways);
00373 
00375     virtual ErrorCode add_adjacencies(const EntityHandle from_handle, 
00376                                         Range &adjacencies,
00377                                         bool both_ways);
00378 
00380 
00384     virtual ErrorCode remove_adjacencies(const EntityHandle from_handle, 
00385                                             const EntityHandle *to_handles,
00386                                             const int num_handles);
00387 
00389 
00397     virtual ErrorCode get_entities_by_dimension( const EntityHandle meshset,
00398                                                    const int dimension, 
00399                                                    Range &entities,
00400                                                    const bool recursive = false) const;
00401 
00402     virtual ErrorCode get_entities_by_dimension( const EntityHandle meshset,
00403                                                    const int dimension, 
00404                                                    std::vector<EntityHandle> &entities,
00405                                                    const bool recursive = false) const;
00406 
00408 
00416     virtual ErrorCode get_entities_by_type( const EntityHandle meshset,
00417                                               const EntityType type, 
00418                                               Range &entities,
00419                                               const bool recursive = false) const;
00420 
00421     virtual ErrorCode get_entities_by_type( const EntityHandle meshset,
00422                                               const EntityType type, 
00423                                               std::vector<EntityHandle> &entities,
00424                                               const bool recursive = false) const;
00425 
00426     virtual ErrorCode get_entities_by_type_and_tag(const EntityHandle meshset,
00427                                                       const EntityType type,
00428                                                       const Tag *tag_handles,
00429                                                       const void* const* values,
00430                                                       const int num_tags,
00431                                                       Range &entities,
00432                                                       const int condition = Interface::INTERSECT,
00433                                                       const bool recursive = false) const;
00434 
00436 
00442     virtual ErrorCode get_entities_by_handle(const EntityHandle meshset,
00443                                       Range &entities,
00444                                       const bool recursive = false) const;
00445 
00447 
00453     virtual ErrorCode get_entities_by_handle(const EntityHandle meshset,
00454                                       std::vector<EntityHandle> &entities,
00455                                       const bool recursive = false) const;
00456 
00458 
00466     virtual ErrorCode get_number_entities_by_dimension(const EntityHandle meshset,
00467                                                           const int dimension, 
00468                                                           int &num_entities,
00469                                                           const bool recursive = false) const;
00470 
00472 
00480     virtual ErrorCode get_number_entities_by_type(const EntityHandle meshset,
00481                                                      const EntityType type, 
00482                                                      int &num_entities,
00483                                                      const bool recursive = false) const;
00484 
00485     virtual ErrorCode get_number_entities_by_type_and_tag(const EntityHandle meshset,
00486                                                              const EntityType type,
00487                                                              const Tag *tag_handles,
00488                                                              const void* const* values,
00489                                                              const int num_tags,
00490                                                              int &num_entities,
00491                                                              const int condition = Interface::INTERSECT,
00492                                                              const bool recursive = false) const;
00493 
00495 
00501     virtual ErrorCode get_number_entities_by_handle(const EntityHandle meshset,
00502                                              int &num_entities,
00503                                              const bool recursive = false) const;
00504 
00506 
00521     virtual ErrorCode create_element(const EntityType type, 
00522                                         const EntityHandle *connectivity,
00523                                         const int num_nodes, 
00524                                         EntityHandle &element_handle);
00525 
00527 
00538     virtual ErrorCode create_vertex(const double coordinates[3], 
00539                                        EntityHandle &entity_handle );
00540 
00542 
00547   virtual ErrorCode create_vertices(const double *coordinates, 
00548                                       const int nverts,
00549                                       Range &entity_handles );
00550 
00552     virtual ErrorCode merge_entities(EntityHandle entity_to_keep, 
00553                                         EntityHandle entity_to_remove,
00554                                         bool auto_merge,
00555                                         bool delete_removed_entity);
00556 
00558 
00564     virtual ErrorCode delete_entities(const EntityHandle *entities,
00565                                          const int num_entities);
00566 
00568 
00573     virtual ErrorCode delete_entities(const Range &entities);
00574 
00575   virtual ErrorCode list_entities(const Range &entities) const;
00576   
00577   virtual ErrorCode list_entities(const EntityHandle *entities,
00578                                     const int num_entities) const;
00579 
00580   virtual ErrorCode list_entity(const EntityHandle entity) const;
00581 
00584     class HONodeAddedRemoved
00585     {
00586     public:
00587       HONodeAddedRemoved(){}
00588       virtual ~HONodeAddedRemoved(){}
00591       virtual void node_added(EntityHandle node, EntityHandle element);
00592       virtual void node_removed(EntityHandle node);
00593     };
00594   
00595     virtual ErrorCode convert_entities(const EntityHandle meshset, 
00596                                           const bool mid_side,
00597                                           const bool mid_face, 
00598                                           const bool mid_volume, 
00599                                           Interface::HONodeAddedRemoved* function_object = 0);
00600 
00604     virtual ErrorCode side_number(const EntityHandle parent,
00605                                      const EntityHandle child,
00606                                      int &side_number,
00607                                      int &sense,
00608                                      int &offset) const;
00609 
00612     virtual ErrorCode high_order_node(const EntityHandle parent_handle,
00613                                          const EntityHandle *subfacet_conn,
00614                                          const EntityType subfacet_type,
00615                                          EntityHandle &high_order_node) const;
00616 
00618     virtual ErrorCode side_element(const EntityHandle source_entity,
00619                                       const int dim, 
00620                                       const int side_number,
00621                                       EntityHandle &target_entity) const;
00622 
00623       //-------------------------Tag Stuff-------------------------------------//
00624 
00625 
00653   virtual ErrorCode tag_get_handle( const char* name,
00654                                     int size,
00655                                     DataType type,
00656                                     Tag& tag_handle,
00657                                     unsigned flags = 0,
00658                                     const void* default_value = 0,
00659                                     bool* created = 0 );
00660   
00662   virtual ErrorCode tag_get_handle( const char* name,
00663                                     int size,
00664                                     DataType type,
00665                                     Tag& tag_handle,
00666                                     unsigned flags = 0,
00667                                     const void* default_value = 0 ) const;
00668 
00670 
00678   virtual ErrorCode  tag_get_name(const Tag tag_handle, 
00679                                      std::string& tag_name) const;
00680 
00687   virtual ErrorCode tag_get_handle( const char *tag_name, 
00688                                     Tag &tag_handle ) const;
00689 
00691   virtual ErrorCode tag_get_tags_on_entity(const EntityHandle entity,
00692                                              std::vector<Tag> &tag_handles) const;
00693 
00695   virtual ErrorCode tag_get_bytes(const Tag tag, int& bytes_per_tag) const;
00696 
00698   virtual ErrorCode tag_get_length(const Tag tag, int &length) const;
00699 
00701   virtual ErrorCode tag_get_default_value(const Tag tag, void *def_val) const;
00702   virtual ErrorCode tag_get_default_value( Tag tag, const void*& def_val, int& size) const;
00703 
00705   virtual ErrorCode tag_get_type(const Tag, TagType &tag_type) const;
00706 
00716   virtual ErrorCode tag_get_data_type(const Tag tag, DataType& type) const;
00717 
00719   virtual ErrorCode tag_get_tags(std::vector<Tag> &tag_handles) const;
00720 
00721   virtual ErrorCode  tag_get_data(const Tag tag_handle, 
00722                                      const EntityHandle* entity_handles, 
00723                                      const int num_entities, 
00724                                      void *tag_data) const;
00725 
00726   virtual ErrorCode  tag_get_data(const Tag tag_handle, 
00727                                      const Range& entity_handles, 
00728                                      void *tag_data) const;
00729 
00731 
00741   virtual ErrorCode  tag_set_data( Tag tag_handle, 
00742                                    const EntityHandle* entity_handles, 
00743                                    int num_entities,
00744                                    const void *tag_data );
00745   
00746   virtual ErrorCode  tag_set_data( Tag tag_handle, 
00747                                      const Range& entity_handles,
00748                                      const void *tag_data );
00749 
00764   virtual ErrorCode  tag_get_by_ptr(const Tag tag_handle, 
00765                                   const EntityHandle* entity_handles, 
00766                                   int num_entities, 
00767                                   const void** tag_data,
00768                                   int* tag_sizes = 0 ) const;
00769 
00782   virtual ErrorCode  tag_get_by_ptr(const Tag tag_handle, 
00783                                     const Range& entity_handles, 
00784                                     const void** tag_data,
00785                                     int* tag_sizes = 0 ) const;
00786 
00801   virtual ErrorCode  tag_set_by_ptr( Tag tag_handle, 
00802                                    const EntityHandle* entity_handles, 
00803                                    int num_entities,
00804                                    void const* const* tag_data,
00805                                    const int* tag_sizes = 0 );
00806   
00819   virtual ErrorCode  tag_set_by_ptr( Tag tag_handle, 
00820                                     const Range& entity_handles,
00821                                     void const* const* tag_data,
00822                                     const int* tag_sizes = 0 );
00823 
00836   virtual ErrorCode tag_clear_data( Tag tag_handle,
00837                                     const Range& entity_handles,
00838                                     const void* value,
00839                                     int value_size = 0 );
00840 
00853   virtual ErrorCode tag_clear_data( Tag tag_handle,
00854                                     const EntityHandle* entity_handles,
00855                                     int num_entity_handles,
00856                                     const void* value,
00857                                     int value_size = 0 );
00858 
00860 
00866   virtual ErrorCode  tag_delete_data( Tag tag_handle, 
00867                                       const EntityHandle *entity_handles,
00868                                       int num_handles);
00869 
00871 
00876   virtual ErrorCode  tag_delete_data( Tag tag_handle, 
00877                                      const Range &entity_range);
00878 
00880   virtual ErrorCode  tag_delete(Tag tag_handle);
00881 
00928   virtual ErrorCode tag_iterate( Tag tag_handle,
00929                                  Range::const_iterator begin,
00930                                  Range::const_iterator end,
00931                                  int& count,
00932                                  void*& data_ptr,
00933                                  bool allocate = true);
00934 
00936   virtual ErrorCode create_meshset(const unsigned int options, 
00937                                      EntityHandle &ms_handle,
00938                                      int start_id = 0);
00939 
00941 
00945   virtual ErrorCode clear_meshset( const EntityHandle *ms_handles, 
00946                                      const int num_meshsets);
00947 
00949 
00952   virtual ErrorCode clear_meshset(const Range &ms_handles);
00953 
00955   virtual ErrorCode get_meshset_options(const EntityHandle ms_handle, 
00956                                            unsigned int& options) const;
00957 
00959   virtual ErrorCode set_meshset_options(const EntityHandle ms_handle, 
00960                                           const unsigned int options);
00961 
00963   virtual ErrorCode subtract_meshset(EntityHandle meshset1, 
00964                                         const EntityHandle meshset2);
00965 
00967   virtual ErrorCode intersect_meshset(EntityHandle meshset1, 
00968                                          const EntityHandle meshset2);
00969     
00971   virtual ErrorCode unite_meshset(EntityHandle meshset1, 
00972                                      const EntityHandle meshset2);
00973 
00975   virtual ErrorCode add_entities(EntityHandle meshset, 
00976                                     const Range &entities);
00977 
00979   virtual ErrorCode add_entities(EntityHandle meshset, 
00980                                     const EntityHandle *entities,
00981                                     const int num_entities);
00982   
00984   virtual ErrorCode remove_entities(EntityHandle meshset, 
00985                                        const Range &entities);
00986 
00988   virtual ErrorCode remove_entities(EntityHandle meshset, 
00989                                        const EntityHandle *entities,
00990                                        const int num_entities);
00991 
00993   virtual bool contains_entities(EntityHandle meshset, 
00994                                  const EntityHandle *entities,
00995                                  int num_entities,
00996                                  const int operation_type = Interface::INTERSECT);
00997 
00999   virtual ErrorCode replace_entities(EntityHandle meshset, 
01000                                        const EntityHandle *old_entities,
01001                                        const EntityHandle *new_entities,
01002                                        int num_entities);
01003 
01004   //------MeshSet Parent/Child functions------
01005   
01007   virtual ErrorCode get_parent_meshsets(const EntityHandle meshset,
01008                                            std::vector<EntityHandle> &parents, 
01009                                            const int num_hops = 1) const;
01010 
01012   virtual ErrorCode get_parent_meshsets(const EntityHandle meshset,
01013                                           Range &parents, 
01014                                           const int num_hops = 1) const;
01015 
01017   virtual ErrorCode get_child_meshsets(const EntityHandle meshset, 
01018                                           std::vector<EntityHandle> &children, 
01019                                           const int num_hops = 1) const;
01020 
01022   virtual ErrorCode get_child_meshsets(const EntityHandle meshset, 
01023                                          Range &children, 
01024                                           const int num_hops = 1) const;
01025 
01027   virtual ErrorCode get_contained_meshsets(const EntityHandle meshset, 
01028                                              std::vector<EntityHandle> &contained, 
01029                                              const int num_hops = 1) const;
01030 
01032   virtual ErrorCode get_contained_meshsets(const EntityHandle meshset, 
01033                                              Range &contained, 
01034                                              const int num_hops = 1) const;
01035 
01037   virtual ErrorCode num_parent_meshsets(const EntityHandle meshset,  
01038                                           int *number,
01039                                           const int num_hops = 1) const;
01040 
01042   virtual ErrorCode num_child_meshsets(const EntityHandle meshset, 
01043                                          int *number, 
01044                                          const int num_hops = 1) const;
01045 
01047   virtual ErrorCode num_contained_meshsets(const EntityHandle meshset, 
01048                                              int *number, 
01049                                              const int num_hops = 1) const;
01050 
01052   virtual ErrorCode add_parent_meshset(EntityHandle meshset, 
01053                                           const EntityHandle parent_meshset);
01054 
01056   virtual ErrorCode add_parent_meshsets(EntityHandle meshset, 
01057                                           const EntityHandle* parent_meshsets,
01058                                           int num_parent_meshsets);
01059 
01061   virtual ErrorCode add_child_meshset(EntityHandle meshset, 
01062                                          const EntityHandle child_meshset);
01063 
01065   virtual ErrorCode add_child_meshsets(EntityHandle meshset, 
01066                                          const EntityHandle* child_meshsets,
01067                                          int num_child_meshsets);
01068 
01070   virtual ErrorCode add_parent_child( EntityHandle parent, 
01071                                          EntityHandle child );
01072 
01074   virtual ErrorCode remove_parent_child( EntityHandle parent, 
01075                                             EntityHandle child );
01076 
01078   virtual ErrorCode remove_parent_meshset(EntityHandle meshset, 
01079                                              const EntityHandle parent_meshset);
01080   
01082   virtual ErrorCode remove_child_meshset(EntityHandle meshset, 
01083                                             const EntityHandle child_meshset);
01084 
01085   // ************************  error condition information *************** 
01086 
01088   Tag material_tag();
01089   Tag neumannBC_tag();
01090   Tag dirichletBC_tag();
01091   Tag globalId_tag();
01092   Tag geom_dimension_tag();
01093 
01095     //int total_num_nodes() const;
01096     //void total_num_nodes(const int val);
01097   
01099     //int total_num_elements() const;
01100     //void total_num_elements(const int val);
01101 
01103   SequenceManager* sequence_manager() { return sequenceManager; }
01104   const SequenceManager* sequence_manager() const { return sequenceManager; }
01105 
01107   ErrorCode create_scd_sequence(const HomCoord &    coord_min,
01108                                   const HomCoord &  coord_max,
01109                                   EntityType  type,
01110                                   EntityID  start_id_hint,
01111                                   EntityHandle &  first_handle_out,
01112                                   EntitySequence *&  sequence_out );
01113 
01114   ErrorCode add_vsequence(EntitySequence *    vert_seq,
01115                             EntitySequence *  elem_seq,
01116                             const HomCoord &  p1,
01117                             const HomCoord &  q1,
01118                             const HomCoord &  p2,
01119                             const HomCoord &  q2,
01120                             const HomCoord &  p3,
01121                             const HomCoord &  q3,
01122                             bool  bb_input = false,
01123                             const HomCoord *  bb_min = NULL,
01124                             const HomCoord *  bb_max = NULL);
01125    
01127   AEntityFactory *a_entity_factory() { return aEntityFactory; }
01128   const AEntityFactory *a_entity_factory() const { return aEntityFactory; }
01129   
01131   ReaderWriterSet* reader_writer_set() { return readerWriterSet; }
01132 
01133 //-----------------MeshSet Interface Functions------------------//
01134 
01135   void print(const EntityHandle handle, const char *prefix,
01136              bool first_call = true) const;
01137 
01138   ErrorCode print_entity_tags(std::string indent_prefix, const EntityHandle handle, TagType tp) const;
01139   
01140   virtual ErrorCode get_last_error(std::string& info) const;
01141 
01142   virtual std::string get_error_string(const ErrorCode code) const;
01143 
01145   ErrorCode check_adjacencies();
01146   
01148   ErrorCode check_adjacencies(const EntityHandle *ents, int num_ents);
01149   
01151   bool is_valid(const EntityHandle this_ent) const;
01152   
01170   virtual ErrorCode create_set_iterator(EntityHandle meshset,
01171                                         EntityType ent_type,
01172                                         int ent_dim,
01173                                         int chunk_size,
01174                                         bool check_valid,
01175                                         SetIterator *&set_iter);
01176 
01180   ErrorCode remove_set_iterator(SetIterator *set_iter);
01181   
01186   ErrorCode get_set_iterators(EntityHandle meshset,
01187                               std::vector<SetIterator *> &set_iters);
01188   
01189 
01190 //-----------------Memory Functions------------------//
01191 
01192 
01225   void estimated_memory_use( const EntityHandle* ent_array = 0,
01226                              unsigned long  num_ents = 0,
01227                              unsigned long* total_storage = 0,
01228                              unsigned long* total_amortized_storage = 0,
01229                              unsigned long* entity_storage = 0,
01230                              unsigned long* amortized_entity_storage = 0,
01231                              unsigned long* adjacency_storage = 0,
01232                              unsigned long* amortized_adjacency_storage = 0,
01233                              const Tag*   tag_array = 0,
01234                              unsigned       num_tags = 0,
01235                              unsigned long* tag_storage = 0,
01236                              unsigned long* amortized_tag_storage = 0 );
01237 
01264   void estimated_memory_use( const Range& ents,
01265                              unsigned long* total_storage = 0,
01266                              unsigned long* total_amortized_storage = 0,
01267                              unsigned long* entity_storage = 0,
01268                              unsigned long* amortized_entity_storage = 0,
01269                              unsigned long* adjacency_storage = 0,
01270                              unsigned long* amortized_adjacency_storage = 0,
01271                              const Tag*   tag_array = 0,
01272                              unsigned       num_tags = 0,
01273                              unsigned long* tag_storage = 0,
01274                              unsigned long* amortized_tag_storage = 0 );
01275                                      
01276 
01277   void print_database() const;
01278 
01279 private:
01280 
01282   Core( const Core& copy );
01284   Core& operator=( const Core& copy );
01285 
01286   void estimated_memory_use_internal( const Range* ents,
01287                             unsigned long* total_storage,
01288                             unsigned long* total_amortized_storage,
01289                             unsigned long* entity_storage,
01290                             unsigned long* amortized_entity_storage,
01291                             unsigned long* adjacency_storage,
01292                             unsigned long* amortized_adjacency_storage,
01293                             const Tag*   tag_array,
01294                             unsigned       num_tags,
01295                             unsigned long* tag_storage,
01296                             unsigned long* amortized_tag_storage );
01297 
01299   ErrorCode initialize();
01300   void deinitialize();
01301 
01303   EntityHandle get_root_set();
01304   
01305   
01310   void clean_up_failed_read( const Range& initial_entities,
01311                              std::vector<Tag> initial_tags );
01312   
01313     // other interfaces for MB
01314   WriteUtil* mMBWriteUtil;
01315   ReadUtil* mMBReadUtil;
01316   ScdInterface *scdInterface;
01317 
01319     //int totalNumElements;
01320   
01322     //int totalNumNodes;
01323 
01325   int geometricDimension;
01326 
01327   Tag materialTag;
01328   Tag neumannBCTag;
01329   Tag dirichletBCTag;
01330   Tag geomDimensionTag;
01331   Tag globalIdTag;
01332 
01334   std::list<TagInfo*> tagList;
01335   inline bool valid_tag_handle( const TagInfo* t ) const
01336     { return std::find( tagList.begin(), tagList.end(), t ) != tagList.end(); }
01337 
01338   SequenceManager *sequenceManager;
01339 
01340   AEntityFactory *aEntityFactory;
01341   
01342   ReaderWriterSet* readerWriterSet;
01343 
01344   Error* mError;
01345   bool mpiFinalize;
01346   int writeMPELog;
01347 
01349   std::vector<SetIterator*> setIterators;
01350   
01351 };
01352 
01353 } // namespace moab 
01354 
01355 #endif   // MOAB_IMPL_GENERAL_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines