libccmio

Home Modules Examples

Intermediate API

The Intermediate API provides a higher level method of accessing data than the Core API. More...

Basic functions

CCMIOError CCMIOOpenFile (CCMIOError *err, char const *file, CCMIOIOType mode, CCMIOID *root)
 Opens an CCMIO file.

CCMIOError CCMIOCloseFile (CCMIOError *err, CCMIOID root)
 Closes all references to the CCMIO file.

CCMIOError CCMIOGetVersion (CCMIOError *err, CCMIONode root, int *version)
 Returns the version number of the file.

CCMIOError CCMIOSetVersion (CCMIOError *err, CCMIONode root, int version)
 Sets the version number of the file.

CCMIOError CCMIOGetTitle (CCMIOError *err, CCMIONode root, char **title)
 Returns the title of the file.

CCMIOError CCMIOSetTitle (CCMIOError *err, CCMIONode root, char const *title)
 Sets the title of the file.


Functions for Optional Nodes

CCMIOError CCMIOWriteOpti (CCMIOError *err, CCMIOID parent, char const *name, int value)
 Creates a child node of parent with given name and scalar value.

CCMIOError CCMIOWriteOptf (CCMIOError *err, CCMIOID parent, char const *name, float value)
 Creates a child node of parent with given name and scalar value.

CCMIOError CCMIOWriteOptd (CCMIOError *err, CCMIOID parent, char const *name, double value)
 Creates a child node of parent with given name and scalar value.

CCMIOError CCMIOWriteOptstr (CCMIOError *err, CCMIOID parent, char const *name, char const *value)
 Creates a child node of parent with given name and string value.

CCMIOError CCMIOReadOpti (CCMIOError *err, CCMIOID parent, char const *name, int *value)
 Creates a child node of parent with given name and scalar value.

CCMIOError CCMIOReadOptf (CCMIOError *err, CCMIOID parent, char const *name, float *value)
 Creates a child node of parent with given name and scalar value.

CCMIOError CCMIOReadOptd (CCMIOError *err, CCMIOID parent, char const *name, double *value)
 Creates a child node of parent with given name and scalar value.

CCMIOError CCMIOReadOptstr (CCMIOError *err, CCMIOID parent, char const *name, int *size, char *value)
 Creates a child node of parent with given name and scalar value.

CCMIOError CCMIOReadOpt1i (CCMIOError *err, CCMIOID parent, char const *name, int *data, CCMIOIndex start, CCMIOIndex end)
 Reads a one-dimensional array from the child node of 'parent' with name 'name' into 'data'.

CCMIOError CCMIOReadOpt1f (CCMIOError *err, CCMIOID parent, char const *name, float *data, CCMIOIndex start, CCMIOIndex end)
 Reads a one-dimensional array from the child node of 'parent' with name 'name' into 'data'.

CCMIOError CCMIOReadOpt1d (CCMIOError *err, CCMIOID parent, char const *name, double *data, CCMIOIndex start, CCMIOIndex end)
 Reads a one-dimensional array from the child node of 'parent' with name 'name' into 'data'.

CCMIOError CCMIOReadOpt2i (CCMIOError *err, CCMIOID parent, char const *name, int *data, CCMIOIndex start, CCMIOIndex end)
 Reads a two-dimensional array from the child node of 'parent' with name 'name' into 'data'.

CCMIOError CCMIOReadOpt2f (CCMIOError *err, CCMIOID parent, char const *name, float *data, CCMIOIndex start, CCMIOIndex end)
 Reads a two-dimensional array from the child node of 'parent' with name 'name' into 'data'.

CCMIOError CCMIOReadOpt2d (CCMIOError *err, CCMIOID parent, char const *name, double *data, CCMIOIndex start, CCMIOIndex end)
 Reads a two-dimensional array from the child node of 'parent' with name 'name' into 'data'.

CCMIOError CCMIOReadOpt3i (CCMIOError *err, CCMIOID parent, char const *name, int *data, CCMIOIndex start, CCMIOIndex end)
 Reads a three-dimensional array from the child node of 'parent' with name 'name' into 'data'.

CCMIOError CCMIOReadOpt3f (CCMIOError *err, CCMIOID parent, char const *name, float *data, CCMIOIndex start, CCMIOIndex end)
 Reads a three-dimensional array from the child node of 'parent' with name 'name' into 'data'.

CCMIOError CCMIOReadOpt3d (CCMIOError *err, CCMIOID parent, char const *name, double *data, CCMIOIndex start, CCMIOIndex end)
 Reads a three-dimensional array from the child node of 'parent' with name 'name' into 'data'.

CCMIOError CCMIOWriteOpt1i (CCMIOError *err, CCMIOID const parent, char const *name, CCMIOSize const n, int const *data, CCMIOIndex start, CCMIOIndex end)
 Writes a one-dimensional array to a child node of 'parent' with name 'name'.

CCMIOError CCMIOWriteOpt1f (CCMIOError *err, CCMIOID parent, char const *name, CCMIOSize n, float const *data, CCMIOIndex start, CCMIOIndex end)
 Writes a one-dimensional array to a child node of 'parent' with name 'name'.

CCMIOError CCMIOWriteOpt1d (CCMIOError *err, CCMIOID parent, char const *name, CCMIOSize n, double const *data, CCMIOIndex start, CCMIOIndex end)
 Writes a one-dimensional array to a child node of 'parent' with name 'name'.

CCMIOError CCMIOWriteOpt2i (CCMIOError *err, CCMIOID const parent, char const *name, CCMIOIndex x, CCMIOIndex y, int const *data, CCMIOIndex start, CCMIOIndex end)
 Writes a two-dimensional array to a child node of 'parent' with name 'name'.

CCMIOError CCMIOWriteOpt2f (CCMIOError *err, CCMIOID parent, char const *name, CCMIOIndex x, CCMIOIndex y, float const *data, CCMIOIndex start, CCMIOIndex end)
 Writes a two-dimensional array to a child node of 'parent' with name 'name'.

CCMIOError CCMIOWriteOpt2d (CCMIOError *err, CCMIOID parent, char const *name, CCMIOIndex x, CCMIOIndex y, double const *data, CCMIOIndex start, CCMIOIndex end)
 Writes a two-dimensional array to a child node of 'parent' with name 'name'.

CCMIOError CCMIOWriteOpt3i (CCMIOError *err, CCMIOID parent, char const *name, CCMIOIndex x, CCMIOIndex y, CCMIOIndex z, int const *data, CCMIOIndex start, CCMIOIndex end)
 Writes a three-dimensional array to a child node of 'parent' with name 'name'.

CCMIOError CCMIOWriteOpt3f (CCMIOError *err, CCMIOID parent, char const *name, CCMIOIndex x, CCMIOIndex y, CCMIOIndex z, float const *data, CCMIOIndex start, CCMIOIndex end)
 Writes a three-dimensional array to a child node of 'parent' with name 'name'.

CCMIOError CCMIOWriteOpt3d (CCMIOError *err, CCMIOID parent, char const *name, CCMIOIndex x, CCMIOIndex y, CCMIOIndex z, double const *data, CCMIOIndex start, CCMIOIndex end)
 Writes a three-dimensional array to a child node of 'parent' with name 'name'.

CCMIOError CCMIOGetOptInfo (CCMIOError *err, CCMIOID parent, char const *name, CCMIODataType *type, CCMIOIndex *x, CCMIOIndex *y, CCMIOIndex *z)
 Returns information about the optional node.


Intermediate API

void CCMIOInvalidateEntity (CCMIOID *entity)
 Marks the entity as invalid.

int CCMIOIsValidEntity (CCMIOID entity)
 Returns TRUE if the entity is valid, FALSE otherwise.

int CCMIOIsFromSameFile (CCMIOID entity1, CCMIOID entity2)
 Returns TRUE if the two entities are from the same file, FALSE otherwise.

CCMIOError CCMIONewEntity (CCMIOError *err, CCMIOID parent, CCMIOEntity type, char const *description, CCMIOID *id)
 Creates a new entity.

CCMIOError CCMIOGetEntity (CCMIOError *err, CCMIOID parent, CCMIOEntity type, int idVal, CCMIOID *id)
 Retrieves an entity.

CCMIOError CCMIONewIndexedEntity (CCMIOError *err, CCMIOID parent, CCMIOEntity which, int idVal, char const *description, CCMIOID *id)
 Creates a new entity identified by an index number.

CCMIOError CCMIOGetEntityIndex (CCMIOError *err, CCMIOID id, int *n)
 Returns the index (i.e.

CCMIOError CCMIONewState (CCMIOError *err, CCMIOID root, char const *name, CCMIOID *problemDescription, char const *description, CCMIOID *state)
 Creates a new state.

CCMIOError CCMIOGetState (CCMIOError *err, CCMIOID root, char const *name, CCMIOID *problemDescription, CCMIOID *state)
 Marks the entity as invalid.

CCMIOError CCMIOWriteState (CCMIOError *err, CCMIOID state, CCMIOID problemDescription, char const *description)
 Writes the problem description node to the state.

CCMIOError CCMIONewField (CCMIOError *err, CCMIOID phase, char const *name, char const *shortName, CCMIODimensionality dim, CCMIOID *field)
 Marks the entity as invalid.

CCMIOError CCMIOGetField (CCMIOError *err, CCMIOID phase, char const *name, CCMIODimensionality *dim, CCMIOID *field)
 Retrieves a field entity.

CCMIOError CCMIOReadField (CCMIOError *err, CCMIOID field, char *name, char *shortName, CCMIODimensionality *dim, CCMIODataType *datatype)
 Reads information about a field.

CCMIOError CCMIONewProstarSet (CCMIOError *err, CCMIOID root, const char *name, const char *longName, CCMIOID *setID)
 Creates a new prostar set.

CCMIOError CCMIOGetProstarSet (CCMIOError *err, CCMIOID root, const char *name, int *longNameSize, char *longName, unsigned int *setsAvailableFlag, CCMIOID *setID)
 Gets a prostar set.

CCMIOError CCMIODeleteEntity (CCMIOError *err, CCMIOID id)
 Deletes the entity and all of its children.

CCMIOError CCMIONextEntity (CCMIOError *err, CCMIOID parent, CCMIOEntity type, int *i, CCMIOID *next)
 Marks the entity as invalid.

CCMIOError CCMIOEntitySize (CCMIOError *err, CCMIOID id, CCMIOSize *n, CCMIOIndex *max)
 Returns the number of elements and the maximum element ID in the specified entity.

CCMIOError CCMIOEntityName (CCMIOError *err, CCMIOID id, char *name)
 Gets the name of the entity.

CCMIOError CCMIOEntityLabel (CCMIOError *err, CCMIOID id, CCMIOSize *size, char *label)
 Gets the label of the entity.

CCMIOError CCMIOEntityDescription (CCMIOError *err, CCMIOID id, CCMIOSize *size, char *desc)
 Gets the description (if any) of the specified entity.

CCMIOError CCMIOGetEntityNode (CCMIOError *err, CCMIOID id, CCMIONode *node)
 Returns the CCMIO node corresponding to this entity.

CCMIOError CCMIOEntityDataType (CCMIOError *err, CCMIOID id, CCMIODataType *type)
 Returns the data type of the main data of the entity.

CCMIOError CCMIOWriteMap (CCMIOError *err, CCMIOID id, CCMIOSize n, CCMIOSize max, int const *data, CCMIOIndex start, CCMIOIndex end)
 Writes the map data.

CCMIOError CCMIOReadMap (CCMIOError *err, CCMIOID id, int *data, CCMIOIndex start, CCMIOIndex end)
 Reads the map data.

CCMIOError CCMIOReadVerticesf (CCMIOError *err, CCMIOID id, int *dims, float *scale, CCMIOID *mapID, float *vertices, CCMIOIndex start, CCMIOIndex end)
 Reads the vertex data.

CCMIOError CCMIOReadVerticesd (CCMIOError *err, CCMIOID id, int *dims, float *scale, CCMIOID *mapID, double *vertices, CCMIOIndex start, CCMIOIndex end)
 Reads the vertex data.

CCMIOError CCMIOWriteVerticesf (CCMIOError *err, CCMIOID id, int dims, float scale, CCMIOID mapID, float const *vertices, CCMIOIndex start, CCMIOIndex end)
 Writes the vertex data.

CCMIOError CCMIOWriteVerticesd (CCMIOError *err, CCMIOID id, int dims, float scale, CCMIOID mapID, double const *vertices, CCMIOIndex start, CCMIOIndex end)
 Writes the vertex data.

CCMIOError CCMIOReadCells (CCMIOError *err, CCMIOID id, CCMIOID *mapID, int *cellTypes, CCMIOIndex start, CCMIOIndex end)
 Reads the cell data.

CCMIOError CCMIOWriteCells (CCMIOError *err, CCMIOID id, CCMIOID mapID, int *cellTypes, CCMIOIndex start, CCMIOIndex end)
 Writes the cell data.

CCMIOError CCMIOReadFaces (CCMIOError *err, CCMIOID entity, CCMIOEntity which, CCMIOID *mapID, CCMIOSize *streamSize, int *vertexStream, CCMIOIndex start, CCMIOIndex end)
 Reads the face data.

CCMIOError CCMIOWriteFaces (CCMIOError *err, CCMIOID entity, CCMIOEntity which, CCMIOID mapID, CCMIOSize streamSize, int const *vertexStream, CCMIOIndex start, CCMIOIndex end)
 Writes the face data.

CCMIOError CCMIOReadFaceCells (CCMIOError *err, CCMIOID entity, CCMIOEntity which, int *cells, CCMIOIndex start, CCMIOIndex end)
 Reads the faces' cell associations with the faces.

CCMIOError CCMIOWriteFaceCells (CCMIOError *err, CCMIOID entity, CCMIOEntity which, CCMIOID mapID, int const *cells, CCMIOIndex start, CCMIOIndex end)
 Writes the face data.

CCMIOError CCMIOWriteProcessor (CCMIOError *err, CCMIOID processor, char const *verticesFile, CCMIOID *vertices, char const *topologyFile, CCMIOID *topology, char const *initialFieldFile, CCMIOID *initialField, char const *solutionFile, CCMIOID *solution)
 Writes the processor information.

CCMIOError CCMIOReadProcessor (CCMIOError *err, CCMIOID processor, CCMIOID *vertices, CCMIOID *topology, CCMIOID *initialField, CCMIOID *solution)
 Reads the processor information.

CCMIOError CCMIOClearProcessor (CCMIOError *err, CCMIOID state, CCMIOID processor, int clearVertices, int clearTopology, int clearInitialField, int clearSolution, int clearLagrangian)
 Clears the relevant information from the processor.

CCMIOError CCMIOWriteLagrangianData (CCMIOError *err, CCMIOID lagrangian, char const *positionsFile, CCMIOID *positions, char const *solutionFile, CCMIOID *solution)
 Writes Lagrangian data.

CCMIOError CCMIOReadLagrangianData (CCMIOError *err, CCMIOID lagrangian, CCMIOID *positions, CCMIOID *solution)
 Reads the Langrangian information.

CCMIOError CCMIOWriteMultiDimensionalFieldData (CCMIOError *err, CCMIOID fieldID, CCMIOComponent component, CCMIOID componentField)
 Writes one component of a vector or tensor data field.

CCMIOError CCMIOReadMultiDimensionalFieldData (CCMIOError *err, CCMIOID fieldID, CCMIOComponent component, CCMIOID *componentField)
 Gets the field ID of one component of a vector or tensor data field.

CCMIOError CCMIOWriteFieldDataf (CCMIOError *err, CCMIOID fieldData, CCMIOID mapID, CCMIODataLocation loc, float *data, CCMIOIndex start, CCMIOIndex end)
 Writes scalar data for a field.

CCMIOError CCMIOWriteFieldDatad (CCMIOError *err, CCMIOID fieldData, CCMIOID mapID, CCMIODataLocation loc, double *data, CCMIOIndex start, CCMIOIndex end)
 Writes the data for a field.

CCMIOError CCMIOWriteFieldDatai (CCMIOError *err, CCMIOID fieldData, CCMIOID mapID, CCMIODataLocation loc, int *data, CCMIOIndex start, CCMIOIndex end)
 Writes the data for a field.

CCMIOError CCMIOWriteConstantFieldDataf (CCMIOError *err, CCMIOID fieldData, CCMIOID mapID, CCMIODataLocation loc, float value)
 Writes data for a field that is constant.

CCMIOError CCMIOWriteConstantFieldDatad (CCMIOError *err, CCMIOID fieldData, CCMIOID mapID, CCMIODataLocation loc, double value)
 Writes data for a field that is constant.

CCMIOError CCMIOWriteConstantFieldDatai (CCMIOError *err, CCMIOID fieldData, CCMIOID mapID, CCMIODataLocation loc, int value)
 Writes data for a field that is constant.

CCMIOError CCMIOReadFieldDataf (CCMIOError *err, CCMIOID fieldData, CCMIOID *mapID, CCMIODataLocation *loc, float *data, CCMIOIndex start, CCMIOIndex end)
 Reads scalar data from a field.

CCMIOError CCMIOReadFieldDatad (CCMIOError *err, CCMIOID fieldData, CCMIOID *mapID, CCMIODataLocation *loc, double *data, CCMIOIndex start, CCMIOIndex end)
 Reads the data from a field.

CCMIOError CCMIOReadFieldDatai (CCMIOError *err, CCMIOID fieldData, CCMIOID *mapID, CCMIODataLocation *loc, int *data, CCMIOIndex start, CCMIOIndex end)
 Reads the data from a field.

CCMIOError CCMIOWriteRestartInfo (CCMIOError *err, CCMIOID restartInfo, char const *solverName, int iteration, float time, char const *timeUnits, float startAngle)
 Writes the solver restart entity.

CCMIOError CCMIOReadRestartInfo (CCMIOError *err, CCMIOID restartInfo, char *solverName, int *iteration, float *time, char *timeUnits, float *startAngle)
 Reads the solver restart entity.

CCMIOError CCMIOV2WriteFaceCells (CCMIOError *err, CCMIOID entity, CCMIOEntity which, CCMIOSize nFace, int const *cells, CCMIOIndex start, CCMIOIndex end)

Detailed Description

The Intermediate API provides a higher level method of accessing data than the Core API.


Function Documentation

CCMIOError CCMIOClearProcessor (  CCMIOError *    err,
CCMIOID    state,
CCMIOID    processor,
int    clearVertices,
int    clearTopology,
int    clearInitialField,
int    clearSolution,
int    clearLagrangian
) 
 

Clears the relevant information from the processor.

If this information is not used elsewhere, it will be removed from the file.

Parameters:
state  The state that is the parent of this processor.
processor  The processor to clear.
clearVertices  If TRUE, vertex information will be cleared. If FALSE, it will be untouched.
clearTopology  If TRUE, topology information will be cleared. If FALSE, it will be untouched.
clearInitialField  If TRUE, initial field information will be cleared. If FALSE, it will be untouched.
clearSolution  If TRUE, solution post data will be cleared. If FALSE, it will be untouched.
clearLagrangian  If TRUE, any Lagrangian data will be cleared. If FALSE, it will be untouched.
Examples:
writeexample.cpp.

CCMIOError CCMIOCloseFile (  CCMIOError *    err,
CCMIOID    root
) 
 

Closes all references to the CCMIO file.

Closing an already closed file generates a kCCMIOBadParameterErr.

Examples:
readexample.cpp, rewriteexample.cpp, and writeexample.cpp.

CCMIOError CCMIODeleteEntity (  CCMIOError *    err,
CCMIOID    id
) 
 

Deletes the entity and all of its children.

Note that deleting a processor without calling CCMIOClearProcessor() first will not delete entites that become unused as a result of the delete (e.g. the mesh and post data referred to by that processor) and may lead to wasted disk space. However, calling CCMIODeleteEntity on a state entity is safe.

CCMIOError CCMIOEntityDataType (  CCMIOError *    err,
CCMIOID    id,
CCMIODataType *    type
) 
 

Returns the data type of the main data of the entity.

Currently only valid for vertices.

CCMIOError CCMIOEntityDescription (  CCMIOError *    err,
CCMIOID    id,
CCMIOSize *    size,
char *    desc
) 
 

Gets the description (if any) of the specified entity.

Parameters:
size  Returns the size of the string. May be NULL if the information is not desired.
desc  Returns the description string. This must be allocated to at least as large as the number of characters + 1 and may be NULL if the information is not desired.
Examples:
readexample.cpp, and rewriteexample.cpp.

CCMIOError CCMIOEntityLabel (  CCMIOError *    err,
CCMIOID    id,
CCMIOSize *    size,
char *    label
) 
 

Gets the label of the entity.

Deprecated:
Use CCMIOEntityDescription() instead.
Parameters:
size  Returns the length of the label (not including a terminating NULL). May be NULL if the information is not required.
name  Returns the label. Must be at least 'size' + 1 bytes. If there is no label, this will be the empty string. May be NULL if the information is not required.

CCMIOError CCMIOEntityName (  CCMIOError *    err,
CCMIOID    id,
char *    name
) 
 

Gets the name of the entity.

Although this is not useful for most entities, it may be convenient for named entities (kCCMIOState, kCCMIOField).

Parameters:
name  Returns the name of the entity. Must be at least kCCMIOMaxStringLength + 1.

CCMIOError CCMIOEntitySize (  CCMIOError *    err,
CCMIOID    id,
CCMIOSize *    n,
CCMIOIndex *    max
) 
 

Returns the number of elements and the maximum element ID in the specified entity.

Either 'n' or 'max' may be NULL if the information is not desired.

Examples:
readexample.cpp.

CCMIOError CCMIOGetEntity (  CCMIOError *    err,
CCMIOID    parent,
CCMIOEntity    type,
int    idVal,
CCMIOID *    id
) 
 

Retrieves an entity.

Although it is mostly an internal function, it is necessary for retrieving the cell and internal face entities.

Parameters:
parent  For top-level entities this may be any CCMIOID in the same file, but for child entities this must be the actual parent.
type  The type of entity to be retrieved.
idVal  For entites that may have siblings, this specifies the ID number of the entity (this is most useful internally). For entities that may not have siblings (e.g. cells and internal faces) this value is ignored.
id  The CCMIOID of the created entity.
Examples:
readexample.cpp, and rewriteexample.cpp.

CCMIOError CCMIOGetEntityIndex (  CCMIOError *    err,
CCMIOID    id,
int *    n
) 
 

Returns the index (i.e.

the id) of the given indexed entity. (See CCMIONewIndexedEntity() for more details and a list of valid entities.)

Examples:
readexample.cpp.

CCMIOError CCMIOGetEntityNode (  CCMIOError *    err,
CCMIOID    id,
CCMIONode *    node
) 
 

Returns the CCMIO node corresponding to this entity.

CCMIOError CCMIOGetField (  CCMIOError *    err,
CCMIOID    phase,
char const *    name,
CCMIODimensionality *    dim,
CCMIOID *    field
) 
 

Retrieves a field entity.

Parameters:
phase  The FieldPhase entity.
name  The name of the field (limited to kCCMIOMaxStringLength characters, not including a terminating NULL).
dim  Returns the number of dimensions kCCMIOTensor).
field  The CCMIOID of the field entity.
Examples:
rewriteexample.cpp.

CCMIOError CCMIOGetOptInfo (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
CCMIODataType *    type,
CCMIOIndex *    x,
CCMIOIndex *    y,
CCMIOIndex *    z
) 
 

Returns information about the optional node.

Parameters:
parant  The parent node.
name  Name of the child entity.
type  Returns the data type of the child. Can be NULL if the information is not desired.
x  Returns the size of the first dimension (1 if the node is a scalar). Can be NULL.
y  Returns the size of the third dimension (0 if the node is one dimensional). Can be NULL.
z  Returns the size of the first dimension (0 if the node is less than three dimensions). Can be NULL.
Examples:
readexample.cpp.

CCMIOError CCMIOGetProstarSet (  CCMIOError *    err,
CCMIOID    root,
const char *    name,
int *    longNameSize,
char *    longName,
unsigned int *    setsAvailableFlag,
CCMIOID *    setID
) 
 

Gets a prostar set.

Parameters:
name  The name of the set.
longNameSize  The size of the long name, not including the C string terminator. Can be NULL if the size is not desired.
longName  The long name. Can be NULL if the information is not desired.
setsAvailableFlag  Lists the available sets. The sets can be read using CCMIOReadOpti(). Can be NULL if not desired.
ma setID The CCMIOID of the prostar set. Can be NULL if not
desired.
Examples:
readexample.cpp, and rewriteexample.cpp.

CCMIOError CCMIOGetState (  CCMIOError *    err,
CCMIOID    root,
char const *    name,
CCMIOID *    problemDescription,
CCMIOID *    state
) 
 

Marks the entity as invalid.

Further CCMIO calls will fail, until a call (such as CCMIOGetEntity()) writes a valid entity into it.

Examples:
readexample.cpp, and rewriteexample.cpp.

CCMIOError CCMIOGetTitle (  CCMIOError *    err,
CCMIONode    root,
char **    title
) 
 

Returns the title of the file.

Note that the returned string is allocated by the library and must be freed by the user. It is null-terminated.

CCMIOError CCMIOGetVersion (  CCMIOError *    err,
CCMIONode    root,
int *    version
) 
 

Returns the version number of the file.

void CCMIOInvalidateEntity (  CCMIOID *    entity ) 
 

Marks the entity as invalid.

Further CCMIO calls will fail, until a call (such as CCMIOGetEntity()) writes a valid entity into it.

Examples:
rewriteexample.cpp.

int CCMIOIsFromSameFile (  CCMIOID    entity1,
CCMIOID    entity2
) 
 

Returns TRUE if the two entities are from the same file, FALSE otherwise.

int CCMIOIsValidEntity (  CCMIOID    entity ) 
 

Returns TRUE if the entity is valid, FALSE otherwise.

Note that unitialized entities will likely return TRUE, even though they are not actually valid. Use CCMIOInvalidateEntity() to initialize them.

Examples:
readexample.cpp, and rewriteexample.cpp.

CCMIOError CCMIONewEntity (  CCMIOError *    err,
CCMIOID    parent,
CCMIOEntity    type,
char const *    description,
CCMIOID *    id
) 
 

Creates a new entity.

Parameters:
parent  For top-level entities this may be any CCMIOID in the same file, but for child entities this must be the actual parent.
type  The type of entity to be created.
description  An optional description of the entity. Passing NULL will omit a description.
id  The CCMIOID of the created entity.
Examples:
rewriteexample.cpp, and writeexample.cpp.

CCMIOError CCMIONewField (  CCMIOError *    err,
CCMIOID    phase,
char const *    name,
char const *    shortName,
CCMIODimensionality    dim,
CCMIOID *    field
) 
 

Marks the entity as invalid.

Further CCMIO calls will fail, until a call (such as CCMIOGetEntity()) writes a valid entity into it.

Examples:
rewriteexample.cpp, and writeexample.cpp.

CCMIOError CCMIONewIndexedEntity (  CCMIOError *    err,
CCMIOID    parent,
CCMIOEntity    which,
int    idVal,
char const *    description,
CCMIOID *    id
) 
 

Creates a new entity identified by an index number.

Although almost all entities are internally identified by an ID number, this number is unimportant for most entities and is only used internally. Some entities, however, are most easily identified with a number and for these entities (kCCMIOBoundaryFaces, kCCMIOCellType, and kCCMIOBoundaryRegion) the ID number is provided by the creator. The entities, called indexed entities, can be created with this function.

Parameters:
parent  The CCMIOID of the parent entity.
idVal  The boundary ID number.
which  May be kCCMIOBoundaryFaces, kCCMIOCellType, or kCCMIOBoundaryRegion.
description  An optional description (NULL for no description)
id  The CCMIOID to the new entity.
Examples:
rewriteexample.cpp, and writeexample.cpp.

CCMIOError CCMIONewProstarSet (  CCMIOError *    err,
CCMIOID    root,
const char *    name,
const char *    longName,
CCMIOID *    setID
) 
 

Creates a new prostar set.

The sets can be written with CCMIOWriteOpti(). If called on a pre-existing set, all contents of the original set will be removed.

Parameters:
name  The name of the set. This is limited to kCCMIOMaxStringLength.
longName  The name of the set; length is not limited. If no long name is desired, NULL may be passed here, and the short name will be used.
setID  The CCMIOID of the new prostar set. Can be NULL if not desired.
Examples:
rewriteexample.cpp, and writeexample.cpp.

CCMIOError CCMIONewState (  CCMIOError *    err,
CCMIOID    root,
char const *    name,
CCMIOID *    problemDescription,
char const *    description,
CCMIOID *    state
) 
 

Creates a new state.

If a state with that name exists, its contents, including processor entities, will be cleared.

Parameters:
root  The root node of the file (returned by CCMIOOpenFile()).
name  The name of the new state (limited to kCCMIOMaxStringLength characters, not including a terminating NULL).
problemDescription  The CCMIOID of the problemDescription entity relevant to this state, or NULL if there is none.
state  The CCMIOID of the new entity.
description  An optional description string (NULL for no description)
Examples:
rewriteexample.cpp, and writeexample.cpp.

CCMIOError CCMIONextEntity (  CCMIOError *    err,
CCMIOID    parent,
CCMIOEntity    type,
int *    i,
CCMIOID *    next
) 
 

Marks the entity as invalid.

Further CCMIO calls will fail, until a call (such as CCMIOGetEntity()) writes a valid entity into it.

Examples:
readexample.cpp, rewriteexample.cpp, and writeexample.cpp.

CCMIOError CCMIOOpenFile (  CCMIOError *    err,
char const *    file,
CCMIOIOType    mode,
CCMIOID *    root
) 
 

Opens an CCMIO file.

Calling CCMIOOpenFile() multiple times on a file does not create multiple references to it; thus if CCMIOOpenFile() is called five times on the same file, only one CCMIOCloseFile() is required.

Examples:
readexample.cpp, rewriteexample.cpp, and writeexample.cpp.

