Poster of Linux kernelThe best gift for a Linux geek
DistributedVector

DistributedVector

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

NAME

DistributedVector -  

SYNOPSIS


#include <distributed_vector.h>

Inherits NumericVector< T >.  

Public Member Functions


DistributedVector (const ParallelType=AUTOMATIC)

DistributedVector (const unsigned int n, const ParallelType type=AUTOMATIC)

DistributedVector (const unsigned int n, const unsigned int n_local, const ParallelType type=AUTOMATIC)

DistributedVector (const unsigned int N, const unsigned int n_local, const std::vector< unsigned int > &ghost, const ParallelType type=AUTOMATIC)

~DistributedVector ()

void close ()

void clear ()

void zero ()

AutoPtr< NumericVector< T > > clone () const

void init (const unsigned int N, const unsigned int n_local, const bool fast=false, const ParallelType type=AUTOMATIC)

void init (const unsigned int N, const bool fast=false, const ParallelType type=AUTOMATIC)

virtual void init (const unsigned int, const unsigned int, const std::vector< unsigned int > &, const bool=false, const ParallelType=AUTOMATIC)

virtual void init (const NumericVector< T > &other, const bool fast=false)

NumericVector< T > & operator= (const T s)

NumericVector< T > & operator= (const NumericVector< T > &V)

DistributedVector< T > & operator= (const DistributedVector< T > &V)

NumericVector< T > & operator= (const std::vector< T > &v)

Real min () const

Real max () const

T sum () const

Real l1_norm () const

Real l2_norm () const

Real linfty_norm () const

unsigned int size () const

unsigned int local_size () const

unsigned int first_local_index () const

unsigned int last_local_index () const

T operator() (const unsigned int i) const

NumericVector< T > & operator+= (const NumericVector< T > &V)

NumericVector< T > & operator-= (const NumericVector< T > &V)

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

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

void add (const T s)

void add (const NumericVector< T > &V)

void add (const T a, const NumericVector< T > &v)

void add_vector (const std::vector< T > &v, const std::vector< unsigned int > &dof_indices)

void add_vector (const NumericVector< T > &V, const std::vector< unsigned int > &dof_indices)

void add_vector (const NumericVector< T > &, const SparseMatrix< T > &)

void add_vector (const DenseVector< T > &V, const std::vector< unsigned int > &dof_indices)

virtual void insert (const std::vector< T > &v, const std::vector< unsigned int > &dof_indices)

virtual void insert (const NumericVector< T > &V, const std::vector< unsigned int > &dof_indices)

virtual void insert (const DenseVector< T > &V, const std::vector< unsigned int > &dof_indices)

virtual void insert (const DenseSubVector< T > &V, const std::vector< unsigned int > &dof_indices)

void scale (const T factor)

virtual void abs ()

virtual T dot (const NumericVector< T > &V) const

void localize (std::vector< T > &v_local) const

void localize (NumericVector< T > &v_local) const

void localize (NumericVector< T > &v_local, const std::vector< unsigned int > &send_list) const

void localize (const unsigned int first_local_idx, const unsigned int last_local_idx, const std::vector< unsigned int > &send_list)

void localize_to_one (std::vector< T > &v_local, const unsigned int proc_id=0) const

virtual void pointwise_mult (const NumericVector< T > &vec1, const NumericVector< T > &vec2)

virtual void swap (NumericVector< T > &v)

virtual bool initialized () const

ParallelType type () const

ParallelType & type ()

virtual bool closed () const

virtual Real subset_l1_norm (const std::set< unsigned int > &indices)

virtual Real subset_l2_norm (const std::set< unsigned int > &indices)

virtual Real subset_linfty_norm (const std::set< unsigned int > &indices)

virtual T el (const unsigned int i) const

virtual void get (const std::vector< unsigned int > &index, std::vector< T > &values) const

NumericVector< T > & operator*= (const T a)

NumericVector< T > & operator/= (const T a)

void add_vector (const NumericVector< T > &v, const ShellMatrix< T > &a)

virtual int compare (const NumericVector< T > &other_vector, const Real threshold=TOLERANCE) const

template<> int compare (const NumericVector< float > &other_vector, const Real threshold) const

template<> int compare (const NumericVector< double > &other_vector, const Real threshold) const

template<> int compare (const NumericVector< long double > &other_vector, const Real threshold) const

template<> int compare (const NumericVector< Complex > &other_vector, const Real threshold) const

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

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

virtual void print_global (std::ostream &os=std::cout) const

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

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

virtual void create_subvector (NumericVector< T > &, const std::vector< unsigned int > &) const
 

Static Public Member Functions


static AutoPtr< NumericVector< 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


void increment_constructor_count (const std::string &name)

void increment_destructor_count (const std::string &name)
 

Protected Attributes


bool _is_closed

bool _is_initialized

ParallelType _type
 

Static Protected Attributes


static Counts _counts

static Threads::atomic< unsigned int > _n_objects

static Threads::spin_mutex _mutex
 

Private Attributes


std::vector< T > _values

unsigned int _global_size

unsigned int _local_size

unsigned int _first_local_index

unsigned int _last_local_index
 

Friends


std::ostream & operator<< (std::ostream &os, const NumericVector< T > &v)
 

Detailed Description

 

template<typename T> class DistributedVector< T >

Distributed vector. Provides an interface for simple parallel, distributed vectors. Offers some collective communication capabilities. Note that the class will sill function without MPI, but only on one processor. This lets us keep the parallel details behind the scenes.

Author:

Benjamin S. Kirk, 2003

Definition at line 55 of file distributed_vector.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 > DistributedVector< T >::DistributedVector (const ParallelTypetype = AUTOMATIC) [inline, explicit]Dummy-Constructor. Dimension=0

Definition at line 460 of file distributed_vector.h.

References NumericVector< T >::_type, and NumericVector< T >::type().

                                                                :
  _global_size      (0),
  _local_size       (0),
  _first_local_index(0),
  _last_local_index (0)
{
  this->_type = type;
}
 

template<typename T > DistributedVector< T >::DistributedVector (const unsigned intn, const ParallelTypetype = AUTOMATIC) [inline, explicit]Constructor. Set dimension to n and initialize all elements with zero.

Definition at line 473 of file distributed_vector.h.

References libMesh::init().

{
  this->init(n, n, false, type);
}
 

template<typename T > DistributedVector< T >::DistributedVector (const unsigned intn, const unsigned intn_local, const ParallelTypetype = AUTOMATIC) [inline]Constructor. Set local dimension to n_local, the global dimension to n, and initialize all elements with zero.

Definition at line 483 of file distributed_vector.h.

References libMesh::init().

{
  this->init(n, n_local, false, type);
}
 

template<typename T > DistributedVector< T >::DistributedVector (const unsigned intN, const unsigned intn_local, const std::vector< unsigned int > &ghost, const ParallelTypetype = AUTOMATIC) [inline]Constructor. Set local dimension to n_local, the global dimension to n, but additionally reserve memory for the indices specified by the ghost argument.

Definition at line 494 of file distributed_vector.h.

References libMesh::init().

{
  this->init(n, n_local, ghost, false, type);
}
 

template<typename T > DistributedVector< T >::~DistributedVector () [inline]Destructor, deallocates memory. Made virtual to allow for derived classes to behave properly.

Definition at line 506 of file distributed_vector.h.

{
  this->clear ();
}
 

Member Function Documentation

 

template<typename T > void DistributedVector< T >::abs () [virtual]v = abs(v)... that is, each entry in v is replaced by its absolute value.

Implements NumericVector< T >.

Definition at line 315 of file distributed_vector.C.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  for (unsigned int i=0; i<local_size(); i++)
    this->set(i,std::abs(_values[i]));
}
 

template<typename T > void DistributedVector< T >::add (const unsigned inti, const Tvalue) [inline, virtual]v(i) += value

Implements NumericVector< T >.

Definition at line 781 of file distributed_vector.h.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);
  libmesh_assert (i<size());
  libmesh_assert (i-first_local_index() < local_size());
  
  _values[i - _first_local_index] += value;
}
 

template<typename T > void DistributedVector< T >::add (const Ts) [virtual]$U(0-LIBMESH_DIM)+=s$. Addition of s to all components. Note that s is a scalar and not a vector.

Implements NumericVector< T >.

Definition at line 206 of file distributed_vector.C.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  for (unsigned int i=0; i<local_size(); i++)
    _values[i] += v;
}
 

template<typename T > void DistributedVector< T >::add (const NumericVector< T > &V) [virtual]$U+=V$. Simple vector addition, equal to the operator +=.

Implements NumericVector< T >.

Definition at line 219 of file distributed_vector.C.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  add (1., v);
}
 

template<typename T > void DistributedVector< T >::add (const Ta, const NumericVector< T > &v) [virtual]$U+=a*V$. Simple vector addition, equal to the operator +=.

Implements NumericVector< T >.

Definition at line 231 of file distributed_vector.C.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  add(a, v);
}
 

template<typename T> void DistributedVector< T >::add_vector (const NumericVector< T > &, const SparseMatrix< T > &) [inline, virtual]$U+=A*V$. Add the product of a Sparse matrix A and a Numeric vector V to this Numeric vector. Not implemented.

Implements NumericVector< T >.

Definition at line 315 of file distributed_vector.h.

  { libmesh_error(); }
 

template<typename T > void DistributedVector< T >::add_vector (const DenseVector< T > &V, const std::vector< unsigned int > &dof_indices) [virtual]$U+=V$ where U and V are type DenseVector<T> and you want to specify WHERE to add the DenseVector<T> V

Implements NumericVector< T >.

Definition at line 191 of file distributed_vector.C.

References libMesh::initialized(), and DenseVector< T >::size().

{
  libmesh_assert (V.size() == dof_indices.size());
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  for (unsigned int i=0; i<V.size(); i++)
    add (dof_indices[i], V(i));
}
 

template<typename T > void DistributedVector< T >::add_vector (const NumericVector< T > &V, const std::vector< unsigned int > &dof_indices) [virtual]$U+=V$ where U and V are type NumericVector<T> and you want to specify WHERE to add the NumericVector<T> V

Implements NumericVector< T >.

Definition at line 176 of file distributed_vector.C.

References libMesh::initialized(), and NumericVector< T >::size().

{
  libmesh_assert (V.size() == dof_indices.size());
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  for (unsigned int i=0; i<V.size(); i++)
    add (dof_indices[i], V(i));
}
 

template<typename T> void NumericVector< T >::add_vector (const NumericVector< T > &v, const ShellMatrix< T > &a) [inherited]$U+=A*V$, add the product of a ShellMatrix A and a NumericVector V to this, where this=U.

Definition at line 253 of file numeric_vector.C.

References ShellMatrix< T >::vector_mult_add().

{
  a.vector_mult_add(*this,v);
}
 

template<typename T > void DistributedVector< T >::add_vector (const std::vector< T > &v, const std::vector< unsigned int > &dof_indices) [virtual]$U+=v$ where v is a std::vector<T> and you want to specify WHERE to add it

Implements NumericVector< T >.

Definition at line 160 of file distributed_vector.C.

References libMesh::initialized().

{
  libmesh_assert (!v.empty());
  libmesh_assert (v.size() == dof_indices.size());
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);
  
  for (unsigned int i=0; i<v.size(); i++)
    add (dof_indices[i], v[i]);
}
 

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

Definition at line 41 of file numeric_vector.C.

References LASPACK_SOLVERS, libMeshEnums::PETSC_SOLVERS, and TRILINOS_SOLVERS.

Referenced by ExactErrorEstimator::estimate_error().

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


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


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


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


    default:
      AutoPtr<NumericVector<T> > ap(new DistributedVector<T>);
      return ap;
    }
    
  AutoPtr<NumericVector<T> > ap(NULL);
  return ap;    
}
 

template<typename T > void DistributedVector< T >::clear () [inline, virtual]Returns:

the DistributedVector to a pristine state.

Reimplemented from NumericVector< T >.

Definition at line 652 of file distributed_vector.h.

References libMesh::libMeshPrivateData::_is_initialized.

{
  _values.clear();
  
  _global_size =
    _local_size =
    _first_local_index =
    _last_local_index = 0;
  
  
  this->_is_closed = this->_is_initialized = false;
}
 

template<typename T > AutoPtr< NumericVector< T > > DistributedVector< T >::clone () const [inline, virtual]Creates a copy of this vector and returns it in an AutoPtr.

Implements NumericVector< T >.

Definition at line 684 of file distributed_vector.h.

{
  AutoPtr<NumericVector<T> > cloned_vector (new DistributedVector<T>);

  cloned_vector->init(*this, true);

  *cloned_vector = *this;

  return cloned_vector;
}
 

template<typename T > void DistributedVector< T >::close () [inline, virtual]Call the assemble functions

Implements NumericVector< T >.

Definition at line 641 of file distributed_vector.h.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  
  this->_is_closed = true;
}
 

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

true if the vector is closed and ready for computation, false otherwise.

Definition at line 125 of file numeric_vector.h.

Referenced by DofMap::enforce_constraints_exactly(), and DofMap::max_constraint_error().

{ return _is_closed; }
 

template<> int NumericVector< double >::compare (const NumericVector< double > &other_vector, const Realthreshold) const [inherited]

Definition at line 114 of file numeric_vector.C.

References NumericVector< T >::first_local_index(), NumericVector< T >::initialized(), libMesh::initialized(), and NumericVector< T >::last_local_index().

{
  libmesh_assert (this->initialized());
  libmesh_assert (other_vector.initialized());
  libmesh_assert (this->first_local_index() == other_vector.first_local_index());
  libmesh_assert (this->last_local_index()  == other_vector.last_local_index());

  int rvalue     = -1;
  unsigned int i = first_local_index();

  do
    {
      if ( std::abs( (*this)(i) - other_vector(i) ) > threshold )
        rvalue = i;
      else
        i++;
    }
  while (rvalue==-1 && i<last_local_index());

  return rvalue;
}
 

template<> int NumericVector< long double >::compare (const NumericVector< long double > &other_vector, const Realthreshold) const [inherited]

Definition at line 140 of file numeric_vector.C.

References NumericVector< T >::first_local_index(), NumericVector< T >::initialized(), libMesh::initialized(), and NumericVector< T >::last_local_index().

{
  libmesh_assert (this->initialized());
  libmesh_assert (other_vector.initialized());
  libmesh_assert (this->first_local_index() == other_vector.first_local_index());
  libmesh_assert (this->last_local_index()  == other_vector.last_local_index());

  int rvalue     = -1;
  unsigned int i = first_local_index();

  do
    {
      if ( std::abs( (*this)(i) - other_vector(i) ) > threshold )
        rvalue = i;
      else
        i++;
    }
  while (rvalue==-1 && i<last_local_index());

  return rvalue;
}
 

template<> int NumericVector< Complex >::compare (const NumericVector< Complex > &other_vector, const Realthreshold) const [inherited]

Definition at line 167 of file numeric_vector.C.

References NumericVector< T >::first_local_index(), NumericVector< T >::initialized(), libMesh::initialized(), and NumericVector< T >::last_local_index().

{
  libmesh_assert (this->initialized());
  libmesh_assert (other_vector.initialized());
  libmesh_assert (this->first_local_index() == other_vector.first_local_index());
  libmesh_assert (this->last_local_index()  == other_vector.last_local_index());

  int rvalue     = -1;
  unsigned int i = first_local_index();

  do
    {
      if (( std::abs( (*this)(i).real() - other_vector(i).real() ) > threshold ) ||
          ( std::abs( (*this)(i).imag() - other_vector(i).imag() ) > threshold ))
        rvalue = i;
      else
        i++;
    }
  while (rvalue==-1 && i<this->last_local_index());

  return rvalue;
}
 

template<typename T> virtual int NumericVector< T >::compare (const NumericVector< T > &other_vector, const Realthreshold = TOLERANCE) const [virtual, inherited]Returns:

-1 when this is equivalent to other_vector, up to the given threshold. When differences occur, the return value contains the first index where the difference exceeded the threshold. When no threshold is given, the libMesh TOLERANCE is used.

 

template<> int NumericVector< float >::compare (const NumericVector< float > &other_vector, const Realthreshold) const [inherited]

Definition at line 89 of file numeric_vector.C.

References NumericVector< T >::first_local_index(), NumericVector< T >::initialized(), libMesh::initialized(), and NumericVector< T >::last_local_index().

{
  libmesh_assert (this->initialized());
  libmesh_assert (other_vector.initialized());
  libmesh_assert (this->first_local_index() == other_vector.first_local_index());
  libmesh_assert (this->last_local_index()  == other_vector.last_local_index());

  int rvalue     = -1;
  unsigned int i = first_local_index();

  do
    {
      if ( std::abs( (*this)(i) - other_vector(i) ) > threshold )
        rvalue = i;
      else
        i++;
    }
  while (rvalue==-1 && i<last_local_index());

  return rvalue;
}
 

template<typename T> virtual void NumericVector< T >::create_subvector (NumericVector< T > &, const std::vector< unsigned int > &) const [inline, virtual, inherited]Creates the subvector 'subvector' from the indices in the 'rows' array. Similar to the create_submatrix routine for the SparseMatrix class, it is currently only implemented for PetscVectors.

Reimplemented in PetscVector< T >, and EpetraVector< T >.

Definition at line 562 of file numeric_vector.h.

  {
    std::cerr << 'ERROR: Not Implemented in base class yet!' << std::endl;
    libmesh_error();
  }
 

template<typename T > T DistributedVector< T >::dot (const NumericVector< T > &V) const [virtual]Computes the dot product, p = U.V

Implements NumericVector< T >.

Definition at line 329 of file distributed_vector.C.

References DistributedVector< T >::_values, DistributedVector< T >::first_local_index(), and DistributedVector< T >::last_local_index().

{
  // This function must be run on all processors at once
  parallel_only();

  // Make sure the NumericVector passed in is really a DistributedVector
  const DistributedVector<T>* v = libmesh_cast_ptr<const DistributedVector<T>*>(&V);

  // Make sure that the two vectors are distributed in the same way.
  libmesh_assert ( this->first_local_index() == v->first_local_index() );
  libmesh_assert ( this->last_local_index()  == v->last_local_index()  );
  
  // The result of dotting together the local parts of the vector.
  T local_dot = 0;

  for (unsigned int i=0; i<this->local_size(); i++)
    local_dot += this->_values[i] * v->_values[i];

  // The local dot products are now summed via MPI
  Parallel::sum(local_dot);

  return local_dot;
} 
 

template<typename T> virtual T NumericVector< T >::el (const unsigned inti) const [inline, virtual, inherited]Returns:

the element U(i)

Definition at line 314 of file numeric_vector.h.

{ return (*this)(i); }
 

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

the index of the first vector element actually stored on this processor

Implements NumericVector< T >.

Definition at line 725 of file distributed_vector.h.

References libMesh::initialized().

Referenced by DistributedVector< T >::dot().

{
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  return _first_local_index;
}
 

template<typename T> void NumericVector< T >::get (const std::vector< unsigned int > &index, std::vector< T > &values) const [inline, virtual, inherited]Access multiple components at once. values will be resized, if necessary, and filled. The default implementation calls operator() for each index, but some implementations may supply faster methods here.

Reimplemented in PetscVector< T >.

Definition at line 714 of file numeric_vector.h.

{
  const unsigned int num = index.size();
  values.resize(num);
  for(unsigned int i=0; i<num; i++)
    {
      values[i] = (*this)(index[i]);
    }
}
 

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
}
 

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<class T > void DistributedVector< T >::init (const NumericVector< T > &other, const boolfast = false) [virtual]Creates a vector that has the same dimension and storage type as other, including ghost dofs.

Implements NumericVector< T >.

Definition at line 620 of file distributed_vector.h.

References libMesh::init(), NumericVector< T >::local_size(), NumericVector< T >::size(), and NumericVector< T >::type().

{
  this->init(other.size(),other.local_size(),fast,other.type());
}
 

template<typename T > void DistributedVector< T >::init (const unsigned intN, const unsigned intn_local, const boolfast = false, const ParallelTypetype = AUTOMATIC) [inline, virtual]Change the dimension of the vector to N. The reserved memory for this vector remains unchanged if possible, to make things faster, but this may waste some memory, so take this in the back of your head. However, if N==0 all memory is freed, i.e. if you want to resize the vector and release the memory not needed, you have to first call init(0) and then init(N). This cited behaviour is analogous to that of the STL containers.

On fast==false, the vector is filled by zeros.

Implements NumericVector< T >.

Definition at line 515 of file distributed_vector.h.

References libMesh::libMeshPrivateData::_is_initialized, libMeshEnums::AUTOMATIC, libMesh::COMM_WORLD, libMesh::initialized(), libMeshEnums::PARALLEL, libMeshEnums::SERIAL, and libMesh::zero.

Referenced by DistributedVector< T >::localize().

{
  // This function must be run on all processors at once
  parallel_only();

  libmesh_assert (n_local <= n);

  if (type == AUTOMATIC)
    {
      if (n == n_local)
        this->_type = SERIAL;
      else
        this->_type = PARALLEL;
    }
  else
    this->_type = type;

  libmesh_assert ((this->_type==SERIAL && n==n_local) || 
                  this->_type==PARALLEL);

  // Clear the data structures if already initialized
  if (this->initialized())
    this->clear();
    
  // Initialize data structures
  _values.resize(n_local);
  _local_size  = n_local;
  _global_size = n;

  _first_local_index = 0;
  
#ifdef LIBMESH_HAVE_MPI

  int n_proc=0, proc_id=0;
  
  MPI_Comm_rank (libMesh::COMM_WORLD, &proc_id);
  MPI_Comm_size (libMesh::COMM_WORLD, &n_proc);
  
  std::vector<int> local_sizes     (n_proc, 0);
  
  local_sizes[proc_id] = n_local;

  Parallel::sum(local_sizes);

  // _first_local_index is the sum of _local_size
  // for all processor ids less than ours
  for (int p=0; p<proc_id; p++)
    _first_local_index += local_sizes[p];


#  ifdef DEBUG
  // Make sure all the local sizes sum up to the global
  // size, otherwise there is big trouble!
  int sum=0;

  for (int p=0; p<n_proc; p++)
    sum += local_sizes[p];

  libmesh_assert (sum == static_cast<int>(n));
  
#  endif
  
#else
  
  // No other options without MPI!
  if (n != n_local)
    {
      std::cerr << 'ERROR:  MPI is required for n != n_local!'
                << std::endl;
      libmesh_error();
    }
  
#endif

  _last_local_index = _first_local_index + n_local;
  
  // Set the initialized flag
  this->_is_initialized = true;

  // Zero the components unless directed otherwise
  if (!fast)
    this->zero();
}
 

template<typename T > void DistributedVector< T >::init (const unsigned intN, const boolfast = false, const ParallelTypetype = AUTOMATIC) [inline, virtual]call init with n_local = N,

Implements NumericVector< T >.

Definition at line 630 of file distributed_vector.h.

References libMesh::init().

{
  this->init(n,n,fast,type);
}
 

template<typename T > void DistributedVector< T >::init (const unsigned intn, const unsigned intn_local, const std::vector< unsigned int > &, const boolfast = false, const ParallelTypetype = AUTOMATIC) [inline, virtual]Create a vector that holds tha local indices plus those specified in the ghost argument.

Implements NumericVector< T >.

Definition at line 605 of file distributed_vector.h.

References libMesh::init().

{
  // TODO: we shouldn't ignore the ghost sparsity pattern
  this->init(n, n_local, fast, type);
}
 

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

true if the vector has been initialized, false otherwise.

Definition at line 109 of file numeric_vector.h.

Referenced by ImplicitSystem::assemble(), ExplicitSystem::assemble_qoi(), ExplicitSystem::assemble_qoi_derivative(), NumericVector< T >::compare(), PetscVector< T >::create_subvector(), and PetscVector< T >::init().

{ return _is_initialized; }
 

template<typename T > void DistributedVector< T >::insert (const DenseVector< T > &V, const std::vector< unsigned int > &dof_indices) [virtual]$ U=V $ where V is type DenseVector<T> and you want to specify WHERE to insert it

Implements NumericVector< T >.

Definition at line 274 of file distributed_vector.C.

References libMesh::initialized(), and DenseVector< T >::size().

{
  libmesh_assert (V.size() == dof_indices.size());
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  for (unsigned int i=0; i<V.size(); i++)
    this->set (dof_indices[i], V(i));
}
 

template<typename T > void DistributedVector< T >::insert (const DenseSubVector< T > &V, const std::vector< unsigned int > &dof_indices) [virtual]$ U=V $ where V is type DenseSubVector<T> and you want to specify WHERE to insert it

Implements NumericVector< T >.

Definition at line 289 of file distributed_vector.C.

References libMesh::initialized(), and DenseVectorBase< T >::size().

{
  libmesh_assert (V.size() == dof_indices.size());
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  for (unsigned int i=0; i<V.size(); i++)
    this->set (dof_indices[i], V(i));
}
 

template<typename T > void DistributedVector< T >::insert (const std::vector< T > &v, const std::vector< unsigned int > &dof_indices) [virtual]$ U=v $ where v is a DenseVector<T> and you want to specify WHERE to insert it

Implements NumericVector< T >.

Definition at line 243 of file distributed_vector.C.

References libMesh::initialized().

{
  libmesh_assert (!v.empty());
  libmesh_assert (v.size() == dof_indices.size());
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);
  
  for (unsigned int i=0; i<v.size(); i++)
    this->set (dof_indices[i], v[i]);
}
 

template<typename T > void DistributedVector< T >::insert (const NumericVector< T > &V, const std::vector< unsigned int > &dof_indices) [virtual]$U=V$, where U and V are type NumericVector<T> and you want to specify WHERE to insert the NumericVector<T> V

Implements NumericVector< T >.

Definition at line 259 of file distributed_vector.C.

References libMesh::initialized(), and NumericVector< T >::size().

{
  libmesh_assert (V.size() == dof_indices.size());
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  for (unsigned int i=0; i<V.size(); i++)
    this->set (dof_indices[i], V(i));
}
 

template<typename T > Real DistributedVector< T >::l1_norm () const [virtual]Returns:

the $l_1$-norm of the vector, i.e. the sum of the absolute values.

Implements NumericVector< T >.

Definition at line 60 of file distributed_vector.C.

References libMesh::initialized().

{
  // This function must be run on all processors at once
  parallel_only();

  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  double local_l1 = 0.;

  for (unsigned int i=0; i<local_size(); i++)
    local_l1 += std::abs(_values[i]);
  
  Parallel::sum(local_l1);

  return local_l1;
}
 

template<typename T > Real DistributedVector< T >::l2_norm () const [virtual]Returns:

the $l_2$-norm of the vector, i.e. the square root of the sum of the squares of the elements.

Implements NumericVector< T >.

Definition at line 82 of file distributed_vector.C.

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

{
  // This function must be run on all processors at once
  parallel_only();

  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  double local_l2 = 0.;
  
  for (unsigned int i=0; i<local_size(); i++)
    local_l2 += libmesh_norm(_values[i]);
  
  Parallel::sum(local_l2);

  return std::sqrt(local_l2);
}
 

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

the index of the last vector element actually stored on this processor

Implements NumericVector< T >.

Definition at line 738 of file distributed_vector.h.

References libMesh::initialized().

Referenced by DistributedVector< T >::dot().

{
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  return _last_local_index;
}
 

template<typename T > Real DistributedVector< T >::linfty_norm () const [virtual]Returns:

the maximum absolute value of the elements of this vector, which is the $l_infty$-norm of a vector.

Implements NumericVector< T >.

Definition at line 104 of file distributed_vector.C.

References libMesh::initialized(), and std::max().

{
  // This function must be run on all processors at once
  parallel_only();

  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  Real local_linfty = 0.;
  
  for (unsigned int i=0; i<local_size(); i++)
    local_linfty  = std::max(local_linfty,
                             static_cast<Real>(std::abs(_values[i]))
                             ); // Note we static_cast so that both
                                // types are the same, as required
                                // by std::max
  
  Parallel::max(local_linfty);

  return local_linfty;
}
 

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

the local size of the vector (index_stop-index_start)

Implements NumericVector< T >.

Definition at line 712 of file distributed_vector.h.

References libMesh::initialized().

Referenced by DistributedVector< T >::operator=().

{
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  return _local_size;
}
 

template<typename T > void DistributedVector< T >::localize (NumericVector< T > &v_local) const [virtual]Same, but fills a NumericVector<T> instead of a std::vector.

Implements NumericVector< T >.

Definition at line 438 of file distributed_vector.C.

References DistributedVector< T >::_first_local_index, DistributedVector< T >::_global_size, NumericVector< T >::_is_closed, NumericVector< T >::_is_initialized, DistributedVector< T >::_last_local_index, DistributedVector< T >::_local_size, DistributedVector< T >::_values, and libMesh::initialized().

{
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  DistributedVector<T>* v_local = libmesh_cast_ptr<DistributedVector<T>*>(&v_local_in);

  v_local->_first_local_index = 0;
  
  v_local->_global_size =
    v_local->_local_size =
    v_local->_last_local_index = size();

  v_local->_is_initialized =
    v_local->_is_closed = true;
  
  // Call localize on the vector's values.  This will help
  // prevent code duplication
  localize (v_local->_values);    
  
#ifndef LIBMESH_HAVE_MPI

  libmesh_assert (local_size() == size());
  
#endif
}
 

template<typename T > void DistributedVector< T >::localize (std::vector< T > &v_local) const [virtual]Creates a copy of the global vector in the local vector v_local.

Implements NumericVector< T >.

Definition at line 520 of file distributed_vector.C.

References libMesh::initialized().

Referenced by DistributedVector< T >::localize().

{
  // This function must be run on all processors at once
  parallel_only();

  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  v_local = this->_values;

  Parallel::allgather (v_local);

#ifndef LIBMESH_HAVE_MPI
  libmesh_assert (local_size() == size());
#endif  
}
 

template<typename T > void DistributedVector< T >::localize (NumericVector< T > &v_local, const std::vector< unsigned int > &send_list) const [virtual]Creates a local vector v_local containing only information relevant to this processor, as defined by the send_list.

Implements NumericVector< T >.

Definition at line 470 of file distributed_vector.C.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  // TODO: We don't yet support the send list; this is inefficient:
  localize (v_local_in);
}
 

template<typename T > void DistributedVector< T >::localize (const unsigned intfirst_local_idx, const unsigned intlast_local_idx, const std::vector< unsigned int > &send_list) [virtual]Updates a local vector with selected values from neighboring processors, as defined by send_list.

Implements NumericVector< T >.

Definition at line 484 of file distributed_vector.C.

References DistributedVector< T >::_values, DistributedVector< T >::init(), DistributedVector< T >::localize(), and libMeshEnums::PARALLEL.

{
  // Only good for serial vectors
  libmesh_assert (this->size() == this->local_size());
  libmesh_assert (last_local_idx > first_local_idx);
  libmesh_assert (send_list.size() <= this->size());
  libmesh_assert (last_local_idx < this->size());
  
  const unsigned int size       = this->size();
  const unsigned int local_size = (last_local_idx - first_local_idx + 1);

    // Don't bother for serial cases
  if ((first_local_idx == 0) &&
      (local_size == size))
    return;
  
          
  // Build a parallel vector, initialize it with the local
  // parts of (*this)
  DistributedVector<T> parallel_vec;

  parallel_vec.init (size, local_size, true, PARALLEL);

  // Copy part of *this into the parallel_vec
  for (unsigned int i=first_local_idx; i<=last_local_idx; i++)
    parallel_vec._values[i-first_local_idx] = _values[i];

  // localize like normal
  parallel_vec.localize (*this, send_list);    
}
 

template<typename T > void DistributedVector< T >::localize_to_one (std::vector< T > &v_local, const unsigned intproc_id = 0) const [virtual]Creates a local copy of the global vector in v_local only on processor proc_id. By default the data is sent to processor 0. This method is useful for outputting data from one processor.

Implements NumericVector< T >.

Definition at line 541 of file distributed_vector.C.

References libMesh::initialized().

{
  // This function must be run on all processors at once
  parallel_only();

  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  v_local = this->_values;

  Parallel::gather (pid, v_local);

#ifndef LIBMESH_HAVE_MPI
  libmesh_assert (local_size() == size());
#endif  
}
 

template<typename T > Real DistributedVector< T >::max () const [inline, virtual]Returns:

the maximum element in the vector. In case of complex numbers, this returns the maximum Real part.

Implements NumericVector< T >.

Definition at line 819 of file distributed_vector.h.

References libMesh::initialized(), libmesh_real(), and std::max().

{
  // This function must be run on all processors at once
  parallel_only();

  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  Real local_max = _values.size() ? 
    libmesh_real(_values[0]) : -std::numeric_limits<Real>::max();
  for (unsigned int i = 1; i < _values.size(); ++i)
    local_max = std::max(libmesh_real(_values[i]), local_max);
  
  Parallel::max(local_max);

  return local_max;
}
 

template<typename T > Real DistributedVector< T >::min () const [inline, virtual]Returns:

the minimum element in the vector. In case of complex numbers, this returns the minimum Real part.

Implements NumericVector< T >.

Definition at line 796 of file distributed_vector.h.

References libMesh::initialized(), libmesh_real(), std::max(), and std::min().

{
  // This function must be run on all processors at once
  parallel_only();

  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  Real local_min = _values.size() ? 
    libmesh_real(_values[0]) : std::numeric_limits<Real>::max();
  for (unsigned int i = 1; i < _values.size(); ++i)
    local_min = std::min(libmesh_real(_values[i]), local_min);
  
  Parallel::min(local_min);

  return local_min;
}
 

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 > T DistributedVector< T >::operator() (const unsigned inti) const [inline, virtual]Access components, returns U(i).

Implements NumericVector< T >.

Definition at line 751 of file distributed_vector.h.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);
  libmesh_assert ( ((i >= first_local_index()) &&
            (i <  last_local_index())) );

  return _values[i - _first_local_index];
}
 

template<typename T> NumericVector<T>& NumericVector< T >::operator*= (const Ta) [inline, inherited]Multiplication operator. Equivalent to U.scale(a)

Definition at line 340 of file numeric_vector.h.

{ this->scale(a); return *this; }
 

template<typename T > NumericVector< T > & DistributedVector< T >::operator+= (const NumericVector< T > &V) [virtual]Addition operator. Fast equivalent to U.add(1, V).

Implements NumericVector< T >.

Definition at line 130 of file distributed_vector.C.

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

{
  libmesh_assert (this->closed());
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);
  
  add(1., v);
  
  return *this;
}
 

template<typename T > NumericVector< T > & DistributedVector< T >::operator-= (const NumericVector< T > &V) [virtual]Subtraction operator. Fast equivalent to U.add(-1, V).

Implements NumericVector< T >.

Definition at line 145 of file distributed_vector.C.

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

{
  libmesh_assert (this->closed());
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);
  
  add(-1., v);
  
  return *this;
}
 

template<typename T> NumericVector<T>& NumericVector< T >::operator/= (const Ta) [inline, inherited]Division operator. Equivalent to U.scale(1./a)

Definition at line 346 of file numeric_vector.h.

{ this->scale(1./a); return *this; }
 

template<typename T > DistributedVector< T > & DistributedVector< T >::operator= (const DistributedVector< T > &V)$U = V$: copy all components.

Definition at line 387 of file distributed_vector.C.

References DistributedVector< T >::_first_local_index, DistributedVector< T >::_global_size, NumericVector< T >::_is_closed, NumericVector< T >::_is_initialized, libMesh::libMeshPrivateData::_is_initialized, DistributedVector< T >::_last_local_index, DistributedVector< T >::_local_size, DistributedVector< T >::_values, and DistributedVector< T >::local_size().

{
  this->_is_initialized    = v._is_initialized;
  this->_is_closed         = v._is_closed;

  _global_size       = v._global_size;
  _local_size        = v._local_size;
  _first_local_index = v._first_local_index;
  _last_local_index  = v._last_local_index;
  
  if (v.local_size() == this->local_size())
    {
      _values = v._values;
    }
  else
    {
      libmesh_error();
    }
  
  return *this;
}
 

template<typename T > NumericVector< T > & DistributedVector< T >::operator= (const NumericVector< T > &V) [virtual]$U = V$: copy all components.

Implements NumericVector< T >.

Definition at line 373 of file distributed_vector.C.

{
  // Make sure the NumericVector passed in is really a DistributedVector
  const DistributedVector<T>* v = libmesh_cast_ptr<const DistributedVector<T>*>(&v_in);
  
  *this = *v;
  
  return *this;
}
 

template<typename T > NumericVector< T > & DistributedVector< T >::operator= (const std::vector< T > &v) [virtual]$U = V$: copy all components.

Implements NumericVector< T >.

Definition at line 413 of file distributed_vector.C.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  if (v.size() == local_size())
    _values = v;

  else if (v.size() == size())
    for (unsigned int i=first_local_index(); i<last_local_index(); i++)
      _values[i-first_local_index()] = v[i];

  else
    {
      libmesh_error();
    }

  
  return *this;
}
 

template<typename T > NumericVector< T > & DistributedVector< T >::operator= (const Ts) [virtual]$U(0-N) = s$: fill all components.

Implements NumericVector< T >.

Definition at line 357 of file distributed_vector.C.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  for (unsigned int i=0; i<local_size(); i++)
    _values[i] = s;
  
  return *this;
}
 

template<typename T > void DistributedVector< T >::pointwise_mult (const NumericVector< T > &vec1, const NumericVector< T > &vec2) [virtual]Computes the pointwise (i.e. component-wise) product of vec1 and vec2 and stores the result in *this.

Implements NumericVector< T >.

Definition at line 563 of file distributed_vector.C.

{
  libmesh_not_implemented();
}
 

template<typename T > void NumericVector< T >::print (std::ostream &os = std::cout) const [inline, virtual, inherited]Prints the local contents of the vector to the screen.

Definition at line 749 of file numeric_vector.h.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  os << 'Size	global =  ' << this->size()
     << '		local =  ' << this->local_size() << std::endl;

  os << '#	Value' << std::endl;
  for (unsigned int i=this->first_local_index(); i<this->last_local_index(); i++)
    os << i << '	' << (*this)(i) << std::endl;
}
 

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

Definition at line 731 of file numeric_vector.h.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  os << 'Size	global =  ' << this->size()
     << '		local =  ' << this->local_size() << std::endl;
  
  // std::complex<>::operator<<() is defined, but use this form
  os << '#	Real part		Imaginary part' << std::endl;
  for (unsigned int i=this->first_local_index(); i<this->last_local_index(); i++)
    os << i << '	' 
       << (*this)(i).real() << '		' 
       << (*this)(i).imag() << std::endl;
}
 

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

Definition at line 764 of file numeric_vector.h.

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

{
  libmesh_assert (this->initialized());

  std::vector<Complex> v(this->size());
  this->localize(v);

  // Right now we only want one copy of the output
  if (libMesh::processor_id())
    return;
  
  os << 'Size	global =  ' << this->size() << std::endl;
  os << '#	Real part		Imaginary part' << std::endl;
  for (unsigned int i=0; i!=v.size(); i++)
    os << i << '	' 
       << v[i].real() << '		' 
       << v[i].imag() << std::endl;
}
 

template<typename T > void NumericVector< T >::print_global (std::ostream &os = std::cout) const [inline, virtual, inherited]Prints the global contents of the vector to the screen.

Definition at line 786 of file numeric_vector.h.

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

{
  libmesh_assert (this->initialized());

  std::vector<T> v(this->size());
  this->localize(v);

  // Right now we only want one copy of the output
  if (libMesh::processor_id())
    return;

  os << 'Size	global =  ' << this->size() << std::endl;
  os << '#	Value' << std::endl;
  for (unsigned int i=0; i!=v.size(); i++)
    os << i << '	' << v[i] << std::endl;
}
 

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> virtual void NumericVector< T >::print_matlab (const std::stringname = 'NULL') const [inline, virtual, inherited]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.

Reimplemented in PetscVector< T >, and EpetraVector< T >.

Definition at line 549 of file numeric_vector.h.

  {
    std::cerr << 'ERROR: Not Implemented in base class yet!' << std::endl;
    std::cerr << 'ERROR writing MATLAB file ' << name << std::endl;
    libmesh_error();
  }
 

template<typename T > void DistributedVector< T >::scale (const Tfactor) [virtual]Scale each element of the vector by the given factor.

Implements NumericVector< T >.

Definition at line 304 of file distributed_vector.C.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  for (unsigned int i=0; i<local_size(); i++)
    _values[i] *= factor;  
}
 

template<typename T > void DistributedVector< T >::set (const unsigned inti, const Tvalue) [inline, virtual]v(i) = value

Implements NumericVector< T >.

Definition at line 766 of file distributed_vector.h.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);
  libmesh_assert (i<size());
  libmesh_assert (i-first_local_index() < local_size());
  
  _values[i - _first_local_index] = value;
}
 

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

dimension of the vector. This function was formerly called n(), but was renamed to get the DistributedVector class closer to the C++ standard library's std::vector container.

Implements NumericVector< T >.

Definition at line 699 of file distributed_vector.h.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  return _global_size;
}
 

template<class T > Real NumericVector< T >::subset_l1_norm (const std::set< unsigned int > &indices) [virtual, inherited]Returns:

the $l_1$-norm of the vector, i.e. the sum of the absolute values for the specified entries in the vector.

Note that the indices must necessary live on this processor.

Definition at line 193 of file numeric_vector.C.

Referenced by System::discrete_var_norm().

{
  NumericVector<T> & v = *this;
  
  std::set<unsigned int>::iterator it = indices.begin();
  const std::set<unsigned int>::iterator it_end = indices.end();

  Real norm = 0;
  
  for(; it!=it_end; ++it)
    norm += std::abs(v(*it));

  Parallel::sum(norm);

  return norm;
}
 

template<class T > Real NumericVector< T >::subset_l2_norm (const std::set< unsigned int > &indices) [virtual, inherited]Returns:

the $l_2$-norm of the vector, i.e. the square root of the sum of the squares of the elements for the specified entries in the vector.

Note that the indices must necessary live on this processor.

Definition at line 211 of file numeric_vector.C.

References libmesh_norm().

Referenced by System::discrete_var_norm().

{
  NumericVector<T> & v = *this;

  std::set<unsigned int>::iterator it = indices.begin();
  const std::set<unsigned int>::iterator it_end = indices.end();

  Real norm = 0;
  
  for(; it!=it_end; ++it)
    norm += libmesh_norm(v(*it));

  Parallel::sum(norm);

  return std::sqrt(norm);
}
 

template<class T > Real NumericVector< T >::subset_linfty_norm (const std::set< unsigned int > &indices) [virtual, inherited]Returns:

the maximum absolute value of the specified entries of this vector, which is the $l_infty$-norm of a vector.

Note that the indices must necessary live on this processor.

Definition at line 229 of file numeric_vector.C.

References std::max().

Referenced by System::discrete_var_norm().

{
  NumericVector<T> & v = *this;

  std::set<unsigned int>::iterator it = indices.begin();
  const std::set<unsigned int>::iterator it_end = indices.end();

  Real norm = 0;
  
  for(; it!=it_end; ++it)
    {
      Real value = std::abs(v(*it));
      if(value > norm)
        norm = value;
    }

  Parallel::max(norm);

  return norm;
}
 

template<typename T > T DistributedVector< T >::sum () const [virtual]Returns:

the sum of all values in the vector

Implements NumericVector< T >.

Definition at line 38 of file distributed_vector.C.

References libMesh::initialized().

{
  // This function must be run on all processors at once
  parallel_only();

  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);

  T local_sum = 0.;

  for (unsigned int i=0; i<local_size(); i++)
    local_sum += _values[i];
  
  Parallel::sum(local_sum);

  return local_sum;
}
 

template<typename T > void DistributedVector< T >::swap (NumericVector< T > &v) [inline, virtual]Swaps the vector data and metadata

Reimplemented from NumericVector< T >.

Definition at line 841 of file distributed_vector.h.

References DistributedVector< T >::_first_local_index, DistributedVector< T >::_global_size, DistributedVector< T >::_last_local_index, DistributedVector< T >::_local_size, and DistributedVector< T >::_values.

{
  DistributedVector<T>& v = libmesh_cast_ref<DistributedVector<T>&>(other);

  std::swap(_global_size, v._global_size);
  std::swap(_local_size, v._local_size);
  std::swap(_first_local_index, v._first_local_index);
  std::swap(_last_local_index, v._last_local_index);

  // This should be O(1) with any reasonable STL implementation
  std::swap(_values, v._values);
}
 

template<typename T> ParallelType& NumericVector< T >::type () [inline, inherited]Returns:

the type (SERIAL, PARALLEL, GHOSTED) of the vector.

Definition at line 119 of file numeric_vector.h.

{ return _type; }
 

template<typename T> ParallelType NumericVector< T >::type () const [inline, inherited]Returns:

the type (SERIAL, PARALLEL, GHOSTED) of the vector.

Definition at line 114 of file numeric_vector.h.

Referenced by DistributedVector< T >::DistributedVector(), DofMap::enforce_constraints_exactly(), EpetraVector< T >::EpetraVector(), EpetraVector< T >::init(), LaspackVector< T >::init(), DistributedVector< T >::init(), PetscVector< T >::localize(), PetscVector< T >::PetscVector(), System::project_vector(), and System::read_serialized_vector().

{ return _type; }
 

template<typename T > void DistributedVector< T >::zero () [inline, virtual]Set all entries to zero. Equivalent to v = 0, but more obvious and faster.

Implements NumericVector< T >.

Definition at line 669 of file distributed_vector.h.

References libMesh::initialized().

{
  libmesh_assert (this->initialized());
  libmesh_assert (_values.size() == _local_size);
  libmesh_assert ((_last_local_index - _first_local_index) == _local_size);
  
  std::fill (_values.begin(),
             _values.end(),
             0.);
}
 

Friends And Related Function Documentation

 

template<typename T> std::ostream& operator<< (std::ostream &os, const NumericVector< T > &v) [friend, inherited]Same as above but allows you to use stream syntax.

Definition at line 537 of file numeric_vector.h.

  {
    v.print_global(os);
    return os;
  }
 

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> unsigned int DistributedVector< T >::_first_local_index [private]The first component stored locally

Definition at line 447 of file distributed_vector.h.

Referenced by DistributedVector< T >::localize(), DistributedVector< T >::operator=(), and DistributedVector< T >::swap().  

template<typename T> unsigned int DistributedVector< T >::_global_size [private]The global vector size

Definition at line 437 of file distributed_vector.h.

Referenced by DistributedVector< T >::localize(), DistributedVector< T >::operator=(), and DistributedVector< T >::swap().  

template<typename T> bool NumericVector< T >::_is_closed [protected, inherited]Flag to see if the Numeric assemble routines have been called yet

Definition at line 582 of file numeric_vector.h.

Referenced by NumericVector< Number >::closed(), PetscVector< T >::init(), DistributedVector< T >::localize(), LaspackVector< T >::operator=(), DistributedVector< T >::operator=(), PetscVector< T >::PetscVector(), and NumericVector< T >::swap().  

template<typename T> bool NumericVector< T >::_is_initialized [protected, inherited]Flag to tell if init has been called yet

Definition at line 588 of file numeric_vector.h.

Referenced by PetscVector< T >::create_subvector(), EpetraVector< T >::EpetraVector(), PetscVector< T >::init(), NumericVector< Number >::initialized(), DistributedVector< T >::localize(), DistributedVector< T >::operator=(), PetscVector< T >::PetscVector(), and NumericVector< T >::swap().  

template<typename T> unsigned int DistributedVector< T >::_last_local_index [private]The last component (+1) stored locally

Definition at line 452 of file distributed_vector.h.

Referenced by DistributedVector< T >::localize(), DistributedVector< T >::operator=(), and DistributedVector< T >::swap().  

template<typename T> unsigned int DistributedVector< T >::_local_size [private]The local vector size

Definition at line 442 of file distributed_vector.h.

Referenced by DistributedVector< T >::localize(), DistributedVector< T >::operator=(), and DistributedVector< T >::swap().  

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().  

template<typename T> ParallelType NumericVector< T >::_type [protected, inherited]Type of vector

Definition at line 593 of file numeric_vector.h.

Referenced by DistributedVector< T >::DistributedVector(), EpetraVector< T >::EpetraVector(), PetscVector< T >::init(), PetscVector< T >::operator=(), PetscVector< T >::PetscVector(), NumericVector< T >::swap(), and NumericVector< Number >::type().  

template<typename T> std::vector<T> DistributedVector< T >::_values [private]Actual vector datatype to hold vector entries

Definition at line 432 of file distributed_vector.h.

Referenced by DistributedVector< T >::dot(), DistributedVector< T >::localize(), DistributedVector< T >::operator=(), and DistributedVector< T >::swap().

 

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 DistributedVector< 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 > DistributedVector< T >::DistributedVector (const ParallelTypetype = AUTOMATIC) [inline, explicit]Dummy-Constructor. Dimension=0
template<typename T > DistributedVector< T >::DistributedVector (const unsigned intn, const ParallelTypetype = AUTOMATIC) [inline, explicit]Constructor. Set dimension to n and initialize all elements with zero.
template<typename T > DistributedVector< T >::DistributedVector (const unsigned intn, const unsigned intn_local, const ParallelTypetype = AUTOMATIC) [inline]Constructor. Set local dimension to n_local, the global dimension to n, and initialize all elements with zero.
template<typename T > DistributedVector< T >::DistributedVector (const unsigned intN, const unsigned intn_local, const std::vector< unsigned int > &ghost, const ParallelTypetype = AUTOMATIC) [inline]Constructor. Set local dimension to n_local, the global dimension to n, but additionally reserve memory for the indices specified by the ghost argument.
template<typename T > DistributedVector< T >::~DistributedVector () [inline]Destructor, deallocates memory. Made virtual to allow for derived classes to behave properly.
Member Function Documentation
template<typename T > void DistributedVector< T >::abs () [virtual]v = abs(v)... that is, each entry in v is replaced by its absolute value.
template<typename T > void DistributedVector< T >::add (const unsigned inti, const Tvalue) [inline, virtual]v(i) += value
template<typename T > void DistributedVector< T >::add (const Ts) [virtual]$U(0-LIBMESH_DIM)+=s$. Addition of s to all components. Note that s is a scalar and not a vector.
template<typename T > void DistributedVector< T >::add (const NumericVector< T > &V) [virtual]$U+=V$. Simple vector addition, equal to the operator +=.
template<typename T > void DistributedVector< T >::add (const Ta, const NumericVector< T > &v) [virtual]$U+=a*V$. Simple vector addition, equal to the operator +=.
template<typename T> void DistributedVector< T >::add_vector (const NumericVector< T > &, const SparseMatrix< T > &) [inline, virtual]$U+=A*V$. Add the product of a Sparse matrix A and a Numeric vector V to this Numeric vector. Not implemented.
template<typename T > void DistributedVector< T >::add_vector (const DenseVector< T > &V, const std::vector< unsigned int > &dof_indices) [virtual]$U+=V$ where U and V are type DenseVector<T> and you want to specify WHERE to add the DenseVector<T> V
template<typename T > void DistributedVector< T >::add_vector (const NumericVector< T > &V, const std::vector< unsigned int > &dof_indices) [virtual]$U+=V$ where U and V are type NumericVector<T> and you want to specify WHERE to add the NumericVector<T> V
template<typename T> void NumericVector< T >::add_vector (const NumericVector< T > &v, const ShellMatrix< T > &a) [inherited]$U+=A*V$, add the product of a ShellMatrix A and a NumericVector V to this, where this=U.
template<typename T > void DistributedVector< T >::add_vector (const std::vector< T > &v, const std::vector< unsigned int > &dof_indices) [virtual]$U+=v$ where v is a std::vector<T> and you want to specify WHERE to add it
template<typename T > AutoPtr< NumericVector< T > > NumericVector< T >::build (const SolverPackagesolver_package = libMesh::default_solver_package()) [static, inherited]Builds a NumericVector using the linear solver package specified by solver_package
template<typename T > void DistributedVector< T >::clear () [inline, virtual]Returns:
template<typename T > AutoPtr< NumericVector< T > > DistributedVector< T >::clone () const [inline, virtual]Creates a copy of this vector and returns it in an AutoPtr.
template<typename T > void DistributedVector< T >::close () [inline, virtual]Call the assemble functions
template<typename T> virtual bool NumericVector< T >::closed () const [inline, virtual, inherited]Returns:
template<> int NumericVector< double >::compare (const NumericVector< double > &other_vector, const Realthreshold) const [inherited]
template<> int NumericVector< long double >::compare (const NumericVector< long double > &other_vector, const Realthreshold) const [inherited]
template<> int NumericVector< Complex >::compare (const NumericVector< Complex > &other_vector, const Realthreshold) const [inherited]
template<typename T> virtual int NumericVector< T >::compare (const NumericVector< T > &other_vector, const Realthreshold = TOLERANCE) const [virtual, inherited]Returns:
template<> int NumericVector< float >::compare (const NumericVector< float > &other_vector, const Realthreshold) const [inherited]
template<typename T> virtual void NumericVector< T >::create_subvector (NumericVector< T > &, const std::vector< unsigned int > &) const [inline, virtual, inherited]Creates the subvector 'subvector' from the indices in the 'rows' array. Similar to the create_submatrix routine for the SparseMatrix class, it is currently only implemented for PetscVectors.
template<typename T > T DistributedVector< T >::dot (const NumericVector< T > &V) const [virtual]Computes the dot product, p = U.V
template<typename T> virtual T NumericVector< T >::el (const unsigned inti) const [inline, virtual, inherited]Returns:
template<typename T > unsigned int DistributedVector< T >::first_local_index () const [inline, virtual]Returns:
template<typename T> void NumericVector< T >::get (const std::vector< unsigned int > &index, std::vector< T > &values) const [inline, virtual, inherited]Access multiple components at once. values will be resized, if necessary, and filled. The default implementation calls operator() for each index, but some implementations may supply faster methods here.
std::string ReferenceCounter::get_info () [static, inherited]Gets a string containing the reference information.
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<class T > void DistributedVector< T >::init (const NumericVector< T > &other, const boolfast = false) [virtual]Creates a vector that has the same dimension and storage type as other, including ghost dofs.
template<typename T > void DistributedVector< T >::init (const unsigned intN, const unsigned intn_local, const boolfast = false, const ParallelTypetype = AUTOMATIC) [inline, virtual]Change the dimension of the vector to N. The reserved memory for this vector remains unchanged if possible, to make things faster, but this may waste some memory, so take this in the back of your head. However, if N==0 all memory is freed, i.e. if you want to resize the vector and release the memory not needed, you have to first call init(0) and then init(N). This cited behaviour is analogous to that of the STL containers.
template<typename T > void DistributedVector< T >::init (const unsigned intN, const boolfast = false, const ParallelTypetype = AUTOMATIC) [inline, virtual]call init with n_local = N,
template<typename T > void DistributedVector< T >::init (const unsigned intn, const unsigned intn_local, const std::vector< unsigned int > &, const boolfast = false, const ParallelTypetype = AUTOMATIC) [inline, virtual]Create a vector that holds tha local indices plus those specified in the ghost argument.
template<typename T> virtual bool NumericVector< T >::initialized () const [inline, virtual, inherited]Returns:
template<typename T > void DistributedVector< T >::insert (const DenseVector< T > &V, const std::vector< unsigned int > &dof_indices) [virtual]$ U=V $ where V is type DenseVector<T> and you want to specify WHERE to insert it
template<typename T > void DistributedVector< T >::insert (const DenseSubVector< T > &V, const std::vector< unsigned int > &dof_indices) [virtual]$ U=V $ where V is type DenseSubVector<T> and you want to specify WHERE to insert it
template<typename T > void DistributedVector< T >::insert (const std::vector< T > &v, const std::vector< unsigned int > &dof_indices) [virtual]$ U=v $ where v is a DenseVector<T> and you want to specify WHERE to insert it
template<typename T > void DistributedVector< T >::insert (const NumericVector< T > &V, const std::vector< unsigned int > &dof_indices) [virtual]$U=V$, where U and V are type NumericVector<T> and you want to specify WHERE to insert the NumericVector<T> V
template<typename T > Real DistributedVector< T >::l1_norm () const [virtual]Returns:
template<typename T > Real DistributedVector< T >::l2_norm () const [virtual]Returns:
template<typename T > unsigned int DistributedVector< T >::last_local_index () const [inline, virtual]Returns:
template<typename T > Real DistributedVector< T >::linfty_norm () const [virtual]Returns:
template<typename T > unsigned int DistributedVector< T >::local_size () const [inline, virtual]Returns:
template<typename T > void DistributedVector< T >::localize (NumericVector< T > &v_local) const [virtual]Same, but fills a NumericVector<T> instead of a std::vector.
template<typename T > void DistributedVector< T >::localize (std::vector< T > &v_local) const [virtual]Creates a copy of the global vector in the local vector v_local.
template<typename T > void DistributedVector< T >::localize (NumericVector< T > &v_local, const std::vector< unsigned int > &send_list) const [virtual]Creates a local vector v_local containing only information relevant to this processor, as defined by the send_list.
template<typename T > void DistributedVector< T >::localize (const unsigned intfirst_local_idx, const unsigned intlast_local_idx, const std::vector< unsigned int > &send_list) [virtual]Updates a local vector with selected values from neighboring processors, as defined by send_list.
template<typename T > void DistributedVector< T >::localize_to_one (std::vector< T > &v_local, const unsigned intproc_id = 0) const [virtual]Creates a local copy of the global vector in v_local only on processor proc_id. By default the data is sent to processor 0. This method is useful for outputting data from one processor.
template<typename T > Real DistributedVector< T >::max () const [inline, virtual]Returns:
template<typename T > Real DistributedVector< T >::min () 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 > T DistributedVector< T >::operator() (const unsigned inti) const [inline, virtual]Access components, returns U(i).
template<typename T> NumericVector<T>& NumericVector< T >::operator*= (const Ta) [inline, inherited]Multiplication operator. Equivalent to U.scale(a)
template<typename T > NumericVector< T > & DistributedVector< T >::operator+= (const NumericVector< T > &V) [virtual]Addition operator. Fast equivalent to U.add(1, V).
template<typename T > NumericVector< T > & DistributedVector< T >::operator-= (const NumericVector< T > &V) [virtual]Subtraction operator. Fast equivalent to U.add(-1, V).
template<typename T> NumericVector<T>& NumericVector< T >::operator/= (const Ta) [inline, inherited]Division operator. Equivalent to U.scale(1./a)
template<typename T > DistributedVector< T > & DistributedVector< T >::operator= (const DistributedVector< T > &V)$U = V$: copy all components.
template<typename T > NumericVector< T > & DistributedVector< T >::operator= (const NumericVector< T > &V) [virtual]$U = V$: copy all components.
template<typename T > NumericVector< T > & DistributedVector< T >::operator= (const std::vector< T > &v) [virtual]$U = V$: copy all components.
template<typename T > NumericVector< T > & DistributedVector< T >::operator= (const Ts) [virtual]$U(0-N) = s$: fill all components.
template<typename T > void DistributedVector< T >::pointwise_mult (const NumericVector< T > &vec1, const NumericVector< T > &vec2) [virtual]Computes the pointwise (i.e. component-wise) product of vec1 and vec2 and stores the result in *this.
template<typename T > void NumericVector< T >::print (std::ostream &os = std::cout) const [inline, virtual, inherited]Prints the local contents of the vector to the screen.
template<> void NumericVector< Complex >::print (std::ostream &os) const [inline, inherited]
template<> void NumericVector< Complex >::print_global (std::ostream &os) const [inline, inherited]
template<typename T > void NumericVector< T >::print_global (std::ostream &os = std::cout) const [inline, virtual, inherited]Prints the global contents of the vector to the screen.
void ReferenceCounter::print_info () [static, inherited]Prints the reference information to std::cout.
template<typename T> virtual void NumericVector< T >::print_matlab (const std::stringname = 'NULL') const [inline, virtual, inherited]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 DistributedVector< T >::scale (const Tfactor) [virtual]Scale each element of the vector by the given factor.
template<typename T > void DistributedVector< T >::set (const unsigned inti, const Tvalue) [inline, virtual]v(i) = value
template<typename T > unsigned int DistributedVector< T >::size () const [inline, virtual]Returns:
template<class T > Real NumericVector< T >::subset_l1_norm (const std::set< unsigned int > &indices) [virtual, inherited]Returns:
template<class T > Real NumericVector< T >::subset_l2_norm (const std::set< unsigned int > &indices) [virtual, inherited]Returns:
template<class T > Real NumericVector< T >::subset_linfty_norm (const std::set< unsigned int > &indices) [virtual, inherited]Returns:
template<typename T > T DistributedVector< T >::sum () const [virtual]Returns:
template<typename T > void DistributedVector< T >::swap (NumericVector< T > &v) [inline, virtual]Swaps the vector data and metadata
template<typename T> ParallelType& NumericVector< T >::type () [inline, inherited]Returns:
template<typename T> ParallelType NumericVector< T >::type () const [inline, inherited]Returns:
template<typename T > void DistributedVector< T >::zero () [inline, virtual]Set all entries to zero. Equivalent to v = 0, but more obvious and faster.
Friends And Related Function Documentation
template<typename T> std::ostream& operator<< (std::ostream &os, const NumericVector< T > &v) [friend, inherited]Same as above but allows you to use stream syntax.
Member Data Documentation
ReferenceCounter::Counts ReferenceCounter::_counts [static, protected, inherited]Actually holds the data.
template<typename T> unsigned int DistributedVector< T >::_first_local_index [private]The first component stored locally
template<typename T> unsigned int DistributedVector< T >::_global_size [private]The global vector size
template<typename T> bool NumericVector< T >::_is_closed [protected, inherited]Flag to see if the Numeric assemble routines have been called yet
template<typename T> bool NumericVector< T >::_is_initialized [protected, inherited]Flag to tell if init has been called yet
template<typename T> unsigned int DistributedVector< T >::_last_local_index [private]The last component (+1) stored locally
template<typename T> unsigned int DistributedVector< T >::_local_size [private]The local vector size
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.
template<typename T> ParallelType NumericVector< T >::_type [protected, inherited]Type of vector
template<typename T> std::vector<T> DistributedVector< T >::_values [private]Actual vector datatype to hold vector entries
Author

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