libMesh::MeshInput< MT > Class Template Reference

#include <mesh_input.h>

List of all members.

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)

Protected Attributes

std::vector< bool > elems_of_dimension

Private Attributes

MT * _obj
const bool _is_parallel_format

Detailed Description

template<class MT>
class libMesh::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

Definition at line 51 of file mesh_input.h.


Constructor & Destructor Documentation

template<class MT >
libMesh::MeshInput< MT >::MeshInput ( bool  is_parallel_format = false  )  [inline, explicit, protected]

Default constructor. Will set the _obj to NULL, effectively rendering this object useless.

Definition at line 126 of file mesh_input.h.

00126                                                        :
00127   elems_of_dimension(),
00128   _obj (NULL),
00129   _is_parallel_format(is_parallel_format)
00130 {
00131 }

template<class MT>
libMesh::MeshInput< MT >::MeshInput ( MT &  obj,
const bool  is_parallel_format = false 
) [inline, explicit, protected]

Constructor. Takes a writeable reference to an object. This is the constructor required to read an object.

Definition at line 137 of file mesh_input.h.

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

00137                                                                 :
00138   elems_of_dimension(),
00139   _obj (&obj),
00140   _is_parallel_format(is_parallel_format)
00141 {
00142   if (!_is_parallel_format && !this->mesh().is_serial())
00143     {
00144       if (libMesh::processor_id() == 0)
00145         {
00146           libmesh_do_once(libMesh::out <<
00147             "Warning:  This MeshOutput subclass only supports meshes which have been serialized!"
00148             << std::endl;);
00149         }
00150     }
00151 }

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

Destructor.

Definition at line 157 of file mesh_input.h.

00158 {
00159 }


Member Function Documentation

template<class MT >
MT & libMesh::MeshInput< MT >::mesh (  )  [inline, protected]

Returns the object as a writeable reference.

Definition at line 165 of file mesh_input.h.

References libMesh::MeshInput< MT >::_obj.

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

00166 {
00167   if (_obj == NULL) libmesh_error();
00168   return *_obj;
00169 }

template<class MT>
virtual void libMesh::MeshInput< MT >::read ( const std::string &   )  [pure virtual]
template<class MT >
void libMesh::MeshInput< MT >::skip_comment_lines ( std::istream &  in,
const char  comment_start 
) [inline, protected]

Reads input from in, skipping all the lines that start with the character comment_start.

Definition at line 174 of file mesh_input.h.

00176 {
00177   char c, line[256];
00178 
00179   while (in.get(c), c==comment_start)
00180     in.getline (line, 255);
00181 
00182   // put back first character of
00183   // first non-comment line
00184   in.putback (c);
00185 }


Member Data Documentation

template<class MT>
const bool libMesh::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 117 of file mesh_input.h.

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

template<class MT>
MT* libMesh::MeshInput< MT >::_obj [private]

A pointer to a non-const object object. This allows us to read the object from file.

Definition at line 110 of file mesh_input.h.

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

template<class MT>
std::vector<bool> libMesh::MeshInput< MT >::elems_of_dimension [protected]

A vector of bools describing what dimension elements have been encountered when reading a mesh.

Definition at line 93 of file mesh_input.h.


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

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

Hosted By:
SourceForge.net Logo