MOAB: Mesh Oriented datABase  (version 5.2.1)
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, const EntityHandle* file_set, const FileOptions& opts,
00041                          const SubsetList* subset_list = 0, const Tag* file_id_tag = 0 );
00042 
00043     ErrorCode read_tag_values( const char* file_name, const char* tag_name, const FileOptions& opts,
00044                                std::vector< int >& tag_values_out, const SubsetList* subset_list = 0 );
00045 
00046     //! Constructor
00047     ReadGmsh( Interface* impl = NULL );
00048 
00049     //! Destructor
00050     virtual ~ReadGmsh();
00051 
00052   private:
00053     ErrorCode create_elements( const GmshElemType& type, const std::vector< int >& elem_ids,
00054                                const std::vector< int >& matl_ids, const std::vector< int >& geom_ids,
00055                                const std::vector< int >& prtn_ids, const std::vector< EntityHandle >& connectivity,
00056                                const Tag* file_id_tag );
00057 
00058     ErrorCode create_sets( EntityType element_type, const Range& elements, const std::vector< int >& set_ids,
00059                            int set_type );
00060 
00061     ErrorCode create_geometric_topology();
00062 
00063     ReadUtilIface* readMeshIface;
00064 
00065     //! interface instance
00066     Interface* mdbImpl;
00067 
00068     Tag globalId;
00069     Range geomSets;
00070 };
00071 
00072 }  // namespace moab
00073 
00074 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines