MOAB: Mesh Oriented datABase  (version 5.4.1)
Node coordinate data.
+ Collaboration diagram for Node coordinate data.:

Functions

int mhdf_haveNodes (mhdf_FileHandle file_handle, mhdf_Status *status)
hid_t mhdf_createNodeCoords (mhdf_FileHandle file_handle, int dimension, long num_nodes, long *first_node_id_out, mhdf_Status *status)
 Create new table for node coordinate data.
hid_t mhdf_openNodeCoords (mhdf_FileHandle file_handle, long *num_nodes_out, int *dimension_out, long *first_node_id_out, mhdf_Status *status)
 Open table containing node coordinate data.
hid_t mhdf_openNodeCoordsSimple (mhdf_FileHandle file_handle, mhdf_Status *status)
void mhdf_writeNodeCoords (hid_t data_handle, long offset, long count, const double *coords, mhdf_Status *status)
 Write node coordinate data.
void mhdf_writeNodeCoordsWithOpt (hid_t data_handle, long offset, long count, const double *coords, hid_t write_prop, mhdf_Status *status)
void mhdf_writeNodeCoord (hid_t data_handle, long offset, long count, int dimension, const double *coords, mhdf_Status *status)
 Write node coordinate data.
void mhdf_writeNodeCoordWithOpt (hid_t data_handle, long offset, long count, int dimension, const double *coords, hid_t write_prop, mhdf_Status *status)
void mhdf_readNodeCoords (hid_t data_handle, long offset, long count, double *coordinates, mhdf_Status *status)
 Read node coordinate data.
void mhdf_readNodeCoordsWithOpt (hid_t data_handle, long offset, long count, double *coordinates, hid_t read_prop, mhdf_Status *status)
void mhdf_readNodeCoord (hid_t data_handle, long offset, long count, int dimension, double *coords, mhdf_Status *status)
 Read node coordinate data.
void mhdf_readNodeCoordWithOpt (hid_t data_handle, long offset, long count, int dimension, double *coords, hid_t read_prop, mhdf_Status *status)

Function Documentation

hid_t mhdf_createNodeCoords ( mhdf_FileHandle  file_handle,
int  dimension,
long  num_nodes,
long *  first_node_id_out,
mhdf_Status status 
)

Create new table for node coordinate data.

Parameters:
file_handleThe file.
dimensionNumber of coordinate values per node.
num_nodesThe number of nodes the table will contain.
first_node_id_outNodes are assigned IDs sequentially in the order they occur in the table, where the ID of the first node in the table is this passed-back value.
statusPassed back status of API call.
Returns:
An HDF5 handle to the coordinate table.

Definition at line 72 of file nodes.c.

References API_BEGIN, API_END_H, struct_FileHandle::hdf_handle, struct_FileHandle::max_id, mhdf_check_valid_file(), mhdf_create_scalar_attrib(), mhdf_create_table(), mhdf_setFail(), mhdf_setOkay(), mhdf_write_max_id(), NODE_COORD_PATH, struct_FileHandle::open_handle_count, and START_ID_ATTRIB.

Referenced by moab::WriteHDF5Parallel::create_node_table(), and moab::WriteHDF5::serial_create_file().

{
    FileHandle* file_ptr = (FileHandle*)file_handle;
    hid_t table_id;
    hsize_t dims[2];
    long first_id;
    API_BEGIN;

    if( !mhdf_check_valid_file( file_ptr, status ) ) return -1;

    if( dimension < 1 )
    {
        mhdf_setFail( status, "Invalid argument: dimension = %d.", dimension );
        return -1;
    }

    dims[0]  = (hsize_t)num_nodes;
    dims[1]  = (hsize_t)dimension;
    table_id = mhdf_create_table( file_ptr->hdf_handle, NODE_COORD_PATH, H5T_NATIVE_DOUBLE, 2, dims, status );
    if( table_id < 0 ) return -1;

    first_id = file_ptr->max_id + 1;
    if( !mhdf_create_scalar_attrib( table_id, START_ID_ATTRIB, H5T_NATIVE_LONG, &first_id, status ) )
    {
        H5Dclose( table_id );
        return -1;
    }

    *first_id_out = first_id;
    file_ptr->max_id += num_nodes;
    if( !mhdf_write_max_id( file_ptr, status ) )
    {
        H5Dclose( table_id );
        return -1;
    }
    file_ptr->open_handle_count++;
    mhdf_setOkay( status );

    API_END_H( 1 );
    return table_id;
}
int mhdf_haveNodes ( mhdf_FileHandle  file,
mhdf_Status status 
)

MOAB, a Mesh-Oriented datABase, is a software component for creating, storing and accessing finite element mesh data.

Copyright 2004 Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

Definition at line 26 of file nodes.c.

References API_BEGIN, API_END, struct_FileHandle::hdf_handle, mhdf_check_valid_file(), mhdf_is_in_group(), mhdf_setFail(), mhdf_setOkay(), NODE_COORD_NAME, NODE_GROUP, NODE_GROUP_NAME, and ROOT_GROUP.

Referenced by mhdf_getFileSummary().

{
    FileHandle* file_ptr = (FileHandle*)file;
    hid_t root_id, node_id;
    int result;
    API_BEGIN;

    if( !mhdf_check_valid_file( file_ptr, status ) ) return -1;

#if defined( H5Gopen_vers ) && H5Gopen_vers > 1
    root_id = H5Gopen2( file_ptr->hdf_handle, ROOT_GROUP, H5P_DEFAULT );
#else
    root_id = H5Gopen( file_ptr->hdf_handle, ROOT_GROUP );
#endif
    if( root_id < 0 )
    {
        mhdf_setFail( status, "H5Gopen( \"%s\" ) failed.", ROOT_GROUP );
        return -1;
    }

    result = mhdf_is_in_group( root_id, NODE_GROUP_NAME, status );
    if( result < 1 )
    {
        H5Gclose( root_id );
        return result;
    }

#if defined( H5Gopen_vers ) && H5Gopen_vers > 1
    node_id = H5Gopen2( root_id, NODE_GROUP_NAME, H5P_DEFAULT );
#else
    node_id = H5Gopen( root_id, NODE_GROUP_NAME );
#endif
    H5Gclose( root_id );
    if( node_id < 0 )
    {
        mhdf_setFail( status, "H5Gopen( \"%s\" ) failed.", NODE_GROUP );
        return -1;
    }

    result = mhdf_is_in_group( node_id, NODE_COORD_NAME, status );
    if( result >= 0 ) mhdf_setOkay( status );
    H5Gclose( node_id );
    API_END;
    return result;
}
hid_t mhdf_openNodeCoords ( mhdf_FileHandle  file_handle,
long *  num_nodes_out,
int *  dimension_out,
long *  first_node_id_out,
mhdf_Status status 
)

Open table containing node coordinate data.

Parameters:
file_handleThe file.
dimension_outNumber of coordinate values per node.
num_nodes_outThe number of nodes the table contains.
first_node_id_outNodes are assigned IDs sequentially in the order they occur in the table, where the ID of the first node in the table is this passed-back value.
statusPassed back status of API call.
Returns:
An HDF5 handle to the coordinate table.

Definition at line 118 of file nodes.c.

References API_BEGIN, API_END_H, struct_FileHandle::hdf_handle, mhdf_check_valid_file(), mhdf_open_table2(), mhdf_setOkay(), NODE_COORD_PATH, and struct_FileHandle::open_handle_count.

Referenced by main(), mhdf_getFileSummary(), and moab::WriteHDF5::write_nodes().

{
    FileHandle* file_ptr = (FileHandle*)file_handle;
    hid_t table_id;
    hsize_t dims[2];
    API_BEGIN;

    if( !mhdf_check_valid_file( file_ptr, status ) ) return -1;

    table_id = mhdf_open_table2( file_ptr->hdf_handle, NODE_COORD_PATH, 2, dims, first_id_out, status );
    if( table_id < 0 ) return -1;

    *num_nodes_out = dims[0];
    *dimension_out = dims[1];
    file_ptr->open_handle_count++;
    mhdf_setOkay( status );
    API_END_H( 1 );
    return table_id;
}
hid_t mhdf_openNodeCoordsSimple ( mhdf_FileHandle  file_handle,
mhdf_Status status 
)

Definition at line 142 of file nodes.c.

References API_BEGIN, API_END_H, struct_FileHandle::hdf_handle, mhdf_check_valid_file(), mhdf_open_table_simple(), mhdf_setOkay(), NODE_COORD_PATH, and struct_FileHandle::open_handle_count.

Referenced by moab::ReadHDF5::read_nodes().

{
    FileHandle* file_ptr = (FileHandle*)file_handle;
    hid_t table_id;
    API_BEGIN;

    if( !mhdf_check_valid_file( file_ptr, status ) ) return -1;

    table_id = mhdf_open_table_simple( file_ptr->hdf_handle, NODE_COORD_PATH, status );
    if( table_id < 0 ) return -1;

    file_ptr->open_handle_count++;
    mhdf_setOkay( status );
    API_END_H( 1 );
    return table_id;
}
void mhdf_readNodeCoord ( hid_t  data_handle,
long  offset,
long  count,
int  dimension,
double *  coords,
mhdf_Status status 
)

Read node coordinate data.

Read a single coordinate value (e.g. the 'x' coordinate) for a block of nodes.

Parameters:
data_handleHandle returned from mhdf_createNodeCoords or mhdf_openNodeCoords.
offsetTable row (node index) at which to start reading.
countNumber of rows (number of nodes) to read.
dimensionThe coordinate to read (0->x, 1->y, ...)
coordsBuffer in which to write node coordinate data.
statusPassed back status of API call.

