Reference documentation for deal.II version 8.5.1
|
#include <deal.II/lac/trilinos_epetra_vector.h>
Public Member Functions | |
Vector () | |
Vector (const Vector &V) | |
Vector (const IndexSet ¶llel_partitioner, const MPI_Comm &communicator) | |
void | reinit (const IndexSet ¶llel_partitioner, const MPI_Comm &communicator, const bool omit_zeroing_entries=false) |
Vector & | operator= (const Vector &V) |
virtual void | import (const ReadWriteVector< double > &V, VectorOperation::values operation, std_cxx11::shared_ptr< const CommunicationPatternBase > communication_pattern=std_cxx11::shared_ptr< const CommunicationPatternBase >()) |
virtual Vector & | operator*= (const double factor) |
virtual Vector & | operator/= (const double factor) |
virtual Vector & | operator+= (const VectorSpaceVector< double > &V) |
virtual Vector & | operator-= (const VectorSpaceVector< double > &V) |
virtual double | operator* (const VectorSpaceVector< double > &V) const |
virtual void | add (const double a) |
virtual void | add (const double a, const VectorSpaceVector< double > &V) |
virtual void | add (const double a, const VectorSpaceVector< double > &V, const double b, const VectorSpaceVector< double > &W) |
virtual void | sadd (const double s, const double a, const VectorSpaceVector< double > &V) |
virtual void | scale (const VectorSpaceVector< double > &scaling_factors) |
virtual void | equ (const double a, const VectorSpaceVector< double > &V) |
virtual double | mean_value () const |
virtual double | l1_norm () const |
virtual double | l2_norm () const |
virtual double | linfty_norm () const |
virtual double | add_and_dot (const double a, const VectorSpaceVector< double > &V, const VectorSpaceVector< double > &W) |
virtual size_type | size () const |
MPI_Comm | get_mpi_communicator () const |
virtual ::IndexSet | locally_owned_elements () const |
const Epetra_FEVector & | trilinos_vector () const |
Epetra_FEVector & | trilinos_vector () |
virtual void | print (std::ostream &out, const unsigned int precision=3, const bool scientific=true, const bool across=true) const |
virtual std::size_t | memory_consumption () const |
Public Member Functions inherited from LinearAlgebra::VectorSpaceVector< double > | |
virtual void | compress (VectorOperation::values) |
virtual | ~VectorSpaceVector () |
Static Public Member Functions | |
static ::ExceptionBase & | ExcDifferentParallelPartitioning () |
static ::ExceptionBase & | ExcVectorTypeNotCompatible () |
static ::ExceptionBase & | ExcTrilinosError (int arg1) |
Private Member Functions | |
void | create_epetra_comm_pattern (const IndexSet &source_index_set, const MPI_Comm &mpi_comm) |
Private Attributes | |
std_cxx11::shared_ptr< Epetra_FEVector > | vector |
::IndexSet | source_stored_elements |
std_cxx11::shared_ptr< const CommunicationPattern > | epetra_comm_pattern |
This class implements a wrapper to the Trilinos distributed vector class Epetra_FEVector. This class is derived from the LinearAlgebra::VectorSpaceVector class. Note however that Epetra only works with Number = double.
Definition at line 54 of file trilinos_epetra_vector.h.
Constructor. Create a vector of dimension zero.
Definition at line 37 of file trilinos_epetra_vector.cc.
Copy constructor. Sets the dimension and the partitioning to that of the given vector and copies all elements.
Definition at line 44 of file trilinos_epetra_vector.cc.
|
explicit |
This constructor takes an IndexSet that defines how to distribute the individual components among the MPI processors. Since it also includes information about the size of the vector, this is all we need to genereate a parallel vector.
Definition at line 51 of file trilinos_epetra_vector.cc.
void Vector< Number >::reinit | ( | const IndexSet & | parallel_partitioner, |
const MPI_Comm & | communicator, | ||
const bool | omit_zeroing_entries = false |
||
) |
Reinit functionality. This function destroys the old vector content and generates a new one based on the input partitioning. The flag omit_zeroing_entries
determines whether the vector should be filled with zero (false) or left untouched (true).
Definition at line 59 of file trilinos_epetra_vector.cc.
Copy function. This function takes a Vector and copies all the elements. The Vector will have the same parallel distribution as V
.
Definition at line 76 of file trilinos_epetra_vector.cc.
|
virtual |
Imports all the elements present in the vector's IndexSet from the input vector V
. VectorOperation::values operation
is used to decide if the elements in V
should be added to the current vector or replace the current elements. The last parameter can be used if the same communication pattern is used multiple times. This can be used to improve performance.
Implements LinearAlgebra::VectorSpaceVector< double >.
Definition at line 103 of file trilinos_epetra_vector.cc.
Multiply the entire vector by a fixed factor.
Implements LinearAlgebra::VectorSpaceVector< double >.
Definition at line 146 of file trilinos_epetra_vector.cc.
Divide the entire vector by a fixed factor.
Implements LinearAlgebra::VectorSpaceVector< double >.
Definition at line 156 of file trilinos_epetra_vector.cc.
|
virtual |
Add the vector V
to the present one.
Implements LinearAlgebra::VectorSpaceVector< double >.
Definition at line 167 of file trilinos_epetra_vector.cc.
|
virtual |
Substract the vector V
from the present one.
Implements LinearAlgebra::VectorSpaceVector< double >.
Definition at line 213 of file trilinos_epetra_vector.cc.
|
virtual |
Return the scalar product of two vectors. The vectors need to have the same layout.
Implements LinearAlgebra::VectorSpaceVector< double >.
Definition at line 222 of file trilinos_epetra_vector.cc.
|
virtual |
Add a
to all components. Note that is
a scalar not a vector.
Implements LinearAlgebra::VectorSpaceVector< double >.
Definition at line 245 of file trilinos_epetra_vector.cc.
|
virtual |
Simple addition of a multiple of a vector, i.e. *this += a*V
. The vectors need to have the same layout.
Implements LinearAlgebra::VectorSpaceVector< double >.
Definition at line 255 of file trilinos_epetra_vector.cc.
|
virtual |
Multiple addition of multiple of a vector, i.e. *this> += a*V+b*W
. The vectors need to have the same layout.
Implements LinearAlgebra::VectorSpaceVector< double >.
Definition at line 274 of file trilinos_epetra_vector.cc.
|
virtual |
Scaling and simple addition of a multiple of a vector, i.e. *this = s*(*this)+a*V
.
Implements LinearAlgebra::VectorSpaceVector< double >.
Definition at line 303 of file trilinos_epetra_vector.cc.
|
virtual |
Scale each element of this vector by the corresponding element in the argument. This function is mostly meant to simulate multiplication (and immediate re-assignement) by a diagonal scaling matrix. The vectors need to have the same layout.
Implements LinearAlgebra::VectorSpaceVector< double >.
Definition at line 320 of file trilinos_epetra_vector.cc.
|
virtual |
Assignement *this = a*V
.
Implements LinearAlgebra::VectorSpaceVector< double >.
Definition at line 340 of file trilinos_epetra_vector.cc.
|
virtual |
Return the mean value of the element of this vector.
Implements LinearAlgebra::VectorSpaceVector< double >.
Definition at line 362 of file trilinos_epetra_vector.cc.
|
virtual |
Return the l1 norm of the vector (i.e., the sum of the absolute values of all entries among all processors).
Implements LinearAlgebra::VectorSpaceVector< double >.
Definition at line 375 of file trilinos_epetra_vector.cc.
|
virtual |
Return the l2 norm of the vector (i.e., the square root of the sum of the square of all entries among all processors).
Implements LinearAlgebra::VectorSpaceVector< double >.
Definition at line 387 of file trilinos_epetra_vector.cc.
|
virtual |
Return the maximum norm of the vector (i.e., the maximum absolute value among all entries and among all processors).
Implements LinearAlgebra::VectorSpaceVector< double >.
Definition at line 399 of file trilinos_epetra_vector.cc.
|
virtual |
Performs a combined operation of a vector addition and a subsequent inner product, returning the value of the inner product. In other words, the result of this function is the same as if the user called
The reason this function exists is that this operation involves less memory transfer than calling the two functions separately. This method only needs to load three vectors, this
, V
, W
, whereas calling separate methods means to load the calling vector this
twice. Since most vector operations are memory transfer limited, this reduces the time by 25% (or 50% if W
equals this
).
The vectors need to have the same layout.
Implements LinearAlgebra::VectorSpaceVector< double >.
Definition at line 411 of file trilinos_epetra_vector.cc.
|
virtual |
Return the global size of the vector, equal to the sum of the number of locally owned indices among all processors.
Implements LinearAlgebra::VectorSpaceVector< double >.
Definition at line 422 of file trilinos_epetra_vector.cc.
MPI_Comm Vector< Number >::get_mpi_communicator | ( | ) | const |
Return the MPI communicator object in use with this object.
Definition at line 433 of file trilinos_epetra_vector.cc.
Return an index set that describes which elements of this vector are owned by the current processor. As a consequence, the index sets returned on different procesors if this is a distributed vector will form disjoint sets that add up to the complete index set. Obviously, if a vector is created on only one processor, then the result would satisfy
Implements LinearAlgebra::VectorSpaceVector< double >.
Definition at line 443 of file trilinos_epetra_vector.cc.
const Epetra_FEVector & Vector< Number >::trilinos_vector | ( | ) | const |
Return a const reference to the underlying Trilinos Epetra_FEVector class.
Definition at line 473 of file trilinos_epetra_vector.cc.
Epetra_FEVector & Vector< Number >::trilinos_vector | ( | ) |
Return a (modifyable) reference to the underlying Trilinos Epetra_FEVector class.
Definition at line 480 of file trilinos_epetra_vector.cc.
|
virtual |
Prints the vector to the output stream out
.
Implements LinearAlgebra::VectorSpaceVector< double >.
Definition at line 487 of file trilinos_epetra_vector.cc.
|
virtual |
Return the memory consumption of this class in bytes.
Implements LinearAlgebra::VectorSpaceVector< double >.
Definition at line 524 of file trilinos_epetra_vector.cc.
|
private |
Create the CommunicationPattern for the communication between the IndexSet source_index_set
and the current vector based on the communicator mpi_comm
.
Definition at line 533 of file trilinos_epetra_vector.cc.
|
private |
Pointer to the actual Epetra vector object.
Definition at line 299 of file trilinos_epetra_vector.h.
|
private |
IndexSet of the elements of the last imported vector.
Definition at line 304 of file trilinos_epetra_vector.h.
|
private |
CommunicationPattern for the communication between the source_stored_elements IndexSet and the current vector.
Definition at line 310 of file trilinos_epetra_vector.h.