libMesh::XdrSOLN Class Reference

#include <xdr_soln.h>

Inheritance diagram for libMesh::XdrSOLN:

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

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 98 of file xdr_mgf.h.

98  {UNKNOWN = -1, ENCODE=0, DECODE,
99  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.

48 : m_wrtVar(-1) {}
libMesh::XdrSOLN::~XdrSOLN ( )
inline

Destructor.

Definition at line 65 of file xdr_soln.h.

65 {}

Member Function Documentation

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
arrayPointer to data to be read/written
numvarThe total number of variables (size of the array)
sizeThe 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::libmesh_assert(), 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().

279 {
280  int totalSize = numvar*size;
281 
282  switch (m_type)
283  {
284 
285 #ifdef LIBMESH_HAVE_XDR
286 
287  case (XdrMGF::DECODE):
288  case (XdrMGF::ENCODE):
289  {
290  xdr_vector(mp_xdr_handle,
291  (char *) &array[0],
292  totalSize,
293  sizeof(int),
294  (xdrproc_t) xdr_int);
295  break;
296  }
297 
298 #endif
299 
300  case (XdrMGF::W_ASCII):
301  {
302  for (int i=0; i<size; i++)
303  {
304  for (int j=0; j<numvar; j++)
305  mp_out << array[i*numvar + j] << " ";
306 
307  mp_out << '\n';
308  }
309 
310  mp_out.flush();
311  break;
312  }
313 
314  case (XdrMGF::R_ASCII):
315  {
316  libmesh_assert (mp_in.good());
317 
318  for (int i=0; i<size; i++)
319  {
320  for (int j=0; j<numvar; j++)
321  {
322  mp_in >> array[i*numvar + j];
323  }
324 
325  mp_in.ignore(); // Read newline
326  }
327 
328  break;
329  }
330 
331  default:
332  // Unknown access type
333  libmesh_error();
334  }
335 
336  return totalSize;
337 }
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::libmesh_assert(), 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.

342 {
343  int totalSize = numvar*size;
344 
345  // If this function is called by coord(),
346  // numvar is the problem dimension, and
347  // size is the number of nodes in the problem.
348 
349  //libMesh::out << "Total amount of data to be written: " << totalSize << std::endl;
350 
351  switch (m_type)
352  {
353 
354 #ifdef LIBMESH_HAVE_XDR
355 
356  case (XdrMGF::DECODE):
357  case (XdrMGF::ENCODE):
358  {
359  // FIXME - this is probably broken for Real == long double
360  // RHS
361  xdr_vector(mp_xdr_handle,
362  (char *) &array[0],
363  totalSize,
364  sizeof(Real),
365  (xdrproc_t) xdr_REAL);
366  }
367 
368 #endif
369 
370  case (XdrMGF::W_ASCII):
371  {
372  // Save stream flags
373  std::ios_base::fmtflags out_flags = mp_out.flags();
374 
375  // We will use scientific notation with a precision of 16
376  // digits in the following output. The desired precision and
377  // format will automatically determine the width.
378  mp_out << std::scientific
379  << std::setprecision(16);
380 
381  for (int i=0; i<size; i++)
382  {
383  for (int j=0; j<numvar; j++)
384  mp_out << array[i*numvar + j] << " \t";
385 
386  mp_out << '\n';
387  }
388 
389  // Restore stream flags
390  mp_out.flags(out_flags);
391 
392  mp_out.flush();
393  break;
394  }
395 
396  case (XdrMGF::R_ASCII):
397  {
398  libmesh_assert (mp_in.good());
399 
400  for (int i=0; i<size; i++)
401  {
402  libmesh_assert (mp_in.good());
403 
404  for (int j=0; j<numvar; j++)
405  mp_in >> array[i*numvar + j];
406 
407  mp_in.ignore(); // Read newline
408  }
409 
410  break;
411  }
412 
413  default:
414  // Unknown access type
415  libmesh_error();
416  }
417 
418  return totalSize;
419 }
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().

36 {
37 
38 #ifdef LIBMESH_HAVE_XDR
39 
40  if (mp_xdr_handle)
41  {
42  //libMesh::out << "Destroying XDR file handle." << std::endl;
43  xdr_destroy(mp_xdr_handle);
44  }
45 
46  //libMesh::out << "Deleting the file handle pointer." << std::endl;
47  delete mp_xdr_handle;
48 
49  mp_xdr_handle = NULL;
50 
51 #endif
52 
53  if (mp_fp)
54  {
55  //libMesh::out << "Closing file." << std::endl;
56  std::fflush(mp_fp);
57  std::fclose(mp_fp);
58  }
59 
60  mp_fp = NULL;
61 }
unsigned int libMesh::XdrMGF::get_num_levels ( )
inlineinherited

Get number of levels

Definition at line 190 of file xdr_mgf.h.

References libMesh::XdrMGF::_num_levels.

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

190 { return _num_levels; }
LegacyXdrIO::FileFormat libMesh::XdrMGF::get_orig_flag ( ) const
inlineinherited

Get the originator flag.

Definition at line 174 of file xdr_mgf.h.

References libMesh::XdrMGF::orig_flag.

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

174 { return orig_flag; }
int libMesh::XdrSOLN::header ( XdrSHEAD hd)

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

Parameters
hdPointer 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::libmesh_assert(), 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().

33 {
34  // Temporary variables to facilitate stream reading
35  const int comm_len= 80;
36  char comment[comm_len];
37 
38 
39 
40  switch (m_type)
41  {
42 
43 #ifdef LIBMESH_HAVE_XDR
44 
45  case (XdrMGF::ENCODE):
46  case (XdrMGF::DECODE):
47  {
48 
49  xdr_int(mp_xdr_handle, &(hd->m_wrtVar));
50  xdr_int(mp_xdr_handle, &(hd->m_numvar));
51  xdr_int(mp_xdr_handle, &(hd->m_numNodes));
52  xdr_int(mp_xdr_handle, &(hd->m_meshCnt));
53  xdr_int(mp_xdr_handle, &(hd->m_kstep));
54  xdr_int(mp_xdr_handle, &(hd->m_strSize));
55  xdr_REAL(mp_xdr_handle, &(hd->m_time));
56 
57  m_wrtVar=hd->m_wrtVar;
58 
59  char* temp = const_cast<char *>(hd->getId());
60  xdr_string(mp_xdr_handle,&(temp),
61  ((m_type == XdrMGF::ENCODE) ? std::strlen(temp) : hd->m_strSize));
62  hd->setId(temp);
63 
64  temp = const_cast<char *>(hd->getTitle());
65  xdr_string(mp_xdr_handle,&(temp),
66  ((m_type == XdrMGF::ENCODE) ? std::strlen(temp) : hd->m_strSize));
67  hd->setTitle(temp);
68 
69  temp = const_cast<char *>(hd->getUserTitle());
70  xdr_string(mp_xdr_handle,&(temp),
71  ((m_type == XdrMGF::ENCODE) ? std::strlen(temp) : hd->m_strSize));
72  hd->setUserTitle(temp);
73 
74 
75  char * tempTitle = new char[hd->m_strSize*m_wrtVar];
76 
77 
78  if (m_type == XdrMGF::DECODE)
79  {
80  int tempSize = 0;
81  xdr_string(mp_xdr_handle, &tempTitle, hd->m_strSize*m_wrtVar);
82  int olen= std::strlen(tempTitle);
83  char *p;
84  char *top = tempTitle;
85  for (int ivar = 0; ivar < m_wrtVar; ++ivar)
86  {
87  p = strchr(tempTitle,' ');
88  *p = '\0';
89  tempSize = std::strlen(tempTitle) ;
90  tempTitle+=tempSize+1;
91  }
92  tempTitle = top;
93  hd->mp_varTitle = new char[olen];
94  std::memcpy(hd->mp_varTitle,tempTitle,olen*sizeof(char));
95  }
96  else if (m_type == XdrMGF::ENCODE)
97  {
98  char *p = hd->mp_varTitle;
99  char *top = tempTitle;
100  for (int ivar = 0; ivar < m_wrtVar; ++ivar)
101  {
102  int tempSize = std::strlen(p) + 1;
103  std::memcpy(tempTitle,p,tempSize*sizeof(char));
104  tempSize = std::strlen(tempTitle);
105  tempTitle[tempSize] = ' ';
106  tempTitle += tempSize+1;
107  p += tempSize+1;
108  }
109  tempTitle = top;
110  xdr_string(mp_xdr_handle, &tempTitle, hd->m_strSize*m_wrtVar);
111  }
112  delete [] tempTitle;
113 
114  return 0;
115  }
116 #endif
117 
118 
119  case (XdrMGF::R_ASCII):
120  {
121  libmesh_assert (mp_in.good());
122 
123  mp_in >> hd->m_numNodes ; mp_in.getline(comment, comm_len);
124  mp_in >> hd->m_wrtVar ; mp_in.getline(comment, comm_len);
125  mp_in >> hd->m_strSize ; mp_in.getline(comment, comm_len);
126  mp_in >> hd->m_time ; mp_in.getline(comment, comm_len);
127 
128  mp_in.getline(comment, comm_len);
129  hd->setId(comment);
130 
131  mp_in.getline(comment, comm_len);
132  hd->setTitle(comment);
133 
134  mp_in.getline(comment, comm_len);
135  hd->setUserTitle(comment);
136 
137  m_wrtVar = hd->m_wrtVar;
138 
139  // Read the variable names
140  {
141  std::string var_name;
142  char* titles = new char[hd->m_wrtVar*hd->m_strSize];
143  unsigned int c=0;
144 
145  for (int var=0; var < hd->m_wrtVar; var++)
146  {
147  mp_in >> var_name;
148 
149  for (unsigned int l=0; l<var_name.size(); l++)
150  titles[c++] = var_name[l];
151 
152  titles[c++] = '\0';
153  }
154 
155  mp_in.getline(comment, comm_len);
156 
157  hd->setVarTitle(titles, c);
158 
159  delete [] titles;
160  }
161 
162 
163  return 0;
164  }
165 
166 
167  case (XdrMGF::W_ASCII):
168  {
169  mp_out << hd->m_numNodes << "\t # Num. Nodes\n";
170  mp_out << hd->m_wrtVar << "\t # Num. of Vars\n";
171  mp_out << hd->m_strSize << "\t # String Size (ignore)\n";
172  mp_out << hd->m_time << "\t # Current Time\n";
173  mp_out << hd->mp_id << '\n';
174  mp_out << hd->mp_title << '\n';
175  mp_out << hd->mp_userTitle << '\n';
176 
177  // write the variable names
178  {
179  const char* p = hd->getVarTitle();
180 
181  for (int var=0; var<hd->m_wrtVar ; var++)
182  {
183  mp_out << p << " ";
184  p += std::strlen(p)+1;
185  }
186  mp_out << "\t # Variable Names\n";
187  }
188 
189  m_wrtVar = hd->m_wrtVar;
190 
191  return 0;
192  }
193 
194 
195 
196  default:
197  // Unknown access type
198  libmesh_error();
199 
200  }
201 
202  return 1;
203 }
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
typeOne of: UNKNOWN, ENCODE, DECODE
fnconst char pointer to a file name
icntNumber to be appended to file e.g. name.soln.0000

Definition at line 59 of file xdr_soln.h.

References libMesh::XdrMGF::init().

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

60  {XdrMGF::init (type, fn, "soln",icnt);}
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.

Referenced by init(), and libMesh::XdrMESH::init().

69 {
70  m_type=t;
71 
72  // Close old file if necessary
73  if (mp_fp) this->fini();
74 
75 
76  // Open file
77  switch (m_type)
78  {
79 
80 #ifdef LIBMESH_HAVE_XDR
81 
82  case (XdrMGF::ENCODE):
83  case (XdrMGF::DECODE):
84  {
85  mp_fp = fopen (fn, (m_type == ENCODE) ? "w" : "r");
86 
87  // Make sure the file is ready for use
88  if (!mp_fp)
89  {
90  libMesh::err << "XDR Error: Accessing file: "
91  << fn
92  << " failed."
93  << std::endl;
94  libmesh_error();
95  }
96 
97  // Create the XDR handle
98  mp_xdr_handle = new XDR;
99  xdrstdio_create(mp_xdr_handle,
100  mp_fp,
101  ((m_type == ENCODE) ? XDR_ENCODE : XDR_DECODE));
102 
103  break;
104  }
105 
106 #endif
107 
108  case (XdrMGF::R_ASCII):
109  {
110  mp_in.open(fn, std::ios::in);
111 
112  // Make sure it opened correctly
113  if (!mp_in.good())
114  libmesh_file_error(fn);
115 
116  break;
117  }
118 
119  case (XdrMGF::W_ASCII):
120  {
121  mp_out.open(fn, std::ios::out);
122 
123  // Make sure it opened correctly
124  if (!mp_out.good())
125  libmesh_file_error(fn);
126 
127  break;
128  }
129 
130  default:
131  {
132  libMesh::out << "Unrecognized file access type!" << std::endl;
133  libmesh_error();
134  }
135  }
136 
137 
138 
139 
140 
141  // Read/Write the file signature
142  const int bufLen = 12;
143  char buf[bufLen+1];
144 
145  switch (m_type)
146  {
147 
148 #ifdef LIBMESH_HAVE_XDR
149 
150  case (XdrMGF::ENCODE):
151  {
152  char* p = &buf[0];
153  const LegacyXdrIO::FileFormat orig = this->get_orig_flag();
154 
155  std::ostringstream name;
156  if (orig == LegacyXdrIO::DEAL)
157  name << "DEAL 003:003";
158 
159  else if (orig == LegacyXdrIO::MGF)
160  name << "MGF 002:000";
161 
162  else if (orig == LegacyXdrIO::LIBM)
163  name << "LIBM " << this->get_num_levels();
164 
165  else
166  libmesh_error();
167 
168  // Fill the buffer
169  std::sprintf(&buf[0], "%s", name.str().c_str());
170 
171  xdr_string(mp_xdr_handle, &p, bufLen); // Writes binary signature
172 
173  break;
174  }
175 
176  case (XdrMGF::DECODE):
177  {
178  char* p = &buf[0];
179  xdr_string(mp_xdr_handle, &p, bufLen); // Reads binary signature
180 
181  // Set the number of levels used in the mesh
182  this->tokenize_first_line(p);
183 
184  break;
185  }
186 
187 #endif
188 
189  case (XdrMGF::W_ASCII):
190  {
191  const LegacyXdrIO::FileFormat orig = this->get_orig_flag();
192 
193  if (orig == LegacyXdrIO::DEAL)
194  std::sprintf(&buf[0], "%s %03d:%03d", "DEAL", 3, 3);
195 
196  else if (orig == LegacyXdrIO::MGF)
197  std::sprintf(&buf[0], "%s %03d:%03d", "MGF ", 2, 0);
198 
199  else if (orig == LegacyXdrIO::LIBM)
200  std::sprintf(&buf[0], "%s %d", "LIBM", this->get_num_levels());
201 
202  mp_out << buf << '\n';
203 
204  break;
205  }
206 
207  case (XdrMGF::R_ASCII):
208  {
209 
210 #ifdef __HP_aCC
211  // weirdly, _only_ here aCC
212  // is not fond of mp_in.getline()
213  // however, using mp_in.getline()
214  // further below is ok...
215  std::string buf_buf;
216  std::getline (mp_in, buf_buf, '\n');
217  libmesh_assert_less_equal (buf_buf.size(), bufLen);
218 
219  buf_buf.copy (buf, std::string::npos);
220 #else
221 
222  // Here we first use getline() to grab the very
223  // first line of the file into a char buffer. Then
224  // this line is tokenized to look for:
225  // 1.) The name LIBM, which specifies the new Mesh style.
226  // 2.) The number of levels in the Mesh which is being read.
227  // Note that "buf" will be further processed below, here we
228  // are just attempting to get the number of levels.
229  mp_in.getline(buf, bufLen+1);
230 
231 #endif
232 
233  // Determine the number of levels in this mesh
234  this->tokenize_first_line(buf);
235 
236  break;
237  }
238 
239  default:
240  libmesh_error();
241  }
242 
243 
244 
245  // If you are reading or decoding, process the signature
246  if ((m_type == R_ASCII) || (m_type == DECODE))
247  {
248  char name[5];
249  std::strncpy(name, &buf[0], 4);
250  name[4] = '\0';
251 
252  if (std::strcmp (name, "DEAL") == 0)
253  {
254  this->orig_flag = LegacyXdrIO::DEAL; // 0 is the DEAL identifier by definition
255  }
256  else if (std::strcmp (name, "MGF ") == 0)
257  {
258  this->orig_flag = LegacyXdrIO::MGF; // 1 is the MGF identifier by definition
259  }
260  else if (std::strcmp (name, "LIBM") == 0)
261  {
262  this->orig_flag = LegacyXdrIO::LIBM; // the New and Improved XDA
263  }
264 
265  else
266  {
267  libMesh::err <<
268  "No originating software can be determined for header string '" <<
269  name << "'. Error." << std::endl;
270  libmesh_error();
271  }
272  }
273 
274 }
void libMesh::XdrMGF::set_num_levels ( unsigned int  num_levels)
inlineinherited

Set number of levels

Definition at line 185 of file xdr_mgf.h.

References libMesh::XdrMGF::_num_levels.

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

185 { _num_levels = num_levels; }
void libMesh::XdrMGF::set_orig_flag ( LegacyXdrIO::FileFormat  in_orig_flag)
inlineinherited

Set the originator flag.

Definition at line 179 of file xdr_mgf.h.

References libMesh::XdrMGF::orig_flag.

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

179 { orig_flag = in_orig_flag; }
int libMesh::XdrSOLN::values ( Real array,
int  size 
)
inline

Read/Write solution values.

Parameters
arrayPointer to array of Reals to be read/written
sizeSize 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().

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

Member Data Documentation

unsigned int libMesh::XdrMGF::_num_levels
protectedinherited

Number of levels of refinement in the mesh

Definition at line 197 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
protectedinherited

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

Definition at line 210 of file xdr_mgf.h.

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

int libMesh::XdrSOLN::m_wrtVar
private

Definition at line 87 of file xdr_soln.h.

Referenced by header(), and values().

std::ifstream libMesh::XdrMGF::mp_in
protectedinherited

An input file stream object

Definition at line 244 of file xdr_mgf.h.

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

std::ofstream libMesh::XdrMGF::mp_out
protectedinherited

An output file stream object.

Definition at line 249 of file xdr_mgf.h.

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

XDR* libMesh::XdrMGF::mp_xdr_handle
protectedinherited

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

Definition at line 220 of file xdr_mgf.h.

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

LegacyXdrIO::FileFormat libMesh::XdrMGF::orig_flag
protectedinherited

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 239 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 07 2014 16:58:02 UTC

Hosted By:
SourceForge.net Logo