Definition at line 219 of file nodes.c.

References API_BEGIN, API_END, and mhdf_read_column().

{
    API_BEGIN;
    mhdf_read_column( table_id, dimension, offset, count, H5T_NATIVE_DOUBLE, coords, H5P_DEFAULT, status );
    API_END;
}
void mhdf_readNodeCoords ( hid_t  data_handle,
long  offset,
long  count,
double *  coordinates,
mhdf_Status status 
)

Read node coordinate data.

Read interleaved coordinate data for a block of nodes

Parameters:
data_handleHandle returned from mhdf_createNodeCoords or mhdf_openNodeCoords.
offsetTable row (node index) at which to start reading.
countNumber of rows (number of nodes) to read.
coordinatesBuffer in which to write node coordinate data.
statusPassed back status of API call.

Definition at line 177 of file nodes.c.

References API_BEGIN, API_END, and mhdf_read_data().

Referenced by main().

{
    API_BEGIN;
    mhdf_read_data( table_id, offset, count, H5T_NATIVE_DOUBLE, coords, H5P_DEFAULT, status );
    API_END;
}
void mhdf_readNodeCoordsWithOpt ( hid_t  data_handle,
long  offset,
long  count,
double *  coordinates,
hid_t  read_prop,
mhdf_Status status 
)

Definition at line 183 of file nodes.c.

References API_BEGIN, API_END, and mhdf_read_data().

{
    API_BEGIN;
    mhdf_read_data( table_id, offset, count, H5T_NATIVE_DOUBLE, coords, prop, status );
    API_END;
}
void mhdf_readNodeCoordWithOpt ( hid_t  data_handle,
long  offset,
long  count,
int  dimension,
double *  coords,
hid_t  read_prop,
mhdf_Status status 
)

Definition at line 225 of file nodes.c.

References API_BEGIN, API_END, and mhdf_read_column().

{
    API_BEGIN;
    mhdf_read_column( table_id, dimension, offset, count, H5T_NATIVE_DOUBLE, coords, prop, status );
    API_END;
}
void mhdf_writeNodeCoord ( hid_t  data_handle,
long  offset,
long  count,
int  dimension,
const double *  coords,
mhdf_Status status 
)

Write node coordinate data.

Write a single coordinate value (e.g. the 'x' coordinate) for a block of nodes.

Parameters:
data_handleHandle returned from mhdf_createNodeCoords or mhdf_openNodeCoords.
offsetTable row (node index) at which to start writing.
countNumber of rows (number of nodes) to write.
dimensionThe coordinate to write (0->x, 1->y, ...)
coordsCoordinate list.
statusPassed back status of API call.

Definition at line 195 of file nodes.c.

References API_BEGIN, API_END, and mhdf_write_column().

{
    API_BEGIN;
    mhdf_write_column( table_id, dimension, offset, count, H5T_NATIVE_DOUBLE, coords, H5P_DEFAULT, status );
    API_END;
}
void mhdf_writeNodeCoords ( hid_t  data_handle,
long  offset,
long  count,
const double *  coords,
mhdf_Status status 
)

Write node coordinate data.

Write interleaved coordinate data for a block of nodes

Parameters:
data_handleHandle returned from mhdf_createNodeCoords or mhdf_openNodeCoords.
offsetTable row (node index) at which to start writing.
countNumber of rows (number of nodes) to write.
coordsInterleaved node coordinate data.
statusPassed back status of API call.

Definition at line 159 of file nodes.c.

References API_BEGIN, API_END, and mhdf_write_data().

{
    API_BEGIN;
    mhdf_write_data( table_id, offset, count, H5T_NATIVE_DOUBLE, coords, H5P_DEFAULT, status );
    API_END;
}
void mhdf_writeNodeCoordsWithOpt ( hid_t  data_handle,
long  offset,
long  count,
const double *  coords,
hid_t  write_prop,
mhdf_Status status 
)

Definition at line 165 of file nodes.c.

References API_BEGIN, API_END, and mhdf_write_data().

Referenced by moab::WriteHDF5::write_nodes().

{
    API_BEGIN;
    mhdf_write_data( table_id, offset, count, H5T_NATIVE_DOUBLE, coords, prop, status );
    API_END;
}
void mhdf_writeNodeCoordWithOpt ( hid_t  data_handle,
long  offset,
long  count,
int  dimension,
const double *  coords,
hid_t  write_prop,
mhdf_Status status 
)

Definition at line 206 of file nodes.c.

References API_BEGIN, API_END, and mhdf_write_column().

Referenced by moab::WriteHDF5::write_nodes().

{
    API_BEGIN;
    mhdf_write_column( table_id, dimension, offset, count, H5T_NATIVE_DOUBLE, coords, prop, status );
    API_END;
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines