libMesh
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
libMesh::NumericVector< T > Class Template Referenceabstract

Numeric vector. More...

#include <dof_map.h>

Inheritance diagram for libMesh::NumericVector< T >:
[legend]

Public Member Functions

 NumericVector (const Parallel::Communicator &comm_in, const ParallelType ptype=AUTOMATIC)
 Dummy-Constructor. More...
 
 NumericVector (const Parallel::Communicator &comm_in, const numeric_index_type n, const ParallelType ptype=AUTOMATIC)
 Constructor. More...
 
 NumericVector (const Parallel::Communicator &comm_in, const numeric_index_type n, const numeric_index_type n_local, const ParallelType ptype=AUTOMATIC)
 Constructor. More...
 
 NumericVector (const Parallel::Communicator &comm_in, const numeric_index_type N, const numeric_index_type n_local, const std::vector< numeric_index_type > &ghost, const ParallelType ptype=AUTOMATIC)
 Constructor. More...
 
virtual ~NumericVector ()
 Destructor, deallocates memory. More...
 
virtual bool initialized () const
 
ParallelType type () const
 
ParallelTypetype ()
 
virtual bool closed () const
 
virtual void close ()=0
 Calls the NumericVector's internal assembly routines, ensuring that the values are consistent across processors. More...
 
virtual void clear ()
 Restores the NumericVector<T> to a pristine state. More...
 
virtual void zero ()=0
 Set all entries to zero. More...
 
virtual UniquePtr< NumericVector< T > > zero_clone () const =0
 
virtual UniquePtr< NumericVector< T > > clone () const =0
 
virtual void init (const numeric_index_type, const numeric_index_type, const bool=false, const ParallelType=AUTOMATIC)=0
 Change the dimension of the vector to N. More...
 
virtual void init (const numeric_index_type, const bool=false, const ParallelType=AUTOMATIC)=0
 Call init() with n_local = N. More...
 
virtual void init (const numeric_index_type, const numeric_index_type, const std::vector< numeric_index_type > &, const bool=false, const ParallelType=AUTOMATIC)=0
 Create a vector that holds tha local indices plus those specified in the ghost argument. More...
 
virtual void init (const NumericVector< T > &other, const bool fast=false)=0
 Creates a vector that has the same dimension and storage type as other, including ghost dofs. More...
 
virtual NumericVector< T > & operator= (const T s)=0
 Sets all entries of the vector to the value s. More...
 
virtual NumericVector< T > & operator= (const NumericVector< T > &v)=0
 Sets (*this)(i) = v(i) for each entry of the vector. More...
 
virtual NumericVector< T > & operator= (const std::vector< T > &v)=0
 Sets (*this)(i) = v(i) for each entry of the vector. More...
 
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< numeric_index_type > &indices) const
 
virtual Real subset_l2_norm (const std::set< numeric_index_type > &indices) const
 
virtual Real subset_linfty_norm (const std::set< numeric_index_type > &indices) const
 
virtual numeric_index_type size () const =0
 
virtual numeric_index_type local_size () const =0
 
virtual numeric_index_type first_local_index () const =0
 
virtual numeric_index_type last_local_index () const =0
 
virtual T operator() (const numeric_index_type i) const =0
 
virtual T el (const numeric_index_type i) const
 
virtual void get (const std::vector< numeric_index_type > &index, T *values) const
 Access multiple components at once. More...
 
void get (const std::vector< numeric_index_type > &index, std::vector< T > &values) const
 Access multiple components at once. More...
 
virtual NumericVector< T > & operator+= (const NumericVector< T > &v)=0
 Adds v to *this, $ \vec{u} \leftarrow \vec{u} + \vec{v} $. More...
 
virtual NumericVector< T > & operator-= (const NumericVector< T > &v)=0
 Subtracts v from *this, $ \vec{u} \leftarrow \vec{u} - \vec{v} $. More...
 
NumericVector< T > & operator*= (const T a)
 Scales the vector by a, $ \vec{u} \leftarrow a\vec{u} $. More...
 
NumericVector< T > & operator/= (const T a)
 Scales the vector by 1/a, $ \vec{u} \leftarrow \frac{1}{a}\vec{u} $. More...
 
virtual NumericVector< T > & operator/= (NumericVector< T > &)=0
 Computes the pointwise division of this vector's entries by another's, $ u_i \leftarrow \frac{u_i}{v_i} \, \forall i$. More...
 
virtual void reciprocal ()=0
 Computes the pointwise reciprocal, $ u_i \leftarrow \frac{1}{u_i} \, \forall i$. More...
 
virtual void conjugate ()=0
 Negates the imaginary component of each entry in the vector. More...
 
virtual void set (const numeric_index_type i, const T value)=0
 Sets v(i) = value. More...
 
virtual void add (const numeric_index_type i, const T value)=0
 Adds value to each entry of the vector. More...
 
virtual void add (const T s)=0
 Adds s to each entry of the vector, $ u_i \leftarrow u_i + s $. More...
 
virtual void add (const NumericVector< T > &v)=0
 Adds v to this, $ \vec{u} \leftarrow \vec{u} + \vec{v} $. More...
 
virtual void add (const T a, const NumericVector< T > &v)=0
 Vector addition with a scalar multiple, $ \vec{u} \leftarrow \vec{u} + a\vec{v} $. More...
 
virtual void add_vector (const T *v, const std::vector< numeric_index_type > &dof_indices)
 Computes $ \vec{u} \leftarrow \vec{u} + \vec{v} $, where v is a pointer and each dof_indices[i] specifies where to add value v[i]. More...
 
void add_vector (const std::vector< T > &v, const std::vector< numeric_index_type > &dof_indices)
 Computes $ \vec{u} \leftarrow \vec{u} + \vec{v} $, where v is a std::vector and each dof_indices[i] specifies where to add value v[i]. More...
 
virtual void add_vector (const NumericVector< T > &v, const std::vector< numeric_index_type > &dof_indices)
 Computes $ \vec{u} \leftarrow \vec{u} + \vec{v} $, where v is a NumericVector and each dof_indices[i] specifies where to add value v(i). More...
 
void add_vector (const DenseVector< T > &v, const std::vector< numeric_index_type > &dof_indices)
 Computes $ \vec{u} \leftarrow \vec{u} + \vec{v} $, where v is a DenseVector and each dof_indices[i] specifies where to add value v(i). More...
 
virtual void add_vector (const NumericVector< T > &v, const SparseMatrix< T > &A)=0
 Computes $ \vec{u} \leftarrow \vec{u} + A \vec{v} $, i.e. More...
 
void add_vector (const NumericVector< T > &v, const ShellMatrix< T > &A)
 Computes $ \vec{u} \leftarrow \vec{u} + A \vec{v} $, i.e. More...
 
virtual void add_vector_transpose (const NumericVector< T > &v, const SparseMatrix< T > &A)=0
 Computes $ \vec{u} \leftarrow \vec{u} + A^T \vec{v} $, i.e. More...
 
virtual void insert (const T *v, const std::vector< numeric_index_type > &dof_indices)
 Inserts the entries of v in *this at the locations specified by v. More...
 
void insert (const std::vector< T > &v, const std::vector< numeric_index_type > &dof_indices)
 Inserts the entries of v in *this at the locations specified by v. More...
 
virtual void insert (const NumericVector< T > &v, const std::vector< numeric_index_type > &dof_indices)
 Inserts the entries of v in *this at the locations specified by v. More...
 
void insert (const DenseVector< T > &v, const std::vector< numeric_index_type > &dof_indices)
 Inserts the entries of v in *this at the locations specified by v. More...
 
void insert (const DenseSubVector< T > &v, const std::vector< numeric_index_type > &dof_indices)
 Inserts the entries of v in *this at the locations specified by v. More...
 
virtual void scale (const T factor)=0
 Scale each element of the vector by the given factor. More...
 
virtual void abs ()=0
 Sets $ u_i \leftarrow |u_i| $ for each entry in the vector. More...
 
virtual T dot (const NumericVector< T > &v) const =0
 
virtual void localize (std::vector< T > &v_local) const =0
 Creates a copy of the global vector in the local vector v_local. More...
 
virtual void localize (NumericVector< T > &v_local) const =0
 Same, but fills a NumericVector<T> instead of a std::vector. More...
 
virtual void localize (NumericVector< T > &v_local, const std::vector< numeric_index_type > &send_list) const =0
 Creates a local vector v_local containing only information relevant to this processor, as defined by the send_list. More...
 
virtual void localize (std::vector< T > &v_local, const std::vector< numeric_index_type > &indices) const =0
 Fill in the local std::vector "v_local" with the global indices given in "indices". More...
 
virtual void localize (const numeric_index_type first_local_idx, const numeric_index_type last_local_idx, const std::vector< numeric_index_type > &send_list)=0
 Updates a local vector with selected values from neighboring processors, as defined by send_list. More...
 
virtual void localize_to_one (std::vector< T > &v_local, const processor_id_type proc_id=0) const =0
 Creates a local copy of the global vector in v_local only on processor proc_id. More...
 
virtual int compare (const NumericVector< T > &other_vector, const Real threshold=TOLERANCE) const
 
virtual int local_relative_compare (const NumericVector< T > &other_vector, const Real threshold=TOLERANCE) const
 
virtual int global_relative_compare (const NumericVector< T > &other_vector, const Real threshold=TOLERANCE) const
 
virtual void pointwise_mult (const NumericVector< T > &vec1, const NumericVector< T > &vec2)=0
 Computes $ u_i \leftarrow u_i v_i $ (summation not implied) i.e. More...
 
virtual void print (std::ostream &os=libMesh::out) const
 Prints the local contents of the vector, by default to libMesh::out. More...
 
virtual void print_global (std::ostream &os=libMesh::out) const
 Prints the global contents of the vector, by default to libMesh::out. More...
 
virtual void print_matlab (const std::string &="") const
 Print the contents of the vector in Matlab's sparse matrix format. More...
 
virtual void create_subvector (NumericVector< T > &, const std::vector< numeric_index_type > &) const
 Fills in subvector from this vector using the indices in rows. More...
 
virtual void swap (NumericVector< T > &v)
 Swaps the contents of this with v. More...
 
template<>
void print (std::ostream &os) const
 
template<>
void print_global (std::ostream &os) const
 
const Parallel::Communicatorcomm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static UniquePtr< NumericVector< T > > build (const Parallel::Communicator &comm, const SolverPackage solver_package=libMesh::default_solver_package())
 Builds a NumericVector on the processors in communicator comm using the linear solver package specified by solver_package. More...
 
static UniquePtr< NumericVector< T > > build (const SolverPackage solver_package=libMesh::default_solver_package())
 Builds a NumericVector on the processors in communicator CommWorld using the linear solver package specified by solver_package. More...
 
static std::string get_info ()
 Gets a string containing the reference information. More...
 
static void print_info (std::ostream &out=libMesh::out)
 Prints the reference information, by default to libMesh::out. More...
 
static unsigned int n_objects ()
 Prints the number of outstanding (created, but not yet destroyed) objects. More...
 
static void enable_print_counter_info ()
 Methods to enable/disable the reference counter output from print_info() More...
 
static void disable_print_counter_info ()
 

Protected Types

typedef std::map< std::string, std::pair< unsigned int, unsigned int > > Counts
 Data structure to log the information. More...
 

Protected Member Functions

void increment_constructor_count (const std::string &name)
 Increments the construction counter. More...
 
void increment_destructor_count (const std::string &name)
 Increments the destruction counter. More...
 

Protected Attributes

bool _is_closed
 Flag which tracks whether the vector's values are consistent on all processors after insertion or addition of values has occurred on some or all processors. More...
 
bool _is_initialized
 true once init() has been called. More...
 
ParallelType _type
 Type of vector. More...
 
const Parallel::Communicator_communicator
 

Static Protected Attributes

static Counts _counts
 Actually holds the data. More...
 
static Threads::atomic< unsigned int_n_objects
 The number of objects. More...
 
static Threads::spin_mutex _mutex
 Mutual exclusion object to enable thread-safe reference counting. More...
 
static bool _enable_print_counter = true
 Flag to control whether reference count information is printed when print_info is called. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const NumericVector< T > &v)
 Same as above but allows you to use stream syntax. More...
 

Detailed Description

template<typename T>
class libMesh::NumericVector< T >

Numeric vector.

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

Author
Benjamin S. Kirk
Date
2003

Definition at line 66 of file dof_map.h.

Member Typedef Documentation

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

Data structure to log the information.

The log is identified by the class name.

Definition at line 119 of file reference_counter.h.

Constructor & Destructor Documentation

template<typename T >
libMesh::NumericVector< T >::NumericVector ( const Parallel::Communicator comm_in,
const ParallelType  ptype = AUTOMATIC 
)
explicit

Dummy-Constructor.

Dimension=0

Definition at line 727 of file numeric_vector.h.

728  :
729  ParallelObject(comm_in),
730  _is_closed(false),
731  _is_initialized(false),
732  _type(ptype)
733 {
734 }
ParallelObject(const Parallel::Communicator &comm_in)
Constructor.
bool _is_initialized
true once init() has been called.
ParallelType _type
Type of vector.
bool _is_closed
Flag which tracks whether the vector&#39;s values are consistent on all processors after insertion or add...
template<typename T >
libMesh::NumericVector< T >::NumericVector ( const Parallel::Communicator comm_in,
const numeric_index_type  n,
const ParallelType  ptype = AUTOMATIC 
)
explicit

Constructor.

Set dimension to n and initialize all elements with zero.

Definition at line 740 of file numeric_vector.h.

742  :
743  ParallelObject(comm_in),
744  _is_closed(false),
745  _is_initialized(false),
746  _type(ptype)
747 {
748  libmesh_not_implemented(); // Abstract base class!
749  // init(n, n, false, ptype);
750 }
ParallelObject(const Parallel::Communicator &comm_in)
Constructor.
bool _is_initialized
true once init() has been called.
ParallelType _type
Type of vector.
bool _is_closed
Flag which tracks whether the vector&#39;s values are consistent on all processors after insertion or add...
template<typename T >
libMesh::NumericVector< T >::NumericVector ( const Parallel::Communicator comm_in,
const numeric_index_type  n,
const numeric_index_type  n_local,
const ParallelType  ptype = AUTOMATIC 
)

Constructor.

Set local dimension to n_local, the global dimension to n, and initialize all elements with zero.

Definition at line 756 of file numeric_vector.h.

759  :
760  ParallelObject(comm_in),
761  _is_closed(false),
762  _is_initialized(false),
763  _type(ptype)
764 {
765  libmesh_not_implemented(); // Abstract base class!
766  // init(n, n_local, false, ptype);
767 }
ParallelObject(const Parallel::Communicator &comm_in)
Constructor.
bool _is_initialized
true once init() has been called.
ParallelType _type
Type of vector.
bool _is_closed
Flag which tracks whether the vector&#39;s values are consistent on all processors after insertion or add...
template<typename T >
libMesh::NumericVector< T >::NumericVector ( const Parallel::Communicator comm_in,
const numeric_index_type  N,
const numeric_index_type  n_local,
const std::vector< numeric_index_type > &  ghost,
const ParallelType  ptype = AUTOMATIC 
)

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 773 of file numeric_vector.h.

777  :
778  ParallelObject(comm_in),
779  _is_closed(false),
780  _is_initialized(false),
781  _type(ptype)
782 {
783  libmesh_not_implemented(); // Abstract base class!
784  // init(n, n_local, ghost, false, ptype);
785 }
ParallelObject(const Parallel::Communicator &comm_in)
Constructor.
bool _is_initialized
true once init() has been called.
ParallelType _type
Type of vector.
bool _is_closed
Flag which tracks whether the vector&#39;s values are consistent on all processors after insertion or add...
template<typename T >
libMesh::NumericVector< T >::~NumericVector ( )
virtual

Destructor, deallocates memory.

Made virtual to allow for derived classes to behave properly.

Definition at line 791 of file numeric_vector.h.

References libMesh::NumericVector< T >::clear().

792 {
793  clear ();
794 }
virtual void clear()
Restores the NumericVector<T> to a pristine state.

Member Function Documentation

template<typename T>
virtual void libMesh::NumericVector< T >::abs ( )
pure virtual
template<typename T>
virtual void libMesh::NumericVector< T >::add ( const numeric_index_type  i,
const T  value 
)
pure virtual
template<typename T>
virtual void libMesh::NumericVector< T >::add ( const T  s)
pure virtual
template<typename T>
virtual void libMesh::NumericVector< T >::add ( const NumericVector< T > &  v)
pure virtual
template<typename T>
virtual void libMesh::NumericVector< T >::add ( const T  a,
const NumericVector< T > &  v 
)
pure virtual
template<typename T>
void libMesh::NumericVector< T >::add_vector ( const T *  v,
const std::vector< numeric_index_type > &  dof_indices 
)
virtual
template<typename T>
void libMesh::NumericVector< T >::add_vector ( const std::vector< T > &  v,
const std::vector< numeric_index_type > &  dof_indices 
)

Computes $ \vec{u} \leftarrow \vec{u} + \vec{v} $, where v is a std::vector and each dof_indices[i] specifies where to add value v[i].

Definition at line 839 of file numeric_vector.h.

References libMesh::NumericVector< T >::add_vector(), and libMesh::libmesh_assert().

841 {
842  libmesh_assert(v.size() == dof_indices.size());
843  if (!v.empty())
844  this->add_vector(&v[0], dof_indices);
845 }
virtual void add_vector(const T *v, const std::vector< numeric_index_type > &dof_indices)
Computes , where v is a pointer and each dof_indices[i] specifies where to add value v[i]...
libmesh_assert(j)
template<typename T>
void libMesh::NumericVector< T >::add_vector ( const NumericVector< T > &  v,
const std::vector< numeric_index_type > &  dof_indices 
)
virtual

Computes $ \vec{u} \leftarrow \vec{u} + \vec{v} $, where v is a NumericVector and each dof_indices[i] specifies where to add value v(i).

Definition at line 396 of file numeric_vector.C.

References libMesh::NumericVector< T >::size().

398 {
399  int n = dof_indices.size();
400  libmesh_assert_equal_to(v.size(), static_cast<unsigned>(n));
401  for (int i=0; i<n; i++)
402  this->add (dof_indices[i], v(i));
403 }
virtual void add(const numeric_index_type i, const T value)=0
Adds value to each entry of the vector.
template<typename T>
void libMesh::NumericVector< T >::add_vector ( const DenseVector< T > &  v,
const std::vector< numeric_index_type > &  dof_indices 
)

Computes $ \vec{u} \leftarrow \vec{u} + \vec{v} $, where v is a DenseVector and each dof_indices[i] specifies where to add value v(i).

Definition at line 851 of file numeric_vector.h.

References libMesh::NumericVector< T >::add_vector(), libMesh::DenseVector< T >::empty(), libMesh::libmesh_assert(), and libMesh::DenseVector< T >::size().

853 {
854  libmesh_assert(v.size() == dof_indices.size());
855  if (!v.empty())
856  this->add_vector(&v(0), dof_indices);
857 }
virtual void add_vector(const T *v, const std::vector< numeric_index_type > &dof_indices)
Computes , where v is a pointer and each dof_indices[i] specifies where to add value v[i]...
libmesh_assert(j)
template<typename T>
virtual void libMesh::NumericVector< T >::add_vector ( const NumericVector< T > &  v,
const SparseMatrix< T > &  A 
)
pure virtual
template<typename T>
void libMesh::NumericVector< T >::add_vector ( const NumericVector< T > &  v,
const ShellMatrix< T > &  A 
)

Computes $ \vec{u} \leftarrow \vec{u} + A \vec{v} $, i.e.

adds the product of a ShellMatrix A and a NumericVector v to this.

Definition at line 408 of file numeric_vector.C.

References libMesh::ShellMatrix< T >::vector_mult_add().

410 {
411  a.vector_mult_add(*this,v);
412 }
template<typename T>
virtual void libMesh::NumericVector< T >::add_vector_transpose ( const NumericVector< T > &  v,
const SparseMatrix< T > &  A 
)
pure virtual
template<typename T >
UniquePtr< NumericVector< T > > libMesh::NumericVector< T >::build ( const Parallel::Communicator comm,
const SolverPackage  solver_package = libMesh::default_solver_package() 
)
static

Builds a NumericVector on the processors in communicator comm using the linear solver package specified by solver_package.

Definition at line 46 of file numeric_vector.C.

References libMesh::AUTOMATIC, libMesh::EIGEN_SOLVERS, libMesh::LASPACK_SOLVERS, libMesh::PETSC_SOLVERS, and libMesh::TRILINOS_SOLVERS.

Referenced by libMesh::ExactSolution::_compute_error(), libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::System::add_vector(), libMesh::TransientRBConstruction::allocate_data_structures(), libMesh::RBConstruction::allocate_data_structures(), libMesh::TransientRBConstruction::assemble_affine_expansion(), libMesh::NumericVector< T >::build(), libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::System::calculate_norm(), libMesh::RBConstruction::compute_Fq_representor_innerprods(), libMesh::RBConstruction::compute_output_dual_innerprods(), libMesh::DofMap::constrain_nothing(), libMesh::RBEIMConstruction::enrich_RB_space(), libMesh::RBConstruction::enrich_RB_space(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::RBConstructionBase< Base >::generate_training_parameters_deterministic(), libMesh::RBConstructionBase< Base >::generate_training_parameters_random(), libMesh::CondensedEigenSystem::get_eigenpair(), libMesh::EquationSystems::get_solution(), libMesh::RBConstructionBase< Base >::init_data(), libMesh::RBEIMConstruction::initialize_rb_construction(), libMesh::RBConstructionBase< Base >::load_training_set(), main(), libMesh::TransientRBConstruction::mass_matrix_scaled_matvec(), libMesh::System::project_vector(), libMesh::RBEvaluation::read_in_vectors_from_multiple_files(), libMesh::TransientRBConstruction::read_riesz_representors_from_files(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::TransientRBConstruction::set_error_temporal_data(), libMesh::RBEIMConstruction::set_explicit_sys_subvector(), MeshfunctionDFEM::test_mesh_function_dfem(), MeshfunctionDFEM::test_mesh_function_dfem_grad(), SystemsTest::testProjectCubeWithMeshFunction(), libMesh::MeshFunctionSolutionTransfer::transfer(), libMesh::TransientRBConstruction::truth_assembly(), libMesh::RBConstruction::truth_assembly(), libMesh::TransientRBConstruction::update_RB_initial_condition_all_N(), libMesh::RBEIMConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_RB_system_matrices(), libMesh::RBConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_residual_terms(), and libMesh::RBConstruction::update_residual_terms().

47 {
48  // Build the appropriate vector
49  switch (solver_package)
50  {
51 
52 #ifdef LIBMESH_HAVE_LASPACK
53  case LASPACK_SOLVERS:
54  return UniquePtr<NumericVector<T>>(new LaspackVector<T>(comm, AUTOMATIC));
55 #endif
56 
57 #ifdef LIBMESH_HAVE_PETSC
58  case PETSC_SOLVERS:
59  return UniquePtr<NumericVector<T>>(new PetscVector<T>(comm, AUTOMATIC));
60 #endif
61 
62 #ifdef LIBMESH_TRILINOS_HAVE_EPETRA
63  case TRILINOS_SOLVERS:
64  return UniquePtr<NumericVector<T>>(new EpetraVector<T>(comm, AUTOMATIC));
65 #endif
66 
67 #ifdef LIBMESH_HAVE_EIGEN
68  case EIGEN_SOLVERS:
69  return UniquePtr<NumericVector<T>>(new EigenSparseVector<T>(comm, AUTOMATIC));
70 #endif
71 
72  default:
73  return UniquePtr<NumericVector<T>>(new DistributedVector<T>(comm, AUTOMATIC));
74  }
75 
76  libmesh_error_msg("We'll never get here!");
77  return UniquePtr<NumericVector<T>>();
78 }
const Parallel::Communicator & comm() const
template<typename T >
UniquePtr< NumericVector< T > > libMesh::NumericVector< T >::build ( const SolverPackage  solver_package = libMesh::default_solver_package())
static

Builds a NumericVector on the processors in communicator CommWorld using the linear solver package specified by solver_package.

Deprecated:
LIBMESH_DISABLE_COMMWORLD is now the default, use the build() method that takes a Parallel::Communicator instead.

Definition at line 85 of file numeric_vector.C.

References libMesh::NumericVector< T >::build(), and libMesh::CommWorld.

86 {
87  libmesh_deprecated();
88  return NumericVector<T>::build(CommWorld, solver_package);
89 }
static UniquePtr< NumericVector< T > > build(const Parallel::Communicator &comm, const SolverPackage solver_package=libMesh::default_solver_package())
Builds a NumericVector on the processors in communicator comm using the linear solver package specifi...
Parallel::FakeCommunicator CommWorld
The default libMesh communicator.
Definition: parallel.h:1433
template<typename T >
void libMesh::NumericVector< T >::clear ( )
virtual
template<typename T>
virtual UniquePtr<NumericVector<T> > libMesh::NumericVector< T >::clone ( ) const
pure virtual
template<typename T>
virtual void libMesh::NumericVector< T >::close ( )
pure virtual

Calls the NumericVector's internal assembly routines, ensuring that the values are consistent across processors.

Implemented in libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, and libMesh::libmesh_final< T >.

Referenced by add_M_C_K_helmholtz(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), assemble(), AssembleOptimization::assemble_A_and_F(), libMesh::ImplicitSystem::assemble_residual_derivatives(), assemble_shell(), libMesh::FEMSystem::assembly(), libMesh::LinearImplicitSystem::assembly(), libMesh::System::boundary_project_vector(), libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::NumericVector< Number >::closed(), libMesh::DofMap::constrain_nothing(), libMesh::ContinuationSystem::continuation_solve(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ImplicitSystem::forward_qoi_parameter_sensitivity(), libMesh::RBEIMConstruction::get_explicit_sys_subvector(), libMesh::EquationSystems::get_solution(), libMesh::ContinuationSystem::initialize_tangent(), libMesh::NewtonSolver::line_search(), HeatSystem::perturb_accumulate_residuals(), libMesh::System::project_vector(), libMesh::ImplicitSystem::qoi_parameter_hessian(), libMesh::ImplicitSystem::qoi_parameter_hessian_vector_product(), libMesh::System::read_serialized_vector(), libMesh::RBEIMConstruction::set_explicit_sys_subvector(), ParsedFEMFunctionTest::setUp(), libMesh::NewtonSolver::solve(), libMesh::NoxNonlinearSolver< T >::solve(), libMesh::ContinuationSystem::solve_tangent(), libMesh::TransientRBConstruction::truth_assembly(), libMesh::RBConstruction::truth_assembly(), libMesh::ContinuationSystem::update_solution(), libMesh::ImplicitSystem::weighted_sensitivity_adjoint_solve(), libMesh::ImplicitSystem::weighted_sensitivity_solve(), and libMesh::RBConstruction::zero_constrained_dofs_on_vector().

template<typename T>
virtual bool libMesh::NumericVector< T >::closed ( ) const
virtual
Returns
true if the vector is closed and ready for computation, false otherwise.

Reimplemented in libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, and libMesh::libmesh_final< T >.

Definition at line 153 of file numeric_vector.h.

Referenced by libMesh::DofMap::constrain_nothing(), and libMesh::DofMap::max_constraint_error().

153 { return _is_closed; }
bool _is_closed
Flag which tracks whether the vector&#39;s values are consistent on all processors after insertion or add...
const Parallel::Communicator& libMesh::ParallelObject::comm ( ) const
inherited
Returns
A reference to the Parallel::Communicator object used by this mesh.

Definition at line 87 of file parallel_object.h.

References libMesh::ParallelObject::_communicator.

Referenced by libMesh::__libmesh_petsc_diff_solver_monitor(), libMesh::__libmesh_petsc_diff_solver_residual(), libMesh::__libmesh_petsc_preconditioner_apply(), libMesh::__libmesh_petsc_snes_jacobian(), libMesh::__libmesh_petsc_snes_postcheck(), libMesh::__libmesh_petsc_snes_residual(), libMesh::__libmesh_tao_equality_constraints(), libMesh::__libmesh_tao_equality_constraints_jacobian(), libMesh::__libmesh_tao_gradient(), libMesh::__libmesh_tao_hessian(), libMesh::__libmesh_tao_inequality_constraints(), libMesh::__libmesh_tao_inequality_constraints_jacobian(), libMesh::__libmesh_tao_objective(), libMesh::MeshRefinement::_coarsen_elements(), libMesh::ExactSolution::_compute_error(), libMesh::ParmetisPartitioner::_do_repartition(), libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_get_diagonal(), libMesh::SlepcEigenSolver< T >::_petsc_shell_matrix_get_diagonal(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_mult(), libMesh::SlepcEigenSolver< T >::_petsc_shell_matrix_mult(), libMesh::PetscLinearSolver< T >::_petsc_shell_matrix_mult_add(), libMesh::EquationSystems::_read_impl(), libMesh::MeshRefinement::_refine_elements(), libMesh::MeshRefinement::_smooth_flags(), add_cube_convex_hull_to_mesh(), libMesh::TransientRBConstruction::add_IC_to_RB_space(), libMesh::ImplicitSystem::add_matrix(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::System::add_vector(), libMesh::EigenSparseLinearSolver< T >::adjoint_solve(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::TransientRBConstruction::allocate_data_structures(), libMesh::RBConstruction::allocate_data_structures(), libMesh::TransientRBConstruction::assemble_affine_expansion(), libMesh::FEMSystem::assemble_qoi(), libMesh::MeshCommunication::assign_global_indices(), libMesh::ParmetisPartitioner::assign_partitioning(), libMesh::DofMap::attach_matrix(), libMesh::Parallel::BinSorter< KeyType, IdxType >::binsort(), libMesh::Parallel::Sort< KeyType, IdxType >::binsort(), libMesh::MeshCommunication::broadcast(), libMesh::SparseMatrix< T >::build(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::Parallel::Histogram< KeyType, IdxType >::build_histogram(), libMesh::PetscNonlinearSolver< T >::build_mat_null_space(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::MeshBase::cache_elem_dims(), libMesh::System::calculate_norm(), libMesh::DofMap::check_dirichlet_bcid_consistency(), libMesh::Parallel::Sort< KeyType, IdxType >::communicate_bins(), libMesh::RBConstruction::compute_Fq_representor_innerprods(), libMesh::RBConstruction::compute_max_error_bound(), libMesh::Nemesis_IO_Helper::compute_num_global_elem_blocks(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::RBConstruction::compute_output_dual_innerprods(), libMesh::RBSCMConstruction::compute_SCM_bounds_on_training_set(), libMesh::Problem_Interface::computeF(), libMesh::Problem_Interface::computeJacobian(), libMesh::Problem_Interface::computePreconditioner(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::MeshTools::create_bounding_box(), libMesh::MeshTools::create_nodal_bounding_box(), libMesh::MeshRefinement::create_parent_error_vector(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::MeshTools::create_subdomain_bounding_box(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::DofMap::distribute_dofs(), DMlibMeshFunction(), DMlibMeshJacobian(), DMlibMeshSetSystem_libMesh(), DMVariableBounds_libMesh(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::RBEIMConstruction::enrich_RB_space(), libMesh::TransientRBConstruction::enrich_RB_space(), libMesh::RBConstruction::enrich_RB_space(), AssembleOptimization::equality_constraints(), libMesh::WeightedPatchRecoveryErrorEstimator::estimate_error(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::PatchRecoveryErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::RBEIMConstruction::evaluate_mesh_function(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::MeshCommunication::gather(), libMesh::MeshCommunication::gather_neighboring_elements(), libMesh::MeshfreeInterpolation::gather_remote_data(), libMesh::CondensedEigenSystem::get_eigenpair(), libMesh::DofMap::get_info(), libMesh::ImplicitSystem::get_linear_solver(), libMesh::EquationSystems::get_solution(), AssembleOptimization::inequality_constraints(), AssembleOptimization::inequality_constraints_jacobian(), libMesh::LocationMap< T >::init(), libMesh::TopologyMap::init(), libMesh::PetscDiffSolver::init(), libMesh::TimeSolver::init(), libMesh::TaoOptimizationSolver< T >::init(), libMesh::PetscNonlinearSolver< T >::init(), libMesh::SystemSubsetBySubdomain::init(), libMesh::EigenSystem::init_data(), libMesh::EigenSystem::init_matrices(), libMesh::ParmetisPartitioner::initialize(), libMesh::OptimizationSystem::initialize_equality_constraints_storage(), libMesh::OptimizationSystem::initialize_inequality_constraints_storage(), libMesh::RBEIMConstruction::initialize_rb_construction(), integrate_function(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::MeshTools::libmesh_assert_valid_dof_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_flags(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_p_levels(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::MeshTools::libmesh_assert_valid_unique_ids(), libMesh::MeshRefinement::limit_level_mismatch_at_edge(), libMesh::MeshRefinement::limit_level_mismatch_at_node(), libMesh::MeshRefinement::limit_overrefined_boundary(), libMesh::MeshRefinement::limit_underrefined_boundary(), main(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshCommunication::make_elems_parallel_consistent(), libMesh::MeshRefinement::make_flags_parallel_consistent(), libMesh::MeshCommunication::make_new_node_proc_ids_parallel_consistent(), libMesh::MeshCommunication::make_new_nodes_parallel_consistent(), libMesh::MeshCommunication::make_node_ids_parallel_consistent(), libMesh::MeshCommunication::make_node_proc_ids_parallel_consistent(), libMesh::MeshCommunication::make_node_unique_ids_parallel_consistent(), libMesh::MeshCommunication::make_nodes_parallel_consistent(), libMesh::MeshCommunication::make_p_levels_parallel_consistent(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::TransientRBConstruction::mass_matrix_scaled_matvec(), libMesh::FEMSystem::mesh_position_set(), libMesh::MeshSerializer::MeshSerializer(), LinearElasticityWithContact::move_mesh(), libMesh::DistributedMesh::n_active_elem(), libMesh::MeshTools::n_active_levels(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::BoundaryInfo::n_edge_conds(), libMesh::CondensedEigenSystem::n_global_non_condensed_dofs(), libMesh::MeshTools::n_levels(), libMesh::BoundaryInfo::n_nodeset_conds(), libMesh::MeshTools::n_p_levels(), libMesh::BoundaryInfo::n_shellface_conds(), new_function_base(), libMesh::DistributedMesh::parallel_max_elem_id(), libMesh::DistributedMesh::parallel_max_node_id(), libMesh::ReplicatedMesh::parallel_max_unique_id(), libMesh::DistributedMesh::parallel_max_unique_id(), libMesh::DistributedMesh::parallel_n_elem(), libMesh::DistributedMesh::parallel_n_nodes(), libMesh::SparsityPattern::Build::parallel_sync(), libMesh::MeshTools::paranoid_n_levels(), libMesh::Partitioner::partition(), libMesh::MetisPartitioner::partition_range(), libMesh::Partitioner::partition_unpartitioned_elements(), libMesh::petsc_auto_fieldsplit(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::MeshBase::prepare_for_use(), libMesh::SparseMatrix< T >::print(), FEMParameters::read(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read(), libMesh::XdrIO::read(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::RBEvaluation::read_in_vectors_from_multiple_files(), libMesh::TransientRBConstruction::read_riesz_representors_from_files(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::XdrIO::read_serialized_bc_names(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::MeshBase::recalculate_n_partitions(), libMesh::MeshCommunication::redistribute(), libMesh::MeshRefinement::refine_and_coarsen_elements(), libMesh::DistributedMesh::renumber_dof_objects(), LinearElasticityWithContact::residual_and_jacobian(), libMesh::MeshCommunication::send_coarse_ghosts(), libMesh::TransientRBConstruction::set_error_temporal_data(), libMesh::RBEIMConstruction::set_explicit_sys_subvector(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::LaplaceMeshSmoother::smooth(), libMesh::Parallel::Sort< KeyType, IdxType >::sort(), libMesh::MeshBase::subdomain_ids(), libMesh::BoundaryInfo::sync(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id(), libMesh::MeshRefinement::test_level_one(), MeshfunctionDFEM::test_mesh_function_dfem(), MeshfunctionDFEM::test_mesh_function_dfem_grad(), libMesh::MeshRefinement::test_unflagged(), PointLocatorTest::testLocator(), BoundaryInfoTest::testMesh(), SystemsTest::testProjectCubeWithMeshFunction(), libMesh::MeshTools::total_weight(), libMesh::MeshFunctionSolutionTransfer::transfer(), libMesh::MeshfreeSolutionTransfer::transfer(), libMesh::TransientRBConstruction::truth_assembly(), libMesh::RBConstruction::truth_assembly(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::TransientRBConstruction::update_RB_initial_condition_all_N(), libMesh::RBEIMConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_RB_system_matrices(), libMesh::RBConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_residual_terms(), libMesh::RBConstruction::update_residual_terms(), libMesh::NameBasedIO::write(), libMesh::XdrIO::write(), libMesh::RBEvaluation::write_out_vectors(), libMesh::TransientRBConstruction::write_riesz_representors_to_files(), libMesh::RBConstruction::write_riesz_representors_to_files(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), libMesh::RBDataSerialization::RBEvaluationSerialization::write_to_file(), libMesh::RBDataSerialization::TransientRBEvaluationSerialization::write_to_file(), libMesh::RBDataSerialization::RBEIMEvaluationSerialization::write_to_file(), and libMesh::RBDataSerialization::RBSCMEvaluationSerialization::write_to_file().

88  { return _communicator; }
const Parallel::Communicator & _communicator
template<typename T>
int libMesh::NumericVector< T >::compare ( const NumericVector< T > &  other_vector,
const Real  threshold = TOLERANCE 
) const
virtual
Returns
-1 when this is equivalent to other_vector (up to the given threshold), or the first index where abs(a[i]-b[i]) exceeds the threshold.

Definition at line 118 of file numeric_vector.C.

References std::abs(), libMesh::NumericVector< T >::first_local_index(), libMesh::initialized(), libMesh::NumericVector< T >::initialized(), libMesh::NumericVector< T >::last_local_index(), libMesh::libmesh_assert(), and std::max().

Referenced by libMesh::NumericVector< Number >::operator/=().

120 {
121  libmesh_assert (this->initialized());
122  libmesh_assert (other_vector.initialized());
123  libmesh_assert_equal_to (this->first_local_index(), other_vector.first_local_index());
124  libmesh_assert_equal_to (this->last_local_index(), other_vector.last_local_index());
125 
126  int first_different_i = std::numeric_limits<int>::max();
128 
129  do
130  {
131  if (std::abs((*this)(i) - other_vector(i)) > threshold)
132  first_different_i = i;
133  else
134  i++;
135  }
136  while (first_different_i==std::numeric_limits<int>::max()
137  && i<last_local_index());
138 
139  // Find the correct first differing index in parallel
140  this->comm().min(first_different_i);
141 
142  if (first_different_i == std::numeric_limits<int>::max())
143  return -1;
144 
145  return first_different_i;
146 }
double abs(double a)
virtual numeric_index_type last_local_index() const =0
void min(T &r) const
Take a local variable and replace it with the minimum of it&#39;s values on all processors.
virtual bool initialized() const
long double max(long double a, double b)
libmesh_assert(j)
dof_id_type numeric_index_type
Definition: id_types.h:92
const Parallel::Communicator & comm() const
virtual numeric_index_type first_local_index() const =0
template<typename T>
virtual void libMesh::NumericVector< T >::conjugate ( )
pure virtual
template<typename T>
virtual void libMesh::NumericVector< T >::create_subvector ( NumericVector< T > &  ,
const std::vector< numeric_index_type > &   
) const
virtual

Fills in subvector from this vector using the indices in rows.

Similar to the create_submatrix() routine for the SparseMatrix class, it is currently only implemented for PetscVectors.

Reimplemented in libMesh::libmesh_final< T >, and libMesh::libmesh_final< T >.

Definition at line 687 of file numeric_vector.h.

689  {
690  libmesh_not_implemented();
691  }
void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 107 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

Referenced by libMesh::LibMeshInit::LibMeshInit(), and libMesh::ReferenceCounter::n_objects().

108 {
109  _enable_print_counter = false;
110  return;
111 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
template<typename T>
virtual T libMesh::NumericVector< T >::dot ( const NumericVector< T > &  v) const
pure virtual
template<typename T>
virtual T libMesh::NumericVector< T >::el ( const numeric_index_type  i) const
virtual
Returns
(*this)(i).

Definition at line 341 of file numeric_vector.h.

341 { return (*this)(i); }
void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

Methods to enable/disable the reference counter output from print_info()

Definition at line 101 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

Referenced by libMesh::ReferenceCounter::n_objects().

102 {
103  _enable_print_counter = true;
104  return;
105 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
template<typename T>
virtual numeric_index_type libMesh::NumericVector< T >::first_local_index ( ) const
pure virtual
template<typename T>
void libMesh::NumericVector< T >::get ( const std::vector< numeric_index_type > &  index,
T *  values 
) const
virtual

Access multiple components at once.

values will not be reallocated; it should already have enough space. The default implementation calls operator() for each index, but some implementations may supply faster methods here.

Reimplemented in libMesh::libmesh_final< T >.

Definition at line 810 of file numeric_vector.h.

Referenced by libMesh::DofMap::constrain_nothing(), libMesh::FEMContext::pre_fe_reinit(), and libMesh::System::project_vector().

812 {
813  const std::size_t num = index.size();
814  for (std::size_t i=0; i<num; i++)
815  {
816  values[i] = (*this)(index[i]);
817  }
818 }
template<typename T>
void libMesh::NumericVector< T >::get ( const std::vector< numeric_index_type > &  index,
std::vector< T > &  values 
) const

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.

Definition at line 824 of file numeric_vector.h.

826 {
827  const std::size_t num = index.size();
828  values.resize(num);
829  if (!num)
830  return;
831 
832  this->get(index, &values[0]);
833 }
std::string libMesh::ReferenceCounter::get_info ( )
staticinherited

Gets a string containing the reference information.

Definition at line 47 of file reference_counter.C.

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

Referenced by libMesh::ReferenceCounter::print_info().

48 {
49 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
50 
51  std::ostringstream oss;
52 
53  oss << '\n'
54  << " ---------------------------------------------------------------------------- \n"
55  << "| Reference count information |\n"
56  << " ---------------------------------------------------------------------------- \n";
57 
58  for (Counts::iterator it = _counts.begin();
59  it != _counts.end(); ++it)
60  {
61  const std::string name(it->first);
62  const unsigned int creations = it->second.first;
63  const unsigned int destructions = it->second.second;
64 
65  oss << "| " << name << " reference count information:\n"
66  << "| Creations: " << creations << '\n'
67  << "| Destructions: " << destructions << '\n';
68  }
69 
70  oss << " ---------------------------------------------------------------------------- \n";
71 
72  return oss.str();
73 
74 #else
75 
76  return "";
77 
78 #endif
79 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
static Counts _counts
Actually holds the data.
template<typename T>
int libMesh::NumericVector< T >::global_relative_compare ( const NumericVector< T > &  other_vector,
const Real  threshold = TOLERANCE 
) const
virtual
Returns
-1 when this is equivalent to other_vector (up to the given global relative threshold), or the first index where abs(a[i]-b[i])/max_j(a[j],b[j]) exceeds the threshold.

Definition at line 183 of file numeric_vector.C.

References std::abs(), libMesh::NumericVector< T >::first_local_index(), libMesh::initialized(), libMesh::NumericVector< T >::initialized(), libMesh::NumericVector< T >::last_local_index(), libMesh::libmesh_assert(), libMesh::NumericVector< T >::linfty_norm(), std::max(), and libMesh::Real.

Referenced by libMesh::NumericVector< Number >::operator/=().

185 {
186  libmesh_assert (this->initialized());
187  libmesh_assert (other_vector.initialized());
188  libmesh_assert_equal_to (this->first_local_index(), other_vector.first_local_index());
189  libmesh_assert_equal_to (this->last_local_index(), other_vector.last_local_index());
190 
191  int first_different_i = std::numeric_limits<int>::max();
193 
194  const Real my_norm = this->linfty_norm();
195  const Real other_norm = other_vector.linfty_norm();
196  const Real abs_threshold = std::max(my_norm, other_norm) * threshold;
197 
198  do
199  {
200  if (std::abs((*this)(i) - other_vector(i) ) > abs_threshold)
201  first_different_i = i;
202  else
203  i++;
204  }
205  while (first_different_i==std::numeric_limits<int>::max()
206  && i<last_local_index());
207 
208  // Find the correct first differing index in parallel
209  this->comm().min(first_different_i);
210 
211  if (first_different_i == std::numeric_limits<int>::max())
212  return -1;
213 
214  return first_different_i;
215 }
double abs(double a)
virtual numeric_index_type last_local_index() const =0
void min(T &r) const
Take a local variable and replace it with the minimum of it&#39;s values on all processors.
virtual bool initialized() const
long double max(long double a, double b)
libmesh_assert(j)
dof_id_type numeric_index_type
Definition: id_types.h:92
virtual Real linfty_norm() const =0
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Parallel::Communicator & comm() const
virtual numeric_index_type first_local_index() const =0
void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
protectedinherited

Increments the construction counter.

Should be called in the constructor of any derived class that will be reference counted.

Definition at line 185 of file reference_counter.h.

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

Referenced by libMesh::ReferenceCounter::n_objects(), and libMesh::ReferenceCountedObject< RBParametrized >::ReferenceCountedObject().

186 {
187  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
188  std::pair<unsigned int, unsigned int> & p = _counts[name];
189 
190  p.first++;
191 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:29
static Counts _counts
Actually holds the data.
void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
protectedinherited

Increments the destruction counter.

Should be called in the destructor of any derived class that will be reference counted.

Definition at line 198 of file reference_counter.h.

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

Referenced by libMesh::ReferenceCounter::n_objects(), and libMesh::ReferenceCountedObject< RBParametrized >::~ReferenceCountedObject().

199 {
200  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
201  std::pair<unsigned int, unsigned int> & p = _counts[name];
202 
203  p.second++;
204 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:29
static Counts _counts
Actually holds the data.
template<typename T>
virtual void libMesh::NumericVector< T >::init ( const numeric_index_type  ,
const numeric_index_type  ,
const bool  = false,
const ParallelType  = AUTOMATIC 
)
pure virtual
template<typename T>
virtual void libMesh::NumericVector< T >::init ( const numeric_index_type  ,
const bool  = false,
const ParallelType  = AUTOMATIC 
)
pure virtual
template<typename T>
virtual void libMesh::NumericVector< T >::init ( const numeric_index_type  ,
const numeric_index_type  ,
const std::vector< numeric_index_type > &  ,
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 libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, and libMesh::libmesh_final< T >.

template<typename T>
virtual void libMesh::NumericVector< T >::init ( const NumericVector< T > &  other,
const bool  fast = false 
)
pure virtual

Creates a vector that has the same dimension and storage type as other, including ghost dofs.

Implemented in libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, and libMesh::libmesh_final< T >.

template<typename T>
virtual bool libMesh::NumericVector< T >::initialized ( ) const
virtual
template<typename T>
void libMesh::NumericVector< T >::insert ( const T *  v,
const std::vector< numeric_index_type > &  dof_indices 
)
virtual

Inserts the entries of v in *this at the locations specified by v.

Reimplemented in libMesh::libmesh_final< T >, and libMesh::libmesh_final< T >.

Definition at line 96 of file numeric_vector.C.

Referenced by Biharmonic::JR::bounds(), libMesh::NumericVector< T >::insert(), main(), and libMesh::NumericVector< Number >::operator/=().

98 {
99  for (numeric_index_type i=0; i<dof_indices.size(); i++)
100  this->set (dof_indices[i], v[i]);
101 }
dof_id_type numeric_index_type
Definition: id_types.h:92
template<typename T>
void libMesh::NumericVector< T >::insert ( const std::vector< T > &  v,
const std::vector< numeric_index_type > &  dof_indices 
)

Inserts the entries of v in *this at the locations specified by v.

Definition at line 863 of file numeric_vector.h.

References libMesh::NumericVector< T >::insert(), and libMesh::libmesh_assert().

865 {
866  libmesh_assert(v.size() == dof_indices.size());
867  if (!v.empty())
868  this->insert(&v[0], dof_indices);
869 }
virtual void insert(const T *v, const std::vector< numeric_index_type > &dof_indices)
Inserts the entries of v in *this at the locations specified by v.
libmesh_assert(j)
template<typename T>
void libMesh::NumericVector< T >::insert ( const NumericVector< T > &  v,
const std::vector< numeric_index_type > &  dof_indices 
)
virtual

Inserts the entries of v in *this at the locations specified by v.

Definition at line 106 of file numeric_vector.C.

References libMesh::NumericVector< T >::size().

108 {
109  libmesh_assert_equal_to (V.size(), dof_indices.size());
110 
111  for (numeric_index_type i=0; i<dof_indices.size(); i++)
112  this->set (dof_indices[i], V(i));
113 }
dof_id_type numeric_index_type
Definition: id_types.h:92
template<typename T>
void libMesh::NumericVector< T >::insert ( const DenseVector< T > &  v,
const std::vector< numeric_index_type > &  dof_indices 
)

Inserts the entries of v in *this at the locations specified by v.

Definition at line 875 of file numeric_vector.h.

References libMesh::DenseVector< T >::empty(), libMesh::NumericVector< T >::insert(), libMesh::libmesh_assert(), and libMesh::DenseVector< T >::size().

877 {
878  libmesh_assert(v.size() == dof_indices.size());
879  if (!v.empty())
880  this->insert(&v(0), dof_indices);
881 }
virtual void insert(const T *v, const std::vector< numeric_index_type > &dof_indices)
Inserts the entries of v in *this at the locations specified by v.
libmesh_assert(j)
template<typename T>
void libMesh::NumericVector< T >::insert ( const DenseSubVector< T > &  v,
const std::vector< numeric_index_type > &  dof_indices 
)

Inserts the entries of v in *this at the locations specified by v.

Definition at line 887 of file numeric_vector.h.

References libMesh::DenseSubVector< T >::empty(), libMesh::NumericVector< T >::insert(), libMesh::libmesh_assert(), and libMesh::DenseSubVector< T >::size().

889 {
890  libmesh_assert(v.size() == dof_indices.size());
891  if (!v.empty())
892  this->insert(&v(0), dof_indices);
893 }
virtual void insert(const T *v, const std::vector< numeric_index_type > &dof_indices)
Inserts the entries of v in *this at the locations specified by v.
libmesh_assert(j)
template<typename T>
virtual Real libMesh::NumericVector< T >::l1_norm ( ) const
pure virtual
template<typename T>
virtual Real libMesh::NumericVector< T >::l2_norm ( ) const
pure virtual
template<typename T>
virtual numeric_index_type libMesh::NumericVector< T >::last_local_index ( ) const
pure virtual
template<typename T>
virtual Real libMesh::NumericVector< T >::linfty_norm ( ) const
pure virtual
template<typename T>
int libMesh::NumericVector< T >::local_relative_compare ( const NumericVector< T > &  other_vector,
const Real  threshold = TOLERANCE 
) const
virtual
Returns
-1 when this is equivalent to other_vector, (up to the given local relative threshold), or the first index where abs(a[i]-b[i])/max(a[i],b[i]) exceeds the threshold.

Definition at line 150 of file numeric_vector.C.

References std::abs(), libMesh::NumericVector< T >::first_local_index(), libMesh::initialized(), libMesh::NumericVector< T >::initialized(), libMesh::NumericVector< T >::last_local_index(), libMesh::libmesh_assert(), and std::max().

Referenced by libMesh::NumericVector< Number >::operator/=().

152 {
153  libmesh_assert (this->initialized());
154  libmesh_assert (other_vector.initialized());
155  libmesh_assert_equal_to (this->first_local_index(), other_vector.first_local_index());
156  libmesh_assert_equal_to (this->last_local_index(), other_vector.last_local_index());
157 
158  int first_different_i = std::numeric_limits<int>::max();
160 
161  do
162  {
163  if (std::abs((*this)(i) - other_vector(i)) > threshold *
164  std::max(std::abs((*this)(i)), std::abs(other_vector(i))))
165  first_different_i = i;
166  else
167  i++;
168  }
169  while (first_different_i==std::numeric_limits<int>::max()
170  && i<last_local_index());
171 
172  // Find the correct first differing index in parallel
173  this->comm().min(first_different_i);
174 
175  if (first_different_i == std::numeric_limits<int>::max())
176  return -1;
177 
178  return first_different_i;
179 }
double abs(double a)
virtual numeric_index_type last_local_index() const =0
void min(T &r) const
Take a local variable and replace it with the minimum of it&#39;s values on all processors.
virtual bool initialized() const
long double max(long double a, double b)
libmesh_assert(j)
dof_id_type numeric_index_type
Definition: id_types.h:92
const Parallel::Communicator & comm() const
virtual numeric_index_type first_local_index() const =0
template<typename T>
virtual numeric_index_type libMesh::NumericVector< T >::local_size ( ) const
pure virtual
template<typename T>
virtual void libMesh::NumericVector< T >::localize ( std::vector< T > &  v_local) const
pure virtual
template<typename T>
virtual void libMesh::NumericVector< T >::localize ( NumericVector< T > &  v_local) const
pure virtual

Same, but fills a NumericVector<T> instead of a std::vector.

Implemented in libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, and libMesh::libmesh_final< T >.

template<typename T>
virtual void libMesh::NumericVector< T >::localize ( NumericVector< T > &  v_local,
const std::vector< numeric_index_type > &  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 libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, and libMesh::libmesh_final< T >.

template<typename T>
virtual void libMesh::NumericVector< T >::localize ( std::vector< T > &  v_local,
const std::vector< numeric_index_type > &  indices 
) const
pure virtual

Fill in the local std::vector "v_local" with the global indices given in "indices".

Note
The indices can be different on every processor, and the same index can be localized to more than one processor. The resulting v_local can be shorter than the original, and the entries will be in the order specified by indices.

Example:

*   On 4 procs *this = {a, b, c, d, e, f, g, h, i} is a parallel vector.
*   On each proc, the indices arrays are set up as:
*   proc0, indices = {1,2,4,5}
*   proc1, indices = {2,5,6,8}
*   proc2, indices = {2,3,6,7}
*   proc3, indices = {0,1,2,3}
*
*   After calling this version of localize, the v_local vectors are:
*   proc0, v_local = {b,c,e,f}
*   proc1, v_local = {c,f,g,i}
*   proc2, v_local = {c,d,g,h}
*   proc3, v_local = {a,b,c,d}
* 

This function is useful in parallel I/O routines, when you have a parallel vector of solution values which you want to write a subset of.

Implemented in libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, and libMesh::libmesh_final< T >.

template<typename T>
virtual void libMesh::NumericVector< T >::localize ( const numeric_index_type  first_local_idx,
const numeric_index_type  last_local_idx,
const std::vector< numeric_index_type > &  send_list 
)
pure virtual

Updates a local vector with selected values from neighboring processors, as defined by send_list.

Implemented in libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, and libMesh::libmesh_final< T >.

template<typename T>
virtual void libMesh::NumericVector< T >::localize_to_one ( std::vector< T > &  v_local,
const processor_id_type  proc_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 libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, and libMesh::libmesh_final< T >.

Referenced by libMesh::EquationSystems::get_solution(), and libMesh::NumericVector< Number >::operator/=().

template<typename T>
virtual Real libMesh::NumericVector< T >::max ( ) const
pure virtual
Returns
The maximum entry in the vector, or the maximum real part in the case of complex numbers.

Implemented in libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, and libMesh::libmesh_final< T >.

Referenced by libMesh::NumericVector< Number >::closed().

template<typename T>
virtual Real libMesh::NumericVector< T >::min ( ) const
pure virtual
Returns
The minimum entry in the vector, or the minimum real part in the case of complex numbers.

Implemented in libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, and libMesh::libmesh_final< T >.

Referenced by libMesh::NumericVector< Number >::closed().

static unsigned int libMesh::ReferenceCounter::n_objects ( )
staticinherited
processor_id_type libMesh::ParallelObject::n_processors ( ) const
inherited
Returns
The number of processors in the group.

Definition at line 93 of file parallel_object.h.

References libMesh::ParallelObject::_communicator, and libMesh::Parallel::Communicator::size().

Referenced by libMesh::ParmetisPartitioner::_do_repartition(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::DistributedMesh::add_elem(), libMesh::DistributedMesh::add_node(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::FEMSystem::assembly(), libMesh::ParmetisPartitioner::assign_partitioning(), libMesh::AztecLinearSolver< T >::AztecLinearSolver(), libMesh::MeshCommunication::broadcast(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::DistributedMesh::clear(), libMesh::Nemesis_IO_Helper::compute_border_node_ids(), libMesh::Nemesis_IO_Helper::construct_nemesis_filename(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::UnstructuredMesh::create_pid_mesh(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DistributedMesh::DistributedMesh(), libMesh::EnsightIO::EnsightIO(), libMesh::MeshCommunication::gather(), libMesh::MeshCommunication::gather_neighboring_elements(), libMesh::MeshBase::get_info(), libMesh::EquationSystems::get_solution(), libMesh::SystemSubsetBySubdomain::init(), libMesh::ParmetisPartitioner::initialize(), libMesh::Nemesis_IO_Helper::initialize(), libMesh::DistributedMesh::insert_elem(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::MeshTools::libmesh_assert_valid_dof_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::DofMap::local_variable_indices(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshBase::n_active_elem_on_proc(), libMesh::MeshBase::n_elem_on_proc(), libMesh::MeshBase::n_nodes_on_proc(), libMesh::SparsityPattern::Build::parallel_sync(), libMesh::Partitioner::partition(), libMesh::MeshBase::partition(), libMesh::Partitioner::partition_unpartitioned_elements(), libMesh::PetscLinearSolver< T >::PetscLinearSolver(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::SparseMatrix< T >::print(), libMesh::NameBasedIO::read(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::XdrIO::read_header(), libMesh::CheckpointIO::read_nodes(), libMesh::MeshCommunication::redistribute(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::Partitioner::repartition(), libMesh::MeshCommunication::send_coarse_ghosts(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Parallel::Sort< KeyType, IdxType >::sort(), WriteVecAndScalar::testWrite(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::GMVIO::write_binary(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), and libMesh::XdrIO::write_serialized_nodesets().

94  { return cast_int<processor_id_type>(_communicator.size()); }
unsigned int size() const
Definition: parallel.h:726
const Parallel::Communicator & _communicator
template<typename T>
virtual T libMesh::NumericVector< T >::operator() ( const numeric_index_type  i) const
pure virtual
template<typename T>
NumericVector<T>& libMesh::NumericVector< T >::operator*= ( const T  a)

Scales the vector by a, $ \vec{u} \leftarrow a\vec{u} $.

Equivalent to u.scale(a)

Returns
A reference to *this.

Definition at line 386 of file numeric_vector.h.

386 { this->scale(a); return *this; }
virtual void scale(const T factor)=0
Scale each element of the vector by the given factor.
template<typename T>
virtual NumericVector<T>& libMesh::NumericVector< T >::operator+= ( const NumericVector< T > &  v)
pure virtual

Adds v to *this, $ \vec{u} \leftarrow \vec{u} + \vec{v} $.

Equivalent to u.add(1, v).

Returns
A reference to *this.

Implemented in libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, and libMesh::libmesh_final< T >.

Referenced by libMesh::NumericVector< Number >::el().

template<typename T>
virtual NumericVector<T>& libMesh::NumericVector< T >::operator-= ( const NumericVector< T > &  v)
pure virtual

Subtracts v from *this, $ \vec{u} \leftarrow \vec{u} - \vec{v} $.

Equivalent to u.add(-1, v).

Returns
A reference to *this.

Implemented in libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, and libMesh::libmesh_final< T >.

Referenced by libMesh::NumericVector< Number >::el().

template<typename T>
NumericVector<T>& libMesh::NumericVector< T >::operator/= ( const T  a)

Scales the vector by 1/a, $ \vec{u} \leftarrow \frac{1}{a}\vec{u} $.

Equivalent to u.scale(1./a)

Returns
A reference to *this.

Definition at line 395 of file numeric_vector.h.

Referenced by libMesh::NumericVector< Number >::operator/=().

395 { this->scale(1./a); return *this; }
virtual void scale(const T factor)=0
Scale each element of the vector by the given factor.
template<typename T>
virtual NumericVector<T>& libMesh::NumericVector< T >::operator/= ( NumericVector< T > &  )
pure virtual

Computes the pointwise division of this vector's entries by another's, $ u_i \leftarrow \frac{u_i}{v_i} \, \forall i$.

Returns
A reference to *this.

Implemented in libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, and libMesh::libmesh_final< T >.

template<typename T>
virtual NumericVector<T>& libMesh::NumericVector< T >::operator= ( const T  s)
pure virtual

Sets all entries of the vector to the value s.

Returns
A reference to *this.

Implemented in libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, and libMesh::libmesh_final< T >.

Referenced by libMesh::NumericVector< Number >::closed().

template<typename T>
virtual NumericVector<T>& libMesh::NumericVector< T >::operator= ( const NumericVector< T > &  v)
pure virtual

Sets (*this)(i) = v(i) for each entry of the vector.

Returns
A reference to *this as the base type.

Implemented in libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, and libMesh::libmesh_final< T >.

template<typename T>
virtual NumericVector<T>& libMesh::NumericVector< T >::operator= ( const std::vector< T > &  v)
pure virtual

Sets (*this)(i) = v(i) for each entry of the vector.

Returns
A reference to *this as the base type.

Implemented in libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, and libMesh::libmesh_final< T >.

template<typename T>
virtual void libMesh::NumericVector< T >::pointwise_mult ( const NumericVector< T > &  vec1,
const NumericVector< T > &  vec2 
)
pure virtual

Computes $ u_i \leftarrow u_i v_i $ (summation not implied) i.e.

the pointwise (component-wise) product of vec1 and vec2, and stores the result in *this.

Implemented in libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, and libMesh::libmesh_final< T >.

Referenced by libMesh::TensorShellMatrix< T >::get_diagonal(), and libMesh::NumericVector< Number >::operator/=().

template<typename T >
void libMesh::NumericVector< T >::print ( std::ostream &  os = libMesh::out) const
virtual

Prints the local contents of the vector, by default to libMesh::out.

Definition at line 920 of file numeric_vector.h.

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

Referenced by libMesh::NumericVector< Number >::operator/=().

921 {
922  libmesh_assert (this->initialized());
923  os << "Size\tglobal = " << this->size()
924  << "\t\tlocal = " << this->local_size() << std::endl;
925 
926  os << "#\tValue" << std::endl;
927  for (numeric_index_type i=this->first_local_index(); i<this->last_local_index(); i++)
928  os << i << "\t" << (*this)(i) << std::endl;
929 }
virtual numeric_index_type size() const =0
virtual numeric_index_type last_local_index() const =0
virtual bool initialized() const
libmesh_assert(j)
dof_id_type numeric_index_type
Definition: id_types.h:92
virtual numeric_index_type local_size() const =0
virtual numeric_index_type first_local_index() const =0
template<>
void libMesh::NumericVector< Complex >::print ( std::ostream &  os) const

Definition at line 902 of file numeric_vector.h.

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

903 {
904  libmesh_assert (this->initialized());
905  os << "Size\tglobal = " << this->size()
906  << "\t\tlocal = " << this->local_size() << std::endl;
907 
908  // std::complex<>::operator<<() is defined, but use this form
909  os << "#\tReal part\t\tImaginary part" << std::endl;
910  for (numeric_index_type i=this->first_local_index(); i<this->last_local_index(); i++)
911  os << i << "\t"
912  << (*this)(i).real() << "\t\t"
913  << (*this)(i).imag() << std::endl;
914 }
virtual numeric_index_type size() const =0
virtual numeric_index_type last_local_index() const =0
virtual bool initialized() const
libmesh_assert(j)
dof_id_type numeric_index_type
Definition: id_types.h:92
virtual numeric_index_type local_size() const =0
virtual numeric_index_type first_local_index() const =0
template<typename T >
void libMesh::NumericVector< T >::print_global ( std::ostream &  os = libMesh::out) const
virtual

Prints the global contents of the vector, by default to libMesh::out.

Definition at line 957 of file numeric_vector.h.

References libMesh::NumericVector< T >::initialized(), libMesh::libmesh_assert(), libMesh::NumericVector< T >::localize(), libMesh::ParallelObject::processor_id(), and libMesh::NumericVector< T >::size().

Referenced by libMesh::NumericVector< Number >::operator/=().

958 {
959  libmesh_assert (this->initialized());
960 
961  std::vector<T> v(this->size());
962  this->localize(v);
963 
964  // Right now we only want one copy of the output
965  if (this->processor_id())
966  return;
967 
968  os << "Size\tglobal = " << this->size() << std::endl;
969  os << "#\tValue" << std::endl;
970  for (numeric_index_type i=0; i!=v.size(); i++)
971  os << i << "\t" << v[i] << std::endl;
972 }
virtual numeric_index_type size() const =0
virtual bool initialized() const
libmesh_assert(j)
dof_id_type numeric_index_type
Definition: id_types.h:92
virtual void localize(std::vector< T > &v_local) const =0
Creates a copy of the global vector in the local vector v_local.
processor_id_type processor_id() const
template<>
void libMesh::NumericVector< Complex >::print_global ( std::ostream &  os) const

Definition at line 935 of file numeric_vector.h.

References libMesh::NumericVector< T >::initialized(), libMesh::libmesh_assert(), libMesh::NumericVector< T >::localize(), libMesh::ParallelObject::processor_id(), and libMesh::NumericVector< T >::size().

936 {
937  libmesh_assert (this->initialized());
938 
939  std::vector<Complex> v(this->size());
940  this->localize(v);
941 
942  // Right now we only want one copy of the output
943  if (this->processor_id())
944  return;
945 
946  os << "Size\tglobal = " << this->size() << std::endl;
947  os << "#\tReal part\t\tImaginary part" << std::endl;
948  for (numeric_index_type i=0; i!=v.size(); i++)
949  os << i << "\t"
950  << v[i].real() << "\t\t"
951  << v[i].imag() << std::endl;
952 }
virtual numeric_index_type size() const =0
virtual bool initialized() const
libmesh_assert(j)
dof_id_type numeric_index_type
Definition: id_types.h:92
virtual void localize(std::vector< T > &v_local) const =0
Creates a copy of the global vector in the local vector v_local.
processor_id_type processor_id() const
void libMesh::ReferenceCounter::print_info ( std::ostream &  out = libMesh::out)
staticinherited

Prints the reference information, by default to libMesh::out.

Definition at line 88 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter, and libMesh::ReferenceCounter::get_info().

Referenced by libMesh::LibMeshInit::LibMeshInit().

89 {
91  out_stream << ReferenceCounter::get_info();
92 }
static std::string get_info()
Gets a string containing the reference information.
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
template<typename T>
virtual void libMesh::NumericVector< T >::print_matlab ( const std::string &  = "") const
virtual

Print the contents of the vector in Matlab's sparse matrix format.

Optionally prints the vector to the file named name. If name is not specified it is dumped to the screen.

Reimplemented in libMesh::libmesh_final< T >, and libMesh::libmesh_final< T >.

Definition at line 676 of file numeric_vector.h.

677  {
678  libmesh_not_implemented();
679  }
processor_id_type libMesh::ParallelObject::processor_id ( ) const
inherited
Returns
The rank of this processor in the group.

Definition at line 99 of file parallel_object.h.

References libMesh::ParallelObject::_communicator, and libMesh::Parallel::Communicator::rank().

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::EquationSystems::_read_impl(), libMesh::DistributedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::DistributedMesh::add_node(), libMesh::MeshRefinement::add_node(), libMesh::MeshTools::Modification::all_tri(), libMesh::FEMSystem::assembly(), libMesh::ParmetisPartitioner::assign_partitioning(), libMesh::MeshCommunication::broadcast(), libMesh::EquationSystems::build_discontinuous_solution_vector(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::ParmetisPartitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::DofMap::build_sparsity(), libMesh::DistributedMesh::clear(), libMesh::ExodusII_IO_Helper::close(), libMesh::Nemesis_IO_Helper::compute_border_node_ids(), libMesh::Nemesis_IO_Helper::compute_communication_map_parameters(), libMesh::Nemesis_IO_Helper::compute_internal_and_border_elems_and_internal_nodes(), libMesh::RBConstruction::compute_max_error_bound(), libMesh::Nemesis_IO_Helper::compute_node_communication_maps(), libMesh::Nemesis_IO_Helper::compute_num_global_elem_blocks(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::Nemesis_IO_Helper::construct_nemesis_filename(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::ExodusII_IO_Helper::create(), libMesh::DistributedMesh::delete_elem(), libMesh::DistributedMesh::delete_node(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DistributedMesh::DistributedMesh(), libMesh::EnsightIO::EnsightIO(), libMesh::RBEIMConstruction::evaluate_mesh_function(), libMesh::MeshFunction::find_element(), libMesh::MeshFunction::find_elements(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshCommunication::gather(), libMesh::MeshCommunication::gather_neighboring_elements(), libMesh::Nemesis_IO_Helper::get_cmap_params(), libMesh::Nemesis_IO_Helper::get_eb_info_global(), libMesh::Nemesis_IO_Helper::get_elem_cmap(), libMesh::Nemesis_IO_Helper::get_elem_map(), libMesh::MeshBase::get_info(), libMesh::DofMap::get_info(), libMesh::Nemesis_IO_Helper::get_init_global(), libMesh::Nemesis_IO_Helper::get_init_info(), libMesh::Nemesis_IO_Helper::get_loadbal_param(), libMesh::Nemesis_IO_Helper::get_node_cmap(), libMesh::Nemesis_IO_Helper::get_node_map(), libMesh::Nemesis_IO_Helper::get_ns_param_global(), libMesh::EquationSystems::get_solution(), libMesh::Nemesis_IO_Helper::get_ss_param_global(), libMesh::SparsityPattern::Build::handle_vi_vj(), libMesh::SystemSubsetBySubdomain::init(), HeatSystem::init_data(), libMesh::ParmetisPartitioner::initialize(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::ExodusII_IO_Helper::initialize_element_variables(), libMesh::ExodusII_IO_Helper::initialize_global_variables(), libMesh::ExodusII_IO_Helper::initialize_nodal_variables(), libMesh::DistributedMesh::insert_elem(), libMesh::DofMap::is_evaluable(), libMesh::SparsityPattern::Build::join(), libMesh::TransientRBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEIMEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBSCMEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEIMEvaluation::legacy_write_out_interpolation_points_elem(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::DofMap::local_variable_indices(), main(), libMesh::MeshRefinement::make_coarsening_compatible(), AugmentSparsityOnInterface::mesh_reinit(), libMesh::MeshBase::n_active_local_elem(), libMesh::BoundaryInfo::n_boundary_conds(), libMesh::BoundaryInfo::n_edge_conds(), libMesh::System::n_local_dofs(), libMesh::MeshBase::n_local_elem(), libMesh::MeshBase::n_local_nodes(), libMesh::BoundaryInfo::n_nodeset_conds(), libMesh::BoundaryInfo::n_shellface_conds(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::SparsityPattern::Build::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::SparsityPattern::Build::parallel_sync(), libMesh::MetisPartitioner::partition_range(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::SparseMatrix< T >::print(), libMesh::NumericVector< T >::print_global(), libMesh::Nemesis_IO_Helper::put_cmap_params(), libMesh::Nemesis_IO_Helper::put_elem_cmap(), libMesh::Nemesis_IO_Helper::put_elem_map(), libMesh::Nemesis_IO_Helper::put_loadbal_param(), libMesh::Nemesis_IO_Helper::put_node_cmap(), libMesh::Nemesis_IO_Helper::put_node_map(), libMesh::NameBasedIO::read(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read(), libMesh::XdrIO::read(), libMesh::ExodusII_IO_Helper::read_elem_num_map(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::RBEvaluation::read_in_vectors_from_multiple_files(), libMesh::ExodusII_IO_Helper::read_node_num_map(), libMesh::TransientRBConstruction::read_riesz_representors_from_files(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::XdrIO::read_serialized_bc_names(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::MeshCommunication::redistribute(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::MeshCommunication::send_coarse_ghosts(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::LaplaceMeshSmoother::smooth(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), BoundaryInfoTest::testShellFaceConstraints(), WriteVecAndScalar::testWrite(), libMesh::MeshTools::total_weight(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::Parallel::Packing< Node * >::unpack(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::DTKAdapter::update_variable_values(), libMesh::MeshTools::weight(), libMesh::NameBasedIO::write(), libMesh::CheckpointIO::write(), libMesh::XdrIO::write(), libMesh::EquationSystems::write(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::ExodusII_IO::write_element_data(), libMesh::ExodusII_IO_Helper::write_element_values(), libMesh::ExodusII_IO_Helper::write_elements(), libMesh::ExodusII_IO::write_global_data(), libMesh::ExodusII_IO_Helper::write_global_values(), libMesh::ExodusII_IO::write_information_records(), libMesh::ExodusII_IO_Helper::write_information_records(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::UCDIO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data_discontinuous(), libMesh::ExodusII_IO_Helper::write_nodal_values(), libMesh::Nemesis_IO_Helper::write_nodesets(), libMesh::ExodusII_IO_Helper::write_nodesets(), libMesh::RBEvaluation::write_out_vectors(), write_output_solvedata(), libMesh::RBConstruction::write_riesz_representors_to_files(), libMesh::XdrIO::write_serialized_bc_names(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), libMesh::XdrIO::write_serialized_subdomain_names(), libMesh::Nemesis_IO_Helper::write_sidesets(), libMesh::ExodusII_IO_Helper::write_sidesets(), libMesh::ExodusII_IO::write_timestep(), and libMesh::ExodusII_IO_Helper::write_timestep().

100  { return cast_int<processor_id_type>(_communicator.rank()); }
const Parallel::Communicator & _communicator
unsigned int rank() const
Definition: parallel.h:724
template<typename T>
virtual void libMesh::NumericVector< T >::reciprocal ( )
pure virtual
template<typename T>
virtual void libMesh::NumericVector< T >::scale ( const T  factor)
pure virtual
template<typename T>
virtual void libMesh::NumericVector< T >::set ( const numeric_index_type  i,
const T  value 
)
pure virtual
template<typename T>
virtual numeric_index_type libMesh::NumericVector< T >::size ( ) const
pure virtual
template<class T >
Real libMesh::NumericVector< T >::subset_l1_norm ( const std::set< numeric_index_type > &  indices) const
virtual
Returns
The $ \ell_1 $-norm of the vector, i.e. the sum of the absolute values for the specified entries in the vector.
Note
The indices must necessarily live on this processor.

Definition at line 325 of file numeric_vector.C.

References std::abs(), and libMesh::Real.

Referenced by libMesh::NumericVector< Number >::closed(), and libMesh::System::discrete_var_norm().

326 {
327  const NumericVector<T> & v = *this;
328 
329  std::set<numeric_index_type>::const_iterator it = indices.begin();
330  const std::set<numeric_index_type>::const_iterator it_end = indices.end();
331 
332  Real norm = 0;
333 
334  for (; it!=it_end; ++it)
335  norm += std::abs(v(*it));
336 
337  this->comm().sum(norm);
338 
339  return norm;
340 }
double abs(double a)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Parallel::Communicator & comm() const
void sum(T &r) const
Take a local variable and replace it with the sum of it&#39;s values on all processors.
template<class T >
Real libMesh::NumericVector< T >::subset_l2_norm ( const std::set< numeric_index_type > &  indices) const
virtual
Returns
The $ \ell_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
The indices must necessarily live on this processor.

Definition at line 343 of file numeric_vector.C.

References libMesh::TensorTools::norm_sq(), and libMesh::Real.

Referenced by libMesh::NumericVector< Number >::closed(), and libMesh::System::discrete_var_norm().

344 {
345  const NumericVector<T> & v = *this;
346 
347  std::set<numeric_index_type>::const_iterator it = indices.begin();
348  const std::set<numeric_index_type>::const_iterator it_end = indices.end();
349 
350  Real norm = 0;
351 
352  for (; it!=it_end; ++it)
353  norm += TensorTools::norm_sq(v(*it));
354 
355  this->comm().sum(norm);
356 
357  return std::sqrt(norm);
358 }
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Parallel::Communicator & comm() const
void sum(T &r) const
Take a local variable and replace it with the sum of it&#39;s values on all processors.
template<class T >
Real libMesh::NumericVector< T >::subset_linfty_norm ( const std::set< numeric_index_type > &  indices) const
virtual
Returns
The maximum absolute value of the specified entries of this vector, which is the $ \ell_{\infty} $-norm of a vector.
Note
The indices must necessarily live on this processor.

Definition at line 361 of file numeric_vector.C.

References std::abs(), libMesh::Real, and value.

Referenced by libMesh::NumericVector< Number >::closed(), and libMesh::System::discrete_var_norm().

362 {
363  const NumericVector<T> & v = *this;
364 
365  std::set<numeric_index_type>::const_iterator it = indices.begin();
366  const std::set<numeric_index_type>::const_iterator it_end = indices.end();
367 
368  Real norm = 0;
369 
370  for (; it!=it_end; ++it)
371  {
372  Real value = std::abs(v(*it));
373  if (value > norm)
374  norm = value;
375  }
376 
377  this->comm().max(norm);
378 
379  return norm;
380 }
double abs(double a)
void max(T &r) const
Take a local variable and replace it with the maximum of it&#39;s values on all processors.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Parallel::Communicator & comm() const
static const bool value
Definition: xdr_io.C:108
template<typename T>
virtual T libMesh::NumericVector< T >::sum ( ) const
pure virtual
template<typename T>
void libMesh::NumericVector< T >::swap ( NumericVector< T > &  v)
virtual

Swaps the contents of this with v.

There should be enough indirection in subclasses to make this an O(1) header-swap operation.

Reimplemented in libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, and libMesh::libmesh_final< T >.

Definition at line 978 of file numeric_vector.h.

References libMesh::NumericVector< T >::_is_closed, libMesh::NumericVector< T >::_is_initialized, libMesh::NumericVector< T >::_type, and swap().

Referenced by libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::NumericVector< Number >::create_subvector(), libMesh::WeightedPatchRecoveryErrorEstimator::estimate_error(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::PatchRecoveryErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), and main().

979 {
980  std::swap(_is_closed, v._is_closed);
981  std::swap(_is_initialized, v._is_initialized);
982  std::swap(_type, v._type);
983 }
bool _is_initialized
true once init() has been called.
ParallelType _type
Type of vector.
void swap(Iterator &lhs, Iterator &rhs)
swap, used to implement op=
bool _is_closed
Flag which tracks whether the vector&#39;s values are consistent on all processors after insertion or add...
template<typename T>
ParallelType libMesh::NumericVector< T >::type ( ) const
Returns
The type (SERIAL, PARALLEL, GHOSTED) of the vector.

Definition at line 142 of file numeric_vector.h.

Referenced by libMesh::DofMap::constrain_nothing(), libMesh::MeshFunction::find_element(), libMesh::MeshFunction::find_elements(), libMesh::System::project_vector(), and libMesh::System::read_serialized_vector().

142 { return _type; }
ParallelType _type
Type of vector.
template<typename T>
ParallelType& libMesh::NumericVector< T >::type ( )
Returns
The type (SERIAL, PARALLEL, GHOSTED) of the vector.

Definition at line 147 of file numeric_vector.h.

147 { return _type; }
ParallelType _type
Type of vector.
template<typename T>
virtual void libMesh::NumericVector< T >::zero ( )
pure virtual

Set all entries to zero.

Equivalent to v = 0, but more obvious and faster.

Implemented in libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, libMesh::libmesh_final< T >, and libMesh::libmesh_final< T >.

Referenced by add_M_C_K_helmholtz(), apply_initial(), libMesh::ImplicitSystem::assemble(), AssembleOptimization::assemble_A_and_F(), libMesh::RBConstruction::assemble_all_output_vectors(), libMesh::RBConstruction::assemble_Fq_vector(), libMesh::ExplicitSystem::assemble_qoi_derivative(), libMesh::FEMSystem::assemble_qoi_derivative(), libMesh::FEMSystem::assembly(), libMesh::NumericVector< Number >::closed(), libMesh::RBConstruction::compute_Fq_representor_innerprods(), libMesh::RBConstruction::compute_output_dual_innerprods(), libMesh::ContinuationSystem::continuation_solve(), libMesh::TransientRBConstruction::enrich_RB_space(), libMesh::RBConstruction::enrich_RB_space(), AssembleOptimization::equality_constraints(), AssembleOptimization::gradient(), AssembleOptimization::inequality_constraints(), libMesh::NewmarkSystem::initial_conditions(), libMesh::TransientRBConstruction::mass_matrix_scaled_matvec(), LaplaceYoung::residual(), LargeDeformationElasticity::residual(), LinearElasticityWithContact::residual_and_jacobian(), libMesh::NewtonSolver::solve(), libMesh::ContinuationSystem::solve_tangent(), libMesh::TransientRBConstruction::truth_assembly(), libMesh::RBConstruction::truth_assembly(), libMesh::RBEIMConstruction::truth_solve(), libMesh::TransientRBConstruction::update_residual_terms(), libMesh::RBConstruction::update_residual_terms(), libMesh::NewmarkSystem::update_rhs(), libMesh::SumShellMatrix< T >::vector_mult(), and libMesh::SparseMatrix< T >::vector_mult().

template<typename T>
virtual UniquePtr<NumericVector<T> > libMesh::NumericVector< T >::zero_clone ( ) const
pure virtual

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 665 of file numeric_vector.h.

666  {
667  v.print_global(os);
668  return os;
669  }

Member Data Documentation

const Parallel::Communicator& libMesh::ParallelObject::_communicator
protectedinherited
ReferenceCounter::Counts libMesh::ReferenceCounter::_counts
staticprotectedinherited
bool libMesh::ReferenceCounter::_enable_print_counter = true
staticprotectedinherited

Flag to control whether reference count information is printed when print_info is called.

Definition at line 143 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::disable_print_counter_info(), libMesh::ReferenceCounter::enable_print_counter_info(), and libMesh::ReferenceCounter::print_info().

template<typename T>
bool libMesh::NumericVector< T >::_is_closed
protected

Flag which tracks whether the vector's values are consistent on all processors after insertion or addition of values has occurred on some or all processors.

Definition at line 707 of file numeric_vector.h.

Referenced by libMesh::NumericVector< T >::clear(), libMesh::NumericVector< Number >::closed(), and libMesh::NumericVector< T >::swap().

template<typename T>
bool libMesh::NumericVector< T >::_is_initialized
protected
Threads::spin_mutex libMesh::ReferenceCounter::_mutex
staticprotectedinherited

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 137 of file reference_counter.h.

Threads::atomic< unsigned int > libMesh::ReferenceCounter::_n_objects
staticprotectedinherited

The number of objects.

Print the reference count information when the number returns to 0.

Definition at line 132 of file reference_counter.h.

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

template<typename T>
ParallelType libMesh::NumericVector< T >::_type
protected

Type of vector.

Definition at line 717 of file numeric_vector.h.

Referenced by libMesh::NumericVector< T >::swap(), and libMesh::NumericVector< Number >::type().


The documentation for this class was generated from the following files: