Poster of Linux kernelThe best gift for a Linux geek
EpetraMatrix

EpetraMatrix

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

NAME

EpetraMatrix -  

SYNOPSIS


#include <trilinos_epetra_matrix.h>

Inherits SparseMatrix< T >.  

Public Member Functions


EpetraMatrix ()

~EpetraMatrix ()

bool need_full_sparsity_pattern () const

void update_sparsity_pattern (const SparsityPattern::Graph &)

void init (const unsigned int m, const unsigned int n, const unsigned int m_l, const unsigned int n_l, const unsigned int nnz=30, const unsigned int noz=10)

void init ()

void clear ()

void zero ()

void close () const

unsigned int m () const

unsigned int n () const

unsigned int row_start () const

unsigned int row_stop () const

void set (const unsigned int i, const unsigned int j, const T value)

void add (const unsigned int i, const unsigned int j, const T value)

void add_matrix (const DenseMatrix< T > &dm, const std::vector< unsigned int > &rows, const std::vector< unsigned int > &cols)

void add_matrix (const DenseMatrix< T > &dm, const std::vector< unsigned int > &dof_indices)

void add (const T a, SparseMatrix< T > &X)

T operator() (const unsigned int i, const unsigned int j) const

Real l1_norm () const

Real linfty_norm () const

bool closed () const

void print_personal (std::ostream &os=std::cout) const

void print_matlab (const std::string name='NULL') const

void get_diagonal (NumericVector< T > &dest) const

virtual void get_transpose (SparseMatrix< T > &dest) const

void swap (EpetraMatrix< T > &)

Epetra_FECrsMatrix * mat ()

virtual bool initialized () const

void attach_dof_map (const DofMap &dof_map)

virtual void zero_rows (std::vector< int > &rows, T diag_value=0.0)

void print (std::ostream &os=std::cout) const

template<> void print (std::ostream &os) const

virtual void create_submatrix (SparseMatrix< T > &submatrix, const std::vector< unsigned int > &rows, const std::vector< unsigned int > &cols) const

virtual void reinit_submatrix (SparseMatrix< T > &submatrix, const std::vector< unsigned int > &rows, const std::vector< unsigned int > &cols) const

void vector_mult (NumericVector< T > &dest, const NumericVector< T > &arg) const

void vector_mult_add (NumericVector< T > &dest, const NumericVector< T > &arg) const
 

Static Public Member Functions


static AutoPtr< SparseMatrix< T > > build (const SolverPackage solver_package=libMesh::default_solver_package())

static std::string get_info ()

static void print_info ()

static unsigned int n_objects ()
 

Protected Types


typedef std::map< std::string, std::pair< unsigned int, unsigned int > > Counts
 

Protected Member Functions


virtual void _get_submatrix (SparseMatrix< T > &, const std::vector< unsigned int > &, const std::vector< unsigned int > &, const bool) const

void increment_constructor_count (const std::string &name)

void increment_destructor_count (const std::string &name)
 

Protected Attributes


DofMap const * _dof_map

bool _is_initialized
 

Static Protected Attributes


static Counts _counts

static Threads::atomic< unsigned int > _n_objects

static Threads::spin_mutex _mutex
 

Private Attributes


Epetra_FECrsMatrix * _mat

Epetra_Map * _map

Epetra_CrsGraph * _graph

bool _destroy_mat_on_exit
 

Friends


template<typename U > std::ostream & operator<< (std::ostream &os, const SparseMatrix< U > &m)
 

Detailed Description

 

template<typename T> class EpetraMatrix< T >

Epetra matrix. Provides a nice interface to the Epetra data structures for parallel, sparse matrices.

Author:

Benjamin S. Kirk, 2008

Definition at line 54 of file trilinos_epetra_matrix.h.  

Member Typedef Documentation

 

typedef std::map<std::string, std::pair<unsigned int, unsigned int> > ReferenceCounter::Counts [protected, inherited]Data structure to log the information. The log is identified by the class name.

Definition at line 105 of file reference_counter.h.  

Constructor & Destructor Documentation

 

template<typename T > EpetraMatrix< T >::EpetraMatrix () [inline]Constructor; initializes the matrix to be empty, without any structure, i.e. the matrix is not usable at all. This constructor is therefore only useful for matrices which are members of a class. All other matrices should be created at a point in the data flow where all necessary information is available.

You have to initialize the matrix before usage with init(...).

Definition at line 360 of file trilinos_epetra_matrix.h.

  : _destroy_mat_on_exit(true)
{}
 

template<typename T > EpetraMatrix< T >::~EpetraMatrix () [inline]Constructor. Creates a EpetraMatrix assuming you already have a valid Mat object. In this case, m is NOT destroyed by the EpetraMatrix destructor when this object goes out of scope. This allows ownership of m to remain with the original creator, and to simply provide additional functionality with the EpetraMatrix. Destructor. Free all memory, but do not release the memory of the sparsity structure.

Definition at line 381 of file trilinos_epetra_matrix.h.

{
  this->clear();
}
 

Member Function Documentation

 

template<typename T> virtual void SparseMatrix< T >::_get_submatrix (SparseMatrix< T > &, const std::vector< unsigned int > &, const std::vector< unsigned int > &, const bool) const [inline, protected, virtual, inherited]Protected implementation of the create_submatrix and reinit_submatrix routines. Note that this function must be redefined in derived classes for it to work properly!

Reimplemented in PetscMatrix< T >.

Definition at line 382 of file sparse_matrix.h.

Referenced by SparseMatrix< Number >::create_submatrix(), and SparseMatrix< Number >::reinit_submatrix().

  {
    std::cerr << 'Error! This function is not yet implemented in the base class!'
              << std::endl;
    libmesh_error();
  }
 

template<typename T > void EpetraMatrix< T >::add (const unsigned inti, const unsigned intj, const Tvalue) [inline, virtual]Add value to the element (i,j). Throws an error if the entry does not exist. Still, it is allowed to store zero values in non-existent fields.

Implements SparseMatrix< T >.

Definition at line 469 of file trilinos_epetra_matrix.h.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  
  int 
    epetra_i = static_cast<int>(i),
    epetra_j = static_cast<int>(j);

  T epetra_value = value;
  
  _mat->SumIntoGlobalValues (epetra_i, 1, &epetra_value, &epetra_j);
}
 

template<typename T > void EpetraMatrix< T >::add (const Ta, SparseMatrix< T > &X) [inline, virtual]Add a Sparse matrix X, scaled with a, to this, stores the result in this: $ exttt{this} = a*X + exttt{this} $. Use this with caution, the sparse matrices need to have the same nonzero pattern, otherwise PETSc will crash! It is advisable to not only allocate appropriate memory with init() , but also explicitly zero the terms of this whenever you add a non-zero value to X. Note: X will be closed, if not already done, before performing any work.

Implements SparseMatrix< T >.

Definition at line 498 of file trilinos_epetra_matrix.h.

References libMesh::initialized(), SparseMatrix< T >::m(), and SparseMatrix< T >::n().

{
  libmesh_assert (this->initialized());

  // sanity check. but this cannot avoid 
  // crash due to incompatible sparsity structure...
  libmesh_assert (this->m() == X_in.m());
  libmesh_assert (this->n() == X_in.n());

  libmesh_not_implemented();

//   PetscScalar     a = static_cast<PetscScalar>      (a_in);
//   EpetraMatrix<T>* X = dynamic_cast<EpetraMatrix<T>*> (&X_in);

//   libmesh_assert (X != NULL);
  
//   int ierr=0;

//   // the matrix from which we copy the values has to be assembled/closed
//   X->close ();

// // 2.2.x & earlier style
// #if PETSC_VERSION_LESS_THAN(2,3,0)  
  
//   ierr = MatAXPY(&a,  X->_mat, _mat, SAME_NONZERO_PATTERN);
//          CHKERRABORT(libMesh::COMM_WORLD,ierr);
         
// // 2.3.x & newer
// #else
  
//   ierr = MatAXPY(_mat, a, X->_mat, DIFFERENT_NONZERO_PATTERN);
//          CHKERRABORT(libMesh::COMM_WORLD,ierr);
         
// #endif
}
 

template<typename T > void EpetraMatrix< T >::add_matrix (const DenseMatrix< T > &dm, const std::vector< unsigned int > &rows, const std::vector< unsigned int > &cols) [virtual]Add the full matrix to the Petsc matrix. This is useful for adding an element matrix at assembly time

Implements SparseMatrix< T >.

Definition at line 301 of file trilinos_epetra_matrix.C.

References DenseMatrix< T >::get_values(), libMesh::initialized(), DenseMatrixBase< T >::m(), and DenseMatrixBase< T >::n().

{
  libmesh_assert (this->initialized());

  const unsigned int m = dm.m();
  const unsigned int n = dm.n();

  libmesh_assert (rows.size() == m);
  libmesh_assert (cols.size() == n);

  _mat->SumIntoGlobalValues(m, (int *)&rows[0], n, (int *)&cols[0], &dm.get_values()[0]);
}
 

template<typename T > void EpetraMatrix< T >::add_matrix (const DenseMatrix< T > &dm, const std::vector< unsigned int > &dof_indices) [inline, virtual]Same, but assumes the row and column maps are the same. Thus the matrix dm must be square.

Implements SparseMatrix< T >.

Definition at line 488 of file trilinos_epetra_matrix.h.

{
  this->add_matrix (dm, dof_indices, dof_indices);
}
 

template<typename T> void SparseMatrix< T >::attach_dof_map (const DofMap &dof_map) [inline, inherited]Get a pointer to the DofMap to use.

Definition at line 100 of file sparse_matrix.h.

Referenced by DofMap::attach_matrix().

  { _dof_map = &dof_map; }
 

template<typename T > AutoPtr< SparseMatrix< T > > SparseMatrix< T >::build (const SolverPackagesolver_package = libMesh::default_solver_package()) [static, inherited]Builds a SparseMatrix<T> using the linear solver package specified by solver_package

Definition at line 40 of file sparse_matrix.C.

References LASPACK_SOLVERS, libMeshEnums::PETSC_SOLVERS, and TRILINOS_SOLVERS.

{
  // Build the appropriate vector
  switch (solver_package)
    {


#ifdef LIBMESH_HAVE_LASPACK
    case LASPACK_SOLVERS:
      {
        AutoPtr<SparseMatrix<T> > ap(new LaspackMatrix<T>);
        return ap;
      }
#endif


#ifdef LIBMESH_HAVE_PETSC
    case PETSC_SOLVERS:
      {
        AutoPtr<SparseMatrix<T> > ap(new PetscMatrix<T>);
        return ap;
      }
#endif


#ifdef LIBMESH_HAVE_TRILINOS
    case TRILINOS_SOLVERS:
      {
        AutoPtr<SparseMatrix<T> > ap(new EpetraMatrix<T>);
        return ap;
      }
#endif


    default:
      std::cerr << 'ERROR:  Unrecognized solver package: '
                << solver_package
                << std::endl;
      libmesh_error();
    }

  AutoPtr<SparseMatrix<T> > ap(NULL);
  return ap;    
}
 

template<typename T > void EpetraMatrix< T >::clear () [virtual]Release all memory and return to a state just like after having called the default constructor.

Implements SparseMatrix< T >.

Definition at line 201 of file trilinos_epetra_matrix.C.

References libMesh::libMeshPrivateData::_is_initialized, and libMesh::initialized().

{
//  delete _mat;
//  delete _map;

  this->_is_initialized = false;
  
  libmesh_assert (!this->initialized());
}
 

template<typename T > void EpetraMatrix< T >::close () const [inline, virtual]Call the Petsc assemble routines. sends necessary messages to other processors

Implements SparseMatrix< T >.

Definition at line 390 of file trilinos_epetra_matrix.h.

Referenced by AztecLinearSolver< T >::solve().

{
  libmesh_assert (_mat != NULL);
  
  _mat->GlobalAssemble();
}
 

template<typename T > bool EpetraMatrix< T >::closed () const [inline, virtual]see if Petsc matrix has been closed and fully assembled yet

Implements SparseMatrix< T >.

Definition at line 574 of file trilinos_epetra_matrix.h.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  libmesh_assert (this->_mat != NULL);
  
  return this->_mat->Filled();
}
 

template<typename T> virtual void SparseMatrix< T >::create_submatrix (SparseMatrix< T > &submatrix, const std::vector< unsigned int > &rows, const std::vector< unsigned int > &cols) const [inline, virtual, inherited]This function creates a matrix called 'submatrix' which is defined by the row and column indices given in the 'rows' and 'cols' entries. Currently this operation is only defined for the PetscMatrix type.

Definition at line 325 of file sparse_matrix.h.

  {
    this->_get_submatrix(submatrix,
                         rows,
                         cols,
                         false); // false means DO NOT REUSE submatrix
  }
 

template<typename T > void EpetraMatrix< T >::get_diagonal (NumericVector< T > &dest) const [virtual]Copies the diagonal part of the matrix into dest.

Implements SparseMatrix< T >.

Definition at line 366 of file trilinos_epetra_matrix.C.

References EpetraVector< T >::vec().

{
  // Convert vector to EpetraVector.
  EpetraVector<T>* epetra_dest = libmesh_cast_ptr<EpetraVector<T>*>(&dest);

  // Call Epetra function.
  _mat->ExtractDiagonalCopy(*(epetra_dest->vec()));
}
 

std::string ReferenceCounter::get_info () [static, inherited]Gets a string containing the reference information.

Definition at line 45 of file reference_counter.C.

References ReferenceCounter::_counts, and Quality::name().

Referenced by ReferenceCounter::print_info().

{
#if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)

  std::ostringstream out;
  
  out << '
      << ' ---------------------------------------------------------------------------- 
      << '| Reference count information                                                |
      << ' ---------------------------------------------------------------------------- ;
  
  for (Counts::iterator it = _counts.begin();
       it != _counts.end(); ++it)
    {
      const std::string name(it->first);
      const unsigned int creations    = it->second.first;
      const unsigned int destructions = it->second.second;

      out << '| ' << name << ' reference count information:
          << '|  Creations:    ' << creations    << '
          << '|  Destructions: ' << destructions << ';
    }
  
  out << ' ---------------------------------------------------------------------------- ;

  return out.str();

#else

  return '';
  
#endif
}
 

template<typename T > void EpetraMatrix< T >::get_transpose (SparseMatrix< T > &dest) const [virtual]Copies the transpose of the matrix into dest, which may be *this.

Implements SparseMatrix< T >.

Definition at line 378 of file trilinos_epetra_matrix.C.

{
  libmesh_not_implemented();
}
 

void ReferenceCounter::increment_constructor_count (const std::string &name) [inline, protected, inherited]Increments the construction counter. Should be called in the constructor of any derived class that will be reference counted.

Definition at line 149 of file reference_counter.h.

References ReferenceCounter::_counts, Quality::name(), and Threads::spin_mtx.

Referenced by ReferenceCountedObject< Value >::ReferenceCountedObject().

{
  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
  std::pair<unsigned int, unsigned int>& p = _counts[name];

  p.first++;
}
 

void ReferenceCounter::increment_destructor_count (const std::string &name) [inline, protected, inherited]Increments the destruction counter. Should be called in the destructor of any derived class that will be reference counted.

Definition at line 167 of file reference_counter.h.

References ReferenceCounter::_counts, Quality::name(), and Threads::spin_mtx.

Referenced by ReferenceCountedObject< Value >::~ReferenceCountedObject().

{
  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
  std::pair<unsigned int, unsigned int>& p = _counts[name];

  p.second++;
}
 

template<typename T > void EpetraMatrix< T >::init (const unsigned intm, const unsigned intn, const unsigned intm_l, const unsigned intn_l, const unsigned intnnz = 30, const unsigned intnoz = 10) [virtual]Initialize a Petsc matrix that is of global dimension $ m imes n $ with local dimensions $ m_l imes n_l $. nnz is the number of on-processor nonzeros per row (defaults to 30). noz is the number of on-processor nonzeros per row (defaults to 30).

Implements SparseMatrix< T >.

Definition at line 117 of file trilinos_epetra_matrix.C.

References libMesh::libMeshPrivateData::_is_initialized, libMesh::COMM_WORLD, and libMesh::initialized().

{
  if ((m==0) || (n==0))
    return;

  {
    // Clear initialized matrices
    if (this->initialized())
      this->clear();

    libmesh_assert (this->_mat == NULL);
    libmesh_assert (this->_map == NULL);

    this->_is_initialized = true;
  }

  // error checking
#ifndef NDEBUG
  {
    libmesh_assert (n == m);
    libmesh_assert (n_l == m_l);

    unsigned int 
      summed_m_l = m_l,
      summed_n_l = n_l;

    Parallel::sum (summed_m_l);
    Parallel::sum (summed_n_l);

    libmesh_assert (m == summed_m_l);
    libmesh_assert (n == summed_n_l);
  }
#endif

  // build a map defining the data distribution
  _map = new Epetra_Map (m, 
                         m_l,
                         0,
                         Epetra_MpiComm (libMesh::COMM_WORLD));
  
  libmesh_assert (static_cast<unsigned int>(_map->NumGlobalPoints()) == m);
  libmesh_assert (static_cast<unsigned int>(_map->MaxAllGID()+1) == m);

  _mat = new Epetra_FECrsMatrix (Copy, *_map, nnz + noz);
}
 

template<typename T > void EpetraMatrix< T >::init () [virtual]Initialize using sparsity structure computed by dof_map.

Implements SparseMatrix< T >.

Definition at line 172 of file trilinos_epetra_matrix.C.

References libMesh::libMeshPrivateData::_is_initialized, and libMesh::initialized().

{
  libmesh_assert (this->_dof_map != NULL);
  
  {
    // Clear initialized matrices
    if (this->initialized())
      this->clear();

    this->_is_initialized = true;
  }
  

  _mat = new Epetra_FECrsMatrix (Copy, *_graph);
}
 

template<typename T> virtual bool SparseMatrix< T >::initialized () const [inline, virtual, inherited]Returns:

true if the matrix has been initialized, false otherwise.

Definition at line 95 of file sparse_matrix.h.

Referenced by PetscMatrix< T >::_get_submatrix(), ImplicitSystem::assemble(), and ImplicitSystem::init_matrices().

{ return _is_initialized; }
 

template<typename T > Real EpetraMatrix< T >::l1_norm () const [virtual]Return the l1-norm of the matrix, that is $|M|_1=max_{all columns j}um_{all rows i} |M_ij|$, (max. sum of columns). This is the natural matrix norm that is compatible to the l1-norm for vectors, i.e. $|Mv|_1
mmerlin-Hoffmann : Numerische Mathematik)

Implements SparseMatrix< T >.

Definition at line 214 of file trilinos_epetra_matrix.C.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  
  libmesh_assert (_mat != NULL);

  return static_cast<Real>(_mat->NormOne());
}
 

template<typename T > Real EpetraMatrix< T >::linfty_norm () const [virtual]Return the linfty-norm of the matrix, that is $|M|_infty=max_{all rows i}um_{all columns j} |M_ij|$, (max. sum of rows). This is the natural matrix norm that is compatible to the linfty-norm of vectors, i.e. $|Mv|_infty
mmerlin-Hoffmann : Numerische Mathematik)

Implements SparseMatrix< T >.

Definition at line 226 of file trilinos_epetra_matrix.C.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  
  
  libmesh_assert (_mat != NULL);

  return static_cast<Real>(_mat->NormInf());
}
 

template<typename T > unsigned int EpetraMatrix< T >::m () const [inline, virtual]Returns:

m, the row-dimension of the matrix where the marix is $ M imes N $.

Implements SparseMatrix< T >.

Definition at line 401 of file trilinos_epetra_matrix.h.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  
  return static_cast<unsigned int>(_mat->NumGlobalRows());
}
 

template<typename T> Epetra_FECrsMatrix* EpetraMatrix< T >::mat () [inline]Returns the raw PETSc matrix context pointer. Note this is generally not required in user-level code. Just don't do anything crazy like calling MatDestroy()!

Definition at line 309 of file trilinos_epetra_matrix.h.

References EpetraMatrix< T >::_mat.

Referenced by AztecLinearSolver< T >::solve().

{ libmesh_assert (_mat != NULL); return _mat; }
 

template<typename T > unsigned int EpetraMatrix< T >::n () const [inline, virtual]Returns:

n, the column-dimension of the matrix where the marix is $ M imes N $.

Implements SparseMatrix< T >.

Definition at line 412 of file trilinos_epetra_matrix.h.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  
  return static_cast<unsigned int>(_mat->NumGlobalCols());
}
 

static unsigned int ReferenceCounter::n_objects () [inline, static, inherited]Prints the number of outstanding (created, but not yet destroyed) objects.

Definition at line 76 of file reference_counter.h.

References ReferenceCounter::_n_objects.

Referenced by System::read_serialized_blocked_dof_objects(), and System::write_serialized_blocked_dof_objects().

  { return _n_objects; }
 

template<typename T> bool EpetraMatrix< T >::need_full_sparsity_pattern () const [inline, virtual]The EpetraMatrix needs the full sparsity pattern.

Reimplemented from SparseMatrix< T >.

Definition at line 93 of file trilinos_epetra_matrix.h.

  { return true; }
 

template<typename T > T EpetraMatrix< T >::operator() (const unsigned inti, const unsigned intj) const [inline, virtual]Return the value of the entry (i,j). This may be an expensive operation and you should always take care where to call this function. In order to avoid abuse, this function throws an exception if the required element does not exist in the matrix.

In case you want a function that returns zero instead (for entries that are not in the sparsity pattern of the matrix), use the el function.

Implements SparseMatrix< T >.

Definition at line 539 of file trilinos_epetra_matrix.h.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  libmesh_assert (this->_mat != NULL);
  libmesh_assert (this->_mat->MyGlobalRow(i));
  libmesh_assert (i >= this->row_start());
  libmesh_assert (i < this->row_stop());


  int row_length, *row_indices;
  double *values;

  _mat->ExtractMyRowView (i-this->row_start(),
                          row_length,
                          values,
                          row_indices);

  //std::cout << 'row_length=' << row_length << std::endl;

  int *index = std::lower_bound (row_indices, row_indices+row_length, j);

  libmesh_assert (*index < row_length);
  libmesh_assert (static_cast<unsigned int>(row_indices[*index]) == j);

  //std::cout << 'val=' << values[*index] << std::endl;
  
  return values[*index];
}
 

template<> void SparseMatrix< Complex >::print (std::ostream &os) const [inline, inherited]

Definition at line 429 of file sparse_matrix.h.

{
  // std::complex<>::operator<<() is defined, but use this form

  std::cout << 'Real part:' << std::endl;
  for (unsigned int i=0; i<this->m(); i++)
    {
      for (unsigned int j=0; j<this->n(); j++)
        os << std::setw(8) << (*this)(i,j).real() << ' ';
      os << std::endl;
    }

  os << std::endl << 'Imaginary part:' << std::endl;
  for (unsigned int i=0; i<this->m(); i++)
    {
      for (unsigned int j=0; j<this->n(); j++)
        os << std::setw(8) << (*this)(i,j).imag() << ' ';
      os << std::endl;
    }
}
 

template<typename T > void SparseMatrix< T >::print (std::ostream &os = std::cout) const [inline, inherited]Print the contents of the matrix to the screen in a uniform style, regardless of matrix/solver package being used.

Definition at line 118 of file sparse_matrix.C.

References libMesh::initialized(), libMesh::n_processors(), and libMesh::processor_id().

Referenced by LaspackMatrix< T >::print_personal().

{
  parallel_only();

  libmesh_assert (this->initialized());

  // We'll print the matrix from processor 0 to make sure
  // it's serialized properly
  if (libMesh::processor_id() == 0)
    {
      libmesh_assert(this->_dof_map->first_dof() == 0);
      for (unsigned int i=this->_dof_map->first_dof();
           i!=this->_dof_map->end_dof(); ++i)
        {
          for (unsigned int j=0; j<this->n(); j++)
            os << (*this)(i,j) << ' ';
          os << std::endl;
        }

      std::vector<unsigned int> ibuf, jbuf;
      std::vector<T> cbuf;
      unsigned int currenti = this->_dof_map->end_dof();
      for (unsigned int p=1; p < libMesh::n_processors(); ++p)
        {
          Parallel::receive(p, ibuf);
          Parallel::receive(p, jbuf);
          Parallel::receive(p, cbuf);
          libmesh_assert(ibuf.size() == jbuf.size());
          libmesh_assert(ibuf.size() == cbuf.size());

          if (ibuf.empty())
            continue;
          libmesh_assert(ibuf.front() >= currenti);
          libmesh_assert(ibuf.back() >= ibuf.front());

          unsigned int currentb = 0;
          for (;currenti <= ibuf.back(); ++currenti)
            {
              for (unsigned int j=0; j<this->n(); j++)
                {
                  if (currentb < ibuf.size() &&
                      ibuf[currentb] == currenti &&
                      jbuf[currentb] == j)
                    {
                      os << cbuf[currentb] << ' ';
                      currentb++;
                    }
                  else
                    os << static_cast<T>(0.0) << ' ';
                }
              os << std::endl;
            }
        }
      for (; currenti != this->m(); ++currenti)
        {
          for (unsigned int j=0; j<this->n(); j++)
            os << static_cast<T>(0.0) << ' ';
          os << std::endl;
        }
    }
  else
    {
      std::vector<unsigned int> ibuf, jbuf;
      std::vector<T> cbuf;

      // We'll assume each processor has access to entire
      // matrix rows, so (*this)(i,j) is valid if i is a local index.
      for (unsigned int i=this->_dof_map->first_dof();
           i!=this->_dof_map->end_dof(); ++i)
        {
          for (unsigned int j=0; j<this->n(); j++)
            {
              T c = (*this)(i,j);
              if (c != static_cast<T>(0.0))
                {
                  ibuf.push_back(i);
                  jbuf.push_back(j);
                  cbuf.push_back(c);
                }
            }
        }
      Parallel::send(0,ibuf);
      Parallel::send(0,jbuf);
      Parallel::send(0,cbuf);
    }
}
 

void ReferenceCounter::print_info () [static, inherited]Prints the reference information to std::cout.

Definition at line 83 of file reference_counter.C.

References ReferenceCounter::get_info().

{
#if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
  
  std::cout << ReferenceCounter::get_info();
  
#endif
}
 

template<typename T > void EpetraMatrix< T >::print_matlab (const std::stringname = 'NULL') const [virtual]Print the contents of the matrix in Matlab's sparse matrix format. Optionally prints the matrix to the file named name. If name is not specified it is dumped to the screen.

Create an ASCII file containing the matrix if a filename was provided.

Otherwise the matrix will be dumped to the screen.

Destroy the viewer.

Reimplemented from SparseMatrix< T >.

Definition at line 240 of file trilinos_epetra_matrix.C.

References libMesh::close(), and libMesh::initialized().

{
  libmesh_assert (this->initialized());

  // libmesh_assert (this->closed());
  this->close();
  
  libmesh_not_implemented();

//   int ierr=0; 
//   PetscViewer petsc_viewer;


//   ierr = PetscViewerCreate (libMesh::COMM_WORLD,
//                          &petsc_viewer);
//          CHKERRABORT(libMesh::COMM_WORLD,ierr);

//   /**
//    * Create an ASCII file containing the matrix
//    * if a filename was provided.  
//    */
//   if (name != 'NULL')
//     {
//       ierr = PetscViewerASCIIOpen( libMesh::COMM_WORLD,
//                                 name.c_str(),
//                                 &petsc_viewer);
//              CHKERRABORT(libMesh::COMM_WORLD,ierr);
      
//       ierr = PetscViewerSetFormat (petsc_viewer,
//                                 PETSC_VIEWER_ASCII_MATLAB);
//              CHKERRABORT(libMesh::COMM_WORLD,ierr);
  
//       ierr = MatView (_mat, petsc_viewer);
//              CHKERRABORT(libMesh::COMM_WORLD,ierr);
//     }

//   /**
//    * Otherwise the matrix will be dumped to the screen.
//    */
//   else
//     {
//       ierr = PetscViewerSetFormat (PETSC_VIEWER_STDOUT_WORLD,
//                                 PETSC_VIEWER_ASCII_MATLAB);
//              CHKERRABORT(libMesh::COMM_WORLD,ierr);
  
//       ierr = MatView (_mat, PETSC_VIEWER_STDOUT_WORLD);
//              CHKERRABORT(libMesh::COMM_WORLD,ierr);
//     }


//   /**
//    * Destroy the viewer.
//    */
//   ierr = PetscViewerDestroy (petsc_viewer);
//          CHKERRABORT(libMesh::COMM_WORLD,ierr);
}
 

template<typename T > void EpetraMatrix< T >::print_personal (std::ostream &os = std::cout) const [inline, virtual]Print the contents of the matrix to the screen.

Implements SparseMatrix< T >.

Definition at line 600 of file trilinos_epetra_matrix.h.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  libmesh_assert (_mat != NULL);

  os << *_mat;
}
 

template<typename T> virtual void SparseMatrix< T >::reinit_submatrix (SparseMatrix< T > &submatrix, const std::vector< unsigned int > &rows, const std::vector< unsigned int > &cols) const [inline, virtual, inherited]This function is similar to the one above, but it allows you to reuse the existing sparsity pattern of 'submatrix' instead of reallocating it again. This should hopefully be more efficient if you are frequently extracting submatrices of the same size.

Definition at line 341 of file sparse_matrix.h.

  {
    this->_get_submatrix(submatrix,
                         rows,
                         cols,
                         true); // true means REUSE submatrix
  }
 

template<typename T > unsigned int EpetraMatrix< T >::row_start () const [inline, virtual]return row_start, the index of the first matrix row stored on this processor

Implements SparseMatrix< T >.

Definition at line 423 of file trilinos_epetra_matrix.h.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  libmesh_assert (_map != NULL);

  return static_cast<unsigned int>(_map->MinMyGID());
}
 

template<typename T > unsigned int EpetraMatrix< T >::row_stop () const [inline, virtual]return row_stop, the index of the last matrix row (+1) stored on this processor

Implements SparseMatrix< T >.

Definition at line 435 of file trilinos_epetra_matrix.h.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  libmesh_assert (_map != NULL);

  return static_cast<unsigned int>(_map->MaxMyGID())+1;
}
 

template<typename T > void EpetraMatrix< T >::set (const unsigned inti, const unsigned intj, const Tvalue) [inline, virtual]Set the element (i,j) to value. Throws an error if the entry does not exist. Still, it is allowed to store zero values in non-existent fields.

Implements SparseMatrix< T >.

Definition at line 447 of file trilinos_epetra_matrix.h.

References libMesh::initialized().

{  
  libmesh_assert (this->initialized());

  int 
    epetra_i = static_cast<int>(i),
    epetra_j = static_cast<int>(j);

  T epetra_value = value;

  if (_mat->Filled())    
    _mat->ReplaceGlobalValues (epetra_i, 1, &epetra_value, &epetra_j);
  else    
    _mat->InsertGlobalValues (epetra_i, 1, &epetra_value, &epetra_j);
}
 

template<typename T > void EpetraMatrix< T >::swap (EpetraMatrix< T > &) [inline]Swaps the raw PETSc matrix context pointers.

Definition at line 586 of file trilinos_epetra_matrix.h.

{
  libmesh_not_implemented();

//   std::swap(_mat, m._mat);
//   std::swap(_destroy_mat_on_exit, m._destroy_mat_on_exit);
}
 

template<typename T > void EpetraMatrix< T >::update_sparsity_pattern (const SparsityPattern::Graph &sparsity_pattern) [virtual]Updates the matrix sparsity pattern. This will tell the underlying matrix storage scheme how to map the $ (i,j) $ elements.

Reimplemented from SparseMatrix< T >.

Definition at line 39 of file trilinos_epetra_matrix.C.

References libMesh::COMM_WORLD, libMesh::init(), libMesh::initialized(), std::min(), and libMesh::processor_id().

{  
  // clear data, start over
  this->clear ();    

  // big trouble if this fails!
  libmesh_assert (this->_dof_map != NULL);
  
  const unsigned int n_rows = sparsity_pattern.size();

  const unsigned int m   = this->_dof_map->n_dofs();
  const unsigned int n   = m;
  const unsigned int n_l = this->_dof_map->n_dofs_on_processor(libMesh::processor_id()); 
  const unsigned int m_l = n_l;

  // error checking
#ifndef NDEBUG
  {
    libmesh_assert (n == m);
    libmesh_assert (n_l == m_l);

    unsigned int 
      summed_m_l = m_l,
      summed_n_l = n_l;

    Parallel::sum (summed_m_l);
    Parallel::sum (summed_n_l);

    libmesh_assert (m == summed_m_l);
    libmesh_assert (n == summed_n_l);
  }
#endif
  
  // build a map defining the data distribution
  _map = new Epetra_Map (m, 
                         m_l,
                         0,
                         Epetra_MpiComm (libMesh::COMM_WORLD));

  libmesh_assert (static_cast<unsigned int>(_map->NumGlobalPoints()) == m);
  libmesh_assert (static_cast<unsigned int>(_map->MaxAllGID()+1) == m);
  
  const std::vector<unsigned int>& n_nz = this->_dof_map->get_n_nz();
  const std::vector<unsigned int>& n_oz = this->_dof_map->get_n_oz();
  
   // Make sure the sparsity pattern isn't empty
  libmesh_assert (n_nz.size() == n_l);
  libmesh_assert (n_oz.size() == n_l);

  // Epetra wants the total number of nonzeros, both local and remote.
  std::vector<int> n_nz_tot;  n_nz_tot.reserve(n_nz.size());
  
  for (unsigned int i=0; i<n_nz.size(); i++)    
    n_nz_tot.push_back(std::min(n_nz[i] + n_oz[i], n));
  
  if (m==0)
    return;

  _graph = new Epetra_CrsGraph(Copy, *_map, &n_nz_tot[0]);

  // Tell the matrix about its structure.  Initialize it
  // to zero.
  for (unsigned int i=0; i<n_rows; i++)
    _graph->InsertGlobalIndices(_graph->GRID(i),
                                sparsity_pattern[i].size(),
                                const_cast<int *>((const int *)&sparsity_pattern[i][0]));

  _graph->FillComplete();

  //Initialize the matrix
  libmesh_assert (!this->initialized());
  this->init ();
  libmesh_assert (this->initialized());
}
 

template<typename T> void SparseMatrix< T >::vector_mult (NumericVector< T > &dest, const NumericVector< T > &arg) const [inherited]Multiplies the matrix with arg and stores the result in dest.

Definition at line 87 of file sparse_matrix.C.

References NumericVector< T >::zero().

{
  dest.zero();
  this->vector_mult_add(dest,arg);
}
 

template<typename T> void SparseMatrix< T >::vector_mult_add (NumericVector< T > &dest, const NumericVector< T > &arg) const [inherited]Multiplies the matrix with arg and adds the result to dest.

Definition at line 97 of file sparse_matrix.C.

References NumericVector< T >::add_vector().

{
  /* This functionality is actually implemented in the 
NumericVector class. */ dest.add_vector(arg,*this); }
 

template<typename T > void EpetraMatrix< T >::zero () [virtual]Set all entries to 0. This method retains sparsity structure.

Implements SparseMatrix< T >.

Definition at line 191 of file trilinos_epetra_matrix.C.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  
  _mat->Scale(0.0);
}
 

template<typename T> void SparseMatrix< T >::zero_rows (std::vector< int > &rows, Tdiag_value = 0.0) [virtual, inherited]Set all row entries to 0 then puts diag_value in the diagonal entry

Reimplemented in PetscMatrix< T >.

Definition at line 108 of file sparse_matrix.C.

{
  /* This functionality isn't implemented or stubbed in every subclass yet */
  libmesh_not_implemented();
}
 

Friends And Related Function Documentation

 

template<typename T> template<typename U > std::ostream& operator<< (std::ostream &os, const SparseMatrix< U > &m) [friend, inherited]Same as the print method above, but allows you to print to a stream in the standard syntax.

 

Member Data Documentation

 

ReferenceCounter::Counts ReferenceCounter::_counts [static, protected, inherited]Actually holds the data.

Definition at line 110 of file reference_counter.h.

Referenced by ReferenceCounter::get_info(), ReferenceCounter::increment_constructor_count(), and ReferenceCounter::increment_destructor_count().  

template<typename T> bool EpetraMatrix< T >::_destroy_mat_on_exit [private]This boolean value should only be set to false for the constructor which takes a PETSc Mat object.

Definition at line 350 of file trilinos_epetra_matrix.h.  

template<typename T> DofMap const* SparseMatrix< T >::_dof_map [protected, inherited]The DofMap object associated with this object.

Definition at line 395 of file sparse_matrix.h.

Referenced by SparseMatrix< Number >::attach_dof_map().  

template<typename T> Epetra_CrsGraph* EpetraMatrix< T >::_graph [private]Holds the sparsity pattern

Definition at line 344 of file trilinos_epetra_matrix.h.  

template<typename T> bool SparseMatrix< T >::_is_initialized [protected, inherited]Flag indicating whether or not the matrix has been initialized.

Definition at line 401 of file sparse_matrix.h.

Referenced by PetscMatrix< T >::_get_submatrix(), PetscMatrix< T >::get_transpose(), SparseMatrix< Number >::initialized(), and PetscMatrix< T >::PetscMatrix().  

template<typename T> Epetra_Map* EpetraMatrix< T >::_map [private]Holds the distributed Map

Definition at line 339 of file trilinos_epetra_matrix.h.  

template<typename T> Epetra_FECrsMatrix* EpetraMatrix< T >::_mat [private]This function either creates or re-initializes a matrix called 'submatrix' which is defined by the row and column indices given in the 'rows' and 'cols' entries. This function is implemented in terms of the MatGetSubMatrix() routine of PETSc. The boolean reuse_submatrix parameter determines whether or not PETSc will treat 'submatrix' as one which has already been used (had memory allocated) or as a new matrix. Actual Epetra datatype to hold matrix entries

Definition at line 334 of file trilinos_epetra_matrix.h.

Referenced by EpetraMatrix< T >::mat().  

Threads::spin_mutex ReferenceCounter::_mutex [static, protected, inherited]Mutual exclusion object to enable thread-safe reference counting.

Definition at line 123 of file reference_counter.h.  

Threads::atomic< unsigned int > ReferenceCounter::_n_objects [static, protected, inherited]The number of objects. Print the reference count information when the number returns to 0.

Definition at line 118 of file reference_counter.h.

Referenced by ReferenceCounter::n_objects(), ReferenceCounter::ReferenceCounter(), and ReferenceCounter::~ReferenceCounter().

 

Author

Generated automatically by Doxygen for libMesh from the source code.


 

Index

NAME
SYNOPSIS
Public Member Functions
Static Public Member Functions
Protected Types
Protected Member Functions
Protected Attributes
Static Protected Attributes
Private Attributes
Friends
Detailed Description
template<typename T> class EpetraMatrix< T >
Member Typedef Documentation
typedef std::map<std::string, std::pair<unsigned int, unsigned int> > ReferenceCounter::Counts [protected, inherited]Data structure to log the information. The log is identified by the class name.
Constructor & Destructor Documentation
template<typename T > EpetraMatrix< T >::EpetraMatrix () [inline]Constructor; initializes the matrix to be empty, without any structure, i.e. the matrix is not usable at all. This constructor is therefore only useful for matrices which are members of a class. All other matrices should be created at a point in the data flow where all necessary information is available.
template<typename T > EpetraMatrix< T >::~EpetraMatrix () [inline]Constructor. Creates a EpetraMatrix assuming you already have a valid Mat object. In this case, m is NOT destroyed by the EpetraMatrix destructor when this object goes out of scope. This allows ownership of m to remain with the original creator, and to simply provide additional functionality with the EpetraMatrix. Destructor. Free all memory, but do not release the memory of the sparsity structure.
Member Function Documentation
template<typename T> virtual void SparseMatrix< T >::_get_submatrix (SparseMatrix< T > &, const std::vector< unsigned int > &, const std::vector< unsigned int > &, const bool) const [inline, protected, virtual, inherited]Protected implementation of the create_submatrix and reinit_submatrix routines. Note that this function must be redefined in derived classes for it to work properly!
template<typename T > void EpetraMatrix< T >::add (const unsigned inti, const unsigned intj, const Tvalue) [inline, virtual]Add value to the element (i,j). Throws an error if the entry does not exist. Still, it is allowed to store zero values in non-existent fields.
template<typename T > void EpetraMatrix< T >::add (const Ta, SparseMatrix< T > &X) [inline, virtual]Add a Sparse matrix X, scaled with a, to this, stores the result in this: $ exttt{this} = a*X + exttt{this} $. Use this with caution, the sparse matrices need to have the same nonzero pattern, otherwise PETSc will crash! It is advisable to not only allocate appropriate memory with init() , but also explicitly zero the terms of this whenever you add a non-zero value to X. Note: X will be closed, if not already done, before performing any work.
template<typename T > void EpetraMatrix< T >::add_matrix (const DenseMatrix< T > &dm, const std::vector< unsigned int > &rows, const std::vector< unsigned int > &cols) [virtual]Add the full matrix to the Petsc matrix. This is useful for adding an element matrix at assembly time
template<typename T > void EpetraMatrix< T >::add_matrix (const DenseMatrix< T > &dm, const std::vector< unsigned int > &dof_indices) [inline, virtual]Same, but assumes the row and column maps are the same. Thus the matrix dm must be square.
template<typename T> void SparseMatrix< T >::attach_dof_map (const DofMap &dof_map) [inline, inherited]Get a pointer to the DofMap to use.
template<typename T > AutoPtr< SparseMatrix< T > > SparseMatrix< T >::build (const SolverPackagesolver_package = libMesh::default_solver_package()) [static, inherited]Builds a SparseMatrix<T> using the linear solver package specified by solver_package
template<typename T > void EpetraMatrix< T >::clear () [virtual]Release all memory and return to a state just like after having called the default constructor.
template<typename T > void EpetraMatrix< T >::close () const [inline, virtual]Call the Petsc assemble routines. sends necessary messages to other processors
template<typename T > bool EpetraMatrix< T >::closed () const [inline, virtual]see if Petsc matrix has been closed and fully assembled yet
template<typename T> virtual void SparseMatrix< T >::create_submatrix (SparseMatrix< T > &submatrix, const std::vector< unsigned int > &rows, const std::vector< unsigned int > &cols) const [inline, virtual, inherited]This function creates a matrix called 'submatrix' which is defined by the row and column indices given in the 'rows' and 'cols' entries. Currently this operation is only defined for the PetscMatrix type.
template<typename T > void EpetraMatrix< T >::get_diagonal (NumericVector< T > &dest) const [virtual]Copies the diagonal part of the matrix into dest.
std::string ReferenceCounter::get_info () [static, inherited]Gets a string containing the reference information.
template<typename T > void EpetraMatrix< T >::get_transpose (SparseMatrix< T > &dest) const [virtual]Copies the transpose of the matrix into dest, which may be *this.
void ReferenceCounter::increment_constructor_count (const std::string &name) [inline, protected, inherited]Increments the construction counter. Should be called in the constructor of any derived class that will be reference counted.
void ReferenceCounter::increment_destructor_count (const std::string &name) [inline, protected, inherited]Increments the destruction counter. Should be called in the destructor of any derived class that will be reference counted.
template<typename T > void EpetraMatrix< T >::init (const unsigned intm, const unsigned intn, const unsigned intm_l, const unsigned intn_l, const unsigned intnnz = 30, const unsigned intnoz = 10) [virtual]Initialize a Petsc matrix that is of global dimension $ m imes n $ with local dimensions $ m_l imes n_l $. nnz is the number of on-processor nonzeros per row (defaults to 30). noz is the number of on-processor nonzeros per row (defaults to 30).
template<typename T > void EpetraMatrix< T >::init () [virtual]Initialize using sparsity structure computed by dof_map.
template<typename T> virtual bool SparseMatrix< T >::initialized () const [inline, virtual, inherited]Returns:
template<typename T > Real EpetraMatrix< T >::l1_norm () const [virtual]Return the l1-norm of the matrix, that is $|M|_1=max_{all columns j}um_{all rows i} |M_ij|$, (max. sum of columns). This is the natural matrix norm that is compatible to the l1-norm for vectors, i.e. $|Mv|_1
mmerlin-Hoffmann : Numerische Mathematik)
template<typename T > Real EpetraMatrix< T >::linfty_norm () const [virtual]Return the linfty-norm of the matrix, that is $|M|_infty=max_{all rows i}um_{all columns j} |M_ij|$, (max. sum of rows). This is the natural matrix norm that is compatible to the linfty-norm of vectors, i.e. $|Mv|_infty
mmerlin-Hoffmann : Numerische Mathematik)
template<typename T > unsigned int EpetraMatrix< T >::m () const [inline, virtual]Returns:
template<typename T> Epetra_FECrsMatrix* EpetraMatrix< T >::mat () [inline]Returns the raw PETSc matrix context pointer. Note this is generally not required in user-level code. Just don't do anything crazy like calling MatDestroy()!
template<typename T > unsigned int EpetraMatrix< T >::n () const [inline, virtual]Returns:
static unsigned int ReferenceCounter::n_objects () [inline, static, inherited]Prints the number of outstanding (created, but not yet destroyed) objects.
template<typename T> bool EpetraMatrix< T >::need_full_sparsity_pattern () const [inline, virtual]The EpetraMatrix needs the full sparsity pattern.
template<typename T > T EpetraMatrix< T >::operator() (const unsigned inti, const unsigned intj) const [inline, virtual]Return the value of the entry (i,j). This may be an expensive operation and you should always take care where to call this function. In order to avoid abuse, this function throws an exception if the required element does not exist in the matrix.
template<> void SparseMatrix< Complex >::print (std::ostream &os) const [inline, inherited]
template<typename T > void SparseMatrix< T >::print (std::ostream &os = std::cout) const [inline, inherited]Print the contents of the matrix to the screen in a uniform style, regardless of matrix/solver package being used.
void ReferenceCounter::print_info () [static, inherited]Prints the reference information to std::cout.
template<typename T > void EpetraMatrix< T >::print_matlab (const std::stringname = 'NULL') const [virtual]Print the contents of the matrix in Matlab's sparse matrix format. Optionally prints the matrix to the file named name. If name is not specified it is dumped to the screen.
template<typename T > void EpetraMatrix< T >::print_personal (std::ostream &os = std::cout) const [inline, virtual]Print the contents of the matrix to the screen.
template<typename T> virtual void SparseMatrix< T >::reinit_submatrix (SparseMatrix< T > &submatrix, const std::vector< unsigned int > &rows, const std::vector< unsigned int > &cols) const [inline, virtual, inherited]This function is similar to the one above, but it allows you to reuse the existing sparsity pattern of 'submatrix' instead of reallocating it again. This should hopefully be more efficient if you are frequently extracting submatrices of the same size.
template<typename T > unsigned int EpetraMatrix< T >::row_start () const [inline, virtual]return row_start, the index of the first matrix row stored on this processor
template<typename T > unsigned int EpetraMatrix< T >::row_stop () const [inline, virtual]return row_stop, the index of the last matrix row (+1) stored on this processor
template<typename T > void EpetraMatrix< T >::set (const unsigned inti, const unsigned intj, const Tvalue) [inline, virtual]Set the element (i,j) to value. Throws an error if the entry does not exist. Still, it is allowed to store zero values in non-existent fields.
template<typename T > void EpetraMatrix< T >::swap (EpetraMatrix< T > &) [inline]Swaps the raw PETSc matrix context pointers.
template<typename T > void EpetraMatrix< T >::update_sparsity_pattern (const SparsityPattern::Graph &sparsity_pattern) [virtual]Updates the matrix sparsity pattern. This will tell the underlying matrix storage scheme how to map the $ (i,j) $ elements.
template<typename T> void SparseMatrix< T >::vector_mult (NumericVector< T > &dest, const NumericVector< T > &arg) const [inherited]Multiplies the matrix with arg and stores the result in dest.
template<typename T> void SparseMatrix< T >::vector_mult_add (NumericVector< T > &dest, const NumericVector< T > &arg) const [inherited]Multiplies the matrix with arg and adds the result to dest.
template<typename T > void EpetraMatrix< T >::zero () [virtual]Set all entries to 0. This method retains sparsity structure.
template<typename T> void SparseMatrix< T >::zero_rows (std::vector< int > &rows, Tdiag_value = 0.0) [virtual, inherited]Set all row entries to 0 then puts diag_value in the diagonal entry
Friends And Related Function Documentation
template<typename T> template<typename U > std::ostream& operator<< (std::ostream &os, const SparseMatrix< U > &m) [friend, inherited]Same as the print method above, but allows you to print to a stream in the standard syntax.
Member Data Documentation
ReferenceCounter::Counts ReferenceCounter::_counts [static, protected, inherited]Actually holds the data.
template<typename T> bool EpetraMatrix< T >::_destroy_mat_on_exit [private]This boolean value should only be set to false for the constructor which takes a PETSc Mat object.
template<typename T> DofMap const* SparseMatrix< T >::_dof_map [protected, inherited]The DofMap object associated with this object.
template<typename T> Epetra_CrsGraph* EpetraMatrix< T >::_graph [private]Holds the sparsity pattern
template<typename T> bool SparseMatrix< T >::_is_initialized [protected, inherited]Flag indicating whether or not the matrix has been initialized.
template<typename T> Epetra_Map* EpetraMatrix< T >::_map [private]Holds the distributed Map
template<typename T> Epetra_FECrsMatrix* EpetraMatrix< T >::_mat [private]This function either creates or re-initializes a matrix called 'submatrix' which is defined by the row and column indices given in the 'rows' and 'cols' entries. This function is implemented in terms of the MatGetSubMatrix() routine of PETSc. The boolean reuse_submatrix parameter determines whether or not PETSc will treat 'submatrix' as one which has already been used (had memory allocated) or as a new matrix. Actual Epetra datatype to hold matrix entries
Threads::spin_mutex ReferenceCounter::_mutex [static, protected, inherited]Mutual exclusion object to enable thread-safe reference counting.
Threads::atomic< unsigned int > ReferenceCounter::_n_objects [static, protected, inherited]The number of objects. Print the reference count information when the number returns to 0.
Author

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