![]() |
Reference documentation for deal.II version 8.1.0
|
#include <trilinos_vector.h>
Public Types | |
typedef ::types::global_dof_index | size_type |
![]() | |
typedef TrilinosScalar | value_type |
typedef TrilinosScalar | real_type |
typedef ::types::global_dof_index | size_type |
typedef value_type * | iterator |
typedef const value_type * | const_iterator |
typedef internal::VectorReference | reference |
typedef const internal::VectorReference | const_reference |
Public Member Functions | |
Vector () | |
Vector (const size_type n) | |
Vector (const Epetra_Map &partitioning) | |
Vector (const IndexSet &partitioning, const MPI_Comm &communicator=MPI_COMM_WORLD) | |
Vector (const VectorBase &V) | |
template<typename Number > | |
Vector (const ::Vector< Number > &v) | |
void | reinit (const size_type n, const bool fast=false) |
void | reinit (const Epetra_Map &input_map, const bool fast=false) |
void | reinit (const IndexSet &input_map, const MPI_Comm &communicator=MPI_COMM_WORLD, const bool fast=false) |
void | reinit (const VectorBase &V, const bool fast=false, const bool allow_different_maps=false) |
Vector & | operator= (const TrilinosScalar s) |
Vector & | operator= (const MPI::Vector &V) |
template<typename Number > | |
Vector & | operator= (const ::Vector< Number > &V) |
Vector & | operator= (const Vector &V) |
void | update_ghost_values () const |
![]() | |
DeclException0 (ExcGhostsPresent) | |
DeclException0 (ExcDifferentParallelPartitioning) | |
DeclException1 (ExcTrilinosError, int,<< "An error with error number "<< arg1<< " occurred while calling a Trilinos function") | |
DeclException3 (ExcAccessToNonlocalElement, size_type, size_type, size_type,<< "You tried to access element "<< arg1<< " of a distributed vector, but only entries "<< arg2<< " through "<< arg3<< " are stored locally and can be accessed.") | |
VectorBase () | |
VectorBase (const VectorBase &v) | |
virtual | ~VectorBase () |
void | clear () |
void | reinit (const VectorBase &v, const bool fast=false) |
void | compress (::VectorOperation::values operation) |
void | compress () DEAL_II_DEPRECATED |
void | compress (const Epetra_CombineMode last_action) DEAL_II_DEPRECATED |
bool | is_compressed () const |
VectorBase & | operator= (const TrilinosScalar s) |
VectorBase & | operator= (const VectorBase &v) |
template<typename Number > | |
VectorBase & | operator= (const ::Vector< Number > &v) |
bool | operator== (const VectorBase &v) const |
bool | operator!= (const VectorBase &v) const |
size_type | size () const |
size_type | local_size () const |
std::pair< size_type, size_type > | local_range () const |
bool | in_local_range (const size_type index) const |
IndexSet | locally_owned_elements () const |
bool | has_ghost_elements () const |
TrilinosScalar | operator* (const VectorBase &vec) const |
real_type | norm_sqr () const |
TrilinosScalar | mean_value () const |
TrilinosScalar | minimal_value () const |
real_type | l1_norm () const |
real_type | l2_norm () const |
real_type | lp_norm (const TrilinosScalar p) const |
real_type | linfty_norm () const |
bool | all_zero () const |
bool | is_non_negative () const |
reference | operator() (const size_type index) |
TrilinosScalar | operator() (const size_type index) const |
reference | operator[] (const size_type index) |
TrilinosScalar | operator[] (const size_type index) const |
void | extract_subvector_to (const std::vector< size_type > &indices, std::vector< TrilinosScalar > &values) const |
template<typename ForwardIterator , typename OutputIterator > | |
void | extract_subvector_to (ForwardIterator indices_begin, const ForwardIterator indices_end, OutputIterator values_begin) const |
TrilinosScalar | el (const size_type index) const |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
void | set (const std::vector< size_type > &indices, const std::vector< TrilinosScalar > &values) |
void | set (const std::vector< size_type > &indices, const ::Vector< TrilinosScalar > &values) |
void | set (const size_type n_elements, const size_type *indices, const TrilinosScalar *values) |
void | add (const std::vector< size_type > &indices, const std::vector< TrilinosScalar > &values) |
void | add (const std::vector< size_type > &indices, const ::Vector< TrilinosScalar > &values) |
void | add (const size_type n_elements, const size_type *indices, const TrilinosScalar *values) |
VectorBase & | operator*= (const TrilinosScalar factor) |
VectorBase & | operator/= (const TrilinosScalar factor) |
VectorBase & | operator+= (const VectorBase &V) |
VectorBase & | operator-= (const VectorBase &V) |
void | add (const TrilinosScalar s) |
void | add (const VectorBase &V, const bool allow_different_maps=false) |
void | add (const TrilinosScalar a, const VectorBase &V) |
void | add (const TrilinosScalar a, const VectorBase &V, const TrilinosScalar b, const VectorBase &W) |
void | sadd (const TrilinosScalar s, const VectorBase &V) |
void | sadd (const TrilinosScalar s, const TrilinosScalar a, const VectorBase &V) |
void | sadd (const TrilinosScalar s, const TrilinosScalar a, const VectorBase &V, const TrilinosScalar b, const VectorBase &W) |
void | sadd (const TrilinosScalar s, const TrilinosScalar a, const VectorBase &V, const TrilinosScalar b, const VectorBase &W, const TrilinosScalar c, const VectorBase &X) |
void | scale (const VectorBase &scaling_factors) |
void | equ (const TrilinosScalar a, const VectorBase &V) |
void | equ (const TrilinosScalar a, const VectorBase &V, const TrilinosScalar b, const VectorBase &W) |
void | ratio (const VectorBase &a, const VectorBase &b) |
const Epetra_MultiVector & | trilinos_vector () const |
Epetra_FEVector & | trilinos_vector () |
const Epetra_Map & | vector_partitioner () const |
void | print (const char *format=0) const |
void | print (std::ostream &out, const unsigned int precision=3, const bool scientific=true, const bool across=true) const |
void | swap (VectorBase &v) |
std::size_t | memory_consumption () const |
const MPI_Comm & | get_mpi_communicator () const |
![]() | |
Subscriptor () | |
Subscriptor (const Subscriptor &) | |
virtual | ~Subscriptor () |
Subscriptor & | operator= (const Subscriptor &) |
void | subscribe (const char *identifier=0) const |
void | unsubscribe (const char *identifier=0) const |
unsigned int | n_subscriptions () const |
void | list_subscribers () const |
DeclException3 (ExcInUse, int, char *, std::string &,<< "Object of class "<< arg2<< " is still used by "<< arg1<< " other objects.\n"<< "(Additional information: "<< arg3<< ")\n"<< "Note the entry in the Frequently Asked Questions of "<< "deal.II (linked to from http://www.dealii.org/) for "<< "more information on what this error means.") | |
DeclException2 (ExcNoSubscriber, char *, char *,<< "No subscriber with identifier \""<< arg2<< "\" did subscribe to this object of class "<< arg1) | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Static Public Attributes | |
static const bool | supports_distributed_data = false |
Related Functions | |
(Note that these are not member functions.) | |
void | swap (Vector &u, Vector &v) |
![]() | |
void | swap (VectorBase &u, VectorBase &v) |
This class is a specialization of a Trilinos vector to a localized version. The purpose of this class is to provide a copy interface from the possibly parallel Vector class to a local vector on each processor, in order to be able to access all elements in the vector or to apply certain deal.II functions.
Definition at line 633 of file trilinos_vector.h.
Declare type for container size.
Definition at line 639 of file trilinos_vector.h.
TrilinosWrappers::Vector::Vector | ( | ) |
Default constructor that generates an empty (zero size) vector. The function reinit()
will have to give the vector the correct size.
|
explicit |
This constructor takes as input the number of elements in the vector.
|
explicit |
This constructor takes as input the number of elements in the vector. If the map is not localized, i.e., if there are some elements that are not present on all processes, only the global size of the map will be taken and a localized map will be generated internally.
|
explicit |
This constructor takes as input the number of elements in the vector. If the index set is not localized, i.e., if there are some elements that are not present on all processes, only the global size of the index set will be taken and a localized version will be generated internally.
|
explicit |
This constructor takes a (possibly parallel) Trilinos Vector and generates a localized version of the whole content on each processor.
|
explicit |
Copy-constructor from deal.II vectors. Sets the dimension to that of the given vector, and copies all elements.
Reinit function that resizes the vector to the size specified by n
.
void TrilinosWrappers::Vector::reinit | ( | const Epetra_Map & | input_map, |
const bool | fast = false |
||
) |
Initialization with an Epetra_Map. Similar to the call in the other class MPI::Vector, with the difference that now a copy on all processes is generated. This initialization function is appropriate when the data in the localized vector should be imported from a distributed vector that has been initialized with the same communicator. The variable fast
determines whether the vector should be filled with zero or left untouched.
void TrilinosWrappers::Vector::reinit | ( | const IndexSet & | input_map, |
const MPI_Comm & | communicator = MPI_COMM_WORLD , |
||
const bool | fast = false |
||
) |
Initialization with an IndexSet. Similar to the call in the other class MPI::Vector, with the difference that now a copy on all processes is generated. This initialization function is appropriate in case the data in the localized vector should be imported from a distributed vector that has been initialized with the same communicator. The variable fast
determines whether the vector should be filled with zero (false) or left untouched (true).
void TrilinosWrappers::Vector::reinit | ( | const VectorBase & | V, |
const bool | fast = false , |
||
const bool | allow_different_maps = false |
||
) |
Reinit function. Takes the information of a Vector and copies everything to the calling vector, now also allowing different maps.
Vector& TrilinosWrappers::Vector::operator= | ( | const TrilinosScalar | s | ) |
Set all components of the vector to the given number s
. Simply pass this down to the base class, but we still need to declare this function to make the example given in the discussion about making the constructor explicit work.
Vector& TrilinosWrappers::Vector::operator= | ( | const MPI::Vector & | V | ) |
Sets the left hand argument to the (parallel) Trilinos Vector. Equivalent to the reinit
function.
Vector& TrilinosWrappers::Vector::operator= | ( | const ::Vector< Number > & | V | ) |
Sets the left hand argument to the deal.II vector.
Copy operator. Copies both the dimension and the content in the right hand argument.
void TrilinosWrappers::Vector::update_ghost_values | ( | ) | const |
This function does nothing but is there for compatibility with the PETScWrappers::Vector
class.
For the PETSc vector wrapper class, this function updates the ghost values of the PETSc vector. This is necessary after any modification before reading ghost values.
However, for the implementation of this class, it is immaterial and thus an empty function.
Global function swap
which overloads the default implementation of the C++ standard library which uses a temporary object. The function simply exchanges the data of the two vectors.
Definition at line 845 of file trilinos_vector.h.
|
static |
A variable that indicates whether this vector supports distributed data storage. If true, then this vector also needs an appropriate compress() function that allows communicating recent set or add operations to individual elements to be communicated to other processors.
For the current class, the variable equals false, since it does not support parallel data storage. If you do need parallel data storage, use TrilinosWrappers::MPI::Vector.
Definition at line 654 of file trilinos_vector.h.