Poster of Linux kernelThe best gift for a Linux geek
MeshInput

MeshInput

Section: C Library Functions (3) Updated: Thu Apr 7 2011
Local index Up
 

NAME

MeshInput -  

SYNOPSIS


#include <mesh_input.h>  

Public Member Functions


virtual ~MeshInput ()

virtual void read (const std::string &)=0
 

Protected Member Functions


MeshInput (bool is_parallel_format=false)

MeshInput (MT &, const bool is_parallel_format=false)

MT & mesh ()

void skip_comment_lines (std::istream &in, const char comment_start)
 

Private Attributes


MT * _obj

const bool _is_parallel_format
 

Detailed Description

 

template<class MT> class MeshInput< MT >

This class defines an abstract interface for Mesh input. Specific classes derived from this class actually implement reading various mesh formats.

Author:

Benjamin S. Kirk

Date:

2004

Version:

Revision:

3391

Definition at line 49 of file mesh_input.h.  

Constructor & Destructor Documentation

 

template<class MT > MeshInput< MT >::MeshInput (boolis_parallel_format = false) [inline, protected]Default constructor. Will set the _obj to NULL, effectively rendering this object useless.

Definition at line 116 of file mesh_input.h.

                                                       :
  _obj (NULL),
  _is_parallel_format(is_parallel_format)
{
}
 

template<class MT> MeshInput< MT >::MeshInput (MT &obj, const boolis_parallel_format = false) [inline, protected]Constructor. Takes a writeable reference to an object. This is the constructor required to read an object.

Definition at line 126 of file mesh_input.h.

References MeshInput< MT >::_is_parallel_format, MeshInput< MT >::mesh(), and libMesh::processor_id().

                                                                :
  _obj (&obj),
  _is_parallel_format(is_parallel_format)
{
  if (!_is_parallel_format && !this->mesh().is_serial())
    {
      if (libMesh::processor_id() == 0)
        {
          std::cerr << 'Warning:  This I/O operation may only be supported for meshes which have been serialized!'
                    << std::endl;
          libmesh_here();
        }
//      libmesh_error();
    }
}
 

template<class MT > MeshInput< MT >::~MeshInput () [inline, virtual]Destructor.

Definition at line 146 of file mesh_input.h.

{
}
 

Member Function Documentation

 

template<class MT > MT & MeshInput< MT >::mesh () [inline, protected]Returns the object as a writeable reference.

Definition at line 154 of file mesh_input.h.

Referenced by MeshInput< MT >::MeshInput().

{
  if (_obj == NULL) libmesh_error();
  return *_obj;
}
 

template<class MT> virtual void MeshInput< MT >::read (const std::string &) [pure virtual]This method implements reading a mesh from a specified file.

Implemented in ExodusII_IO, GmshIO, GMVIO, LegacyXdrIO, MatlabIO, Nemesis_IO, OFFIO, TetGenIO, UCDIO, UNVIO, VTKIO, and XdrIO.  

template<class MT > void MeshInput< MT >::skip_comment_lines (std::istream &in, const charcomment_start) [protected]Reads input from in, skipping all the lines that start with the character comment_start.

Definition at line 163 of file mesh_input.h.

{    
  char c, line[256];
  
  while (in.get(c), c==comment_start) 
    in.getline (line, 255);
  
  // put back first character of
  // first non-comment line
  in.putback (c);
}
 

Member Data Documentation

 

template<class MT> const bool MeshInput< MT >::_is_parallel_format [private]Flag specifying whether this format is parallel-capable. If this is false (default) I/O is only permitted when the mesh has been serialized.

Definition at line 107 of file mesh_input.h.

Referenced by MeshInput< MT >::MeshInput().  

template<class MT> MT* MeshInput< MT >::_obj [private]A pointer to a non-const object object. This allows us to read the object from file.

Definition at line 100 of file mesh_input.h.

 

Author

Generated automatically by Doxygen for libMesh from the source code.


 

Index

NAME
SYNOPSIS
Public Member Functions
Protected Member Functions
Private Attributes
Detailed Description
template<class MT> class MeshInput< MT >
Constructor & Destructor Documentation
template<class MT > MeshInput< MT >::MeshInput (boolis_parallel_format = false) [inline, protected]Default constructor. Will set the _obj to NULL, effectively rendering this object useless.
template<class MT> MeshInput< MT >::MeshInput (MT &obj, const boolis_parallel_format = false) [inline, protected]Constructor. Takes a writeable reference to an object. This is the constructor required to read an object.
template<class MT > MeshInput< MT >::~MeshInput () [inline, virtual]Destructor.
Member Function Documentation
template<class MT > MT & MeshInput< MT >::mesh () [inline, protected]Returns the object as a writeable reference.
template<class MT> virtual void MeshInput< MT >::read (const std::string &) [pure virtual]This method implements reading a mesh from a specified file.
template<class MT > void MeshInput< MT >::skip_comment_lines (std::istream &in, const charcomment_start) [protected]Reads input from in, skipping all the lines that start with the character comment_start.
Member Data Documentation
template<class MT> const bool MeshInput< MT >::_is_parallel_format [private]Flag specifying whether this format is parallel-capable. If this is false (default) I/O is only permitted when the mesh has been serialized.
template<class MT> MT* MeshInput< MT >::_obj [private]A pointer to a non-const object object. This allows us to read the object from file.
Author

This document was created by man2html, using the manual pages.
Time: 21:50:10 GMT, April 16, 2011