Mesh Oriented datABase  (version 5.4.1)
Array-based unstructured mesh datastructure
ReadGmsh.hpp
Go to the documentation of this file.
00001 /**
00002  * MOAB, a Mesh-Oriented datABase, is a software component for creating,
00003  * storing and accessing finite element mesh data.
00004  *
00005  * Copyright 2004 Sandia Corporation.  Under the terms of Contract
00006  * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
00007  * retains certain rights in this software.
00008  *
00009  * This library is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public
00011  * License as published by the Free Software Foundation; either
00012  * version 2.1 of the License, or (at your option) any later version.
00013  *
00014  */
00015 
00016 #ifndef READ_GMSH_HPP
00017 #define READ_GMSH_HPP
00018 
00019 #include "moab/Forward.hpp"
00020 #include "moab/ReaderIface.hpp"
00021 #include "moab/Range.hpp"
00022 
00023 namespace moab
00024 {
00025 
00026 class ReadUtilIface;
00027 struct GmshElemType;
00028 
00029 /**
00030  * \brief Gmsh (http://www.geuz.org/gmsh) file reader
00031  * \author Jason Kraftcheck
00032  */
00033 class ReadGmsh : public ReaderIface
00034 {
00035 
00036   public:
00037     //! factory method
00038     static ReaderIface* factory( Interface* );
00039 
00040     ErrorCode load_file( const char* file_name,
00041                          const EntityHandle* file_set,
00042                          const FileOptions& opts,
00043                          const SubsetList* subset_list = 0,
00044                          const Tag* file_id_tag        = 0 );
00045 
00046     ErrorCode read_tag_values( const char* file_name,
00047                                const char* tag_name,
00048                                const FileOptions& opts,
00049                                std::vector< int >& tag_values_out,
00050                                const SubsetList* subset_list = 0 );
00051 
00052     //! Constructor
00053     ReadGmsh( Interface* impl = NULL );
00054 
00055     //! Destructor
00056     virtual ~ReadGmsh();
00057 
00058   private:
00059     ErrorCode create_elements( const GmshElemType& type,
00060                                const std::vector< int >& elem_ids,
00061                                const std::vector< int >& matl_ids,
00062                                const std::vector< int >& geom_ids,
00063                                const std::vector< int >& prtn_ids,
00064                                const std::vector< EntityHandle >& connectivity,
00065                                const Tag* file_id_tag );
00066 
00067     ErrorCode create_sets( EntityType element_type,
00068                            const Range& elements,
00069                            const std::vector< int >& set_ids,
00070                            int set_type );
00071 
00072     ErrorCode create_geometric_topology();
00073 
00074     ReadUtilIface* readMeshIface;
00075 
00076     //! interface instance
00077     Interface* mdbImpl;
00078 
00079     Tag globalId;
00080     Range geomSets;
00081 };
00082 
00083 }  // namespace moab
00084 
00085 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines