Poster of Linux kernelThe best gift for a Linux geek
NumericVector

NumericVector

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

NAME

NumericVector -  

SYNOPSIS


#include <numeric_vector.h>

Inherits ReferenceCountedObject< NumericVector< T > >.

Inherited by DistributedVector< T >, EpetraVector< T >, LaspackVector< T >, and PetscVector< T >.  

Public Member Functions


NumericVector (const ParallelType type=AUTOMATIC)

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

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

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

virtual ~NumericVector ()

virtual bool initialized () const

ParallelType type () const

ParallelType & type ()

virtual bool closed () const

virtual void close ()=0

virtual void clear ()

virtual void zero ()=0

virtual AutoPtr< NumericVector< T > > clone () const =0

virtual void init (const unsigned int, const unsigned int, const bool=false, const ParallelType=AUTOMATIC)=0

virtual void init (const unsigned int, const bool=false, const ParallelType=AUTOMATIC)=0

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

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

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

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

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

virtual Real min () const =0

virtual Real max () const =0

virtual T sum () const =0

virtual Real l1_norm () const =0

virtual Real l2_norm () const =0

virtual Real linfty_norm () const =0

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 unsigned int size () const =0

virtual unsigned int local_size () const =0

virtual unsigned int first_local_index () const =0

virtual unsigned int last_local_index () const =0

virtual T operator() (const unsigned int i) const =0

virtual T el (const unsigned int i) const

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

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

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

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

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

virtual void set (const unsigned int i, const T value)=0

virtual void add (const unsigned int i, const T value)=0

virtual void add (const T s)=0

virtual void add (const NumericVector< T > &V)=0

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

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

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

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

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

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

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

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

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

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

virtual void scale (const T factor)=0

virtual void abs ()=0

virtual T dot (const NumericVector< T > &) const =0

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

virtual void localize (NumericVector< T > &v_local) const =0

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

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

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

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

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

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

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

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

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

virtual void swap (NumericVector< T > &v)

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

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

template<> void print_global (std::ostream &os) 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
 

Friends


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

Detailed Description

 

template<typename T> class NumericVector< T >

Numeric vector. Provides a uniform interface to vector storage schemes for different linear algebra libraries.

Author:

Benjamin S. Kirk, 2003

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

Definition at line 603 of file numeric_vector.h.

                                                        :
  _is_closed(false),
  _is_initialized(false),
  _type(type)
{
}
 

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

Definition at line 614 of file numeric_vector.h.

                                                          :
  _is_closed(false),
  _is_initialized(false),
  _type(type)
{
  libmesh_error(); // Abstract base class!
  // init(n, n, false, type);
}
 

template<typename T > NumericVector< T >::NumericVector (const unsignedn, 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 628 of file numeric_vector.h.

                                                          :
  _is_closed(false),
  _is_initialized(false),
  _type(type)
{
  libmesh_error(); // Abstract base class!
  // init(n, n_local, false, type);
}
 

template<typename T > NumericVector< T >::NumericVector (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 643 of file numeric_vector.h.

                                                          :
  _is_closed(false),
  _is_initialized(false),
  _type(type)
{
  libmesh_error(); // Abstract base class!
  // init(n, n_local, ghost, false, type);
}
 

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

Definition at line 659 of file numeric_vector.h.

{
  clear ();
}
 

Member Function Documentation

 

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.

Referenced by ContinuationSystem::continuation_solve(), ContinuationSystem::initialize_tangent(), NewtonSolver::line_search(), NewtonSolver::solve(), ContinuationSystem::solve_tangent(), NewmarkSystem::update_rhs(), ContinuationSystem::update_solution(), NewmarkSystem::update_u_v_a(), and TensorShellMatrix< T >::vector_mult_add().  

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.

Referenced by FEMSystem::assemble_qoi_derivative(), FEMSystem::assembly(), NewmarkSystem::update_rhs(), and SparseMatrix< T >::vector_mult_add().  

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

template<typename T> void NumericVector< T >::add_vector (const NumericVector< T > &v, const ShellMatrix< T > &a)$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> virtual void NumericVector< T >::add_vector (const DenseVector< T > &V, const std::vector< unsigned int > &dof_indices) [pure virtual]$ U+=V $ where U and V are type DenseVector<T> and you want to specify WHERE to add the DenseVector<T> V

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

template<typename T > AutoPtr< NumericVector< T > > NumericVector< T >::build (const SolverPackagesolver_package = libMesh::default_solver_package()) [static]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 NumericVector< T >::clear () [inline, virtual]Returns:

the NumericVector<T> to a pristine state.

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

Definition at line 704 of file numeric_vector.h.

References libMesh::libMeshPrivateData::_is_initialized.

Referenced by UniformRefinementEstimator::_estimate_error(), and System::project_vector().

{
  _is_closed      = false;
  _is_initialized = false;
}
 

template<typename T> virtual AutoPtr<NumericVector<T> > NumericVector< T >::clone () const [pure virtual]Creates a copy of this vector and returns it in an AutoPtr. This must be overloaded in the derived classes.

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.

Referenced by SumShellMatrix< T >::get_diagonal(), System::project_vector(), TwostepTimeSolver::solve(), and NewtonSolver::solve().  

template<typename T> virtual void NumericVector< T >::close () [pure virtual]Call the assemble functions

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.

Referenced by FEMSystem::assembly(), ContinuationSystem::continuation_solve(), DofMap::enforce_constraints_exactly(), ContinuationSystem::initialize_tangent(), NewtonSolver::line_search(), System::project_vector(), System::read_serialized_vector(), NewtonSolver::solve(), ContinuationSystem::solve_tangent(), and ContinuationSystem::update_solution().  

template<typename T> virtual bool NumericVector< T >::closed () const [inline, virtual]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< float >::compare (const NumericVector< float > &other_vector, const Realthreshold) const

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<> int NumericVector< double >::compare (const NumericVector< double > &other_vector, const Realthreshold) const

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

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

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]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<typename T> virtual void NumericVector< T >::create_subvector (NumericVector< T > &, const std::vector< unsigned int > &) const [inline, virtual]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> virtual T NumericVector< T >::dot (const NumericVector< T > &) const [pure virtual]Computes the dot product, p = U.V

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.

Referenced by ContinuationSystem::continuation_solve(), ContinuationSystem::solve_tangent(), and ContinuationSystem::update_solution().  

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

the element U(i)

Definition at line 314 of file numeric_vector.h.

{ return (*this)(i); }
 

template<typename T> virtual unsigned int NumericVector< T >::first_local_index () const [pure virtual]Returns:

the index of the first vector element actually stored on this processor. Hint: the minimum for this index is 0.

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.

Referenced by NumericVector< T >::compare(), DofMap::extract_local_vector(), DofMap::max_constraint_error(), System::ProjectVector::operator()(), System::read_serialized_blocked_dof_objects(), and System::write_serialized_blocked_dof_objects().  

template<typename T> void NumericVector< T >::get (const std::vector< unsigned int > &index, std::vector< T > &values) const [inline, virtual]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<typename T> virtual void NumericVector< T >::init (const unsignedint, const unsignedint, const bool = false, const ParallelType = AUTOMATIC) [pure 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.

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.

Referenced by UniformRefinementEstimator::_estimate_error(), System::add_vector(), System::project_vector(), and System::restrict_vectors().  

template<typename T> virtual void NumericVector< T >::init (const unsignedint, const bool = false, const ParallelType = AUTOMATIC) [pure virtual]call init with n_local = N,

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

template<typename T> virtual void NumericVector< T >::init (const unsignedint, const unsignedint, const std::vector< unsigned int > &, const bool = false, const ParallelType = AUTOMATIC) [pure virtual]Create a vector that holds tha local indices plus those specified in the ghost argument.

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

template<typename T> virtual void NumericVector< T >::init (const NumericVector< T > &other, const boolfast = false) [pure virtual]Creates a vector that has the same dimension and storage type as other, including ghost dofs.

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

template<typename T> virtual bool NumericVector< T >::initialized () const [inline, virtual]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> virtual void NumericVector< T >::insert (const std::vector< T > &v, const std::vector< unsigned int > &dof_indices) [pure virtual]$ U=v $ where v is a std::vector<T> and you want to specify WHERE to insert it

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

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

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.

Referenced by FEMSystem::assembly(), and System::calculate_norm().  

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

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.

Referenced by System::calculate_norm(), ContinuationSystem::continuation_solve(), ContinuationSystem::initialize_tangent(), NewtonSolver::line_search(), NewtonSolver::solve(), ContinuationSystem::solve_tangent(), and ContinuationSystem::update_solution().  

template<typename T> virtual unsigned int NumericVector< T >::last_local_index () const [pure virtual]Returns:

the index+1 of the last vector element actually stored on this processor. Hint: the maximum for this index is size().

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.

Referenced by NumericVector< T >::compare(), DofMap::extract_local_vector(), DofMap::max_constraint_error(), System::ProjectVector::operator()(), System::read_serialized_blocked_dof_objects(), and System::write_serialized_blocked_dof_objects().  

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

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.

Referenced by System::calculate_norm().  

template<typename T> virtual unsigned int NumericVector< T >::local_size () const [pure virtual]Returns:

the local size of the vector (index_stop-index_start). In ghost cell mode, this does *not* include the ghost cells.

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.

Referenced by EpetraVector< T >::init(), LaspackVector< T >::init(), DistributedVector< T >::init(), System::project_vector(), and PetscLinearSolver< T >::solve().  

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.

Referenced by System::calculate_norm(), DofMap::enforce_constraints_exactly(), System::project_vector(), and UnsteadySolver::solve().  

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

template<typename T> virtual void NumericVector< T >::localize_to_one (std::vector< T > &v_local, const unsigned intproc_id = 0) const [pure 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.

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

template<typename T> virtual Real NumericVector< T >::max () const [pure virtual]Returns:

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

template<typename T> virtual Real NumericVector< T >::min () const [pure virtual]Returns:

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

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

Definition at line 340 of file numeric_vector.h.

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

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

template<typename T> NumericVector<T>& NumericVector< T >::operator/= (const Ta) [inline]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> virtual NumericVector<T>& NumericVector< T >::operator= (const std::vector< T > &v) [pure virtual]$U = V$: copy all components.

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.

Referenced by TensorShellMatrix< T >::get_diagonal().  

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

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<typename T > void NumericVector< T >::print (std::ostream &os = std::cout) const [inline, virtual]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_global (std::ostream &os) const [inline]

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]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]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> virtual void NumericVector< T >::scale (const Tfactor) [pure virtual]Scale each element of the vector by the given factor.

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.

Referenced by ContinuationSystem::continuation_solve(), ContinuationSystem::initialize_tangent(), NumericVector< Number >::operator*=(), NumericVector< Number >::operator/=(), ContinuationSystem::solve_tangent(), NewmarkSystem::update_u_v_a(), and TensorShellMatrix< T >::vector_mult().  

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.

Referenced by DofMap::enforce_constraints_exactly(), System::ProjectVector::operator()(), System::project_vector(), System::read_serialized_blocked_dof_objects(), and System::zero_variable().  

template<typename T> virtual unsigned int NumericVector< T >::size () const [pure virtual]Returns:

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

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.

Referenced by EpetraVector< T >::add_vector(), PetscVector< T >::add_vector(), LaspackVector< T >::add_vector(), DistributedVector< T >::add_vector(), System::calculate_norm(), DofMap::enforce_constraints_exactly(), EpetraVector< T >::init(), LaspackVector< T >::init(), DistributedVector< T >::init(), EpetraVector< T >::insert(), PetscVector< T >::insert(), LaspackVector< T >::insert(), DistributedVector< T >::insert(), System::project_vector(), PetscLinearSolver< T >::solve(), and System::write_serialized_vector().  

template<class T > Real NumericVector< T >::subset_l1_norm (const std::set< unsigned int > &indices) [virtual]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]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]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> virtual T NumericVector< T >::sum () const [pure virtual]returns the sum of the elements in a vector

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.  

template<typename T> void NumericVector< T >::swap (NumericVector< T > &v) [inline, virtual]Exchanges the values/sizes of two vectors. There should be enough indirection in subclasses to make this an O(1) header-swap operation.

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

Definition at line 807 of file numeric_vector.h.

References NumericVector< T >::_is_closed, NumericVector< T >::_is_initialized, libMesh::libMeshPrivateData::_is_initialized, and NumericVector< T >::_type.

Referenced by UniformRefinementEstimator::_estimate_error(), PatchRecoveryErrorEstimator::estimate_error(), JumpErrorEstimator::estimate_error(), ExactErrorEstimator::estimate_error(), and PetscVector< T >::swap().

{
  std::swap(_is_closed, v._is_closed);
  std::swap(_is_initialized, v._is_initialized);
  std::swap(_type, v._type);
}
 

template<typename T> ParallelType& NumericVector< T >::type () [inline]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]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> virtual void NumericVector< T >::zero () [pure virtual]Set all entries to zero. Equivalent to v = 0, but more obvious and faster.

Implemented in DistributedVector< T >, LaspackVector< T >, PetscVector< T >, and EpetraVector< T >.

Referenced by NonlinearImplicitSystem::adjoint_solve(), ImplicitSystem::assemble(), FEMSystem::assemble_qoi_derivative(), ExplicitSystem::assemble_qoi_derivative(), FEMSystem::assembly(), ContinuationSystem::continuation_solve(), SumShellMatrix< T >::get_diagonal(), NewmarkSystem::initial_conditions(), NewtonSolver::solve(), ContinuationSystem::solve_tangent(), NewmarkSystem::update_rhs(), SumShellMatrix< T >::vector_mult(), and SparseMatrix< T >::vector_mult().  

Friends And Related Function Documentation

 

template<typename T> std::ostream& operator<< (std::ostream &os, const NumericVector< T > &v) [friend]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> bool NumericVector< T >::_is_closed [protected]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]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().  

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

 

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
Friends
Detailed Description
template<typename T> class NumericVector< 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 > NumericVector< T >::NumericVector (const ParallelTypetype = AUTOMATIC) [inline, explicit]Dummy-Constructor. Dimension=0
template<typename T > NumericVector< T >::NumericVector (const unsigned intn, const ParallelTypetype = AUTOMATIC) [inline, explicit]Constructor. Set dimension to n and initialize all elements with zero.
template<typename T > NumericVector< T >::NumericVector (const unsignedn, 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 > NumericVector< T >::NumericVector (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 > NumericVector< T >::~NumericVector () [inline, virtual]Destructor, deallocates memory. Made virtual to allow for derived classes to behave properly.
Member Function Documentation
template<typename T> virtual void NumericVector< T >::abs () [pure virtual]v = abs(v)... that is, each entry in v is replaced by its absolute value.
template<typename T> virtual void NumericVector< T >::add (const Ts) [pure 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> virtual void NumericVector< T >::add (const NumericVector< T > &V) [pure virtual]$U+=V$: Simple vector addition, equal to the operator +=.
template<typename T> virtual void NumericVector< T >::add (const Ta, const NumericVector< T > &v) [pure virtual]$U+=a*V$. Simple vector addition, equal to the operator +=.
template<typename T> virtual void NumericVector< T >::add (const unsigned inti, const Tvalue) [pure virtual]v(i) += value
template<typename T> virtual void NumericVector< T >::add_vector (const std::vector< T > &v, const std::vector< unsigned int > &dof_indices) [pure virtual]$ U+=v $ where v is a DenseVector<T> and you want to specify WHERE to add it
template<typename T> virtual void NumericVector< T >::add_vector (const NumericVector< T > &V, const std::vector< unsigned int > &dof_indices) [pure 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> virtual void NumericVector< T >::add_vector (const NumericVector< T > &, const SparseMatrix< T > &) [pure virtual]$U+=A*V$, add the product of a SparseMatrix A and a NumericVector V to this, where this=U.
template<typename T> void NumericVector< T >::add_vector (const NumericVector< T > &v, const ShellMatrix< T > &a)$U+=A*V$, add the product of a ShellMatrix A and a NumericVector V to this, where this=U.
template<typename T> virtual void NumericVector< T >::add_vector (const DenseVector< T > &V, const std::vector< unsigned int > &dof_indices) [pure 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 > AutoPtr< NumericVector< T > > NumericVector< T >::build (const SolverPackagesolver_package = libMesh::default_solver_package()) [static]Builds a NumericVector using the linear solver package specified by solver_package
template<typename T > void NumericVector< T >::clear () [inline, virtual]Returns:
template<typename T> virtual AutoPtr<NumericVector<T> > NumericVector< T >::clone () const [pure virtual]Creates a copy of this vector and returns it in an AutoPtr. This must be overloaded in the derived classes.
template<typename T> virtual void NumericVector< T >::close () [pure virtual]Call the assemble functions
template<typename T> virtual bool NumericVector< T >::closed () const [inline, virtual]Returns:
template<> int NumericVector< float >::compare (const NumericVector< float > &other_vector, const Realthreshold) const
template<> int NumericVector< double >::compare (const NumericVector< double > &other_vector, const Realthreshold) const
template<> int NumericVector< long double >::compare (const NumericVector< long double > &other_vector, const Realthreshold) const
template<> int NumericVector< Complex >::compare (const NumericVector< Complex > &other_vector, const Realthreshold) const
template<typename T> virtual int NumericVector< T >::compare (const NumericVector< T > &other_vector, const Realthreshold = TOLERANCE) const [virtual]Returns:
template<typename T> virtual void NumericVector< T >::create_subvector (NumericVector< T > &, const std::vector< unsigned int > &) const [inline, virtual]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> virtual T NumericVector< T >::dot (const NumericVector< T > &) const [pure virtual]Computes the dot product, p = U.V
template<typename T> virtual T NumericVector< T >::el (const unsigned inti) const [inline, virtual]Returns:
template<typename T> virtual unsigned int NumericVector< T >::first_local_index () const [pure virtual]Returns:
template<typename T> void NumericVector< T >::get (const std::vector< unsigned int > &index, std::vector< T > &values) const [inline, virtual]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<typename T> virtual void NumericVector< T >::init (const unsignedint, const unsignedint, const bool = false, const ParallelType = AUTOMATIC) [pure 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> virtual void NumericVector< T >::init (const unsignedint, const bool = false, const ParallelType = AUTOMATIC) [pure virtual]call init with n_local = N,
template<typename T> virtual void NumericVector< T >::init (const unsignedint, const unsignedint, const std::vector< unsigned int > &, const bool = false, const ParallelType = AUTOMATIC) [pure virtual]Create a vector that holds tha local indices plus those specified in the ghost argument.
template<typename T> virtual void NumericVector< T >::init (const NumericVector< T > &other, const boolfast = false) [pure virtual]Creates a vector that has the same dimension and storage type as other, including ghost dofs.
template<typename T> virtual bool NumericVector< T >::initialized () const [inline, virtual]Returns:
template<typename T> virtual void NumericVector< T >::insert (const std::vector< T > &v, const std::vector< unsigned int > &dof_indices) [pure virtual]$ U=v $ where v is a std::vector<T> and you want to specify WHERE to insert it
template<typename T> virtual void NumericVector< T >::insert (const NumericVector< T > &V, const std::vector< unsigned int > &dof_indices) [pure 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> virtual void NumericVector< T >::insert (const DenseVector< T > &V, const std::vector< unsigned int > &dof_indices) [pure virtual]$ U=V $ where U and V are type DenseVector<T> and you want to specify WHERE to insert the DenseVector<T> V
template<typename T> virtual void NumericVector< T >::insert (const DenseSubVector< T > &V, const std::vector< unsigned int > &dof_indices) [pure virtual]$ U=V $ where V is a DenseSubVector<T> and you want to specify WHERE to insert it
template<typename T> virtual Real NumericVector< T >::l1_norm () const [pure virtual]Returns:
template<typename T> virtual Real NumericVector< T >::l2_norm () const [pure virtual]Returns:
template<typename T> virtual unsigned int NumericVector< T >::last_local_index () const [pure virtual]Returns:
template<typename T> virtual Real NumericVector< T >::linfty_norm () const [pure virtual]Returns:
template<typename T> virtual unsigned int NumericVector< T >::local_size () const [pure virtual]Returns:
template<typename T> virtual void NumericVector< T >::localize (const unsigned intfirst_local_idx, const unsigned intlast_local_idx, const std::vector< unsigned int > &send_list) [pure virtual]Updates a local vector with selected values from neighboring processors, as defined by send_list.
template<typename T> virtual void NumericVector< T >::localize (std::vector< T > &v_local) const [pure virtual]Creates a copy of the global vector in the local vector v_local.
template<typename T> virtual void NumericVector< T >::localize (NumericVector< T > &v_local) const [pure virtual]Same, but fills a NumericVector<T> instead of a std::vector.
template<typename T> virtual void NumericVector< T >::localize (NumericVector< T > &v_local, const std::vector< unsigned int > &send_list) const [pure virtual]Creates a local vector v_local containing only information relevant to this processor, as defined by the send_list.
template<typename T> virtual void NumericVector< T >::localize_to_one (std::vector< T > &v_local, const unsigned intproc_id = 0) const [pure 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> virtual Real NumericVector< T >::max () const [pure virtual]Returns:
template<typename T> virtual Real NumericVector< T >::min () const [pure 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> virtual T NumericVector< T >::operator() (const unsigned inti) const [pure virtual]Access components, returns U(i).
template<typename T> NumericVector<T>& NumericVector< T >::operator*= (const Ta) [inline]Multiplication operator. Equivalent to U.scale(a)
template<typename T> virtual NumericVector<T>& NumericVector< T >::operator+= (const NumericVector< T > &V) [pure virtual]Addition operator. Fast equivalent to U.add(1, V).
template<typename T> virtual NumericVector<T>& NumericVector< T >::operator-= (const NumericVector< T > &V) [pure virtual]Subtraction operator. Fast equivalent to U.add(-1, V).
template<typename T> NumericVector<T>& NumericVector< T >::operator/= (const Ta) [inline]Division operator. Equivalent to U.scale(1./a)
template<typename T> virtual NumericVector<T>& NumericVector< T >::operator= (const std::vector< T > &v) [pure virtual]$U = V$: copy all components.
template<typename T> virtual NumericVector<T>& NumericVector< T >::operator= (const Ts) [pure virtual]$U(0-N) = s$: fill all components.
template<typename T> virtual NumericVector<T>& NumericVector< T >::operator= (const NumericVector< T > &V) [pure virtual]$U = V$: copy all components.
template<typename T> virtual void NumericVector< T >::pointwise_mult (const NumericVector< T > &vec1, const NumericVector< T > &vec2) [pure virtual]Computes the pointwise (i.e. component-wise) product of vec1 and vec2 and stores the result in *this.
template<> void NumericVector< Complex >::print (std::ostream &os) const [inline]
template<typename T > void NumericVector< T >::print (std::ostream &os = std::cout) const [inline, virtual]Prints the local contents of the vector to the screen.
template<> void NumericVector< Complex >::print_global (std::ostream &os) const [inline]
template<typename T > void NumericVector< T >::print_global (std::ostream &os = std::cout) const [inline, virtual]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]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> virtual void NumericVector< T >::scale (const Tfactor) [pure virtual]Scale each element of the vector by the given factor.
template<typename T> virtual void NumericVector< T >::set (const unsigned inti, const Tvalue) [pure virtual]v(i) = value
template<typename T> virtual unsigned int NumericVector< T >::size () const [pure virtual]Returns:
template<class T > Real NumericVector< T >::subset_l1_norm (const std::set< unsigned int > &indices) [virtual]Returns:
template<class T > Real NumericVector< T >::subset_l2_norm (const std::set< unsigned int > &indices) [virtual]Returns:
template<class T > Real NumericVector< T >::subset_linfty_norm (const std::set< unsigned int > &indices) [virtual]Returns:
template<typename T> virtual T NumericVector< T >::sum () const [pure virtual]returns the sum of the elements in a vector
template<typename T> void NumericVector< T >::swap (NumericVector< T > &v) [inline, virtual]Exchanges the values/sizes of two vectors. There should be enough indirection in subclasses to make this an O(1) header-swap operation.
template<typename T> ParallelType& NumericVector< T >::type () [inline]Returns:
template<typename T> ParallelType NumericVector< T >::type () const [inline]Returns:
template<typename T> virtual void NumericVector< T >::zero () [pure 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]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> bool NumericVector< T >::_is_closed [protected]Flag to see if the Numeric assemble routines have been called yet
template<typename T> bool NumericVector< T >::_is_initialized [protected]Flag to tell if init has been called yet
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]Type of vector
Author

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