MOAB: Mesh Oriented datABase  (version 5.4.1)
GmshUtil.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 GMSH_UTIL_HPP
00017 #define GMSH_UTIL_HPP
00018 
00019 #include "moab/EntityType.hpp"
00020 
00021 namespace moab
00022 {
00023 
00024 //! Structure defining relation between MOAB and VTK element
00025 //! types.  VTK had different types for quadratic than linear
00026 //! elements, so a tuple of the MOAB type and number of
00027 //! elements maps to a VTK type.
00028 struct GmshElemType
00029 {
00030     const char* name;       //!< String name for use in error messages
00031     unsigned gmsh_type;     //!< GMsh integer type
00032     EntityType mb_type;     //!< MOAB type
00033     unsigned num_nodes;     //!< Number of nodes (0 for polygon)
00034     const int* node_order;  //!< Gmsh element node ordering, indexed by
00035                             //!< the Gmsh node position and containing
00036                             //!< the corresponding MOAB node position.
00037                             //!< NOTE: This field is NULL if MOAB and Gmsh
00038                             //!< ordering is the same!
00039 };
00040 
00041 //! General data about GMsh files for use by read and write code.
00042 //! \author Jason Kraftcheck
00043 class GmshUtil
00044 {
00045 
00046   public:
00047     //! Gmsh types, indexed by Gmsh type number.
00048     //! For unused Gmsh type numbers, mb_type will be MBMAXTYPE.
00049     static const GmshElemType gmshElemTypes[];
00050 
00051     //! Length of \ref gmshElemTypes
00052     static const unsigned numGmshElemType;
00053 
00054     //! Get the Gmsh type corresponding to a tuple of the MOAB type and number of nodes.
00055     //! num_nodes is ignored for MBPOLYGON type.  Returns -1 for unsupported types.
00056     static int get_gmsh_type( EntityType type, unsigned num_nodes );
00057 };
00058 
00059 }  // namespace moab
00060 
00061 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines