Reference documentation for deal.II version 9.4.0
LinearAlgebra::Vector< Number > Class Template Reference

#include <deal.II/lac/la_vector.h>

Inheritance diagram for LinearAlgebra::Vector< Number >:
[legend]

## Public Types

using size_type = types::global_dof_index

using value_type = typename ReadWriteVector< Number >::value_type

using pointer = value_type *

using const_pointer = const value_type *

using iterator = value_type *

using const_iterator = const value_type *

using reference = value_type &

using const_reference = const value_type &

using real_type = typename numbers::NumberTraits< Number >::real_type

using real_type = typename numbers::NumberTraits< Number >::real_type

## Public Member Functions

Vector ()=default

Vector (const Vector< Number > &V)

Vector (const size_type n)

template<typename InputIterator >
Vector (const InputIterator first, const InputIterator last)

virtual void reinit (const size_type size, const bool omit_zeroing_entries=false) override

template<typename Number2 >
void reinit (const ReadWriteVector< Number2 > &in_vector, const bool omit_zeroing_entries=false)

virtual void reinit (const IndexSet &locally_stored_indices, const bool omit_zeroing_entries=false) override

virtual void reinit (const VectorSpaceVector< Number > &V, const bool omit_zeroing_entries=false) override

bool has_ghost_elements () const

Vector< Number > & operator= (const Vector< Number > &in_vector)

template<typename Number2 >
Vector< Number > & operator= (const Vector< Number2 > &in_vector)

virtual Vector< Number > & operator= (const Number s) override

virtual Vector< Number > & operator*= (const Number factor) override

virtual Vector< Number > & operator/= (const Number factor) override

virtual Vector< Number > & operator+= (const VectorSpaceVector< Number > &V) override

virtual Vector< Number > & operator-= (const VectorSpaceVector< Number > &V) override

virtual Number operator* (const VectorSpaceVector< Number > &V) const override

virtual void import (const ReadWriteVector< Number > &V, VectorOperation::values operation, std::shared_ptr< const Utilities::MPI::CommunicationPatternBase > communication_pattern={}) override

virtual void add (const Number a) override

virtual void add (const Number a, const VectorSpaceVector< Number > &V) override

virtual void add (const Number a, const VectorSpaceVector< Number > &V, const Number b, const VectorSpaceVector< Number > &W) override

virtual void sadd (const Number s, const Number a, const VectorSpaceVector< Number > &V) override

virtual void scale (const VectorSpaceVector< Number > &scaling_factors) override

virtual void equ (const Number a, const VectorSpaceVector< Number > &V) override

virtual bool all_zero () const override

virtual value_type mean_value () const override

virtual VectorSpaceVector< Number >::real_type l1_norm () const override

virtual VectorSpaceVector< Number >::real_type l2_norm () const override

virtual VectorSpaceVector< Number >::real_type linfty_norm () const override

virtual Number add_and_dot (const Number a, const VectorSpaceVector< Number > &V, const VectorSpaceVector< Number > &W) override

virtual size_type size () const override

virtual ::IndexSet locally_owned_elements () const override

virtual void print (std::ostream &out, const unsigned int precision=3, const bool scientific=true, const bool across=true) const override

void print_as_numpy_array (std::ostream &out, const unsigned int precision=9) const

void block_write (std::ostream &out) const

virtual std::size_t memory_consumption () const override

template<typename Archive >
void serialize (Archive &ar, const unsigned int version)

virtual void compress (VectorOperation::values)

1: Basic Object-handling
void reinit (const TrilinosWrappers::MPI::Vector &trilinos_vec)

template<typename Functor >
void apply (const Functor &func)

void swap (ReadWriteVector< Number > &v)

void import (const ::Vector< Number > &vec, VectorOperation::values operation, const std::shared_ptr< const Utilities::MPI::CommunicationPatternBase > &communication_pattern={})

void import (const LinearAlgebra::Vector< Number > &vec, VectorOperation::values operation, const std::shared_ptr< const Utilities::MPI::CommunicationPatternBase > &communication_pattern={})

template<typename MemorySpace >
void import (const distributed::Vector< Number, MemorySpace > &vec, VectorOperation::values operation, const std::shared_ptr< const Utilities::MPI::CommunicationPatternBase > &communication_pattern={})

void import (const PETScWrappers::MPI::Vector &petsc_vec, VectorOperation::values operation, const std::shared_ptr< const Utilities::MPI::CommunicationPatternBase > &communication_pattern={})

void import (const TrilinosWrappers::MPI::Vector &trilinos_vec, VectorOperation::values operation, const std::shared_ptr< const Utilities::MPI::CommunicationPatternBase > &communication_pattern={})

void import (const TpetraWrappers::Vector< Number > &tpetra_vec, VectorOperation::values operation, const std::shared_ptr< const Utilities::MPI::CommunicationPatternBase > &communication_pattern={})

void import (const EpetraWrappers::Vector &epetra_vec, VectorOperation::values operation, const std::shared_ptr< const Utilities::MPI::CommunicationPatternBase > &communication_pattern={})

void import (const CUDAWrappers::Vector< Number > &cuda_vec, VectorOperation::values operation, const std::shared_ptr< const Utilities::MPI::CommunicationPatternBase > &communication_pattern={})

size_type n_elements () const

size_type locally_owned_size () const

const IndexSetget_stored_elements () const

iterator begin ()

const_iterator begin () const

iterator end ()

const_iterator end () const

2: Data-Access
Number operator() (const size_type global_index) const

Number & operator() (const size_type global_index)

Number operator[] (const size_type global_index) const

Number & operator[] (const size_type global_index)

template<typename Number2 >
void extract_subvector_to (const std::vector< size_type > &indices, std::vector< Number2 > &values) const

template<typename ForwardIterator , typename OutputIterator >
void extract_subvector_to (ForwardIterator indices_begin, const ForwardIterator indices_end, OutputIterator values_begin) const

Number local_element (const size_type local_index) const

Number & local_element (const size_type local_index)

## Static Public Member Functions

static ::ExceptionBaseExcVectorTypeNotCompatible ()

## Friends

template<typename Number2 >
class Vector

## 3: Modification of vectors

template<typename Number2 >
void add (const std::vector< size_type > &indices, const std::vector< Number2 > &values)

template<typename Number2 >
void add (const std::vector< size_type > &indices, const ReadWriteVector< Number2 > &values)

template<typename Number2 >
void add (const size_type n_elements, const size_type *indices, const Number2 *values)

void print (std::ostream &out, const unsigned int precision=3, const bool scientific=true) const

IndexSet stored_elements

IndexSet source_stored_elements

std::shared_ptr< Utilities::MPI::CommunicationPatternBasecomm_pattern

std::unique_ptr< Number[], decltype(std::free) * > values

void import (const Tpetra::Vector< Number, int, types::global_dof_index > &tpetra_vector, const IndexSet &locally_owned_elements, VectorOperation::values operation, const MPI_Comm &mpi_comm, const std::shared_ptr< const Utilities::MPI::CommunicationPatternBase > &communication_pattern)

void import (const Epetra_MultiVector &multivector, const IndexSet &locally_owned_elements, VectorOperation::values operation, const MPI_Comm &mpi_comm, const std::shared_ptr< const Utilities::MPI::CommunicationPatternBase > &communication_pattern)

unsigned int global_to_local (const types::global_dof_index global_index) const

void resize_val (const size_type new_allocated_size)

TpetraWrappers::CommunicationPattern create_tpetra_comm_pattern (const IndexSet &source_index_set, const MPI_Comm &mpi_comm)

EpetraWrappers::CommunicationPattern create_epetra_comm_pattern (const IndexSet &source_index_set, const MPI_Comm &mpi_comm)

## Subscriptor functionality

Classes derived from Subscriptor provide a facility to subscribe to this object. This is mostly used by the SmartPointer class.

void subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const

void unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") const

unsigned int n_subscriptions () const

template<typename StreamType >
void list_subscribers (StreamType &stream) const

void list_subscribers () const

static ::ExceptionBaseExcInUse (int arg1, std::string arg2, std::string arg3)

static ::ExceptionBaseExcNoSubscriber (std::string arg1, std::string arg2)

using map_value_type = decltype(counter_map)::value_type

using map_iterator = decltype(counter_map)::iterator

std::atomic< unsigned intcounter

std::map< std::string, unsigned intcounter_map

std::vector< std::atomic< bool > * > validity_pointers

const std::type_info * object_info

static std::mutex mutex

void check_no_subscribers () const noexcept

## Detailed Description

template<typename Number>
class LinearAlgebra::Vector< Number >

Numerical vector of data. This class derives from both LinearAlgebra::ReadWriteVector and LinearAlgebra::VectorSpaceVector. As opposed to the array of the C++ standard library, this class implements an element of a vector space suitable for numerical computations.

Definition at line 77 of file la_vector.h.

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