MOAB: Mesh Oriented datABase  (version 5.2.1)
ReadCCMIO.hpp
Go to the documentation of this file.
00001 #ifndef READCCMIO_HPP
00002 #define READCCMIO_HPP
00003 
00004 #ifndef IS_BUILDING_MB
00005 #error "ReadCCMIO.hpp isn't supposed to be included into an application"
00006 #endif
00007 
00008 #include <vector>
00009 #include <set>
00010 #include <map>
00011 #include <string>
00012 
00013 #include "moab/Forward.hpp"
00014 #include "moab/Range.hpp"
00015 #include "moab/ExoIIInterface.hpp"
00016 #include "moab/ReaderIface.hpp"
00017 //#include "moab/TupleList.hpp"
00018 #include "ccmio.h"
00019 
00020 namespace moab
00021 {
00022 
00023 #undef READCCMIO_USE_TUPLE_LIST
00024 
00025 class ReadUtilIface;
00026 
00027 class ReadCCMIO : public ReaderIface
00028 {
00029 
00030   public:
00031     typedef std::map< int, std::vector< EntityHandle > > TupleList;
00032     typedef std::map< int, std::vector< int > > SenseList;
00033 
00034     //! Constructor
00035     ReadCCMIO( Interface* impl );
00036 
00037     //! Destructor
00038     virtual ~ReadCCMIO();
00039 
00040     static ReaderIface* factory( Interface* );
00041 
00042     ErrorCode load_file( const char* file_name, const EntityHandle* file_set, const FileOptions& opts,
00043                          const SubsetList* subset_list = 0, const Tag* file_id_tag = 0 );
00044 
00045   private:
00046     ErrorCode read_processor( CCMIOID rootID, CCMIOID problemID, CCMIOID processorID, CCMIOID verticesID,
00047                               CCMIOID topologyID, CCMIOSize_t proc, Range* new_ents );
00048 
00049     ErrorCode read_cells( CCMIOSize_t proc, CCMIOID processorID, CCMIOID verticesID, CCMIOID topologyID,
00050                           TupleList& vert_map, Range* new_cells );
00051 
00052     ErrorCode construct_cells( TupleList& face_map,
00053 #ifndef READCCMIO_USE_TUPLE_LIST
00054                                SenseList& sense_map,
00055 #endif
00056                                TupleList& vert_map, std::map< int, int >& cell_topo_types,
00057                                std::vector< EntityHandle >& new_cells );
00058 
00059     ErrorCode ccmio_to_moab_type( int ccm_type, EntityType& moab_type, bool& has_mid_nodes );
00060 
00061     ErrorCode create_cell_from_faces( std::vector< EntityHandle >& facehs, std::vector< int >& senses,
00062                                       EntityType this_type, bool has_mid_nodes, EntityHandle& cell );
00063 
00064     ErrorCode read_gids_and_types( CCMIOID problemID, CCMIOID topologyID, std::vector< EntityHandle >& cells );
00065 
00066     ErrorCode read_all_faces( CCMIOID topologyID, TupleList& vert_map, TupleList& face_map
00067 #ifndef READCCMIO_USE_TUPLE_LIST
00068                               ,
00069                               SenseList& sense_map
00070 #endif
00071                               ,
00072                               Range* new_faces );
00073 
00074     ErrorCode read_faces( CCMIOID faceID, CCMIOEntity bdy_or_int, TupleList& vert_map, TupleList& face_map
00075 #ifndef READCCMIO_USE_TUPLE_LIST
00076                           ,
00077                           SenseList& sense_map
00078 #endif
00079                           ,
00080                           Range* new_faces );
00081 
00082     ErrorCode make_faces( int* farray, TupleList& vert_map, std::vector< EntityHandle >& new_faces, int num_faces );
00083 
00084     ErrorCode read_vertices( CCMIOSize_t proc, CCMIOID processorID, CCMIOID verticesID, CCMIOID topologyID,
00085                              Range* verts, TupleList& vert_map );
00086 
00087     ErrorCode get_processors( CCMIOID stateID, CCMIOID& processorID, CCMIOID& verticesID, CCMIOID& topologyID,
00088                               CCMIOID& solutionID, std::vector< CCMIOSize_t >& procs, bool& has_solution );
00089 
00090     ErrorCode get_state( CCMIOID rootID, CCMIOID& problemID, CCMIOID& stateID );
00091 
00092     ErrorCode read_tag_values( const char* file_name, const char* tag_name, const FileOptions& opts,
00093                                std::vector< int >& tag_values_out, const SubsetList* subset_list = 0 );
00094 
00095     ErrorCode load_matset_data( CCMIOID problemID );
00096 
00097     ErrorCode load_neuset_data( CCMIOID problemID );
00098 
00099     ErrorCode load_metadata( CCMIOID rootID, CCMIOID problemID, CCMIOID stateID, CCMIOID processorID,
00100                              const EntityHandle* file_set );
00101 
00102     ErrorCode read_topology_types( CCMIOID& topologyID, std::map< int, int >& cell_topo_types );
00103 
00104     ErrorCode get_int_option( const char* opt_str, EntityHandle seth, Tag& tag, CCMIOID node );
00105 
00106     ErrorCode get_dbl_option( const char* opt_str, EntityHandle seth, Tag& tag, CCMIOID node );
00107 
00108     ErrorCode get_str_option( const char* opt_str, EntityHandle seth, Tag& tag, CCMIOID node,
00109                               const char* tag_name = NULL );
00110 
00111     //! Cached tags for reading.  Note that all these tags are defined when the
00112     //! core is initialized.
00113     Tag mMaterialSetTag;
00114     Tag mDirichletSetTag;
00115     Tag mNeumannSetTag;
00116     Tag mHasMidNodesTag;
00117     Tag mGlobalIdTag;
00118     Tag mNameTag;
00119     Tag mMaterialIdTag, mMaterialTypeTag;
00120     Tag mRadiationTag, mPorosityIdTag, mSpinIdTag, mGroupIdTag, mColorIdxTag, mProcessorIdTag, mLightMaterialTag,
00121         mFreeSurfaceMaterialTag;
00122     Tag mThicknessTag, mProstarRegionNumberTag, mBoundaryTypeTag, mCreatingProgramTag;
00123 
00124     Interface* mbImpl;
00125 
00126     ReadUtilIface* readMeshIface;
00127 
00128     std::map< int, EntityHandle > newMatsets, newNeusets;
00129 
00130     bool hasSolution;
00131 };
00132 
00133 }  // namespace moab
00134 
00135 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines