libccmio

Home Modules Examples

/u/xeona04/people/prewett/src/libccmio/libccmio/ccmio.h

Go to the documentation of this file.
00001 #ifndef CCMIO_H
00002 #define CCMIO_H
00003 
00004 /*@@
00005  *  Program: Star File Format Library  - $RCSfile: ccmio.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: ccmio.h,v 1.18 2006/06/05 21:12:16 geoffp Exp $
00018  */
00019 
00020 #ifdef __cplusplus
00021 extern "C" {
00022 #endif
00023 
00024 #include "libccmio/ccmiotypes.h"
00025 
00026 /* \{ \name Basic functions
00027       \ingroup intermediate */
00028 
00032 extern CCMIOError CCMIOOpenFile( CCMIOError *err, char const *file,
00033                                  CCMIOIOType mode, CCMIOID *root );
00034 
00037 extern CCMIOError CCMIOCloseFile( CCMIOError *err, CCMIOID root );
00038 
00040 extern CCMIOError CCMIOGetVersion( CCMIOError *err, CCMIONode root,
00041                                    int *version );
00042 
00044 extern CCMIOError CCMIOSetVersion( CCMIOError *err, CCMIONode root,
00045                                    int version );
00046 
00049 extern CCMIOError CCMIOGetTitle( CCMIOError *err, CCMIONode root, char **title );
00050 
00052 extern CCMIOError CCMIOSetTitle( CCMIOError *err, CCMIONode root,
00053                                  char const *title );
00054 
00055 /* \} */
00056 /* \{ \name Functions for Optional Nodes
00057       \ingroup intermediate */
00058 
00064 extern CCMIOError CCMIOWriteOpti( CCMIOError *err, CCMIOID parent,
00065                                   char const *name, int value );
00066 
00072 extern CCMIOError CCMIOWriteOptf( CCMIOError *err, CCMIOID parent,
00073                                   char const *name, float value );
00074 
00080 extern CCMIOError CCMIOWriteOptd( CCMIOError *err, CCMIOID parent,
00081                                   char const *name, double value );
00082 
00088 extern CCMIOError CCMIOWriteOptstr( CCMIOError *err, CCMIOID parent,
00089                                     char const *name, char const *value );
00090 
00096 extern CCMIOError CCMIOReadOpti( CCMIOError *err, CCMIOID parent,
00097                                  char const *name, int *value );
00098 
00104 extern CCMIOError CCMIOReadOptf( CCMIOError *err, CCMIOID parent,
00105                                  char const *name, float *value );
00106 
00112 extern CCMIOError CCMIOReadOptd( CCMIOError *err, CCMIOID parent,
00113                                  char const *name, double *value );
00114 
00120 extern CCMIOError CCMIOReadOptstr( CCMIOError *err, CCMIOID parent,
00121                                    char const *name, int *size, char *value );
00122 
00126 extern CCMIOError CCMIOReadOpt1i( CCMIOError *err, CCMIOID parent,
00127                                   char const *name, int *data,
00128                                   CCMIOIndex start, CCMIOIndex end );
00137 extern CCMIOError CCMIOReadOpt1f( CCMIOError *err, CCMIOID parent,
00138                                   char const *name, float *data,
00139                                   CCMIOIndex start, CCMIOIndex end );
00143 extern CCMIOError CCMIOReadOpt1d( CCMIOError *err, CCMIOID parent,
00144                                   char const *name, double *data,
00145                                   CCMIOIndex start, CCMIOIndex end );
00149 extern CCMIOError CCMIOReadOpt2i( CCMIOError *err, CCMIOID parent,
00150                                   char const *name, int *data,
00151                                   CCMIOIndex start, CCMIOIndex end );
00167 extern CCMIOError CCMIOReadOpt2f( CCMIOError *err, CCMIOID parent,
00168                                   char const *name, float *data,
00169                                   CCMIOIndex start, CCMIOIndex end );
00173 extern CCMIOError CCMIOReadOpt2d( CCMIOError *err, CCMIOID parent,
00174                                   char const *name, double *data,
00175                                   CCMIOIndex start, CCMIOIndex end );
00179 extern CCMIOError CCMIOReadOpt3i( CCMIOError *err, CCMIOID parent,
00180                                   char const *name, int *data,
00181                                   CCMIOIndex start, CCMIOIndex end );
00197 extern CCMIOError CCMIOReadOpt3f( CCMIOError *err, CCMIOID parent,
00198                                   char const *name, float *data,
00199                                   CCMIOIndex start, CCMIOIndex end );
00203 extern CCMIOError CCMIOReadOpt3d( CCMIOError *err, CCMIOID parent,
00204                                   char const *name, double *data,
00205                                   CCMIOIndex start, CCMIOIndex end );
00206 
00209 extern CCMIOError CCMIOWriteOpt1i( CCMIOError *err, CCMIOID const parent,
00210                                    char const *name, CCMIOSize const n,
00211                                    int const *data,
00212                                    CCMIOIndex start, CCMIOIndex end );
00227 extern CCMIOError CCMIOWriteOpt1f( CCMIOError *err, CCMIOID parent,
00228                                    char const *name, CCMIOSize n,
00229                                    float const *data,
00230                                    CCMIOIndex start, CCMIOIndex end );
00233 extern CCMIOError CCMIOWriteOpt1d( CCMIOError *err, CCMIOID parent,
00234                                    char const *name, CCMIOSize n,
00235                                    double const *data,
00236                                    CCMIOIndex start, CCMIOIndex end );
00239 extern CCMIOError CCMIOWriteOpt2i( CCMIOError *err, CCMIOID const parent,
00240                                    char const *name, CCMIOIndex x, CCMIOIndex y,
00241                                    int const *data,
00242                                    CCMIOIndex start, CCMIOIndex end );
00265 extern CCMIOError CCMIOWriteOpt2f( CCMIOError *err, CCMIOID parent,
00266                                    char const *name, CCMIOIndex x, CCMIOIndex y,
00267                                    float const *data,
00268                                    CCMIOIndex start, CCMIOIndex end );
00271 extern CCMIOError CCMIOWriteOpt2d( CCMIOError *err, CCMIOID parent,
00272                                    char const *name, CCMIOIndex x, CCMIOIndex y,
00273                                    double const *data,
00274                                    CCMIOIndex start, CCMIOIndex end );
00277 extern CCMIOError CCMIOWriteOpt3i( CCMIOError *err, CCMIOID parent,
00278                                    char const *name,
00279                                    CCMIOIndex x, CCMIOIndex y, CCMIOIndex z,
00280                                    int const *data,
00281                                    CCMIOIndex start, CCMIOIndex end );
00307 extern CCMIOError CCMIOWriteOpt3f( CCMIOError *err, CCMIOID parent,
00308                                    char const *name,
00309                                    CCMIOIndex x, CCMIOIndex y, CCMIOIndex z,
00310                                    float const *data, CCMIOIndex start,
00311                                    CCMIOIndex end );
00314 extern CCMIOError CCMIOWriteOpt3d( CCMIOError *err, CCMIOID parent,
00315                                    char const *name,
00316                                    CCMIOIndex x, CCMIOIndex y, CCMIOIndex z,
00317                                    double const *data, CCMIOIndex start,
00318                                    CCMIOIndex end );
00319 
00331 extern CCMIOError CCMIOGetOptInfo( CCMIOError *err, CCMIOID parent,
00332                                    char const *name, CCMIODataType *type,
00333                                    CCMIOIndex *x, CCMIOIndex *y,
00334                                    CCMIOIndex *z );
00335 
00336 /* \} */
00337 /* \{ \name Intermediate API
00338       \ingroup intermediate */
00339 
00342 extern void CCMIOInvalidateEntity( CCMIOID *entity );
00343 
00347 extern int CCMIOIsValidEntity( CCMIOID entity );
00348 
00351 extern int CCMIOIsFromSameFile( CCMIOID entity1, CCMIOID entity2 );
00352 
00361 extern CCMIOError CCMIONewEntity( CCMIOError *err, CCMIOID parent,
00362                                   CCMIOEntity type, char const *description,
00363                                   CCMIOID *id );
00364 
00376 extern CCMIOError CCMIOGetEntity( CCMIOError *err, CCMIOID parent,
00377                                   CCMIOEntity type, int idVal, CCMIOID *id );
00378 
00392 extern CCMIOError CCMIONewIndexedEntity( CCMIOError *err, CCMIOID parent,
00393                                      CCMIOEntity which, int idVal,
00394                                      char const *description, CCMIOID *id );
00395 
00398 extern CCMIOError CCMIOGetEntityIndex( CCMIOError *err, CCMIOID id , int *n );
00399 
00411 extern CCMIOError CCMIONewState( CCMIOError *err, CCMIOID root,
00412                                  char const *name, CCMIOID *problemDescription,
00413                                  char const *description, CCMIOID *state );
00414 
00426 extern CCMIOError CCMIOGetState( CCMIOError *err, CCMIOID root,
00427                                  char const *name, CCMIOID *problemDescription,
00428                                  CCMIOID *state );
00429 
00436 extern CCMIOError CCMIOWriteState( CCMIOError *err, CCMIOID state,
00437                                    CCMIOID problemDescription,
00438                                    char const *description );
00439 
00452 extern CCMIOError CCMIONewField( CCMIOError *err, CCMIOID phase,
00453                                  char const *name, char const *shortName,
00454                                  CCMIODimensionality dim, CCMIOID *field );
00455 
00464 extern CCMIOError CCMIOGetField( CCMIOError *err, CCMIOID phase,
00465                                  char const *name, CCMIODimensionality *dim,
00466                                  CCMIOID *field );
00467 
00482 extern CCMIOError CCMIOReadField( CCMIOError *err, CCMIOID field, char *name,
00483                                   char *shortName, CCMIODimensionality *dim,
00484                                   CCMIODataType *datatype );
00485 
00496 CCMIOError CCMIONewProstarSet( CCMIOError *err, CCMIOID root, const char *name,
00497                                const char *longName, CCMIOID *setID );
00498 
00509 CCMIOError CCMIOGetProstarSet( CCMIOError *err, CCMIOID root, const char *name,
00510                                int *longNameSize, char *longName,
00511                                unsigned int *setsAvailableFlag,
00512                                CCMIOID *setID );
00513 
00519 extern CCMIOError CCMIODeleteEntity( CCMIOError *err, CCMIOID id );
00520 
00531 extern CCMIOError CCMIONextEntity( CCMIOError *err, CCMIOID parent,
00532                                    CCMIOEntity type, int *i, CCMIOID *next );
00533 
00537 extern CCMIOError CCMIOEntitySize( CCMIOError *err, CCMIOID id, CCMIOSize *n,
00538                                    CCMIOIndex *max );
00539 
00544 extern CCMIOError CCMIOEntityName( CCMIOError *err, CCMIOID id, char *name );
00545 
00554 extern CCMIOError CCMIOEntityLabel( CCMIOError *err, CCMIOID id,
00555                                     CCMIOSize *size, char *label );
00556 
00563 extern CCMIOError CCMIOEntityDescription( CCMIOError *err, CCMIOID id,
00564                                           CCMIOSize *size, char *desc );
00565 
00567 extern CCMIOError CCMIOGetEntityNode( CCMIOError *err, CCMIOID id,
00568                                       CCMIONode *node );
00569 
00572 extern CCMIOError CCMIOEntityDataType( CCMIOError *err, CCMIOID id,
00573                                        CCMIODataType *type );
00574 
00589 extern CCMIOError CCMIOWriteMap( CCMIOError *err, CCMIOID id,
00590                                  CCMIOSize n, CCMIOSize max,
00591                                  int const *data,
00592                                  CCMIOIndex start, CCMIOIndex end );
00593 
00598 extern CCMIOError CCMIOReadMap( CCMIOError *err, CCMIOID id, int *data,
00599                                 CCMIOIndex start, CCMIOIndex end );
00600 
00618 extern CCMIOError CCMIOReadVerticesf( CCMIOError *err, CCMIOID id,
00619                                       int *dims, float *scale,
00620                                       CCMIOID *mapID, float  *vertices,
00621                                       CCMIOIndex start, CCMIOIndex end );
00639 extern CCMIOError CCMIOReadVerticesd( CCMIOError *err, CCMIOID id,
00640                                       int *dims, float *scale,
00641                                       CCMIOID *mapID, double *vertices,
00642                                       CCMIOIndex start, CCMIOIndex end );
00661 extern CCMIOError CCMIOWriteVerticesf( CCMIOError *err, CCMIOID id,
00662                                        int dims, float scale,
00663                                        CCMIOID mapID, float const *vertices,
00664                                        CCMIOIndex start, CCMIOIndex end );
00683 extern CCMIOError CCMIOWriteVerticesd( CCMIOError *err, CCMIOID id,
00684                                        int dims, float scale,
00685                                        CCMIOID mapID, double const *vertices,
00686                                        CCMIOIndex start, CCMIOIndex end );
00687 
00698 extern CCMIOError CCMIOReadCells( CCMIOError *err, CCMIOID id, CCMIOID *mapID,
00699                                   int *cellTypes, CCMIOIndex start,
00700                                   CCMIOIndex end );
00701 
00712 extern CCMIOError CCMIOWriteCells( CCMIOError *err, CCMIOID id, CCMIOID mapID,
00713                                    int *cellTypes, CCMIOIndex start,
00714                                    CCMIOIndex end );
00715 
00737 extern CCMIOError CCMIOReadFaces( CCMIOError *err, CCMIOID entity,
00738                                   CCMIOEntity which, CCMIOID *mapID,
00739                                   CCMIOSize *streamSize, int *vertexStream,
00740                                   CCMIOIndex start, CCMIOIndex end );
00741 
00753 extern CCMIOError CCMIOWriteFaces( CCMIOError *err, CCMIOID entity,
00754                                    CCMIOEntity which, CCMIOID mapID,
00755                                    CCMIOSize streamSize,
00756                                    int const *vertexStream,
00757                                    CCMIOIndex start, CCMIOIndex end );
00758 
00778 CCMIOError CCMIOReadFaceCells( CCMIOError *err, CCMIOID entity,
00779                                CCMIOEntity which, int *cells,
00780                                CCMIOIndex start, CCMIOIndex end );
00781 
00787 CCMIOError CCMIOWriteFaceCells( CCMIOError *err, CCMIOID entity,
00788                                 CCMIOEntity which, CCMIOID mapID,
00789                                 int const *cells, CCMIOIndex start,
00790                                 CCMIOIndex end );
00791 
00812 extern CCMIOError CCMIOWriteProcessor( CCMIOError *err, CCMIOID processor,
00813                                    char const *verticesFile, CCMIOID *vertices,
00814                                    char const *topologyFile, CCMIOID *topology,
00815                                    char const *initialFieldFile, CCMIOID *initialField,
00816                                    char const *solutionFile, CCMIOID *solution);
00817 
00823 extern CCMIOError CCMIOReadProcessor( CCMIOError *err, CCMIOID processor,
00824                                       CCMIOID *vertices, CCMIOID *topology,
00825                                       CCMIOID *initialField, CCMIOID *solution);
00826 
00841 extern CCMIOError CCMIOClearProcessor( CCMIOError *err, CCMIOID state,
00842                                        CCMIOID processor,
00843                                        int clearVertices, int clearTopology,
00844                                        int clearInitialField, int clearSolution,
00845                                        int clearLagrangian );
00846 
00859 extern CCMIOError CCMIOWriteLagrangianData( CCMIOError *err, CCMIOID lagrangian,
00860                                             char const *positionsFile,
00861                                             CCMIOID *positions,
00862                                             char const *solutionFile,
00863                                             CCMIOID *solution );
00864 
00870 extern CCMIOError CCMIOReadLagrangianData( CCMIOError *err, CCMIOID lagrangian,
00871                                            CCMIOID *positions,
00872                                            CCMIOID *solution );
00873 
00884 extern CCMIOError CCMIOWriteMultiDimensionalFieldData( CCMIOError *err,
00885                                                        CCMIOID fieldID,
00886                                                        CCMIOComponent component,
00887                                                        CCMIOID componentField );
00888 
00903 extern CCMIOError CCMIOReadMultiDimensionalFieldData( CCMIOError *err,
00904                                                       CCMIOID fieldID,
00905                                                       CCMIOComponent component,
00906                                                       CCMIOID *componentField );
00907 
00929 extern CCMIOError CCMIOWriteFieldDataf( CCMIOError *err, CCMIOID fieldData,
00930                                         CCMIOID mapID, CCMIODataLocation loc,
00931                                         float *data, CCMIOIndex start,
00932                                         CCMIOIndex end  );
00935 extern CCMIOError CCMIOWriteFieldDatad( CCMIOError *err, CCMIOID fieldData,
00936                                         CCMIOID mapID, CCMIODataLocation loc,
00937                                         double *data, CCMIOIndex start,
00938                                         CCMIOIndex end  );
00939 
00942 extern CCMIOError CCMIOWriteFieldDatai( CCMIOError *err, CCMIOID fieldData,
00943                                         CCMIOID mapID, CCMIODataLocation loc,
00944                                         int *data, CCMIOIndex start,
00945                                         CCMIOIndex end  );
00946 
00954 extern CCMIOError CCMIOWriteConstantFieldDataf( CCMIOError *err,
00955                                                 CCMIOID fieldData,
00956                                                 CCMIOID mapID,
00957                                                 CCMIODataLocation loc,
00958                                                 float value );
00959 
00962 extern CCMIOError CCMIOWriteConstantFieldDatad( CCMIOError *err,
00963                                                 CCMIOID fieldData,
00964                                                 CCMIOID mapID,
00965                                                 CCMIODataLocation loc,
00966                                                 double value );
00967 
00970 extern CCMIOError CCMIOWriteConstantFieldDatai( CCMIOError *err,
00971                                                 CCMIOID fieldData,
00972                                                 CCMIOID mapID,
00973                                                 CCMIODataLocation loc,
00974                                                 int value );
00975 
01003 extern CCMIOError CCMIOReadFieldDataf( CCMIOError *err, CCMIOID fieldData,
01004                                        CCMIOID *mapID, CCMIODataLocation *loc,
01005                                        float *data, CCMIOIndex start,
01006                                        CCMIOIndex end  );
01007 
01011 extern CCMIOError CCMIOReadFieldDatad( CCMIOError *err, CCMIOID fieldData,
01012                                        CCMIOID *mapID, CCMIODataLocation *loc,
01013                                        double *data, CCMIOIndex start,
01014                                        CCMIOIndex end  );
01015 
01019 extern CCMIOError CCMIOReadFieldDatai( CCMIOError *err, CCMIOID fieldData,
01020                                        CCMIOID *mapID, CCMIODataLocation *loc,
01021                                        int *data, CCMIOIndex start,
01022                                        CCMIOIndex end  );
01023 
01036 extern CCMIOError CCMIOWriteRestartInfo( CCMIOError *err, CCMIOID restartInfo,
01037                                          char const *solverName, int iteration,
01038                                          float time, char const *timeUnits,
01039                                          float startAngle );
01040 
01043 extern CCMIOError CCMIOReadRestartInfo( CCMIOError *err, CCMIOID restartInfo,
01044                                         char *solverName, int *iteration,
01045                                         float *time, char *timeUnits,
01046                                         float *startAngle );
01047 
01048 
01049 
01050 
01051   /* I changed this routine to include a parameter for the number of faces to
01052    * speed it up so that there isn't a database read for every buffer write.
01053    * WRO 22-Oct-2004 */
01054 
01061 extern CCMIOError CCMIOV2WriteFaceCells(
01062                                   CCMIOError *err, CCMIOID entity,
01063                                   CCMIOEntity which,
01064                                   CCMIOSize nFace, int const *cells,
01065                                   CCMIOIndex start, CCMIOIndex end );
01066 
01067 /* \} */
01068 
01069 #ifdef __cplusplus
01070 }
01071 #endif
01072 #endif /* CCMIO_H */
01073 
01074 
01075 /* Automatic setting of emacs local variables. */
01076 /* Local Variables: */
01077 /* mode: C++ */
01078 /* tab-width: 8 */
01079 /* End: */

Generated on Mon Jun 5 17:16:02 2006 for libccmio by doxygen1.2.18