#
libsff

Home | Modules | Examples

# /home/pinky2/mattijs/OpenFOAM/OpenFOAM-1.0/applications/utilities/mesh/conversion/ccm24ToFoam/libccmio/libccmio/ccmiotypes.h

Go to the documentation of this file.

    00001 #ifndef CCMIO_TYPES_H
    00002 #define CCMIO_TYPES_H
    00003
    00004 /*@@
    00005  *  Program: Star File Format Library  - $RCSfile: ccmiotypes.h,v $
    00006  *  Author:  Geoff Prewett
    00007  *  Date:    July 28, 2003
    00008  *
    00009  *
    00010  *  Star File Format Library - Copyright (C) 2003 by adapco, Ltd.
    00011  *
    00012  *  This program is the property of adapco, Ltd. and contains
    00013  *  confidential and proprietary information.  The unauthorized use,
    00014  *  distribution, or duplication of this program is prohibited.
    00015  *  All rights reserved.
    00016  *
    00017  *  $Id: ccmiotypes.h,v 1.6 2004/08/06 23:15:00 prewett Exp $
    00018  */
    00019
    00020 #ifdef __cplusplus
    00021 extern "C" {
    00022 #endif
    00023
    00024 #ifdef DEBUG
    00025     #define Debugging   1
    00026 #else
    00027     #define Debugging   0
    00028 #endif
    00029
    00030 #ifndef TRUE
    00031     #define TRUE        1
    00032     #define FALSE       0
    00033 #endif
    00034
    00036 typedef enum {
    00037     kCCMIONoErr = 0,
    00038     kCCMIONoFileErr,
    00039     kCCMIOPermissionErr,
    00040     kCCMIOCorruptFileErr,
    00041     kCCMIOBadLinkErr,
    00042     kCCMIONoNodeErr,
    00043     kCCMIODuplicateNodeErr,
    00044     kCCMIOWrongDataTypeErr,
    00045     kCCMIONoDataErr,
    00046     kCCMIOWrongParentErr,
    00047     kCCMIOBadParameterErr,
    00048     kCCMIONoMemoryErr,
    00049     kCCMIOIOErr,
    00050     kCCMIOTooManyFacesErr,
    00051     kCCMIOVersionErr,
    00052     kCCMIOInternalErr
    00053     } CCMIOError;
    00054
    00055 typedef enum { kCCMIOFloat32, kCCMIOFloat64, kCCMIOInt32, kCCMIOString,
    00056                kCCMIOUnknownType, kCCMIOBadType, kCCMIOLastType } CCMIODataType;
    00057
    00058 struct _CCMIONode {
    00059     double node;
    00060     double parent;
    00061 };
    00062
    00063 #define kCCMIOEndArgs   -1
    00064
    00065 typedef enum { kCCMIORead, kCCMIOWrite } CCMIOBufferType;
    00066 typedef CCMIOBufferType CCMIOIOType;
    00067
    00068 typedef enum { kCCMIOReadData, kCCMIONewData, kCCMIOAddData } CCMIOOpenType;
    00069
    00070 typedef struct _CCMIONode CCMIONode;
    00071
    00072 #define IGNORE_ERROR(err)               \
    00073         CCMIOError dummyErr = kCCMIONoErr;      \
    00074         if (!err) err = &dummyErr;
    00075
    00076 #define CHECK_ERROR(err)                \
    00077         CCMIOError dummyErr = kCCMIONoErr;      \
    00078         if (!err) err = &dummyErr;      \
    00079         if (*err != kCCMIONoErr) return(*err);
    00080
    00081 #define CHECK_ERROR_AND_CLEAR_PTR(err, ptr)             \
    00082         CCMIOError dummyErr = kCCMIONoErr;                      \
    00083         if (!err) err = &dummyErr;                      \
    00084         if (!ptr) return(*err = kCCMIOBadParameterErr); \
    00085         else    *ptr = 0;                               \
    00086         if (*err != kCCMIONoErr) return(*err);
    00087
    00088 #ifdef _WIN32
    00089         #ifndef snprintf
    00090                 #if !defined(__NUTC__)
    00091                         #define snprintf _snprintf
    00092                 #endif
    00093         #endif
    00094 #endif
    00095 #if defined(__hpux__) || defined(__hpux) || defined(hpux) || defined(__alpha) || defined(__alpha__)
    00096         #define kHasSNPrintf    0
    00097 #else
    00098         #define kHasSNPrintf    1
    00099 #endif
    00100
    00101 typedef enum { kCCMIOScalar = 1, kCCMIOVector, kCCMIOTensor } CCMIODimensionality;
    00102 typedef enum { kCCMIOVertex = 0, kCCMIOCell, kCCMIOFace } CCMIODataLocation;
    00103
    00104 /* Keep in sync with gEntityNames and gTypeNames in ccmio.c */
    00105 typedef enum { kCCMIOMap = 0, kCCMIOVertices, kCCMIOTopology,
    00106                kCCMIOInternalFaces, kCCMIOBoundaryFaces, kCCMIOCells,
    00107                kCCMIOProblemDescription, kCCMIOFieldSet, kCCMIOField,
    00108                kCCMIOFieldData, kCCMIOState, kCCMIOProcessor, kCCMIOCellType,
    00109                kCCMIOBoundaryRegion, kCCMIOLagrangianData, kCCMIOInterfaces,
    00110                kCCMIOFieldPhase, kCCMIORestart, kCCMIORestartData,
    00111                kCCMIOReferenceData, kCCMIOModelConstants,
    00112                kCCMIOMaxEntity } CCMIOEntity;
    00113
    00114 typedef enum { kCCMIOVectorX = 0, kCCMIOVectorY, kCCMIOVectorZ,
    00115                kCCMIOTensorXX = 0, kCCMIOTensorXY, kCCMIOTensorXZ,
    00116                kCCMIOTensorYX, kCCMIOTensorYY, kCCMIOTensorYZ,
    00117                kCCMIOTensorZX, kCCMIOTensorZY, kCCMIOTensorZZ } CCMIOComponent;
    00118
    00119 typedef struct {
    00120     CCMIONode root;
    00121     CCMIONode node;
    00122     int id;
    00123     CCMIOEntity type;
    00124     int version;
    00125 } CCMIOID;
    00126
    00127 #define kCCMIOMaxDimension      4
    00128 #define kCCMIOMaxStringLength   32
    00129 #define kCCMIOProstarShortNameLength    8
    00130 #define kCCMIOStart             0
    00131 #define kCCMIOEnd               0
    00132
    00133 #ifdef __cplusplus
    00134     }
    00135 #endif
    00136 #endif // CCMIO_TYPES_H