libMesh::ExodusII_IO_Helper::NamesData Class Reference

#include <exodusII_io_helper.h>

List of all members.

Public Member Functions

 NamesData (size_t size)
 ~NamesData ()
void push_back_entry (const std::string &name)
int write_to_exodus (int ex_id, exII::ex_entity_type type)

Private Attributes

char ** data_table
size_t counter
size_t table_size

Detailed Description

This class is useful for managing the names for named entities in an ExodusII fortmat

Definition at line 1134 of file exodusII_io_helper.h.


Constructor & Destructor Documentation

libMesh::ExodusII_IO_Helper::NamesData::NamesData ( size_t  size  )  [explicit]

Definition at line 1901 of file exodusII_io_helper.C.

References data_table.

01901                                                   :
01902     data_table(new char *[size]),
01903     counter(0),
01904     table_size(size)
01905 {
01906   for (size_t i=0; i<size; ++i)
01907     data_table[i] = new char[MAX_STR_LENGTH];
01908 }

libMesh::ExodusII_IO_Helper::NamesData::~NamesData (  ) 

Definition at line 1912 of file exodusII_io_helper.C.

References data_table, and table_size.

01913 {
01914   for (size_t i=0; i<table_size; ++i)
01915     delete [] data_table[i];
01916   delete [] data_table;
01917 }


Member Function Documentation

void libMesh::ExodusII_IO_Helper::NamesData::push_back_entry ( const std::string &  name  ) 

Adds another name to the current data table

Definition at line 1921 of file exodusII_io_helper.C.

References counter, data_table, and table_size.

Referenced by libMesh::ExodusII_IO_Helper::write_elements().

01922 {
01923   libmesh_assert_less (counter, table_size);
01924 
01925   data_table[counter][ name.copy(data_table[counter], name.length()) ] = '\0';
01926   ++counter;
01927 }

int libMesh::ExodusII_IO_Helper::NamesData::write_to_exodus ( int  ex_id,
exII::ex_entity_type  type 
)

Writes the datastructure to the specified ExodusII file

Definition at line 1931 of file exodusII_io_helper.C.

References data_table, ex_put_names(), and table_size.

Referenced by libMesh::ExodusII_IO_Helper::write_elements().

01932 {
01933   if (table_size)
01934     return exII::ex_put_names(ex_id, type, data_table);
01935   return 0; // EX_NOERR
01936 }


Member Data Documentation

Definition at line 1153 of file exodusII_io_helper.h.

Referenced by push_back_entry().


The documentation for this class was generated from the following files:

Site Created By: libMesh Developers
Last modified: February 05 2013 19:55:18 UTC

Hosted By:
SourceForge.net Logo