$extrastylesheet
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 set_n_partitions (unsigned int n_parts)
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 133 of file mesh_input.h.

                                                       :
  elems_of_dimension(),
  _obj (NULL),
  _is_parallel_format(is_parallel_format)
{
}
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 144 of file mesh_input.h.

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

                                                                :
  elems_of_dimension(),
  _obj (&obj),
  _is_parallel_format(is_parallel_format)
{
  if (!_is_parallel_format && !this->mesh().is_serial())
    {
      if (this->mesh().processor_id() == 0)
        {
          libmesh_do_once(libMesh::out <<
                          "Warning:  This MeshOutput subclass only supports meshes which have been serialized!"
                          << std::endl;);
        }
    }
}
template<class MT >
libMesh::MeshInput< MT >::~MeshInput ( ) [inline, virtual]

Destructor.

Definition at line 164 of file mesh_input.h.

{
}

Member Function Documentation

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

Returns the object as a writeable reference.

Definition at line 172 of file mesh_input.h.

Referenced by libMesh::MeshInput< MT >::MeshInput(), and libMesh::MeshInput< MeshBase >::set_n_partitions().

{
  if (_obj == NULL)
    libmesh_error_msg("ERROR: _obj should not be NULL!");
  return *_obj;
}
template<class MT>
virtual void libMesh::MeshInput< MT >::read ( const std::string &  ) [pure virtual]
template<class MT>
void libMesh::MeshInput< MT >::set_n_partitions ( unsigned int  n_parts) [inline, protected]

Sets the number of partitions in the mesh. Typically this gets done by the partitioner, but some parallel file formats begin "pre-partitioned".

Definition at line 94 of file mesh_input.h.

{ this->mesh().set_n_partitions() = n_parts; }
template<class MT >
void libMesh::MeshInput< MT >::skip_comment_lines ( std::istream &  in,
const char  comment_start 
) [protected]

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

Definition at line 182 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 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 124 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 117 of file mesh_input.h.

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 100 of file mesh_input.h.


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