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