Poster of Linux kernelThe best gift for a Linux geek
LibMeshInit

LibMeshInit

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

NAME

LibMeshInit -  

SYNOPSIS


#include <libmesh.h>  

Public Member Functions


LibMeshInit (int &argc, char **&argv, MPI_Comm COMM_WORLD_IN=MPI_COMM_WORLD)

LibMeshInit (int &argc, char **&argv)

~LibMeshInit ()
 

Detailed Description

The LibMeshInit class, when constructed, initializes the dependent libraries (e.g. MPI or PETSC) and does the command line parsing needed by libMesh. The LibMeshInit destructor closes those libraries properly.

For most users, a single LibMeshInit object should be created at the start of your main() function. This object replaces the previous libMesh::init()/libMeshclose() methods, which are now deprecated.

Definition at line 57 of file libmesh.h.  

Constructor & Destructor Documentation

 

LibMeshInit::LibMeshInit (int &argc, char **&argv, MPI_CommCOMM_WORLD_IN = MPI_COMM_WORLD)Initialize the library for use, with the command line options provided. This will e.g. call PetscInitialize if PETSC is available. You must create a LibMeshInit object before using any of the library functionality. This method may take an optional parameter to use a user-specified MPI communicator.

Definition at line 378 of file libmesh.C.

References libMesh::_init(), EXTERN_C_FOR_PETSC_END::_ofstream, EXTERN_C_FOR_PETSC_END::cerr_buf(), EXTERN_C_FOR_PETSC_END::cout_buf(), libMesh::on_command_line(), and libMesh::processor_id().

{
  libMesh::_init(argc, argv, COMM_WORLD_IN);

  // Honor the --redirect-stdout command-line option.
  // When this is specified each processor sends
  // std::cout/std::cerr messages to
  // stdout.processor.####
  if (libMesh::on_command_line ('--redirect-stdout'))
    {
      char filechar[80];
      sprintf (filechar, 'stdout.processor.%04d',
               libMesh::processor_id());
      _ofstream.reset (new std::ofstream (filechar));
      // Redirect, saving the original streambufs!
      cout_buf = std::cout.rdbuf (_ofstream->rdbuf());
      cerr_buf = std::cerr.rdbuf (_ofstream->rdbuf());
    }
}
 

LibMeshInit::LibMeshInit (int &argc, char **&argv)

Definition at line 373 of file libmesh.C.

References libMesh::_init().

{
  libMesh::_init(argc, argv);
}
 

LibMeshInit::~LibMeshInit ()

Definition at line 400 of file libmesh.C.

{
  libMesh::_close();
}

 

Author

Generated automatically by Doxygen for libMesh from the source code.


 

Index

NAME
SYNOPSIS
Public Member Functions
Detailed Description
Constructor & Destructor Documentation
LibMeshInit::LibMeshInit (int &argc, char **&argv, MPI_CommCOMM_WORLD_IN = MPI_COMM_WORLD)Initialize the library for use, with the command line options provided. This will e.g. call PetscInitialize if PETSC is available. You must create a LibMeshInit object before using any of the library functionality. This method may take an optional parameter to use a user-specified MPI communicator.
LibMeshInit::LibMeshInit (int &argc, char **&argv)
LibMeshInit::~LibMeshInit ()
Author

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