#include <deal.II/lac/trilinos_vector_base.h>
Base class for the two types of Trilinos vectors, the distributed memory vector MPI::Vector and a localized vector Vector. The latter is designed for use in either serial implementations or as a localized copy on each processor. The implementation of this class is based on the Trilinos vector class Epetra_FEVector, the (parallel) partitioning of which is governed by an Epetra_Map. This means that the vector type is generic and can be done in this base class, while the definition of the partition map (and hence, the constructor and reinit function) will have to be done in the derived classes. The Epetra_FEVector is precisely the kind of vector we deal with all the time - we probably get it from some assembly process, where also entries not locally owned might need to written and hence need to be forwarded to the owner. The only requirement for this class to work is that Trilinos is installed with the same compiler as is used for compilation of deal.II.. Therefore, you need to call Vector::compress() before you actually use the vectors.
Definition at line 221 of file trilinos_vector_base.h.
Declare some of the standard types used in all containers. These types parallel those in the
C standard libraries
vector<...> class.
Definition at line 229 of file trilinos_vector_base.h.
Default constructor that generates an empty (zero size) vector. The function
reinit() will have to give the vector the correct size and distribution among processes in case of an MPI run.
Definition at line 83 of file trilinos_vector_base.cc.
Copy constructor. Sets the dimension to that of the given vector, and copies all the elements.
Definition at line 99 of file trilinos_vector_base.cc.
Destructor
Definition at line 111 of file trilinos_vector_base.cc.
Release all memory and return to a state just like after having called the default constructor.
Definition at line 117 of file trilinos_vector_base.cc.
Reinit functionality, sets the dimension and possibly the parallel partitioning (Epetra_Map) of the calling vector to the settings of the input vector. 194 of file trilinos_vector_base.cc.
Return the state of the vector, i.e., whether compress() has already been called after an operation requiring data exchange.
This function is deprecated.
Set all components of the vector to the given number
s. Simply pass this down to the Trilinos Epetra object, function. This function takes a VectorBase vector and copies all the elements. The target vector will have the same parallel distribution as the calling vector.
Definition at line 135 of file trilinos_vector_base. In order to change the map, use the reinit(const Epetra_Map &input_map) function.
Test for equality. This function assumes that the present vector and the one to compare with have the same size already, since comparing vectors of different sizes makes not much sense anyway.
Definition at line 324 of file trilinos_vector_base.cc.
Test for inequality. This function assumes that the present vector and the one to compare with have the same size already, since comparing vectors of different sizes makes not much sense anyway.
Definition at line 341 of file trilinos_vector_base if the vector contains ghost elements. This answer is true if there are ghost elements on at least one process. 352 of file trilinos_vector_base.cc.
Return
true if the vector has no negative entries, i.e. all entries are zero or positive. This function is used, for example, to check whether refinement indicators are really all positive (or zero).
Definition at line 387 of file trilinos_vector_base 265 of file trilinos_vector_base.cc.
Provide access to a given element, both read and write.
Exactly the same as operator().
Provide read-only access to an.
Return the value of the vector entry i. Note that this function does only work properly when we request a data stored on the local processor. In case the elements sits on another process, this function returns 0 which might or might not be appropriate in a given situation. If you rely on consistent results, use the access functions () or [] that throw an assertion in case a non-local element is used.
This function is deprecated.
Definition at line 248 of file trilinos_vector_base.cc. 289 of file trilinos_vector_base.cc.
Simple addition of a multiple of a vector, i.e.
*this += a*V.
Multiple addition of scaled vectors, i.e.
*this += a*V + b*W.
Scaling and simple vector addition, i.e.
*this = s*(*this) + V.
Scaling and simple addition, i.e.
*this = s*(*this) + a*V.
Scaling and multiple addition.
This function is deprecated.
Scaling and multiple addition.
*this = s*(*this) + a*V + b*W + c*X.
This function is deprecated.
Scale each element of this vector by the corresponding element in the argument. This function is mostly meant to simulate multiplication (and immediate re-assignment) by a diagonal scaling matrix.
Assignment
*this = a*V.
Assignment
*this = a*V + b*W.
This function is deprecated.
Definition at line 427 of file trilinos_vector_base.cc.
Compute the elementwise ratio of the two given vectors, that is let
this[i] = a[i]/b[i]. This is useful for example if you want to compute the cellwise ratio of true to estimated error.
This vector is appropriately scaled to hold the result.
If any of the
b[i] is zero, the result is undefined. No attempt is made to catch such situations..
Output of vector in user-defined format in analogy to the Vector class.
This function is deprecated.
Definition at line 469 of file trilinos_vector_base.cc. 489 of file trilinos_vector_base.cc.. Note that the vectors need to be of the same size and base on the same map.
This function is analogous to the the
swap function of all C++ standard containers. Also, there is a global function
swap(u,v) that simply calls
u.swap(v), again in analogy to standard functions.
Definition at line 530 of file trilinos_vector_base.cc.
Estimate for the memory consumption in bytes.
Definition at line 540 of file trilinos_vector_base.cc.
Make the reference class a friend.
Definition at line 953 of file trilinos_vector_base.h.
Make all other ReadWriteVector types friends.
Typedef for the vector type used.
Definition at line 954 of file trilinos_vector_base.h.
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 972 of file trilinos_vector_base.h.
Trilinos doesn't allow to mix additions to matrix entries and overwriting them (to make synchronisation 917 of file trilinos_vector_base.h.
A boolean variable to hold information on whether the vector is compressed or not.
Definition at line 923 of file trilinos_vector_base.h.
Whether this vector has ghost elements. This is true on all processors even if only one of them has any ghost elements.
Definition at line 929 of file trilinos_vector_base.h.
Pointer to the actual Epetra vector object. This may represent a vector that is in fact distributed among multiple processors. The object requires an existing Epetra_Map for storing data when setting it up.
Definition at line 936 of file trilinos_vector_base.h.
A vector object in Trilinos to be used for collecting the non-local elements if the vector was constructed with an additional IndexSet describing ghost elements.
Definition at line 943 of file trilinos_vector_base.h.
An IndexSet storing the indices this vector owns exclusively.
Definition at line 948 of file trilinos_vector_base.h.