
Public Types | |
| typedef MatrixIterators::const_iterator | const_iterator |
| typedef TrilinosScalar | value_type |
Public Member Functions | |
Constructors and initalization. | |
| SparseMatrix () | |
| SparseMatrix (const unsigned int m, const unsigned int n, const unsigned int n_max_entries_per_row) | |
| SparseMatrix (const unsigned int m, const unsigned int n, const std::vector< unsigned int > &n_entries_per_row) | |
| SparseMatrix (const SparsityPattern &InputSparsityPattern) | |
| SparseMatrix (const SparseMatrix &InputMatrix) | |
| virtual | ~SparseMatrix () |
| template<typename SparsityType> | |
| void | reinit (const SparsityType &sparsity_pattern) |
| void | reinit (const SparsityPattern &sparsity_pattern) |
| void | reinit (const SparseMatrix &sparse_matrix) |
| template<typename number> | |
| void | reinit (const ::SparseMatrix< number > &dealii_sparse_matrix, const double drop_tolerance=1e-13, const bool copy_values=true, const ::SparsityPattern *use_this_sparsity=0) |
| void | reinit (const Epetra_CrsMatrix &input_matrix, const bool copy_values=true) |
Constructors and initialization using an Epetra_Map description | |
| SparseMatrix (const Epetra_Map ¶llel_partitioning, const unsigned int n_max_entries_per_row=0) | |
| SparseMatrix (const Epetra_Map ¶llel_partitioning, const std::vector< unsigned int > &n_entries_per_row) | |
| SparseMatrix (const Epetra_Map &row_parallel_partitioning, const Epetra_Map &col_parallel_partitioning, const unsigned int n_max_entries_per_row=0) | |
| SparseMatrix (const Epetra_Map &row_parallel_partitioning, const Epetra_Map &col_parallel_partitioning, const std::vector< unsigned int > &n_entries_per_row) | |
| template<typename SparsityType> | |
| void | reinit (const Epetra_Map ¶llel_partitioning, const SparsityType &sparsity_pattern, const bool exchange_data=false) |
| template<typename SparsityType> | |
| void | reinit (const Epetra_Map &row_parallel_partitioning, const Epetra_Map &col_parallel_partitioning, const SparsityType &sparsity_pattern, const bool exchange_data=false) |
| template<typename number> | |
| void | reinit (const Epetra_Map ¶llel_partitioning, const ::SparseMatrix< number > &dealii_sparse_matrix, const double drop_tolerance=1e-13, const bool copy_values=true, const ::SparsityPattern *use_this_sparsity=0) |
| template<typename number> | |
| void | reinit (const Epetra_Map &row_parallel_partitioning, const Epetra_Map &col_parallel_partitioning, const ::SparseMatrix< number > &dealii_sparse_matrix, const double drop_tolerance=1e-13, const bool copy_values=true, const ::SparsityPattern *use_this_sparsity=0) |
Constructors and initialization using an IndexSet description | |
| SparseMatrix (const IndexSet ¶llel_partitioning, const MPI_Comm &communicator=MPI_COMM_WORLD, const unsigned int n_max_entries_per_row=0) | |
| SparseMatrix (const IndexSet ¶llel_partitioning, const MPI_Comm &communicator, const std::vector< unsigned int > &n_entries_per_row) | |
| SparseMatrix (const IndexSet &row_parallel_partitioning, const IndexSet &col_parallel_partitioning, const MPI_Comm &communicator=MPI_COMM_WORLD, const unsigned int n_max_entries_per_row=0) | |
| SparseMatrix (const IndexSet &row_parallel_partitioning, const IndexSet &col_parallel_partitioning, const MPI_Comm &communicator, const std::vector< unsigned int > &n_entries_per_row) | |
| template<typename SparsityType> | |
| void | reinit (const IndexSet ¶llel_partitioning, const SparsityType &sparsity_pattern, const MPI_Comm &communicator=MPI_COMM_WORLD, const bool exchange_data=false) |
| template<typename SparsityType> | |
| void | reinit (const IndexSet &row_parallel_partitioning, const IndexSet &col_parallel_partitioning, const SparsityType &sparsity_pattern, const MPI_Comm &communicator=MPI_COMM_WORLD, const bool exchange_data=false) |
| template<typename number> | |
| void | reinit (const IndexSet ¶llel_partitioning, const ::SparseMatrix< number > &dealii_sparse_matrix, const MPI_Comm &communicator=MPI_COMM_WORLD, const double drop_tolerance=1e-13, const bool copy_values=true, const ::SparsityPattern *use_this_sparsity=0) |
| template<typename number> | |
| void | reinit (const IndexSet &row_parallel_partitioning, const IndexSet &col_parallel_partitioning, const ::SparseMatrix< number > &dealii_sparse_matrix, const MPI_Comm &communicator=MPI_COMM_WORLD, const double drop_tolerance=1e-13, const bool copy_values=true, const ::SparsityPattern *use_this_sparsity=0) |
Information on the matrix | |
| unsigned int | m () const |
| unsigned int | n () const |
| unsigned int | local_size () const |
| std::pair< unsigned int, unsigned int > | local_range () const |
| bool | in_local_range (const unsigned int index) const |
| unsigned int | n_nonzero_elements () const |
| unsigned int | row_length (const unsigned int row) const |
| bool | is_compressed () const |
| unsigned int | memory_consumption () const |
Modifying entries | |
| SparseMatrix & | operator= (const double d) |
| void | clear () |
| void | compress () |
| void | set (const unsigned int i, const unsigned int j, const TrilinosScalar value) |
| void | set (const std::vector< unsigned int > &indices, const FullMatrix< TrilinosScalar > &full_matrix, const bool elide_zero_values=false) |
| void | set (const std::vector< unsigned int > &row_indices, const std::vector< unsigned int > &col_indices, const FullMatrix< TrilinosScalar > &full_matrix, const bool elide_zero_values=false) |
| void | set (const unsigned int row, const std::vector< unsigned int > &col_indices, const std::vector< TrilinosScalar > &values, const bool elide_zero_values=false) |
| void | set (const unsigned int row, const unsigned int n_cols, const unsigned int *col_indices, const TrilinosScalar *values, const bool elide_zero_values=false) |
| void | add (const unsigned int i, const unsigned int j, const TrilinosScalar value) |
| void | add (const std::vector< unsigned int > &indices, const FullMatrix< TrilinosScalar > &full_matrix, const bool elide_zero_values=true) |
| void | add (const std::vector< unsigned int > &row_indices, const std::vector< unsigned int > &col_indices, const FullMatrix< TrilinosScalar > &full_matrix, const bool elide_zero_values=true) |
| void | add (const unsigned int row, const std::vector< unsigned int > &col_indices, const std::vector< TrilinosScalar > &values, const bool elide_zero_values=true) |
| void | add (const unsigned int row, const unsigned int n_cols, const unsigned int *col_indices, const TrilinosScalar *values, const bool elide_zero_values=true, const bool col_indices_are_sorted=false) |
| SparseMatrix & | operator*= (const TrilinosScalar factor) |
| SparseMatrix & | operator/= (const TrilinosScalar factor) |
| void | copy_from (const SparseMatrix &source) |
| void | add (const TrilinosScalar factor, const SparseMatrix &matrix) |
| void | clear_row (const unsigned int row, const TrilinosScalar new_diag_value=0) |
| void | clear_rows (const std::vector< unsigned int > &rows, const TrilinosScalar new_diag_value=0) |
| void | transpose () |
Entry Access | |
| TrilinosScalar | operator() (const unsigned int i, const unsigned int j) const |
| TrilinosScalar | el (const unsigned int i, const unsigned int j) const |
| TrilinosScalar | diag_element (const unsigned int i) const |
Multiplications | |
| void | vmult (VectorBase &dst, const VectorBase &src) const |
| void | Tvmult (VectorBase &dst, const VectorBase &src) const |
| void | vmult_add (VectorBase &dst, const VectorBase &src) const |
| void | Tvmult_add (VectorBase &dst, const VectorBase &src) const |
| TrilinosScalar | matrix_norm_square (const VectorBase &v) const |
| TrilinosScalar | matrix_scalar_product (const VectorBase &u, const VectorBase &v) const |
| TrilinosScalar | residual (VectorBase &dst, const VectorBase &x, const VectorBase &b) const |
| void | mmult (SparseMatrix &C, const SparseMatrix &B, const VectorBase &V=VectorBase()) const |
| void | Tmmult (SparseMatrix &C, const SparseMatrix &B, const VectorBase &V=VectorBase()) const |
Matrix norms | |
| TrilinosScalar | l1_norm () const |
| TrilinosScalar | linfty_norm () const |
| TrilinosScalar | frobenius_norm () const |
Access to underlying Trilinos data | |
| const Epetra_CrsMatrix & | trilinos_matrix () const |
| const Epetra_CrsGraph & | trilinos_sparsity_pattern () const |
| const Epetra_Map & | domain_partitioner () const |
| const Epetra_Map & | range_partitioner () const |
| const Epetra_Map & | row_partitioner () const |
| const Epetra_Map & | col_partitioner () const |
Iterators | |
| const_iterator | begin () const |
| const_iterator | end () const |
| const_iterator | begin (const unsigned int r) const |
| const_iterator | end (const unsigned int r) const |
Input/Output | |
| void | write_ascii () |
| void | print (std::ostream &out, const bool write_extended_trilinos_info=false) const |
Static Public Member Functions | |
| ::ExceptionBase & | ExcTrilinosError (int arg1) throw (errortext << "An error with error number " << arg1 << " occured while calling a Trilinos function" ) |
| ::ExceptionBase & | ExcInvalidIndex (int arg1, int arg2) throw (errortext << "The entry with index <" << arg1 << ',' << arg2 << "> does not exist." ) |
| ::ExceptionBase & | ExcSourceEqualsDestination () |
| ::ExceptionBase & | ExcMatrixNotCompressed () |
| ::ExceptionBase & | ExcAccessToNonLocalElement (int arg1, int arg2, int arg3, int arg4) throw (errortext << "You tried to access element (" << arg1 << "/" << arg2 << ")" << " of a distributed matrix, but only rows " << arg3 << " through " << arg4 << " are stored locally and can be accessed." ) |
| ::ExceptionBase & | ExcAccessToNonPresentElement (int arg1, int arg2) throw (errortext << "You tried to access element (" << arg1 << "/" << arg2 << ")" << " of a sparse matrix, but it appears to not" << " exist in the Trilinos sparsity pattern." ) |
Protected Member Functions | |
| void | prepare_add () |
| void | prepare_set () |
Private Attributes | |
| std_cxx1x::shared_ptr< Epetra_Map > | column_space_map |
| std_cxx1x::shared_ptr < Epetra_FECrsMatrix > | matrix |
| Epetra_CombineMode | last_action |
| bool | compressed |
| VectorBase | temp_vector |
| std::vector< unsigned int > | column_indices |
| std::vector< TrilinosScalar > | column_values |
Friends | |
| class | BlockMatrixBase< SparseMatrix > |
Classes | |
| struct | Traits |
The interface of this class is modeled after the existing SparseMatrix class in deal.II. It has almost the same member functions, and is often exchangable. However, since Trilinos only supports a single scalar type (double), it is not templated, and only works with doubles.
Note that Trilinos only guarantees that operations do what you expect if the functions GlobalAssemble has been called after matrix assembly. Therefore, you need to call SparseMatrix::compress() before you actually use the matrix. This also calls FillComplete that compresses the storage format for sparse matrices by discarding unused elements. Trilinos allows to continue with assembling the matrix after calls to these functions, though.
Declare a typedef for the iterator class.
| typedef TrilinosScalar TrilinosWrappers::SparseMatrix::value_type |
Declare a typedef in analogy to all the other container classes.
| TrilinosWrappers::SparseMatrix::SparseMatrix | ( | ) |
Default constructor. Generates an empty (zero-size) matrix.
| TrilinosWrappers::SparseMatrix::SparseMatrix | ( | const SparsityPattern & | InputSparsityPattern | ) |
Generate a matrix from a Trilinos sparsity pattern object.
| TrilinosWrappers::SparseMatrix::SparseMatrix | ( | const SparseMatrix & | InputMatrix | ) |
Copy constructor. Sets the calling matrix to be the same as the input matrix, i.e., using the same sparsity pattern and entries.
| virtual TrilinosWrappers::SparseMatrix::~SparseMatrix | ( | ) | [virtual] |
Destructor. Made virtual so that one can use pointers to this class.
| TrilinosWrappers::SparseMatrix::SparseMatrix | ( | const Epetra_Map & | parallel_partitioning, | |
| const unsigned int | n_max_entries_per_row = 0 | |||
| ) |
Constructor using an Epetra_Map to describe the parallel partitioning. The parameter n_max_entries_per_row sets the number of nonzero entries in each row that will be allocated. Note that this number does not need to be exact, and it is even allowed that the actual matrix structure has more nonzero entries than specified in the constructor. However it is still advantageous to provide good estimates here since this will considerably increase the performance of the matrix setup. However, there is no effect in the performance of matrix-vector products, since Trilinos reorganizes the matrix memory prior to use (in the compress() step).
| TrilinosWrappers::SparseMatrix::SparseMatrix | ( | const Epetra_Map & | parallel_partitioning, | |
| const std::vector< unsigned int > & | n_entries_per_row | |||
| ) |
Same as before, but now set a value of nonzeros for each matrix row. Since we know the number of elements in the matrix exactly in this case, we can already allocate the right amount of memory, which makes the creation process including the insertion of nonzero elements by the respective SparseMatrix::reinit call considerably faster.
| TrilinosWrappers::SparseMatrix::SparseMatrix | ( | const Epetra_Map & | row_parallel_partitioning, | |
| const Epetra_Map & | col_parallel_partitioning, | |||
| const unsigned int | n_max_entries_per_row = 0 | |||
| ) |
This constructor is similar to the one above, but it now takes two different Epetra maps for rows and columns. This interface is meant to be used for generating rectangular matrices, where one map describes the parallel partitioning of the dofs associated with the matrix rows and the other one the partitioning of dofs in the matrix columns. Note that there is no real parallelism along the columns – the processor that owns a certain row always owns all the column elements, no matter how far they might be spread out. The second Epetra_Map is only used to specify the number of columns and for internal arragements when doing matrix-vector products with vectors based on that column map.
The integer input n_max_entries_per_row defines the number of columns entries per row that will be allocated.
| TrilinosWrappers::SparseMatrix::SparseMatrix | ( | const Epetra_Map & | row_parallel_partitioning, | |
| const Epetra_Map & | col_parallel_partitioning, | |||
| const std::vector< unsigned int > & | n_entries_per_row | |||
| ) |
This constructor is similar to the one above, but it now takes two different Epetra maps for rows and columns. This interface is meant to be used for generating rectangular matrices, where one map specifies the parallel distribution of degrees of freedom associated with matrix rows and the second one specifies the parallel distribution the dofs associated with columns in the matrix. The second map also provides information for the internal arrangement in matrix vector products (i.e., the distribution of vector this matrix is to be multiplied with), but is not used for the distribution of the columns – rather, all column elements of a row are stored on the same processor in any case. The vector n_entries_per_row specifies the number of entries in each row of the newly generated matrix.
| TrilinosWrappers::SparseMatrix::SparseMatrix | ( | const IndexSet & | parallel_partitioning, | |
| const MPI_Comm & | communicator = MPI_COMM_WORLD, |
|||
| const unsigned int | n_max_entries_per_row = 0 | |||
| ) |
Constructor using an IndexSet and an MPI communicator to describe the parallel partitioning. The parameter n_max_entries_per_row sets the number of nonzero entries in each row that will be allocated. Note that this number does not need to be exact, and it is even allowed that the actual matrix structure has more nonzero entries than specified in the constructor. However it is still advantageous to provide good estimates here since this will considerably increase the performance of the matrix setup. However, there is no effect in the performance of matrix-vector products, since Trilinos reorganizes the matrix memory prior to use (in the compress() step).
| TrilinosWrappers::SparseMatrix::SparseMatrix | ( | const IndexSet & | parallel_partitioning, | |
| const MPI_Comm & | communicator, | |||
| const std::vector< unsigned int > & | n_entries_per_row | |||
| ) |
Same as before, but now set the number of nonzeros in each matrix row separately. Since we know the number of elements in the matrix exactly in this case, we can already allocate the right amount of memory, which makes the creation process including the insertion of nonzero elements by the respective SparseMatrix::reinit call considerably faster.
| TrilinosWrappers::SparseMatrix::SparseMatrix | ( | const IndexSet & | row_parallel_partitioning, | |
| const IndexSet & | col_parallel_partitioning, | |||
| const MPI_Comm & | communicator = MPI_COMM_WORLD, |
|||
| const unsigned int | n_max_entries_per_row = 0 | |||
| ) |
This constructor is similar to the one above, but it now takes two different IndexSet partitions for row and columns. This interface is meant to be used for generating rectangular matrices, where the first index set describes the parallel partitioning of the degrees of freedom associated with the matrix rows and the second one the partitioning of the matrix columns. The second index set specifies the partitioning of the vectors this matrix is to be multiplied with, not the distribution of the elements that actually appear in the matrix.
The parameter n_max_entries_per_row defines how much memory will be allocated for each row. This number does not need to be accurate, as the structure is reorganized in the compress() call.
| TrilinosWrappers::SparseMatrix::SparseMatrix | ( | const IndexSet & | row_parallel_partitioning, | |
| const IndexSet & | col_parallel_partitioning, | |||
| const MPI_Comm & | communicator, | |||
| const std::vector< unsigned int > & | n_entries_per_row | |||
| ) |
This constructor is similar to the one above, but it now takes two different Epetra maps for rows and columns. This interface is meant to be used for generating rectangular matrices, where one map specifies the parallel distribution of degrees of freedom associated with matrix rows and the second one specifies the parallel distribution the dofs associated with columns in the matrix. The second map also provides information for the internal arrangement in matrix vector products (i.e., the distribution of vector this matrix is to be multiplied with), but is not used for the distribution of the columns – rather, all column elements of a row are stored on the same processor in any case. The vector n_entries_per_row specifies the number of entries in each row of the newly generated matrix.
| void TrilinosWrappers::SparseMatrix::reinit | ( | const SparsityType & | sparsity_pattern | ) | [inline] |
This function initializes the Trilinos matrix with a deal.II sparsity pattern, i.e. it makes the Trilinos Epetra matrix know the position of nonzero entries according to the sparsity pattern. This function is meant for use in serial programs, where there is no need to specify how the matrix is going to be distributed among different processors. This function works in parallel, too, but it is recommended to manually specify the parallel partioning of the matrix using an Epetra_Map. When run in parallel, it is currently necessary that each processor holds the sparsity_pattern structure because each processor sets its rows.
This is a collective operation that needs to be called on all processors in order to avoid a dead lock.
| void TrilinosWrappers::SparseMatrix::reinit | ( | const SparsityPattern & | sparsity_pattern | ) |
This function reinitializes the Trilinos sparse matrix from a (possibly distributed) Trilinos sparsity pattern.
This is a collective operation that needs to be called on all processors in order to avoid a dead lock.
| void TrilinosWrappers::SparseMatrix::reinit | ( | const SparseMatrix & | sparse_matrix | ) |
This function copies the content in sparse_matrix to the calling matrix.
This is a collective operation that needs to be called on all processors in order to avoid a dead lock.
| void TrilinosWrappers::SparseMatrix::reinit | ( | const ::SparseMatrix< number > & | dealii_sparse_matrix, | |
| const double | drop_tolerance = 1e-13, |
|||
| const bool | copy_values = true, |
|||
| const ::SparsityPattern * | use_this_sparsity = 0 | |||
| ) | [inline] |
This function initializes the Trilinos matrix using the deal.II sparse matrix and the entries stored therein. It uses a threshold to copy only elements with modulus larger than the threshold (so zeros in the deal.II matrix can be filtered away).
The optional parameter copy_values decides whether only the sparsity structure of the input matrix should be used or the matrix entries should be copied, too.
This is a collective operation that needs to be called on all processors in order to avoid a dead lock.
| void TrilinosWrappers::SparseMatrix::reinit | ( | const Epetra_CrsMatrix & | input_matrix, | |
| const bool | copy_values = true | |||
| ) |
This reinit function takes as input a Trilinos Epetra_CrsMatrix and copies its sparsity pattern. If so requested, even the content (values) will be copied.
| void TrilinosWrappers::SparseMatrix::reinit | ( | const Epetra_Map & | parallel_partitioning, | |
| const SparsityType & | sparsity_pattern, | |||
| const bool | exchange_data = false | |||
| ) | [inline] |
This function is initializes the Trilinos Epetra matrix according to the specified sparsity_pattern, and also reassigns the matrix rows to different processes according to a user-supplied Epetra map. In programs following the style of the tutorial programs, this function (and the respective call for a rectangular matrix) are the natural way to initialize the matrix size, its distribution among the MPI processes (if run in parallel) as well as the locatoin of non-zero elements. Trilinos stores the sparsity pattern internally, so it won't be needed any more after this call, in contrast to the deal.II own object. The optional argument exchange_data can be used for reinitialization with a sparsity pattern that is not fully constructed. This feature is only implemented for input sparsity patterns of type CompressedSimpleSparsityPattern. If the flag is not set, each processor just sets the elements in the sparsity pattern that belong to its rows.
This is a collective operation that needs to be called on all processors in order to avoid a dead lock.
| void TrilinosWrappers::SparseMatrix::reinit | ( | const Epetra_Map & | row_parallel_partitioning, | |
| const Epetra_Map & | col_parallel_partitioning, | |||
| const SparsityType & | sparsity_pattern, | |||
| const bool | exchange_data = false | |||
| ) | [inline] |
This function is similar to the other initialization function above, but now also reassigns the matrix rows and columns according to two user-supplied Epetra maps. To be used for rectangular matrices. The optional argument exchange_data can be used for reinitialization with a sparsity pattern that is not fully constructed. This feature is only implemented for input sparsity patterns of type CompressedSimpleSparsityPattern.
This is a collective operation that needs to be called on all processors in order to avoid a dead lock.
| void TrilinosWrappers::SparseMatrix::reinit | ( | const Epetra_Map & | parallel_partitioning, | |
| const ::SparseMatrix< number > & | dealii_sparse_matrix, | |||
| const double | drop_tolerance = 1e-13, |
|||
| const bool | copy_values = true, |
|||
| const ::SparsityPattern * | use_this_sparsity = 0 | |||
| ) | [inline] |
This function initializes the Trilinos matrix using the deal.II sparse matrix and the entries stored therein. It uses a threshold to copy only elements with modulus larger than the threshold (so zeros in the deal.II matrix can be filtered away). In contrast to the other reinit function with deal.II sparse matrix argument, this function takes a parallel partitioning specified by the user instead of internally generating it.
The optional parameter copy_values decides whether only the sparsity structure of the input matrix should be used or the matrix entries should be copied, too.
This is a collective operation that needs to be called on all processors in order to avoid a dead lock.
| void TrilinosWrappers::SparseMatrix::reinit | ( | const Epetra_Map & | row_parallel_partitioning, | |
| const Epetra_Map & | col_parallel_partitioning, | |||
| const ::SparseMatrix< number > & | dealii_sparse_matrix, | |||
| const double | drop_tolerance = 1e-13, |
|||
| const bool | copy_values = true, |
|||
| const ::SparsityPattern * | use_this_sparsity = 0 | |||
| ) | [inline] |
This function is similar to the other initialization function with deal.II sparse matrix input above, but now takes Epetra maps for both the rows and the columns of the matrix. Chosen for rectangular matrices.
The optional parameter copy_values decides whether only the sparsity structure of the input matrix should be used or the matrix entries should be copied, too.
This is a collective operation that needs to be called on all processors in order to avoid a dead lock.
| void TrilinosWrappers::SparseMatrix::reinit | ( | const IndexSet & | parallel_partitioning, | |
| const SparsityType & | sparsity_pattern, | |||
| const MPI_Comm & | communicator = MPI_COMM_WORLD, |
|||
| const bool | exchange_data = false | |||
| ) | [inline] |
This function is initializes the Trilinos Epetra matrix according to the specified sparsity_pattern, and also reassigns the matrix rows to different processes according to a user-supplied index set and parallel communicator. In programs following the style of the tutorial programs, this function (and the respective call for a rectangular matrix) are the natural way to initialize the matrix size, its distribution among the MPI processes (if run in parallel) as well as the locatoin of non-zero elements. Trilinos stores the sparsity pattern internally, so it won't be needed any more after this call, in contrast to the deal.II own object. The optional argument exchange_data can be used for reinitialization with a sparsity pattern that is not fully constructed. This feature is only implemented for input sparsity patterns of type CompressedSimpleSparsityPattern. If the flag is not set, each processor just sets the elements in the sparsity pattern that belong to its rows.
This is a collective operation that needs to be called on all processors in order to avoid a dead lock.
| void TrilinosWrappers::SparseMatrix::reinit | ( | const IndexSet & | row_parallel_partitioning, | |
| const IndexSet & | col_parallel_partitioning, | |||
| const SparsityType & | sparsity_pattern, | |||
| const MPI_Comm & | communicator = MPI_COMM_WORLD, |
|||
| const bool | exchange_data = false | |||
| ) | [inline] |
This function is similar to the other initialization function above, but now also reassigns the matrix rows and columns according to two user-supplied index sets. To be used for rectangular matrices. The optional argument exchange_data can be used for reinitialization with a sparsity pattern that is not fully constructed. This feature is only implemented for input sparsity patterns of type CompressedSimpleSparsityPattern.
This is a collective operation that needs to be called on all processors in order to avoid a dead lock.
| void TrilinosWrappers::SparseMatrix::reinit | ( | const IndexSet & | parallel_partitioning, | |
| const ::SparseMatrix< number > & | dealii_sparse_matrix, | |||
| const MPI_Comm & | communicator = MPI_COMM_WORLD, |
|||
| const double | drop_tolerance = 1e-13, |
|||
| const bool | copy_values = true, |
|||
| const ::SparsityPattern * | use_this_sparsity = 0 | |||
| ) | [inline] |
This function initializes the Trilinos matrix using the deal.II sparse matrix and the entries stored therein. It uses a threshold to copy only elements with modulus larger than the threshold (so zeros in the deal.II matrix can be filtered away). In contrast to the other reinit function with deal.II sparse matrix argument, this function takes a parallel partitioning specified by the user instead of internally generating it.
The optional parameter copy_values decides whether only the sparsity structure of the input matrix should be used or the matrix entries should be copied, too.
This is a collective operation that needs to be called on all processors in order to avoid a dead lock.
| void TrilinosWrappers::SparseMatrix::reinit | ( | const IndexSet & | row_parallel_partitioning, | |
| const IndexSet & | col_parallel_partitioning, | |||
| const ::SparseMatrix< number > & | dealii_sparse_matrix, | |||
| const MPI_Comm & | communicator = MPI_COMM_WORLD, |
|||
| const double | drop_tolerance = 1e-13, |
|||
| const bool | copy_values = true, |
|||
| const ::SparsityPattern * | use_this_sparsity = 0 | |||
| ) | [inline] |
This function is similar to the other initialization function with deal.II sparse matrix input above, but now takes index sets for both the rows and the columns of the matrix. Chosen for rectangular matrices.
The optional parameter copy_values decides whether only the sparsity structure of the input matrix should be used or the matrix entries should be copied, too.
This is a collective operation that needs to be called on all processors in order to avoid a dead lock.
Return the number of columns in this matrix.
Return the local dimension of the matrix, i.e. the number of rows stored on the present MPI process. For sequential matrices, this number is the same as m(), but for parallel matrices it may be smaller.
To figure out which elements exactly are stored locally, use local_range().
Return a pair of indices indicating which rows of this matrix are stored locally. The first number is the index of the first row stored, the second the index of the one past the last one that is stored locally. If this is a sequential matrix, then the result will be the pair (0,m()), otherwise it will be a pair (i,i+n), where n=local_size().
Return whether index is in the local range or not, see also local_range().
Return the number of nonzero elements of this matrix.
Number of entries in a specific row.
| bool TrilinosWrappers::SparseMatrix::is_compressed | ( | ) | const |
Returns the state of the matrix, i.e., whether compress() needs to be called after an operation requiring data exchange. A call to compress() is also needed when the method set() has been called (even when working in serial).
Determine an estimate for the memory consumption (in bytes) of this object. Note that only the memory reserved on the current processor is returned in case this is called in an MPI-based program.
| SparseMatrix& TrilinosWrappers::SparseMatrix::operator= | ( | const double | d | ) |
This operator assigns a scalar to a matrix. Since this does usually not make much sense (should we set all matrix entries to this value? Only the nonzero entries of the sparsity pattern?), this operation is only allowed if the actual value to be assigned is zero. This operator only exists to allow for the obvious notation matrix=0, which sets all elements of the matrix to zero, but keeps the sparsity pattern previously used.
| void TrilinosWrappers::SparseMatrix::clear | ( | ) |
Release all memory and return to a state just like after having called the default constructor.
This is a collective operation that needs to be called on all processors in order to avoid a dead lock.
| void TrilinosWrappers::SparseMatrix::compress | ( | ) |
This command does two things:
In both cases, this function compresses the data structures and allows the resulting matrix to be used in all other operations like matrix-vector products. This is a collective operation, i.e., it needs to be run on all processors when used in parallel.
See Compressing distributed objects for more information.
| void TrilinosWrappers::SparseMatrix::set | ( | const unsigned int | i, | |
| const unsigned int | j, | |||
| const TrilinosScalar | value | |||
| ) |
Set the element (i,j) to value.
This function is able to insert new elements into the matrix as long as compress() has not been called, so the sparsity pattern will be extended. When compress() is called for the first time, then this is no longer possible and an insertion of elements at positions which have not been initialized will throw an exception. Note that in case elements need to be inserted, it is mandatory that elements are inserted only once. Otherwise, the elements will actually be added in the end (since it is not possible to efficiently find values to the same entry before compress() has been called). In the case that an element is set more than once, initialize the matrix with a sparsity pattern first.
| void TrilinosWrappers::SparseMatrix::set | ( | const std::vector< unsigned int > & | indices, | |
| const FullMatrix< TrilinosScalar > & | full_matrix, | |||
| const bool | elide_zero_values = false | |||
| ) |
Set all elements given in a FullMatrix<double> into the sparse matrix locations given by indices. In other words, this function writes the elements in full_matrix into the calling matrix, using the local-to-global indexing specified by indices for both the rows and the columns of the matrix. This function assumes a quadratic sparse matrix and a quadratic full_matrix, the usual situation in FE calculations.
This function is able to insert new elements into the matrix as long as compress() has not been called, so the sparsity pattern will be extended. When compress() is called for the first time, then this is no longer possible and an insertion of elements at positions which have not been initialized will throw an exception.
The optional parameter elide_zero_values can be used to specify whether zero values should be inserted anyway or they should be filtered away. The default value is false, i.e., even zero values are inserted/replaced.
| void TrilinosWrappers::SparseMatrix::set | ( | const std::vector< unsigned int > & | row_indices, | |
| const std::vector< unsigned int > & | col_indices, | |||
| const FullMatrix< TrilinosScalar > & | full_matrix, | |||
| const bool | elide_zero_values = false | |||
| ) |
Same function as before, but now including the possibility to use rectangular full_matrices and different local-to-global indexing on rows and columns, respectively.
| void TrilinosWrappers::SparseMatrix::set | ( | const unsigned int | row, | |
| const std::vector< unsigned int > & | col_indices, | |||
| const std::vector< TrilinosScalar > & | values, | |||
| const bool | elide_zero_values = false | |||
| ) |
Set several elements in the specified row of the matrix with column indices as given by col_indices to the respective value.
This function is able to insert new elements into the matrix as long as compress() has not been called, so the sparsity pattern will be extended. When compress() is called for the first time, then this is no longer possible and an insertion of elements at positions which have not been initialized will throw an exception.
The optional parameter elide_zero_values can be used to specify whether zero values should be inserted anyway or they should be filtered away. The default value is false, i.e., even zero values are inserted/replaced.
| void TrilinosWrappers::SparseMatrix::set | ( | const unsigned int | row, | |
| const unsigned int | n_cols, | |||
| const unsigned int * | col_indices, | |||
| const TrilinosScalar * | values, | |||
| const bool | elide_zero_values = false | |||
| ) |
Set several elements to values given by values in a given row in columns given by col_indices into the sparse matrix.
This function is able to insert new elements into the matrix as long as compress() has not been called, so the sparsity pattern will be extended. When compress() is called for the first time, then this is no longer possible and an insertion of elements at positions which have not been initialized will throw an exception.
The optional parameter elide_zero_values can be used to specify whether zero values should be inserted anyway or they should be filtered away. The default value is false, i.e., even zero values are inserted/replaced.
| void TrilinosWrappers::SparseMatrix::add | ( | const unsigned int | i, | |
| const unsigned int | j, | |||
| const TrilinosScalar | value | |||
| ) |
Add value to the element (i,j).
Just as the respective call in deal.II SparseMatrix<Number> class (but in contrast to the situation for PETSc based matrices), this function throws an exception if an entry does not exist in the sparsity pattern. Moreover, if value is not a finite number an exception is thrown.
| void TrilinosWrappers::SparseMatrix::add | ( | const std::vector< unsigned int > & | indices, | |
| const FullMatrix< TrilinosScalar > & | full_matrix, | |||
| const bool | elide_zero_values = true | |||
| ) |
Add all elements given in a FullMatrix<double> into sparse matrix locations given by indices. In other words, this function adds the elements in full_matrix to the respective entries in calling matrix, using the local-to-global indexing specified by indices for both the rows and the columns of the matrix. This function assumes a quadratic sparse matrix and a quadratic full_matrix, the usual situation in FE calculations.
Just as the respective call in deal.II SparseMatrix<Number> class (but in contrast to the situation for PETSc based matrices), this function throws an exception if an entry does not exist in the sparsity pattern.
The optional parameter elide_zero_values can be used to specify whether zero values should be added anyway or these should be filtered away and only non-zero data is added. The default value is true, i.e., zero values won't be added into the matrix.
| void TrilinosWrappers::SparseMatrix::add | ( | const std::vector< unsigned int > & | row_indices, | |
| const std::vector< unsigned int > & | col_indices, | |||
| const FullMatrix< TrilinosScalar > & | full_matrix, | |||
| const bool | elide_zero_values = true | |||
| ) |
Same function as before, but now including the possibility to use rectangular full_matrices and different local-to-global indexing on rows and columns, respectively.
| void TrilinosWrappers::SparseMatrix::add | ( | const unsigned int | row, | |
| const std::vector< unsigned int > & | col_indices, | |||
| const std::vector< TrilinosScalar > & | values, | |||
| const bool | elide_zero_values = true | |||
| ) |
Set several elements in the specified row of the matrix with column indices as given by col_indices to the respective value.
Just as the respective call in deal.II SparseMatrix<Number> class (but in contrast to the situation for PETSc based matrices), this function throws an exception if an entry does not exist in the sparsity pattern.
The optional parameter elide_zero_values can be used to specify whether zero values should be added anyway or these should be filtered away and only non-zero data is added. The default value is true, i.e., zero values won't be added into the matrix.
| void TrilinosWrappers::SparseMatrix::add | ( | const unsigned int | row, | |
| const unsigned int | n_cols, | |||
| const unsigned int * | col_indices, | |||
| const TrilinosScalar * | values, | |||
| const bool | elide_zero_values = true, |
|||
| const bool | col_indices_are_sorted = false | |||
| ) |
Add an array of values given by values in the given global matrix row at columns specified by col_indices in the sparse matrix.
Just as the respective call in deal.II SparseMatrix<Number> class (but in contrast to the situation for PETSc based matrices), this function throws an exception if an entry does not exist in the sparsity pattern.
The optional parameter elide_zero_values can be used to specify whether zero values should be added anyway or these should be filtered away and only non-zero data is added. The default value is true, i.e., zero values won't be added into the matrix.
| SparseMatrix& TrilinosWrappers::SparseMatrix::operator*= | ( | const TrilinosScalar | factor | ) |
Multiply the entire matrix by a fixed factor.
| SparseMatrix& TrilinosWrappers::SparseMatrix::operator/= | ( | const TrilinosScalar | factor | ) |
Divide the entire matrix by a fixed factor.
| void TrilinosWrappers::SparseMatrix::copy_from | ( | const SparseMatrix & | source | ) |
Copy the given (Trilinos) matrix (sparsity pattern and entries).
| void TrilinosWrappers::SparseMatrix::add | ( | const TrilinosScalar | factor, | |
| const SparseMatrix & | matrix | |||
| ) |
Add matrix scaled by factor to this matrix, i.e. the matrix factor*matrix is added to this. If the sparsity pattern of the calling matrix does not contain all the elements in the sparsity pattern of the input matrix, this function will throw an exception.
| void TrilinosWrappers::SparseMatrix::clear_row | ( | const unsigned int | row, | |
| const TrilinosScalar | new_diag_value = 0 | |||
| ) |
Remove all elements from this row by setting them to zero. The function does not modify the number of allocated nonzero entries, it only sets some entries to zero. It may drop them from the sparsity pattern, though (but retains the allocated memory in case new entries are again added later). Note that this is a global operation, so this needs to be done on all MPI processes.
This operation is used in eliminating constraints (e.g. due to hanging nodes) and makes sure that we can write this modification to the matrix without having to read entries (such as the locations of non-zero elements) from it — without this operation, removing constraints on parallel matrices is a rather complicated procedure.
The second parameter can be used to set the diagonal entry of this row to a value different from zero. The default is to set it to zero.
| void TrilinosWrappers::SparseMatrix::clear_rows | ( | const std::vector< unsigned int > & | rows, | |
| const TrilinosScalar | new_diag_value = 0 | |||
| ) |
Same as clear_row(), except that it works on a number of rows at once.
The second parameter can be used to set the diagonal entries of all cleared rows to something different from zero. Note that all of these diagonal entries get the same value -- if you want different values for the diagonal entries, you have to set them by hand.
| void TrilinosWrappers::SparseMatrix::transpose | ( | ) |
Make an in-place transpose of a matrix.
| TrilinosScalar TrilinosWrappers::SparseMatrix::operator() | ( | const unsigned int | i, | |
| const unsigned int | j | |||
| ) | const |
Return the value of the entry (i,j). This may be an expensive operation and you should always take care where to call this function. As in the deal.II sparse matrix class, we throw an exception if the respective entry doesn't exist in the sparsity pattern of this class, which is requested from Trilinos. Moreover, an exception will be thrown when the requested element is not saved on the calling process.
| TrilinosScalar TrilinosWrappers::SparseMatrix::el | ( | const unsigned int | i, | |
| const unsigned int | j | |||
| ) | const |
Return the value of the matrix entry (i,j). If this entry does not exist in the sparsity pattern, then zero is returned. While this may be convenient in some cases, note that it is simple to write algorithms that are slow compared to an optimal solution, since the sparsity of the matrix is not used.
Return the main diagonal element in the ith row. This function throws an error if the matrix is not quadratic.
| void TrilinosWrappers::SparseMatrix::vmult | ( | VectorBase & | dst, | |
| const VectorBase & | src | |||
| ) | const |
Matrix-vector multiplication: let dst = M*src with M being this matrix.
Source and destination must not be the same vector.
Note that both vectors have to be distributed vectors generated using the same Map as was used for the matrix in case you work on a distributed memory architecture, using the interface in the TrilinosWrappers::VectorBase class (or one of the two derived classes Vector and MPI::Vector).
In case of a localized Vector, this function will only work when running on one processor, since the matrix object is inherently distributed. Otherwise, and exception will be thrown.
| void TrilinosWrappers::SparseMatrix::Tvmult | ( | VectorBase & | dst, | |
| const VectorBase & | src | |||
| ) | const |
Matrix-vector multiplication: let dst = MT*src with M being this matrix. This function does the same as vmult() but takes the transposed matrix.
Source and destination must not be the same vector.
Note that both vectors have to be distributed vectors generated using the same Map as was used for the matrix in case you work on a distributed memory architecture, using the interface in the TrilinosWrappers::VectorBase class (or one of the two derived classes Vector and MPI::Vector).
In case of a localized Vector, this function will only work when running on one processor, since the matrix object is inherently distributed. Otherwise, and exception will be thrown.
| void TrilinosWrappers::SparseMatrix::vmult_add | ( | VectorBase & | dst, | |
| const VectorBase & | src | |||
| ) | const |
Adding Matrix-vector multiplication. Add M*src on dst with M being this matrix.
Source and destination must not be the same vector.
Note that both vectors have to be distributed vectors generated using the same Map as was used for the matrix in case you work on a distributed memory architecture, using the interface in the TrilinosWrappers::VectorBase class (or one of the two derived classes Vector and MPI::Vector).
In case of a localized Vector, this function will only work when running on one processor, since the matrix object is inherently distributed. Otherwise, and exception will be thrown.
| void TrilinosWrappers::SparseMatrix::Tvmult_add | ( | VectorBase & | dst, | |
| const VectorBase & | src | |||
| ) | const |
Adding Matrix-vector multiplication. Add MT*src to dst with M being this matrix. This function does the same as vmult_add() but takes the transposed matrix.
Source and destination must not be the same vector.
Note that both vectors have to be distributed vectors generated using the same Map as was used for the matrix in case you work on a distributed memory architecture, using the interface in the TrilinosWrappers::VectorBase class (or one of the two derived classes Vector and MPI::Vector).
In case of a localized Vector, this function will only work when running on one processor, since the matrix object is inherently distributed. Otherwise, and exception will be thrown.
| TrilinosScalar TrilinosWrappers::SparseMatrix::matrix_norm_square | ( | const VectorBase & | v | ) | const |
Return the square of the norm of the vector
with respect to the norm induced by this matrix, i.e.,
. This is useful, e.g. in the finite element context, where the
norm of a function equals the matrix norm with respect to the mass matrix of the vector representing the nodal values of the finite element function.
Obviously, the matrix needs to be quadratic for this operation.
The implementation of this function is not as efficient as the one in the SparseMatrix class used in deal.II (i.e. the original one, not the Trilinos wrapper class) since Trilinos doesn't support this operation and needs a temporary vector.
Note that both vectors have to be distributed vectors generated using the same Map as was used for the matrix in case you work on a distributed memory architecture, using the interface in the TrilinosWrappers::VectorBase class (or one of the two derived classes Vector and MPI::Vector).
In case of a localized Vector, this function will only work when running on one processor, since the matrix object is inherently distributed. Otherwise, and exception will be thrown.
| TrilinosScalar TrilinosWrappers::SparseMatrix::matrix_scalar_product | ( | const VectorBase & | u, | |
| const VectorBase & | v | |||
| ) | const |
Compute the matrix scalar product
.
The implementation of this function is not as efficient as the one in the SparseMatrix class used in deal.II (i.e. the original one, not the Trilinos wrapper class) since Trilinos doesn't support this operation and needs a temporary vector.
Note that both vectors have to be distributed vectors generated using the same Map as was used for the matrix in case you work on a distributed memory architecture, using the interface in the TrilinosWrappers::VectorBase class (or one of the two derived classes Vector and MPI::Vector).
In case of a localized Vector, this function will only work when running on one processor, since the matrix object is inherently distributed. Otherwise, and exception will be thrown.
| TrilinosScalar TrilinosWrappers::SparseMatrix::residual | ( | VectorBase & | dst, | |
| const VectorBase & | x, | |||
| const VectorBase & | b | |||
| ) | const |
Compute the residual of an equation Mx=b, where the residual is defined to be r=b-Mx. Write the residual into dst. The l2 norm of the residual vector is returned.
Source x and destination dst must not be the same vector.
Note that both vectors have to be distributed vectors generated using the same Map as was used for the matrix in case you work on a distributed memory architecture, using the interface in the TrilinosWrappers::VectorBase class (or one of the two derived classes Vector and MPI::Vector).
In case of a localized Vector, this function will only work when running on one processor, since the matrix object is inherently distributed. Otherwise, and exception will be thrown.
| void TrilinosWrappers::SparseMatrix::mmult | ( | SparseMatrix & | C, | |
| const SparseMatrix & | B, | |||
| const VectorBase & | V = VectorBase() | |||
| ) | const |
Perform the matrix-matrix multiplication C = A * B, or, if an optional vector argument is given, C = A * diag(V) * B, where diag(V) defines a diagonal matrix with the vector entries.
This function assumes that the calling matrix A and B have compatible sizes. The size of C will be set within this function.
The content as well as the sparsity pattern of the matrix C will be changed by this function, so make sure that the sparsity pattern is not used somewhere else in your program. This is an expensive operation, so think twice before you use this function.
| void TrilinosWrappers::SparseMatrix::Tmmult | ( | SparseMatrix & | C, | |
| const SparseMatrix & | B, | |||
| const VectorBase & | V = VectorBase() | |||
| ) | const |
Perform the matrix-matrix multiplication with the transpose of this, i.e., C = AT * B, or, if an optional vector argument is given, C = AT * diag(V) * B, where diag(V) defines a diagonal matrix with the vector entries.
This function assumes that the calling matrix A and B have compatible sizes. The size of C will be set within this function.
The content as well as the sparsity pattern of the matrix C will be changed by this function, so make sure that the sparsity pattern is not used somewhere else in your program. This is an expensive operation, so think twice before you use this function.
| TrilinosScalar TrilinosWrappers::SparseMatrix::l1_norm | ( | ) | const |
Return the l1-norm of the matrix, that is
, (max. sum of columns). This is the natural matrix norm that is compatible to the l1-norm for vectors, i.e.
. (cf. Haemmerlin-Hoffmann: Numerische Mathematik)
| TrilinosScalar TrilinosWrappers::SparseMatrix::linfty_norm | ( | ) | const |
Return the linfty-norm of the matrix, that is
, (max. sum of rows). This is the natural matrix norm that is compatible to the linfty-norm of vectors, i.e.
. (cf. Haemmerlin-Hoffmann: Numerische Mathematik)
| TrilinosScalar TrilinosWrappers::SparseMatrix::frobenius_norm | ( | ) | const |
Return the frobenius norm of the matrix, i.e. the square root of the sum of squares of all entries in the matrix.
| const Epetra_CrsMatrix& TrilinosWrappers::SparseMatrix::trilinos_matrix | ( | ) | const |
Return a const reference to the underlying Trilinos Epetra_CrsMatrix data.
| const Epetra_CrsGraph& TrilinosWrappers::SparseMatrix::trilinos_sparsity_pattern | ( | ) | const |
Return a const reference to the underlying Trilinos Epetra_CrsGraph data that stores the sparsity pattern of the matrix.
| const Epetra_Map& TrilinosWrappers::SparseMatrix::domain_partitioner | ( | ) | const |
Return a const reference to the underlying Trilinos Epetra_Map that sets the partitioning of the domain space of this matrix, i.e., the partitioning of the vectors this matrix has to be multiplied with.
| const Epetra_Map& TrilinosWrappers::SparseMatrix::range_partitioner | ( | ) | const |
Return a const reference to the underlying Trilinos Epetra_Map that sets the partitioning of the range space of this matrix, i.e., the partitioning of the vectors that are result from matrix-vector products.
| const Epetra_Map& TrilinosWrappers::SparseMatrix::row_partitioner | ( | ) | const |
Return a const reference to the underlying Trilinos Epetra_Map that sets the partitioning of the matrix rows. Equal to the partitioning of the range.
| const Epetra_Map& TrilinosWrappers::SparseMatrix::col_partitioner | ( | ) | const |
Return a const reference to the underlying Trilinos Epetra_Map that sets the partitioning of the matrix columns. This is in general not equal to the partitioner Epetra_Map for the domain because of overlap in the matrix.
| const_iterator TrilinosWrappers::SparseMatrix::begin | ( | ) | const |
STL-like iterator with the first entry.
| const_iterator TrilinosWrappers::SparseMatrix::end | ( | ) | const |
Final iterator.
| const_iterator TrilinosWrappers::SparseMatrix::begin | ( | const unsigned int | r | ) | const |
STL-like iterator with the first entry of row r.
Note that if the given row is empty, i.e. does not contain any nonzero entries, then the iterator returned by this function equals end(r). Note also that the iterator may not be dereferencable in that case.
| const_iterator TrilinosWrappers::SparseMatrix::end | ( | const unsigned int | r | ) | const |
Final iterator of row r. It points to the first element past the end of line r, or past the end of the entire sparsity pattern.
Note that the end iterator is not necessarily dereferencable. This is in particular the case if it is the end iterator for the last row of a matrix.
| void TrilinosWrappers::SparseMatrix::write_ascii | ( | ) |
Abstract Trilinos object that helps view in ASCII other Trilinos objects. Currently this function is not implemented. TODO: Not implemented.
| void TrilinosWrappers::SparseMatrix::print | ( | std::ostream & | out, | |
| const bool | write_extended_trilinos_info = false | |||
| ) | const |
Print the matrix to the given stream, using the format (line,col) value, i.e. one nonzero entry of the matrix per line. The optional flag outputs the sparsity pattern in Trilinos style, where even the according processor number is printed to the stream, as well as a summary before actually writing the entries.
| void TrilinosWrappers::SparseMatrix::prepare_add | ( | ) | [protected] |
For some matrix storage formats, in particular for the PETSc distributed blockmatrices, set and add operations on individual elements can not be freely mixed. Rather, one has to synchronize operations when one wants to switch from setting elements to adding to elements. BlockMatrixBase automatically synchronizes the access by calling this helper function for each block. This function ensures that the matrix is in a state that allows adding elements; if it previously already was in this state, the function does nothing.
| void TrilinosWrappers::SparseMatrix::prepare_set | ( | ) | [protected] |
Same as prepare_add() but prepare the matrix for setting elements if the representation of elements in this class requires such an operation.
friend class BlockMatrixBase< SparseMatrix > [friend] |
To allow calling protected prepare_add() and prepare_set().
std_cxx1x::shared_ptr<Epetra_Map> TrilinosWrappers::SparseMatrix::column_space_map [private] |
Pointer to the user-supplied Epetra Trilinos mapping of the matrix columns that assigns parts of the matrix to the individual processes.
std_cxx1x::shared_ptr<Epetra_FECrsMatrix> TrilinosWrappers::SparseMatrix::matrix [private] |
A sparse matrix object in Trilinos to be used for finite element based problems which allows for assembling into non-local elements. The actual type, a sparse matrix, is set in the constructor.
Epetra_CombineMode TrilinosWrappers::SparseMatrix::last_action [private] |
Trilinos doesn't allow to mix additions to matrix entries and overwriting them (to make synchronisation of parallel computations simpler). The way we do it is to, for each access operation, store whether it is an insertion or an addition. If the previous one was of different type, then we first have to flush the Trilinos buffers; otherwise, we can simply go on. Luckily, Trilinos has an object for this which does already all the parallel communications in such a case, so we simply use their model, which stores whether the last operation was an addition or an insertion.
A boolean variable to hold information on whether the vector is compressed or not.
VectorBase TrilinosWrappers::SparseMatrix::temp_vector [mutable, private] |
An internal Trilinos vector that is used for accelerating vmult_add functions (in order not to need to recreate temporary vectors every time that function is called).
std::vector<unsigned int> TrilinosWrappers::SparseMatrix::column_indices [private] |
An internal array of integer values that is used to store the column indices when adding/inserting local data into the (large) sparse matrix.
std::vector<TrilinosScalar> TrilinosWrappers::SparseMatrix::column_values [private] |
An internal array of double values that is used to store the column indices when adding/inserting local data into the (large) sparse matrix.
documentation generated on Wed Jul 28 23:07:04 2010 by
doxygen
1.5.6