CCMIOError CCMIOReadCells (  CCMIOError *    err,
CCMIOID    id,
CCMIOID *    mapID,
int *    cellTypes,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Reads the cell data.

Parameters:
id  The CCMIOID of the cell entity.
mapID  Returns the CCMIOID of the map corresponding to this entity. May be NULL if the information is not desired.
cellTypes  Returns an array of cell type information. May be NULL if the information is not desired.
start  The beginning cell.
end  The ending cell. Data from 'start' to 'end' -1 will be read. If end is zero, data will be read from 'start' to the end of the data.
Examples:
readexample.cpp, and rewriteexample.cpp.

CCMIOError CCMIOReadFaceCells (  CCMIOError *    err,
CCMIOID    entity,
CCMIOEntity    which,
int *    cells,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Reads the faces' cell associations with the faces.

Parameters:
entity  The face entity.
which  Either kCCMIOInternalFaces or kCCMIOBoundaryFaces.
mapID  Returns the CCMIOID of the map associated with these faces. May be NULL if the information is not desired.
cells  If reading internal faces, this is a two dimensional array with size [nFaces][2]. If reading boundary faces it is a one dimensional array of size nFaces. Must be pre-allocated to the correct size. May be NULL if the information is not desired.
start  The beginning face.
end  The ending face. Data from 'start' to 'end' -1 will be read. If end is zero, data will be read from 'start' to the end of the data.
To read the whole array, set start to kCCMIOStart and end to kCCMIOEnd.

Note: When writing partial arrays, the first block of the array you write must have start equal to kCCMIOStart.

Examples:
readexample.cpp.

CCMIOError CCMIOReadFaces (  CCMIOError *    err,
CCMIOID    entity,
CCMIOEntity    which,
CCMIOID *    mapID,
CCMIOSize *    streamSize,
int *    vertexStream,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Reads the face data.

Parameters:
entity  The face entity.
which  Either kCCMIOInternalFaces or kCCMIOBoundaryFaces.
mapID  Returns the CCMIOID of the map associated with these faces. May be NULL if the information is not desired.
streamSize  Returns the total number of elements in the vertexStream. May be NULL if the information is not desired.
vertexStream  Returns the vertices in the faces in the form
nVerts v1 v2 ... vn
nVerts v1 v2 ... vn
   ...

Note that if the stream is being buffered (with 'start' and 'end'), only a piece of the stream will be returned, and may be in the middle of a face.
start  The beginning element.
end  The ending element. Data from 'start' to 'end' -1 will be read. If end is zero, data will be read from 'start' to the end of the data.
To read the whole array, set start to kCCMIOStart and end to kCCMIOEnd.
Examples:
readexample.cpp, and rewriteexample.cpp.

CCMIOError CCMIOReadField (  CCMIOError *    err,
CCMIOID    field,
char *    name,
char *    shortName,
CCMIODimensionality *    dim,
CCMIODataType *    datatype
) 
 

Reads information about a field.

Note that this does not read the data of the node; use CCMIOReadFieldData(f|v|i)() for that. This is for determining the name of the field when using CCMIONextEntity().

Parameters:
field  The CCMIOID of the field.
name  Returns the name of the field. Must be allocated to at least kCCMIOMaxStringLength + 1 characters.
shortName  Returns the short name of the field. Must be allocated to at least kCCMIOProstarShortName + 1 characters.
dim  Returns the dimensions of the field.
datatype  Returns the type of data. Only valid for scalar data; Vector and tensor components are not required to be the same data type (kCCMIOUnknownType will be returned for non-scalar data). May be NULL if the information is not desired.
Examples:
readexample.cpp.

CCMIOError CCMIOReadFieldDatad (  CCMIOError *    err,
CCMIOID    fieldData,
CCMIOID *    mapID,
CCMIODataLocation *    loc,
double *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Reads the data from a field.

The data is returned in double-precision so if the original data is single-precision it will be converted. See CCMIOReadFieldDataf() for a full description.

CCMIOError CCMIOReadFieldDataf (  CCMIOError *    err,
CCMIOID    fieldData,
CCMIOID *    mapID,
CCMIODataLocation *    loc,
float *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Reads scalar data from a field.

The data is returned in single-precision so if the original data is double-precision it will be converted. If the data is a constant value, the entire array will be filled with that value.

Note: If the file pre-dates vector and tensor data being stored as separate components (that is, if CCMIOReadMultiDimensionalArray() returns a kCCMIOVersion error), CCMIOReadFieldDataf() may be used to read the data. If this is the case, CCMIOReadFieldDataf() will automatically return the multidimensional data into 'data', and 'data' must be big enough to accomodate it.

Parameters:
fieldData  The CCMIOID of the field entity.
mapID  Returns the CCMIOID of the map corresponding to this field. May be NULL if not desired.
loc  Returns the type of data this node is (cell, vertex, face). May be NULL if not desired.
data  The data, must be preallocated to [n], [n][3], or [n][3][3] for kCCMIOScalar, kCCMIOVector, and kCCMIOTensor data, respectively. May be NULL if not desired.
start  The offset of the element pointed to by 'data'. Must Be in units of of the first element; so if float data[10][3][3]; then start can be in the range [0, 9].
end  The element one beyond the end. So to read from [2, 5], start = 2, end = 6, which reads from data[2][0][0] to data[5][3][3]. (Note that newer files will only have scalar data)
Examples:
readexample.cpp.

CCMIOError CCMIOReadFieldDatai (  CCMIOError *    err,
CCMIOID    fieldData,
CCMIOID *    mapID,
CCMIODataLocation *    loc,
int *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Reads the data from a field.

The data is returned in double-precision so if the original data is single-precision it will be converted. See CCMIOReadFieldDataf() for a full description.

CCMIOError CCMIOReadLagrangianData (  CCMIOError *    err,
CCMIOID    lagrangian,
CCMIOID *    positions,
CCMIOID *    solution
) 
 

Reads the Langrangian information.

The returned entities may be in a a different file and this will need to be closed with CCMIOClose, but since the node might be the root of the current file, they should not be closed until the end. 'positions' and 'solution' may be NULL if the information is not desired.

Examples:
readexample.cpp, and rewriteexample.cpp.

CCMIOError CCMIOReadMap (  CCMIOError *    err,
CCMIOID    id,
int *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Reads the map data.

Parameters:
id  The CCMIOID of the map.
data  The map data. Must be pre-allocated to the correct number of elements (given by CCMIOEntitySize()).
Examples:
readexample.cpp.

CCMIOError CCMIOReadMultiDimensionalFieldData (  CCMIOError *    err,
CCMIOID    fieldID,
CCMIOComponent    component,
CCMIOID *    componentField
) 
 

Gets the field ID of one component of a vector or tensor data field.

Although applications should specify all components, if there is a kCCMIONoNodeErr reading the entity, the application should assume that this component was not written and should use a proper default value (presumably 0.0). If the file is from an older version of the library that stores multiple dimensions in one node, a kCCMIOVersionErr is returned. In this case CCMIOReadFieldData*() will read a multiple dimensional array, instead of just one component.

Parameters:
fieldID  The postdata field.
component  The component (kCCMIOVectorX to kCCMIOVectorZ and kCCMIOTensorXX to kCCMIOTensorZZ).
componentField  The component field ID.
Examples:
readexample.cpp.

CCMIOError CCMIOReadOpt1d (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
double *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Reads a one-dimensional array from the child node of 'parent' with name 'name' into 'data'.

See CCMIOReadOpt1f() for a complete description.

CCMIOError CCMIOReadOpt1f (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
float *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Reads a one-dimensional array from the child node of 'parent' with name 'name' into 'data'.

'data' must be the proper size (which can be determined with CCMIOGetDimensions()). If actual node data is stored in a different format than requested (i.e. float or double), it will be converted.

Parameters:
parent  The parent entity.
name  Name of the child node.
data  Data to be read into. Must be non-NULL.

CCMIOError CCMIOReadOpt1i (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
int *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Reads a one-dimensional array from the child node of 'parent' with name 'name' into 'data'.

See CCMIOReadOpt1f() for a complete description.

Examples:
readexample.cpp.

CCMIOError CCMIOReadOpt2d (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
double *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Reads a two-dimensional array from the child node of 'parent' with name 'name' into 'data'.

See CCMIOReadOpt2f() for a complete description.

CCMIOError CCMIOReadOpt2f (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
float *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Reads a two-dimensional array from the child node of 'parent' with name 'name' into 'data'.

'data' must be the proper size (which can be determined with CCMIOGetDimensions()). If actual node data is stored in a different format than requested (i.e. float or double), it will be converted.

Parameters:
parent  The parent entity.
name  Name of the child node.
data  Data to be read into. Must be non-NULL.
start  The offset of the element pointed to by 'data'. Must Be in units of of the first element; so if float data[10][3]; then start can be in the range [0, 9].
end  The element one beyond the end. So to read from [2, 5], start = 2, end = 6, which reads from data[2][0] to data[5][3].

CCMIOError CCMIOReadOpt2i (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
int *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Reads a two-dimensional array from the child node of 'parent' with name 'name' into 'data'.

See CCMIOReadOpt2f() for a complete description.

CCMIOError CCMIOReadOpt3d (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
double *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Reads a three-dimensional array from the child node of 'parent' with name 'name' into 'data'.

See CCMIOReadOpt3f() for a complete description.

CCMIOError CCMIOReadOpt3f (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
float *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Reads a three-dimensional array from the child node of 'parent' with name 'name' into 'data'.

'data' must be the proper size (which can be determined with CCMIOGetDimensions()). If actual node data is stored in a different format than requested (i.e. float or double), it will be converted.

Parameters:
parent  The parent entity.
name  Name of the child node.
data  Data to be read into. Must be non-NULL.
start  The offset of the element pointed to by 'data'. Must Be in units of of the first element; so if float data[10][3][3]; then start can be in the range [0, 9].
end  The element one beyond the end. So to read from [2, 5], start = 2, end = 6, which reads from data[2][0][0] to data[5][3][3].

CCMIOError CCMIOReadOpt3i (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
int *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Reads a three-dimensional array from the child node of 'parent' with name 'name' into 'data'.

See CCMIOReadOpt3f() for a complete description.

CCMIOError CCMIOReadOptd (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
double *    value
) 
 

Creates a child node of parent with given name and scalar value.

If the node already exists it will be overwritten.

Parameters:
parent  The parent entity.
name  Name of the child node.
value  Scalar value to be written.

CCMIOError CCMIOReadOptf (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
float *    value
) 
 

Creates a child node of parent with given name and scalar value.

If the node already exists it will be overwritten.

Parameters:
parent  The parent entity.
name  Name of the child node.
value  Scalar value to be written.
Examples:
readexample.cpp.

CCMIOError CCMIOReadOpti (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
int *    value
) 
 

Creates a child node of parent with given name and scalar value.

If the node already exists it will be overwritten.

Parameters:
parent  The parent entity.
name  Name of the child node.
value  Scalar value to be written.

CCMIOError CCMIOReadOptstr (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
int *    size,
char *    value
) 
 

Creates a child node of parent with given name and scalar value.

If the node already exists it will be overwritten.

Parameters:
parent  The parent entity.
name  Name of the child node.
value  Scalar value to be written.
Examples:
readexample.cpp.

CCMIOError CCMIOReadProcessor (  CCMIOError *    err,
CCMIOID    processor,
CCMIOID *    vertices,
CCMIOID *    topology,
CCMIOID *    initialField,
CCMIOID *    solution
) 
 

Reads the processor information.

The returned entities may be in a a different file and this will need to be closed with CCMIOClose, but since the node might be the root of the current file, they should not be closed until the end. 'positions' and 'solution' may be NULL if the information is not desired.

Examples:
readexample.cpp, and rewriteexample.cpp.

CCMIOError CCMIOReadRestartInfo (  CCMIOError *    err,
CCMIOID    restartInfo,
char *    solverName,
int *    iteration,
float *    time,
char *    timeUnits,
float *    startAngle
) 
 

Reads the solver restart entity.

Any pointer may be NULL if the information is not desired.

Examples:
readexample.cpp.

CCMIOError CCMIOReadVerticesd (  CCMIOError *    err,
CCMIOID    id,
int *    dims,
float *    scale,
CCMIOID *    mapID,
double *    vertices,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Reads the vertex data.

Parameters:
id  The CCMIOID of the vertices.
dims  Returns the dimensionality of the vertex (i.e. 2 or 3). May be NULL if the information is not desired.
scale  Returns the scaling factor. May be NULL if the information is not desired.
mapID  Returns the CCMIOID of the map corresponding to this entity. May be NULL if the information is not desired.
vertices  A two dimensional array of size [nVerts][dims]. Must be pre-allocated to the correct size. May be NULL if the information is not desired.
start  The offset (in units of vertices) of the starting vertex.
end  The offset (in units of vertices) of the ending vertex. Data from start to end - 1 will be read. If end is kCCMIOEnd, data will be read from 'start' to the end of the data.

CCMIOError CCMIOReadVerticesf (  CCMIOError *    err,
CCMIOID    id,
int *    dims,
float *    scale,
CCMIOID *    mapID,
float *    vertices,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Reads the vertex data.

Parameters:
id  The CCMIOID of the vertices.
dims  Returns the dimensionality of the vertex (i.e. 2 or 3). May be NULL if the information is not desired.
scale  Returns the scaling factor. May be NULL if the information is not desired.
mapID  Returns the CCMIOID of the map corresponding to this entity. May be NULL if the information is not desired.
vertices  A two dimensional array of size [nVerts][dims]. Must be pre-allocated to the correct size. May be NULL if the information is not desired.
start  The offset (in units of vertices) of the starting vertex.
end  The offset (in units of vertices) of the ending vertex. Data from start to end - 1 will be read. If end is kCCMIOEnd, data will be read from 'start' to the end of the data.
Examples:
readexample.cpp, and rewriteexample.cpp.

CCMIOError CCMIOSetTitle (  CCMIOError *    err,
CCMIONode    root,
char const *    title
) 
 

Sets the title of the file.

The string must be null-terminated.

CCMIOError CCMIOSetVersion (  CCMIOError *    err,
CCMIONode    root,
int    version
) 
 

Sets the version number of the file.

CCMIOError CCMIOV2WriteFaceCells (  CCMIOError *    err,
CCMIOID    entity,
CCMIOEntity    which,
CCMIOSize    nFace,
int const *    cells,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

For internal use only.

Writes the face data. See CCMIOReadFaces() for a description of the parameters.

Note: When writing partial arrays, the first block of the array you write must have start equal to zero.

CCMIOError CCMIOWriteCells (  CCMIOError *    err,
CCMIOID    id,
CCMIOID    mapID,
int *    cellTypes,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Writes the cell data.

Parameters:
id  The CCMIOID of the cell entity.
mapID  The CCMIOID of the map corresponding to this entity.
cellTypes  Returns an array of cell type information.
start  The beginning cell.
end  The ending cell. Data from 'start' to 'end' -1 will be read. If end is zero, data will be written from 'start' to the end of the data. Note: When writing partial arrays, the first block of the array you write must have start equal to kCCMIOStart.
Examples:
rewriteexample.cpp, and writeexample.cpp.

CCMIOError CCMIOWriteConstantFieldDatad (  CCMIOError *    err,
CCMIOID    fieldData,
CCMIOID    mapID,
CCMIODataLocation    loc,
double    value
) 
 

Writes data for a field that is constant.

See CCMIOWriteConstantFieldDataf() for a description of the parameters.

Examples:
rewriteexample.cpp.

CCMIOError CCMIOWriteConstantFieldDataf (  CCMIOError *    err,
CCMIOID    fieldData,
CCMIOID    mapID,
CCMIODataLocation    loc,
float    value
) 
 

Writes data for a field that is constant.

Note that it is possible for one type of data (e.g. kCCMIOCellValues) to be constant and another type to be specified. (Whether this is meaningful is another issue.)

Parameters:
fieldData  The CCMIOID of the field entity.
mapID  The CCMIOID of the map corresponding to this field.
loc  What type of data this node is (cell, vertex, face)
value  The constant value.
Examples:
rewriteexample.cpp, and writeexample.cpp.

CCMIOError CCMIOWriteConstantFieldDatai (  CCMIOError *    err,
CCMIOID    fieldData,
CCMIOID    mapID,
CCMIODataLocation    loc,
int    value
) 
 

Writes data for a field that is constant.

See CCMIOWriteConstantFieldDataf() for a description of the parameters.

Examples:
rewriteexample.cpp.

CCMIOError CCMIOWriteFaceCells (  CCMIOError *    err,
CCMIOID    entity,
CCMIOEntity    which,
CCMIOID    mapID,
int const *    cells,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Writes the face data.

See CCMIOReadFaces() for a description of the parameters.

Note: When writing partial arrays, the first block of the array you write must have start equal to zero.

Examples:
rewriteexample.cpp, and writeexample.cpp.

CCMIOError CCMIOWriteFaces (  CCMIOError *    err,
CCMIOID    entity,
CCMIOEntity    which,
CCMIOID    mapID,
CCMIOSize    streamSize,
int const *    vertexStream,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Writes the face data.

See CCMIOReadFaces() for a description of the parameters.

Parameters:
streamSize  The total number of integers in the vertex stream.
vertexStream  The stream of vertices that compose a face. This should be in the form:
nVerts v1 v2 ... vn
nVerts v1 v2 ... vn
   ...

Note: When writing partial arrays, the first block of the array you write must have start equal to zero.
Examples:
rewriteexample.cpp, and writeexample.cpp.

CCMIOError CCMIOWriteFieldDatad (  CCMIOError *    err,
CCMIOID    fieldData,
CCMIOID    mapID,
CCMIODataLocation    loc,
double *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Writes the data for a field.

See CCMIOWriteFieldDataf() for a description of the paramaters.

Examples:
rewriteexample.cpp.

CCMIOError CCMIOWriteFieldDataf (  CCMIOError *    err,
CCMIOID    fieldData,
CCMIOID    mapID,
CCMIODataLocation    loc,
float *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Writes scalar data for a field.

Vector or tensor data should be written as individual components and each component written with CCMIOWriteMultiDimensionalFieldData(). Note that if CCMIOWriteMultiDimensionalFieldData() returns a kCCMIOVersionErr, this function will read an old-style field, which will return all components of the array at once, so the 'data' array will need to be 3 or 9 (depending on whether vector or tensor data is being read) times longer.

Parameters:
fieldData  The CCMIOID of the field entity.
mapID  The CCMIOID of the map corresponding to this field.
loc  What type of data this node is (cell, vertex, face)
data  The data.
start  The offset of the element pointed to by 'data'. Must Be in units of of the first element; so if float data[10][3][3]; then start can be in the range [0, 9].
end  The element one beyond the end. So to write from [2, 5], start = 2, end = 6, which writes from data[2][0][0] to data[5][3][3].
Note: When writing partial arrays, the first block of the array you write must have start equal to kCCMIOStart.
Examples:
rewriteexample.cpp, and writeexample.cpp.

CCMIOError CCMIOWriteFieldDatai (  CCMIOError *    err,
CCMIOID    fieldData,
CCMIOID    mapID,
CCMIODataLocation    loc,
int *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Writes the data for a field.

See CCMIOWriteFieldDataf() for a description of the paramaters.

Examples:
rewriteexample.cpp, and writeexample.cpp.

CCMIOError CCMIOWriteLagrangianData (  CCMIOError *    err,
CCMIOID    lagrangian,
char const *    positionsFile,
CCMIOID *    positions,
char const *    solutionFile,
CCMIOID *    solution
) 
 

Writes Lagrangian data.

Parameters:
positionsFile  The file that contains the positions node, NULL for this file.
positions  The node that contains the positions. This node must be a kCCMIOVertices node. (Vertices and positions ultimately store the same data) This node may be NULL if no position data is to be written.
solutionFile  The file containing the solution node, or NULL for this file.
solution  The solution node (field set entity). May be NULL if not solution data is to be written.
Examples:
rewriteexample.cpp, and writeexample.cpp.

CCMIOError CCMIOWriteMap (  CCMIOError *    err,
CCMIOID    id,
CCMIOSize    n,
CCMIOSize    max,
int const *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Writes the map data.

Parameters:
id  The CCMIOID of the map.
n  The total number of elements to be written.
max  The maximum element value.
data  The map data.
start  The offset of the starting data.
end  The offset of the ending data. Data from start to end - 1 will be written. If end is kCCMIOEnd, data will be writen from 'start' to the end of the data.
To write the whole array, set start to kCCMIOStart and end to kCCMIOEnd.

Note: When writing partial arrays, the first block of the array you write must have start equal to kCCMIOStart.

Examples:
rewriteexample.cpp, and writeexample.cpp.

CCMIOError CCMIOWriteMultiDimensionalFieldData (  CCMIOError *    err,
CCMIOID    fieldID,
CCMIOComponent    component,
CCMIOID    componentField
) 
 

Writes one component of a vector or tensor data field.

Parameters:
fieldID  The postdata field.
component  The component (kCCMIOVectorX to kCCMIOVectorZ and kCCMIOTensorXX to kCCMIOTensorZZ). All components should be specified. If a component is not specified, the application is free to use whatever default value it feels is correct.
componentField  The component field ID.
Examples:
rewriteexample.cpp, and writeexample.cpp.

CCMIOError CCMIOWriteOpt1d (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
CCMIOSize    n,
double const *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Writes a one-dimensional array to a child node of 'parent' with name 'name'.

See CCMIOWriteOpt1f() for a complete description.

CCMIOError CCMIOWriteOpt1f (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
CCMIOSize    n,
float const *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Writes a one-dimensional array to a child node of 'parent' with name 'name'.

If the child node does not exist it will be created and in either case its size and data type will be automatically set to the proper values.

Parameters:
parent  The parent entity.
name  Name of the child node.
n  The total number of elements to be written. If not writing the entire array this is the number of elements that will be ultmately be written.
data  The data to be written.
start  When writing partial arrays, where to start writing.
end  When writing partial arrays, where to stop writing. (The write will be from data[start] to data[start-1]) Note: When writing partial arrays, the first block of the array you write must have start equal to kCCMIOStart.

CCMIOError CCMIOWriteOpt1i (  CCMIOError *    err,
CCMIOID const    parent,
char const *    name,
CCMIOSize const    n,
int const *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Writes a one-dimensional array to a child node of 'parent' with name 'name'.

See CCMIOWriteOpt1f() for a complete description.

Examples:
rewriteexample.cpp, and writeexample.cpp.

CCMIOError CCMIOWriteOpt2d (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
CCMIOIndex    x,
CCMIOIndex    y,
double const *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Writes a two-dimensional array to a child node of 'parent' with name 'name'.

See CCMIOWriteOpt2f() for a complete description.

CCMIOError CCMIOWriteOpt2f (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
CCMIOIndex    x,
CCMIOIndex    y,
float const *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Writes a two-dimensional array to a child node of 'parent' with name 'name'.

If the child node does not exist it will be created and in either case its size and data type will be automatically set to the proper values. 'data' is expected to be an array of data[x][y] elements. Note that although the CCM specification specifies dimension in FORTRAN ordering, the API expects C ordering. Thus a C array data[x][y] must be called as CCMIOWriteOpt2f(..., x, y, ...), even though the dimensions will be reversed on disk.

Parameters:
parent  The parent node.
name  Name of the child entity.
x  The size of the first C dimension.
y  The size of the second C dimension.
data  The data to be written.
start  The offset of the element pointed to by 'data'. Must Be in units of of the first element; so if float data[10][3]; then start can be in the range [0, 9].
end  The element one beyond the end. So to write from [2, 5], start = 2, end = 6, which writes from data[2][0] to data[5][3]. Note: When writing partial arrays, the first block of the array you write must have start equal to kCCMIOStart.

CCMIOError CCMIOWriteOpt2i (  CCMIOError *    err,
CCMIOID const    parent,
char const *    name,
CCMIOIndex    x,
CCMIOIndex    y,
int const *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Writes a two-dimensional array to a child node of 'parent' with name 'name'.

See CCMIOWriteOpt2f() for a complete description.

CCMIOError CCMIOWriteOpt3d (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
CCMIOIndex    x,
CCMIOIndex    y,
CCMIOIndex    z,
double const *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Writes a three-dimensional array to a child node of 'parent' with name 'name'.

See CCMIOWriteOpt3f() for a complete description.

CCMIOError CCMIOWriteOpt3f (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
CCMIOIndex    x,
CCMIOIndex    y,
CCMIOIndex    z,
float const *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Writes a three-dimensional array to a child node of 'parent' with name 'name'.

If the child node does not exist it will be created and in either case its size and data type will be automatically set to the proper values. 'data' is expected to be an array of data[x][y] elements. Note that although the CCM specification specifies dimension in FORTRAN ordering, the API expects C ordering. Thus a C array data[x][y] must be called as CCMIOWriteOpt3f(..., x, y, z, ...), even though the dimensions will be reversed on disk.

Parameters:
parent  The parent node.
name  Name of the child entity.
isC  TRUE if 'data' is in C array order, FALSE if in Fortran array order.
x  The size of the first dimension.
y  The size of the second dimension.
z  The size of the third dimension.
data  The data to be written.
start  The offset of the element pointed to by 'data'. Must be in units of of the first element; so if float data[10][3][3]; then start can be in the range [0, 9].
end  The element one beyond the end. So to write from [2, 5], start = 2, end = 6, which writes from data[2][0][0] to data[5][3][3]. Note: When writing partial arrays, the first block of the array you write must have start equal to kCCMIOStart.

CCMIOError CCMIOWriteOpt3i (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
CCMIOIndex    x,
CCMIOIndex    y,
CCMIOIndex    z,
int const *    data,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Writes a three-dimensional array to a child node of 'parent' with name 'name'.

See CCMIOWriteOpt3f() for a complete description.

CCMIOError CCMIOWriteOptd (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
double    value
) 
 

Creates a child node of parent with given name and scalar value.

If the node already exists it will be overwritten.

Parameters:
parent  The parent entity.
name  Name of the child node.
value  Scalar value to be written.

CCMIOError CCMIOWriteOptf (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
float    value
) 
 

Creates a child node of parent with given name and scalar value.

If the node already exists it will be overwritten.

Parameters:
parent  The parent entity.
name  Name of the child node.
value  Scalar value to be written.
Examples:
rewriteexample.cpp, and writeexample.cpp.

CCMIOError CCMIOWriteOpti (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
int    value
) 
 

Creates a child node of parent with given name and scalar value.

If the node already exists it will be overwritten.

Parameters:
parent  The parent entity.
name  Name of the child node.
value  Scalar value to be written.

CCMIOError CCMIOWriteOptstr (  CCMIOError *    err,
CCMIOID    parent,
char const *    name,
char const *    value
) 
 

Creates a child node of parent with given name and string value.

If the node already exists it will be overwritten.

Parameters:
parent  The parent entity.
name  Name of the child node.
value  Null-terminated string.
Examples:
rewriteexample.cpp, and writeexample.cpp.

CCMIOError CCMIOWriteProcessor (  CCMIOError *    err,
CCMIOID    processor,
char const *    verticesFile,
CCMIOID *    vertices,
char const *    topologyFile,
CCMIOID *    topology,
char const *    initialFieldFile,
CCMIOID *    initialField,
char const *    solutionFile,
CCMIOID *    solution
) 
 

Writes the processor information.

Parameters:
processor  The CCMIOID of the processor entity.
verticesFile  The name of the file that the vertices are stored in. NULL indicates the current file.
vertices  The CCMIOID of the vertices entity. If NULL, vertices information will be unchanged.
topologyFile  The name of the file that the mesh is stored in. NULL indicates the current file.
topology  The CCMIOID of the mesh entity. If NULL, mesh information will be unchanged.
initialFieldFile  The name of the file that the inital field is stored in. NULL indicates the current file.
initialField  The CCMIOID of the initial field set entity. If NULL, the initial field information will be unchanged.
solutionFile  The name of the file that the solution data is stored in. NULL indicates the current file.
vertices  The CCMIOID of the solution data field set entity. If NULL, vertices information will be unchanged.
Examples:
rewriteexample.cpp, and writeexample.cpp.

CCMIOError CCMIOWriteRestartInfo (  CCMIOError *    err,
CCMIOID    restartInfo,
char const *    solverName,
int    iteration,
float    time,
char const *    timeUnits,
float    startAngle
) 
 

Writes the solver restart entity.

Parameters:
restartInfo  The restart entity.
solverName  The name of the solver that is writing this node. only the first kCCMIOMaxStringLength characters are meaningful.
iteration  The iteration number.
time  The time (in solver units, with 0.0 being the initial time).
timeUnits  A string describing the units of time. If NULL, the units default to "s".
startAngle  The starting angle of the mesh. Should be 0.0 if the mesh is not rotating.
Examples:
rewriteexample.cpp, and writeexample.cpp.

CCMIOError CCMIOWriteState (  CCMIOError *    err,
CCMIOID    state,
CCMIOID    problemDescription,
char const *    description
) 
 

Writes the problem description node to the state.

Note that there is not an CCMIOReadState(); this functionality is incorporated in CCMIOGetState().

Parameters:
description  Optional character string describing the state. Pass NULL for no description (note that this will remove any existing description).
Examples:
rewriteexample.cpp, and writeexample.cpp.

CCMIOError CCMIOWriteVerticesd (  CCMIOError *    err,
CCMIOID    id,
int    dims,
float    scale,
CCMIOID    mapID,
double const *    vertices,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Writes the vertex data.

Parameters:
id  The CCMIOID of the vertices.
dims  Returns the dimensionality of the vertex (i.e. 2 or 3).
scale  Returns the scaling factor.
mapID  Returns the CCMIOID of the map corresponding to this entity.
vertices  A two dimensional array of size [nVerts][dims].
start  The offset (in units of vertices) of the starting vertex.
end  The offset (in units of vertices) of the ending vertex. Data from start to end - 1 will be read. If end is kCCMIOEnd, data will be written from 'start' to the end of the data.
To write the whole array, set start to kCCMIOStart and end to kCCMIOEnd.

Note: When writing partial arrays, the first block of the array you write must have start equal to zero.

CCMIOError CCMIOWriteVerticesf (  CCMIOError *    err,
CCMIOID    id,
int    dims,
float    scale,
CCMIOID    mapID,
float const *    vertices,
CCMIOIndex    start,
CCMIOIndex    end
) 
 

Writes the vertex data.

Parameters:
id  The CCMIOID of the vertices.
dims  Returns the dimensionality of the vertex (i.e. 2 or 3).
scale  Returns the scaling factor.
mapID  Returns the CCMIOID of the map corresponding to this entity.
vertices  A two dimensional array of size [nVerts][dims].
start  The offset (in units of vertices) of the starting vertex.
end  The offset (in units of vertices) of the ending vertex. Data from start to end - 1 will be read. If end is kCCMIOEnd, data will be written from 'start' to the end of the data.
To write the whole array, set start to kCCMIOStart and end to kCCMIOEnd.

Note: When writing partial arrays, the first block of the array you write must have start equal to zero.

Examples:
rewriteexample.cpp, and writeexample.cpp.


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