Mesh Oriented datABase  (version 5.4.1)
Array-based unstructured mesh datastructure
Types.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 MOAB_TYPES_HPP
00017 #define MOAB_TYPES_HPP
00018 
00019 #ifdef __cplusplus
00020 #include "moab/EntityType.hpp"
00021 #include "moab/EntityHandle.hpp"
00022 #endif
00023 
00024 #include "moab/win32_config.h"
00025 
00026 /**\name Types and names
00027  * Types used in the MOAB interface
00028  */
00029 /*@{*/
00030 
00031 #ifdef __cplusplus
00032 namespace moab
00033 {
00034 #endif
00035 
00036 /** MOAB error codes */
00037 enum MOAB_EXPORT ErrorCode
00038 {
00039     MB_SUCCESS                  = 0,
00040     MB_INDEX_OUT_OF_RANGE       = 1,
00041     MB_TYPE_OUT_OF_RANGE        = 2,
00042     MB_MEMORY_ALLOCATION_FAILED = 3,
00043     MB_ENTITY_NOT_FOUND         = 4,
00044     MB_MULTIPLE_ENTITIES_FOUND  = 5,
00045     MB_TAG_NOT_FOUND            = 6,
00046     MB_FILE_DOES_NOT_EXIST      = 7,
00047     MB_FILE_WRITE_ERROR         = 8,
00048     MB_NOT_IMPLEMENTED          = 9,
00049     MB_ALREADY_ALLOCATED        = 10,
00050     MB_VARIABLE_DATA_LENGTH     = 11,
00051     MB_INVALID_SIZE             = 12,
00052     MB_UNSUPPORTED_OPERATION    = 13,
00053     MB_UNHANDLED_OPTION         = 14,
00054     MB_STRUCTURED_MESH          = 15,
00055     MB_FAILURE                  = 16
00056 };
00057 
00058 #ifdef __cplusplus
00059 extern const char* const ErrorCodeStr[];
00060 #endif
00061 
00062 /** Misc. integer constants, declared in enum for portability */
00063 enum Constants
00064 {
00065     MB_VARIABLE_LENGTH = -1 /**< Length value for variable-length tags */
00066 };
00067 
00068 /** Specify storage type for tags.  See MOAB users guide for more information. */
00069 enum MOAB_EXPORT TagType
00070 {
00071     MB_TAG_BIT    = 0,      /**< Tag size specified in bits, tag value is 8 bits or less */
00072     MB_TAG_SPARSE = 1 << 0, /**< Storage optimized for tags on a few entities */
00073     MB_TAG_DENSE  = 1 << 1, /**< Storage optimized for tags on most entities of a type */
00074     MB_TAG_MESH   = 1 << 2, /**< Storage for tags on no entities, only the root set/whole mesh. */
00075     MB_TAG_BYTES  = 1 << 3, /**< Size is in number of bytes rather than number of values of \c DataType */
00076     MB_TAG_VARLEN = 1 << 4, /**< Create variable-length tag */
00077     MB_TAG_CREAT  = 1 << 5, /**< Create tag if it does not already exist */
00078     MB_TAG_EXCL   = 1 << 6, /**< Fail if TAG_CREATE and tag already exists */
00079     MB_TAG_STORE  = 1 << 7, /**< Fail if tag exists and has different storage type */
00080     MB_TAG_ANY    = 1 << 8, /**< Do not fail if size, type, or default value do not match. */
00081     MB_TAG_NOOPQ  = 1 << 9, /**< Do not accept MB_TYPE_OPAQUE as a match for any type. */
00082     MB_TAG_DFTOK  = 1 << 10 /**< Do not fail for mismatched default values */
00083     /**<  MB_TAG_CNVRT = 1<<11,  Convert storage type if it does not match */
00084 };
00085 
00086 /** Specify data type for tags. */
00087 enum MOAB_EXPORT DataType
00088 {
00089     MB_TYPE_OPAQUE   = 0, /**< byte array */
00090     MB_TYPE_INTEGER  = 1, /**< native 'int' type */
00091     MB_TYPE_DOUBLE   = 2, /**< native 'double' type */
00092     MB_TYPE_BIT      = 3, /**< mandatory type for tags with MB_TAG_BIT storage */
00093     MB_TYPE_HANDLE   = 4, /**< EntityHandle */
00094     MB_MAX_DATA_TYPE = MB_TYPE_HANDLE
00095 };
00096 
00097 #ifdef __cplusplus
00098 extern const char* const DataTypeStr[];
00099 #endif
00100 
00101 /** Used to reference tags; since they're so different from entities, we
00102  *  use void** instead of a uint to prevent them from being confused as
00103  *  entity handles.
00104  */
00105 #ifdef __cplusplus
00106 class TagInfo;
00107 typedef TagInfo* Tag;
00108 #else
00109 struct TagInfo;
00110 typedef struct TagInfo* Tag;
00111 #endif
00112 
00113 /** Meshset options: properties for meshset creation.
00114  *  Values are bit flags that may be combined with a bitwise OR (|)
00115  */
00116 enum MOAB_EXPORT EntitySetProperty
00117 {
00118     MESHSET_TRACK_OWNER = 0x1, /**< create entity to meshset adjacencies */
00119     MESHSET_SET         = 0x2, /**< set contents are unique */
00120     MESHSET_ORDERED     = 0x4  /**< order of set contents is preserved */
00121 };
00122 
00123 enum MOAB_EXPORT SenseType
00124 {
00125     SENSE_INVALID = -2, /**< default, invalid, not defined */
00126     SENSE_REVERSE = -1, /**< reversed */
00127     SENSE_BOTH    = 0,  /**< both senses valid  */
00128     SENSE_FORWARD = 1   /**< forward  */
00129 };
00130 
00131 #ifdef __cplusplus
00132 extern const char* const* const SenseTypeStr;
00133 #endif
00134 
00135 #ifdef __cplusplus
00136 } /* namespace moab */
00137 #endif
00138 
00139 /*@}*/
00140 
00141 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines