libMesh::XdrSOLN Class Reference

#include <xdr_soln.h>

Inheritance diagram for libMesh::XdrSOLN:

List of all members.

Public Types

enum  XdrIO_TYPE {
  UNKNOWN = -1, ENCODE = 0, DECODE, W_ASCII,
  R_ASCII
}

Public Member Functions

 XdrSOLN ()
void init (XdrIO_TYPE type, const char *fn, int icnt)
 ~XdrSOLN ()
int header (XdrSHEAD *hd)
int values (Real *array, int size)
void init (XdrIO_TYPE t, const char *fn, const char *type, int icnt)
void fini ()
int dataBlk (int *array, int numvar, int size)
int dataBlk (Real *array, int numvar, int size)
LegacyXdrIO::FileFormat get_orig_flag () const
void set_orig_flag (LegacyXdrIO::FileFormat in_orig_flag)
void set_num_levels (unsigned int num_levels)
unsigned int get_num_levels ()

Protected Attributes

unsigned int _num_levels
XdrIO_TYPE m_type
XDR * mp_xdr_handle
LegacyXdrIO::FileFormat orig_flag
std::ifstream mp_in
std::ofstream mp_out

Private Attributes

int m_wrtVar

Detailed Description

The XdrSOLN class. This class is responsible for reading/writing information about the solution to xdr style binary files.

Author:
Bill Barth, Robert McLay.

Definition at line 41 of file xdr_soln.h.


Member Enumeration Documentation

enum libMesh::XdrMGF::XdrIO_TYPE [inherited]

This enum specifies the access permission which will be acquired for the current xdr file. Note that it is only possible to read (DECODE) or write (ENCODE) but not both. For ASCII type files, use WRITE or READ instead!

Enumerator:
UNKNOWN 
ENCODE 
DECODE 
W_ASCII 
R_ASCII 

Definition at line 94 of file xdr_mgf.h.

00094                   {UNKNOWN = -1, ENCODE=0, DECODE,
00095                    W_ASCII , R_ASCII};


Constructor & Destructor Documentation

libMesh::XdrSOLN::XdrSOLN (  )  [inline]

Constructor. Initializes m_wrtVar to -1.

Definition at line 48 of file xdr_soln.h.

00048 : m_wrtVar(-1) {}

libMesh::XdrSOLN::~XdrSOLN (  )  [inline]

Destructor.

Definition at line 65 of file xdr_soln.h.

00065 {}


Member Function Documentation

int libMesh::XdrMGF::dataBlk ( Real array,
int  numvar,
int  size 
) [inherited]

Read/Writes a block of Reals to/from the current xdr file/file handle.

Definition at line 341 of file xdr_mgf.C.

References libMesh::XdrMGF::DECODE, libMesh::XdrMGF::ENCODE, libMesh::XdrMGF::m_type, libMesh::XdrMGF::mp_in, libMesh::XdrMGF::mp_out, libMesh::XdrMGF::mp_xdr_handle, libMesh::XdrMGF::R_ASCII, libMesh::Real, and libMesh::XdrMGF::W_ASCII.

00342 {
00343   int totalSize = numvar*size;
00344 
00345   // If this function is called by coord(),
00346   // numvar is the problem dimension, and
00347   // size is the number of nodes in the problem.
00348 
00349   //libMesh::out << "Total amount of data to be written: " << totalSize << std::endl;
00350 
00351   switch (m_type)
00352     {
00353 
00354 #ifdef LIBMESH_HAVE_XDR
00355 
00356     case (XdrMGF::DECODE):
00357     case (XdrMGF::ENCODE):
00358       {
00359         // FIXME - this is probably broken for Real == long double
00360         // RHS
00361         xdr_vector(mp_xdr_handle,
00362                    (char *) &array[0],
00363                    totalSize,
00364                    sizeof(Real),
00365                    (xdrproc_t) xdr_REAL);
00366       }
00367 
00368 #endif
00369 
00370     case (XdrMGF::W_ASCII):
00371       {
00372         // Save stream flags
00373         std::ios_base::fmtflags out_flags = mp_out.flags();
00374 
00375         // We will use scientific notation with a precision of 16
00376         // digits in the following output.  The desired precision and
00377         // format will automatically determine the width.
00378         mp_out << std::scientific
00379                << std::setprecision(16);
00380 
00381         for (int i=0; i<size; i++)
00382           {
00383             for (int j=0; j<numvar; j++)
00384               mp_out << array[i*numvar + j] << " \t";
00385 
00386             mp_out << '\n';
00387           }
00388 
00389         // Restore stream flags
00390         mp_out.flags(out_flags);
00391 
00392         mp_out.flush();
00393         break;
00394       }
00395 
00396     case (XdrMGF::R_ASCII):
00397       {
00398         libmesh_assert (mp_in.good());
00399 
00400         for (int i=0; i<size; i++)
00401           {
00402             libmesh_assert (mp_in.good());
00403 
00404             for (int j=0; j<numvar; j++)
00405               mp_in >> array[i*numvar + j];
00406 
00407             mp_in.ignore(); // Read newline
00408           }
00409 
00410         break;
00411       }
00412 
00413     default:
00414       // Unknown access type
00415       libmesh_error();
00416     }
00417 
00418   return totalSize;
00419 }

int libMesh::XdrMGF::dataBlk ( int *  array,
int  numvar,
int  size 
) [inherited]

Reads/Writes a block of ints to/from the current xdr file/file handle.

Parameters:
array Pointer to data to be read/written
numvar The total number of variables (size of the array)
size The size of each individual variable in the array

Definition at line 278 of file xdr_mgf.C.

References libMesh::XdrMGF::DECODE, libMesh::XdrMGF::ENCODE, libMesh::XdrMGF::m_type, libMesh::XdrMGF::mp_in, libMesh::XdrMGF::mp_out, libMesh::XdrMGF::mp_xdr_handle, libMesh::XdrMGF::R_ASCII, and libMesh::XdrMGF::W_ASCII.

Referenced by libMesh::XdrMESH::BC(), libMesh::XdrMESH::coord(), libMesh::XdrMESH::Icon(), and values().

00279 {
00280   int totalSize = numvar*size;
00281 
00282   switch (m_type)
00283     {
00284 
00285 #ifdef LIBMESH_HAVE_XDR
00286 
00287     case (XdrMGF::DECODE):
00288     case (XdrMGF::ENCODE):
00289       {
00290         xdr_vector(mp_xdr_handle,
00291                    (char *) &array[0],
00292                    totalSize,
00293                    sizeof(int),
00294                    (xdrproc_t) xdr_int);
00295         break;
00296       }
00297 
00298 #endif
00299 
00300     case (XdrMGF::W_ASCII):
00301       {
00302         for (int i=0; i<size; i++)
00303           {
00304             for (int j=0; j<numvar; j++)
00305               mp_out << array[i*numvar + j] << " ";
00306 
00307             mp_out << '\n';
00308           }
00309 
00310         mp_out.flush();
00311         break;
00312       }
00313 
00314     case (XdrMGF::R_ASCII):
00315       {
00316         libmesh_assert (mp_in.good());
00317 
00318         for (int i=0; i<size; i++)
00319           {
00320             for (int j=0; j<numvar; j++)
00321               {
00322                 mp_in >> array[i*numvar + j];
00323               }
00324 
00325             mp_in.ignore(); // Read newline
00326           }
00327 
00328         break;
00329       }
00330 
00331     default:
00332       // Unknown access type
00333       libmesh_error();
00334     }
00335 
00336   return totalSize;
00337 }

void libMesh::XdrMGF::fini (  )  [inherited]

Finalizes operations on the current xdr file handle, and closes the xdr file.

Uses xdr_destroy found in rpc/rpc.h.

Definition at line 35 of file xdr_mgf.C.

References libMesh::XdrMGF::mp_fp, and libMesh::XdrMGF::mp_xdr_handle.

Referenced by libMesh::XdrMGF::init(), and libMesh::XdrMGF::~XdrMGF().

00036 {
00037 
00038 #ifdef LIBMESH_HAVE_XDR
00039 
00040   if (mp_xdr_handle)
00041     {
00042       //libMesh::out << "Destroying XDR file handle." << std::endl;
00043       xdr_destroy(mp_xdr_handle);
00044     }
00045 
00046   //libMesh::out << "Deleting the file handle pointer." << std::endl;
00047   delete mp_xdr_handle;
00048 
00049   mp_xdr_handle = NULL;
00050 
00051 #endif
00052 
00053   if (mp_fp)
00054     {
00055       //libMesh::out << "Closing file." << std::endl;
00056       std::fflush(mp_fp);
00057       std::fclose(mp_fp);
00058     }
00059 
00060   mp_fp = NULL;
00061 }

unsigned int libMesh::XdrMGF::get_num_levels (  )  [inline, inherited]

Get number of levels

Definition at line 186 of file xdr_mgf.h.

References libMesh::XdrMGF::_num_levels.

Referenced by libMesh::XdrMESH::header(), libMesh::XdrMGF::init(), and libMesh::LegacyXdrIO::read_mesh().

00186 { return _num_levels; }

LegacyXdrIO::FileFormat libMesh::XdrMGF::get_orig_flag (  )  const [inline, inherited]

Get the originator flag.

Definition at line 170 of file xdr_mgf.h.

References libMesh::XdrMGF::orig_flag.

Referenced by libMesh::XdrMGF::init(), libMesh::LegacyXdrIO::read_mesh(), and libMesh::LegacyXdrIO::write_mesh().

00170 { return orig_flag; }

int libMesh::XdrSOLN::header ( XdrSHEAD hd  ) 

Read/Write the solution header. Uses xdr_int found in rpc/rpc.h.

Parameters:
hd Pointer to an xdr solution header object
Returns:
1 on success

Definition at line 32 of file xdr_soln.C.

References libMesh::XdrMGF::DECODE, libMesh::XdrMGF::ENCODE, libMesh::XdrHEAD::getId(), libMesh::XdrHEAD::getTitle(), libMesh::XdrSHEAD::getUserTitle(), libMesh::XdrSHEAD::getVarTitle(), libMesh::XdrHEAD::m_kstep, libMesh::XdrHEAD::m_meshCnt, libMesh::XdrHEAD::m_numNodes, libMesh::XdrHEAD::m_numvar, libMesh::XdrHEAD::m_strSize, libMesh::XdrHEAD::m_time, libMesh::XdrMGF::m_type, m_wrtVar, libMesh::XdrHEAD::m_wrtVar, libMesh::XdrHEAD::mp_id, libMesh::XdrMGF::mp_in, libMesh::XdrMGF::mp_out, libMesh::XdrHEAD::mp_title, libMesh::XdrHEAD::mp_userTitle, libMesh::XdrHEAD::mp_varTitle, libMesh::XdrMGF::mp_xdr_handle, libMesh::XdrMGF::R_ASCII, libMesh::XdrHEAD::setId(), libMesh::XdrHEAD::setTitle(), libMesh::XdrSHEAD::setUserTitle(), libMesh::XdrSHEAD::setVarTitle(), and libMesh::XdrMGF::W_ASCII.

Referenced by libMesh::LegacyXdrIO::read_soln(), and libMesh::LegacyXdrIO::write_soln().

00033 {
00034   // Temporary variables to facilitate stream reading
00035   const int comm_len= 80;
00036   char comment[comm_len];
00037 
00038 
00039 
00040   switch (m_type)
00041     {
00042 
00043 #ifdef LIBMESH_HAVE_XDR
00044 
00045     case (XdrMGF::ENCODE):
00046     case (XdrMGF::DECODE):
00047       {
00048 
00049         xdr_int(mp_xdr_handle,  &(hd->m_wrtVar));
00050         xdr_int(mp_xdr_handle,  &(hd->m_numvar));
00051         xdr_int(mp_xdr_handle,  &(hd->m_numNodes));
00052         xdr_int(mp_xdr_handle,  &(hd->m_meshCnt));
00053         xdr_int(mp_xdr_handle,  &(hd->m_kstep));
00054         xdr_int(mp_xdr_handle,  &(hd->m_strSize));
00055         xdr_REAL(mp_xdr_handle, &(hd->m_time));
00056 
00057         m_wrtVar=hd->m_wrtVar;
00058 
00059         char* temp = const_cast<char *>(hd->getId());
00060         xdr_string(mp_xdr_handle,&(temp),
00061                    ((m_type == XdrMGF::ENCODE) ? std::strlen(temp)    : hd->m_strSize));
00062         hd->setId(temp);
00063 
00064         temp = const_cast<char *>(hd->getTitle());
00065         xdr_string(mp_xdr_handle,&(temp),
00066                    ((m_type == XdrMGF::ENCODE) ? std::strlen(temp) : hd->m_strSize));
00067         hd->setTitle(temp);
00068 
00069         temp = const_cast<char *>(hd->getUserTitle());
00070         xdr_string(mp_xdr_handle,&(temp),
00071                    ((m_type == XdrMGF::ENCODE) ? std::strlen(temp) : hd->m_strSize));
00072         hd->setUserTitle(temp);
00073 
00074 
00075         char * tempTitle = new char[hd->m_strSize*m_wrtVar];
00076 
00077 
00078         if (m_type == XdrMGF::DECODE)
00079           {
00080             int tempSize = 0;
00081             xdr_string(mp_xdr_handle, &tempTitle, hd->m_strSize*m_wrtVar);
00082             int olen= std::strlen(tempTitle);
00083             char *p;
00084             char *top = tempTitle;
00085             for (int ivar = 0; ivar < m_wrtVar; ++ivar)
00086               {
00087                 p = strchr(tempTitle,' ');
00088                 *p = '\0';
00089                 tempSize = std::strlen(tempTitle) ;
00090                 tempTitle+=tempSize+1;
00091               }
00092             tempTitle = top;
00093             hd->mp_varTitle = new char[olen];
00094             std::memcpy(hd->mp_varTitle,tempTitle,olen*sizeof(char));
00095           }
00096         else if (m_type == XdrMGF::ENCODE)
00097           {
00098             char *p = hd->mp_varTitle;
00099             char *top = tempTitle;
00100             for (int ivar = 0; ivar < m_wrtVar; ++ivar)
00101               {
00102                 int tempSize = std::strlen(p) + 1;
00103                 std::memcpy(tempTitle,p,tempSize*sizeof(char));
00104                 tempSize = std::strlen(tempTitle);
00105                 tempTitle[tempSize] = ' ';
00106                 tempTitle += tempSize+1;
00107                 p += tempSize+1;
00108               }
00109             tempTitle = top;
00110             xdr_string(mp_xdr_handle, &tempTitle, hd->m_strSize*m_wrtVar);
00111           }
00112         delete [] tempTitle;
00113 
00114         return 0;
00115       }
00116 #endif
00117 
00118 
00119     case (XdrMGF::R_ASCII):
00120       {
00121         libmesh_assert (mp_in.good());
00122 
00123         mp_in >> hd->m_numNodes ; mp_in.getline(comment, comm_len);
00124         mp_in >> hd->m_wrtVar   ; mp_in.getline(comment, comm_len);
00125         mp_in >> hd->m_strSize  ; mp_in.getline(comment, comm_len);
00126         mp_in >> hd->m_time     ; mp_in.getline(comment, comm_len);
00127 
00128         mp_in.getline(comment, comm_len);
00129         hd->setId(comment);
00130 
00131         mp_in.getline(comment, comm_len);
00132         hd->setTitle(comment);
00133 
00134         mp_in.getline(comment, comm_len);
00135         hd->setUserTitle(comment);
00136 
00137         m_wrtVar = hd->m_wrtVar;
00138 
00139         // Read the variable names
00140         {
00141           std::string var_name;
00142           char* titles = new char[hd->m_wrtVar*hd->m_strSize];
00143           unsigned int c=0;
00144 
00145           for (int var=0; var < hd->m_wrtVar; var++)
00146             {
00147               mp_in >> var_name;
00148 
00149               for (unsigned int l=0; l<var_name.size(); l++)
00150                 titles[c++] = var_name[l];
00151 
00152               titles[c++] = '\0';
00153             }
00154 
00155           mp_in.getline(comment, comm_len);
00156 
00157           hd->setVarTitle(titles, c);
00158 
00159           delete [] titles;
00160         }
00161 
00162 
00163         return 0;
00164       }
00165 
00166 
00167     case (XdrMGF::W_ASCII):
00168       {
00169         mp_out << hd->m_numNodes   << "\t # Num. Nodes\n";
00170         mp_out << hd->m_wrtVar     << "\t # Num. of Vars\n";
00171         mp_out << hd->m_strSize    << "\t # String Size (ignore)\n";
00172         mp_out << hd->m_time       << "\t # Current Time\n";
00173         mp_out << hd->mp_id        << '\n';
00174         mp_out << hd->mp_title     << '\n';
00175         mp_out << hd->mp_userTitle << '\n';
00176 
00177         // write the variable names
00178         {
00179           const char* p = hd->getVarTitle();
00180 
00181           for (int var=0; var<hd->m_wrtVar ; var++)
00182             {
00183               mp_out << p << " ";
00184               p += std::strlen(p)+1;
00185             }
00186           mp_out << "\t # Variable Names\n";
00187         }
00188 
00189         m_wrtVar = hd->m_wrtVar;
00190 
00191         return 0;
00192       }
00193 
00194 
00195 
00196     default:
00197       // Unknown access type
00198       libmesh_error();
00199 
00200     }
00201 
00202   return 1;
00203 }

void libMesh::XdrMGF::init ( XdrMGF::XdrIO_TYPE  t,
const char *  fn,
const char *  type,
int  icnt 
) [inherited]

Initialization of the xdr file. This function performs the following operations: {itemize} Closes the old xdr file if necessary.

Creates a new xdr file name and opens this file.

Opens the appropriate xdr file handle.

Reads/Writes a signature to the file.

{itemize}

Definition at line 68 of file xdr_mgf.C.

References libMesh::LegacyXdrIO::DEAL, libMesh::XdrMGF::DECODE, libMesh::XdrMGF::ENCODE, libMesh::err, libMesh::XdrMGF::fini(), libMesh::XdrMGF::get_num_levels(), libMesh::XdrMGF::get_orig_flag(), libMesh::LegacyXdrIO::LIBM, libMesh::XdrMGF::m_type, libMesh::LegacyXdrIO::MGF, libMesh::XdrMGF::mp_fp, libMesh::XdrMGF::mp_in, libMesh::XdrMGF::mp_out, libMesh::XdrMGF::mp_xdr_handle, libMesh::Quality::name(), libMesh::XdrMGF::orig_flag, libMesh::out, libMesh::XdrMGF::R_ASCII, libMesh::XdrMGF::tokenize_first_line(), and libMesh::XdrMGF::W_ASCII.

00069 {
00070   m_type=t;
00071 
00072   // Close old file if necessary
00073   if (mp_fp) this->fini();
00074 
00075 
00076   // Open file
00077   switch (m_type)
00078     {
00079 
00080 #ifdef LIBMESH_HAVE_XDR
00081 
00082     case (XdrMGF::ENCODE):
00083     case (XdrMGF::DECODE):
00084       {
00085         mp_fp = fopen (fn, (m_type == ENCODE) ? "w" : "r");
00086 
00087         // Make sure the file is ready for use
00088         if (!mp_fp)
00089           {
00090             libMesh::err << "XDR Error: Accessing file: "
00091                           << fn
00092                           << " failed."
00093                           << std::endl;
00094             libmesh_error();
00095           }
00096 
00097         // Create the XDR handle
00098         mp_xdr_handle = new XDR;
00099         xdrstdio_create(mp_xdr_handle,
00100                         mp_fp,
00101                         ((m_type == ENCODE) ? XDR_ENCODE : XDR_DECODE));
00102 
00103         break;
00104       }
00105 
00106 #endif
00107 
00108     case (XdrMGF::R_ASCII):
00109       {
00110         mp_in.open(fn, std::ios::in);
00111 
00112         // Make sure it opened correctly
00113         if (!mp_in.good())
00114           libmesh_file_error(fn);
00115 
00116         break;
00117       }
00118 
00119     case (XdrMGF::W_ASCII):
00120       {
00121         mp_out.open(fn, std::ios::out);
00122 
00123         // Make sure it opened correctly
00124         if (!mp_out.good())
00125           libmesh_file_error(fn);
00126 
00127         break;
00128       }
00129 
00130     default:
00131       {
00132         libMesh::out << "Unrecognized file access type!" << std::endl;
00133         libmesh_error();
00134       }
00135     }
00136 
00137 
00138 
00139 
00140 
00141   // Read/Write the file signature
00142   const int  bufLen = 12;
00143   char       buf[bufLen+1];
00144 
00145   switch (m_type)
00146     {
00147 
00148 #ifdef LIBMESH_HAVE_XDR
00149 
00150     case (XdrMGF::ENCODE):
00151       {
00152         char* p = &buf[0];
00153         const LegacyXdrIO::FileFormat orig = this->get_orig_flag();
00154 
00155         std::ostringstream name;
00156         if (orig == LegacyXdrIO::DEAL)
00157           name << "DEAL 003:003";
00158 
00159         else if (orig == LegacyXdrIO::MGF)
00160           name << "MGF  002:000";
00161 
00162         else if (orig == LegacyXdrIO::LIBM)
00163           name << "LIBM " << this->get_num_levels();
00164 
00165         else
00166           libmesh_error();
00167 
00168         // Fill the buffer
00169         std::sprintf(&buf[0], "%s", name.str().c_str());
00170 
00171         xdr_string(mp_xdr_handle, &p, bufLen);  // Writes binary signature
00172 
00173         break;
00174       }
00175 
00176     case (XdrMGF::DECODE):
00177       {
00178         char* p = &buf[0];
00179         xdr_string(mp_xdr_handle, &p, bufLen); // Reads binary signature
00180 
00181         // Set the number of levels used in the mesh
00182         this->tokenize_first_line(p);
00183 
00184         break;
00185       }
00186 
00187 #endif
00188 
00189     case (XdrMGF::W_ASCII):
00190       {
00191         const LegacyXdrIO::FileFormat orig = this->get_orig_flag();
00192 
00193         if (orig == LegacyXdrIO::DEAL)
00194           std::sprintf(&buf[0], "%s %03d:%03d", "DEAL", 3, 3);
00195 
00196         else if (orig == LegacyXdrIO::MGF)
00197           std::sprintf(&buf[0], "%s %03d:%03d", "MGF ", 2, 0);
00198 
00199         else if (orig == LegacyXdrIO::LIBM)
00200           std::sprintf(&buf[0], "%s %d", "LIBM", this->get_num_levels());
00201 
00202         mp_out << buf << '\n';
00203 
00204         break;
00205       }
00206 
00207     case (XdrMGF::R_ASCII):
00208       {
00209 
00210 #ifdef __HP_aCC
00211         // weirdly, _only_ here aCC
00212         // is not fond of mp_in.getline()
00213         // however, using mp_in.getline()
00214         // further below is ok...
00215         std::string buf_buf;
00216         std::getline (mp_in, buf_buf, '\n');
00217         libmesh_assert_less_equal (buf_buf.size(), bufLen);
00218 
00219         buf_buf.copy (buf, std::string::npos);
00220 #else
00221 
00222         // Here we first use getline() to grab the very
00223         // first line of the file into a char buffer.  Then
00224         // this line is tokenized to look for:
00225         // 1.) The name LIBM, which specifies the new Mesh style.
00226         // 2.) The number of levels in the Mesh which is being read.
00227         // Note that "buf" will be further processed below, here we
00228         // are just attempting to get the number of levels.
00229         mp_in.getline(buf, bufLen+1);
00230 
00231 #endif
00232 
00233         // Determine the number of levels in this mesh
00234         this->tokenize_first_line(buf);
00235 
00236         break;
00237       }
00238 
00239     default:
00240       libmesh_error();
00241     }
00242 
00243 
00244 
00245   // If you are reading or decoding, process the signature
00246   if ((m_type == R_ASCII) || (m_type == DECODE))
00247     {
00248       char name[5];
00249       std::strncpy(name, &buf[0], 4);
00250       name[4] = '\0';
00251 
00252       if (std::strcmp (name, "DEAL") == 0)
00253         {
00254           this->orig_flag = LegacyXdrIO::DEAL; // 0 is the DEAL identifier by definition
00255         }
00256       else if (std::strcmp (name, "MGF ") == 0)
00257         {
00258           this->orig_flag = LegacyXdrIO::MGF; // 1 is the MGF identifier by definition
00259         }
00260       else if (std::strcmp (name, "LIBM") == 0)
00261         {
00262           this->orig_flag = LegacyXdrIO::LIBM; // the New and Improved XDA
00263         }
00264 
00265       else
00266         {
00267           libMesh::err <<
00268             "No originating software can be determined for header string '" <<
00269             name << "'. Error." << std::endl;
00270           libmesh_error();
00271         }
00272     }
00273 
00274 }

void libMesh::XdrSOLN::init ( XdrIO_TYPE  type,
const char *  fn,
int  icnt 
) [inline]

Calls the init method in the parent class, XdrMGF with the appropriate parameters.

Parameters:
type One of: UNKNOWN, ENCODE, DECODE
fn const char pointer to a file name
icnt Number to be appended to file e.g. name.soln.0000

Definition at line 59 of file xdr_soln.h.

Referenced by libMesh::LegacyXdrIO::read_soln(), and libMesh::LegacyXdrIO::write_soln().

00060   {XdrMGF::init (type, fn, "soln",icnt);}

void libMesh::XdrMGF::set_num_levels ( unsigned int  num_levels  )  [inline, inherited]

Set number of levels

Definition at line 181 of file xdr_mgf.h.

References libMesh::XdrMGF::_num_levels.

Referenced by libMesh::LegacyXdrIO::write_mesh().

00181 { _num_levels = num_levels; }

void libMesh::XdrMGF::set_orig_flag ( LegacyXdrIO::FileFormat  in_orig_flag  )  [inline, inherited]

Set the originator flag.

Definition at line 175 of file xdr_mgf.h.

References libMesh::XdrMGF::orig_flag.

Referenced by libMesh::LegacyXdrIO::read_mesh(), and libMesh::LegacyXdrIO::write_mesh().

00175 { orig_flag = in_orig_flag; }

int libMesh::XdrSOLN::values ( Real array,
int  size 
) [inline]

Read/Write solution values.

Parameters:
array Pointer to array of Reals to be read/written
size Size of individual variables to be written
Returns:
m_wrtVar*size

Definition at line 84 of file xdr_soln.h.

References libMesh::XdrMGF::dataBlk(), and m_wrtVar.

Referenced by libMesh::LegacyXdrIO::read_soln(), and libMesh::LegacyXdrIO::write_soln().

00084 { return dataBlk(array, m_wrtVar, size);}


Member Data Documentation

unsigned int libMesh::XdrMGF::_num_levels [protected, inherited]

Number of levels of refinement in the mesh

Definition at line 193 of file xdr_mgf.h.

Referenced by libMesh::XdrMGF::get_num_levels(), libMesh::XdrMGF::set_num_levels(), and libMesh::XdrMGF::tokenize_first_line().

XdrIO_TYPE libMesh::XdrMGF::m_type [protected, inherited]

Specifies the read/write permission for the current xdr file. Possibilities are: {itemize} UNKNOWN = -1 ENCODE = 0 DECODE = 1 {itemize}

Definition at line 206 of file xdr_mgf.h.

Referenced by libMesh::XdrMGF::dataBlk(), header(), libMesh::XdrMESH::header(), and libMesh::XdrMGF::init().

Definition at line 87 of file xdr_soln.h.

Referenced by header(), and values().

std::ifstream libMesh::XdrMGF::mp_in [protected, inherited]

An input file stream object

Definition at line 240 of file xdr_mgf.h.

Referenced by libMesh::XdrMGF::dataBlk(), header(), libMesh::XdrMESH::header(), and libMesh::XdrMGF::init().

std::ofstream libMesh::XdrMGF::mp_out [protected, inherited]

An output file stream object.

Definition at line 245 of file xdr_mgf.h.

Referenced by libMesh::XdrMGF::dataBlk(), header(), libMesh::XdrMESH::header(), and libMesh::XdrMGF::init().

XDR* libMesh::XdrMGF::mp_xdr_handle [protected, inherited]

Pointer to the standard {xdr} struct. See the standard header file rpc/rpc.h for more information.

Definition at line 216 of file xdr_mgf.h.

Referenced by libMesh::XdrMGF::dataBlk(), libMesh::XdrMGF::fini(), header(), libMesh::XdrMESH::header(), and libMesh::XdrMGF::init().

Flag indicating how much checking we need to do. We can read in mgf meshes more quickly because there is only one type of element in these meshes. Deal meshes on the other hand will require a check for each element to find out what type it is. Possible values are: {itemize} 0: It's an DEAL style mesh 1: It's a MGF style mesh {itemize}

Definition at line 235 of file xdr_mgf.h.

Referenced by libMesh::XdrMGF::get_orig_flag(), libMesh::XdrMESH::header(), libMesh::XdrMGF::init(), and libMesh::XdrMGF::set_orig_flag().


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

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

Hosted By:
SourceForge.net Logo