Poster of Linux kernelThe best gift for a Linux geek
MeshOutput

MeshOutput

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

NAME

MeshOutput -  

SYNOPSIS


#include <mesh_output.h>  

Public Member Functions


virtual ~MeshOutput ()

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

virtual void write_equation_systems (const std::string &, const EquationSystems &)

virtual void write_nodal_data (const std::string &, const std::vector< Number > &, const std::vector< std::string > &)
 

Protected Member Functions


MeshOutput (const bool is_parallel_format=false)

MeshOutput (const MT &, const bool is_parallel_format=false)

const MT & mesh () const
 

Private Member Functions


void _build_variable_names_and_solution_vector (const EquationSystems &es, std::vector< Number > &soln, std::vector< std::string > &names)
 

Private Attributes


const MT *const _obj

const bool _is_parallel_format
 

Detailed Description

 

template<class MT> class MeshOutput< MT >

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

Author:

Benjamin S. Kirk

Date:

2004

Version:

Revision:

3391

Definition at line 51 of file mesh_output.h.  

Constructor & Destructor Documentation

 

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

Definition at line 137 of file mesh_output.h.

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

template<class MT> MeshOutput< MT >::MeshOutput (const MT &obj, const boolis_parallel_format = false) [inline, protected]Constructor. Takes a reference to a constant object. This constructor will only allow us to write the object.

Definition at line 146 of file mesh_output.h.

References MeshOutput< MT >::_is_parallel_format, MeshOutput< 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 > MeshOutput< MT >::~MeshOutput () [inline, virtual]Destructor.

Definition at line 166 of file mesh_output.h.

{
}
 

Member Function Documentation

 

template<class MT > void MeshOutput< MT >::_build_variable_names_and_solution_vector (const EquationSystems &es, std::vector< Number > &soln, std::vector< std::string > &names) [private]A helper function which allows us to fill temporary name and solution vectors with an EquationSystems object

Definition at line 28 of file mesh_output.C.

References EquationSystems::build_solution_vector(), and EquationSystems::build_variable_names().

{
  // We need a serial mesh for MeshOutput for now
  const_cast<EquationSystems&>(es).allgather();

  es.build_variable_names  (names);
  es.build_solution_vector (soln);
}
 

template<class MT > const MT & MeshOutput< MT >::mesh () const [inline, protected]Returns the object as a read-only reference.

Definition at line 193 of file mesh_output.h.

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

{
  libmesh_assert (_obj != NULL);
  return *_obj;
}
 

template<class MT> virtual void MeshOutput< MT >::write (const std::string &) [pure virtual]This method implements writing a mesh to a specified file.

Implemented in DivaIO, EnsightIO, ExodusII_IO, FroIO, GmshIO, GMVIO, GnuPlotIO, LegacyXdrIO, MEDITIO, PostscriptIO, TecplotIO, TetGenIO, UCDIO, UNVIO, VTKIO, and XdrIO.  

template<class MT > void MeshOutput< MT >::write_equation_systems (const std::string &fname, const EquationSystems &es) [inline, virtual]This method implements writing a mesh with data to a specified file where the data is taken from the EquationSystems object.

Reimplemented in VTKIO.

Definition at line 174 of file mesh_output.h.

Referenced by ErrorVector::plot_error().

{
  // Build the nodal solution values & get the variable
  // names from the EquationSystems object
  std::vector<Number>      soln;
  std::vector<std::string> names;

  this->_build_variable_names_and_solution_vector(es, soln, names);
  //es.build_variable_names  (names);
  //es.build_solution_vector (soln);

  this->write_nodal_data (fname, soln, names);  
}
 

template<class MT> virtual void MeshOutput< MT >::write_nodal_data (const std::string &, const std::vector< Number > &, const std::vector< std::string > &) [inline, virtual]This method implements writing a mesh with nodal data to a specified file where the nodal data and variable names are provided.

Reimplemented in ExodusII_IO, GmshIO, GMVIO, GnuPlotIO, MEDITIO, and TecplotIO.

Definition at line 91 of file mesh_output.h.

Referenced by UnstructuredMesh::write().

  { libmesh_error(); }
 

Member Data Documentation

 

template<class MT> const bool MeshOutput< 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 120 of file mesh_output.h.

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

template<class MT> const MT* const MeshOutput< MT >::_obj [private]A pointer to a constant object. This allows us to write the object to file.

Definition at line 113 of file mesh_output.h.

 

Author

Generated automatically by Doxygen for libMesh from the source code.


 

Index

NAME
SYNOPSIS
Public Member Functions
Protected Member Functions
Private Member Functions
Private Attributes
Detailed Description
template<class MT> class MeshOutput< MT >
Constructor & Destructor Documentation
template<class MT > MeshOutput< MT >::MeshOutput (const boolis_parallel_format = false) [inline, protected]Default constructor. Will set the _obj to NULL, effectively rendering this object useless.
template<class MT> MeshOutput< MT >::MeshOutput (const MT &obj, const boolis_parallel_format = false) [inline, protected]Constructor. Takes a reference to a constant object. This constructor will only allow us to write the object.
template<class MT > MeshOutput< MT >::~MeshOutput () [inline, virtual]Destructor.
Member Function Documentation
template<class MT > void MeshOutput< MT >::_build_variable_names_and_solution_vector (const EquationSystems &es, std::vector< Number > &soln, std::vector< std::string > &names) [private]A helper function which allows us to fill temporary name and solution vectors with an EquationSystems object
template<class MT > const MT & MeshOutput< MT >::mesh () const [inline, protected]Returns the object as a read-only reference.
template<class MT> virtual void MeshOutput< MT >::write (const std::string &) [pure virtual]This method implements writing a mesh to a specified file.
template<class MT > void MeshOutput< MT >::write_equation_systems (const std::string &fname, const EquationSystems &es) [inline, virtual]This method implements writing a mesh with data to a specified file where the data is taken from the EquationSystems object.
template<class MT> virtual void MeshOutput< MT >::write_nodal_data (const std::string &, const std::vector< Number > &, const std::vector< std::string > &) [inline, virtual]This method implements writing a mesh with nodal data to a specified file where the nodal data and variable names are provided.
Member Data Documentation
template<class MT> const bool MeshOutput< 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> const MT* const MeshOutput< MT >::_obj [private]A pointer to a constant object. This allows us to write the object to file.
Author

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