Helper namespace for use with the Trilinos Epetra package. Contains functions to generate two Epetra containers (Epetra_Vector and Epetra_CrsMatrix) and provides access to the trilinos matrix-matrix and matrix-vector product routines. More...
Functions | |
Epetra_Vector * | create_distributed_epetra_vector (const DoubleVector &oomph_vec) |
create an Epetra_Vector from an oomph-lib DoubleVector. If oomph_vec is NOT distributed (i.e. locally replicated) and on more than one processor, then the returned Epetra_Vector will be uniformly distributed. If the oomph_vec is distributed then the Epetra_Vector returned will have the same distribution as oomp_vec. More... | |
Epetra_Vector * | create_distributed_epetra_vector (const LinearAlgebraDistribution *dist_pt) |
create an Epetra_Vector based on the argument oomph-lib LinearAlgebraDistribution If dist is NOT distributed and on more than one processor, then the returned Epetra_Vector will be uniformly distributed. If dist is distributed then the Epetra_Vector returned will have the same distribution as dist. The coefficient values are not set. More... | |
Epetra_Vector * | create_epetra_vector_view_data (DoubleVector &oomph_vec) |
create an Epetra_Vector equivalent of DoubleVector The argument DoubleVector must be built. The Epetra_Vector will point to, and NOT COPY the underlying data in the DoubleVector. The oomph-lib DoubleVector and the returned Epetra_Vector will have the the same distribution. More... | |
void | copy_to_oomphlib_vector (const Epetra_Vector *epetra_vec_pt, DoubleVector &oomph_vec) |
Helper function to copy the contents of a Trilinos vector to an oomph-lib distributed vector. The distribution of the two vectors must be identical. More... | |
Epetra_CrsMatrix * | create_distributed_epetra_matrix (const CRDoubleMatrix *oomph_matrix_pt, const LinearAlgebraDistribution *dist_pt) |
create an Epetra_CrsMatrix from an oomph-lib CRDoubleMatrix. If oomph_matrix_pt is NOT distributed (i.e. locally replicated) and on more than one processor, then the returned Epetra_Vector will be uniformly distributed. If the oomph_matrix_pt is distributed then the Epetra_CrsMatrix returned will have the same distribution as oomph_matrix_pt. The LinearAlgebraDistribution argument dist_pt should specify the distribution of the object this matrix will operate on. More... | |
Epetra_CrsMatrix * | create_distributed_epetra_matrix_for_aztecoo (CRDoubleMatrix *oomph_matrix_pt) |
create and Epetra_CrsMatrix from an oomph-lib CRDoubleMatrix. Specialisation for Trilinos AztecOO. If oomph_matrix_pt is NOT distributed (i.e. locally replicated) and on more than one processor, then the returned Epetra_Vector will be uniformly distributed. If the oomph_matrix_pt is distributed then the Epetra_CrsMatrix returned will have the same distribution as oomph_matrix_pt. For AztecOO, the column map is ordered such that the local rows are first. More... | |
void | multiply (const CRDoubleMatrix *matrix, const DoubleVector &x, DoubleVector &soln) |
Function to perform a matrix-vector multiplication on a oomph-lib matrix and vector using Trilinos functionality. NOTE 1. the matrix and the vectors must have the same communicator. NOTE 2. The vector will be returned with the same distribution as the matrix, unless a distribution is predefined in the solution vector in which case the vector will be returned with that distribution. More... | |
void | multiply (const CRDoubleMatrix &matrix_1, const CRDoubleMatrix &matrix_2, CRDoubleMatrix &matrix_soln, const bool &use_ml=false) |
Function to perform a matrix-matrix multiplication on oomph-lib matrices by using Trilinos functionality. NOTE 1. There are two Trilinos matrix-matrix multiplication methods available, using either the EpetraExt::MatrixMatrix class (if use_ml == false) or using ML (Epetra_MatrixMult method) NOTE 2. the solution matrix (matrix_soln) will be returned with the same distribution as matrix1 NOTE 3. All matrices must share the same communicator. More... | |
Epetra_Map * | create_epetra_map (const LinearAlgebraDistribution *const dist) |
create an Epetra_Map corresponding to the LinearAlgebraDistribution More... | |
Helper namespace for use with the Trilinos Epetra package. Contains functions to generate two Epetra containers (Epetra_Vector and Epetra_CrsMatrix) and provides access to the trilinos matrix-matrix and matrix-vector product routines.
void oomph::TrilinosEpetraHelpers::copy_to_oomphlib_vector | ( | const Epetra_Vector * | epetra_vec_pt, |
DoubleVector & | oomph_vec | ||
) |
Helper function to copy the contents of a Trilinos vector to an oomph-lib distributed vector. The distribution of the two vectors must be identical.
Definition at line 180 of file trilinos_helpers.cc.
References oomph::DoubleVector::built(), oomph::LinearAlgebraDistribution::communicator_pt(), oomph::DistributableLinearAlgebraObject::distributed(), oomph::DistributableLinearAlgebraObject::distribution_pt(), i, oomph::DistributableLinearAlgebraObject::nrow_local(), and oomph::DoubleVector::values_pt().
Referenced by multiply(), oomph::TrilinosPreconditionerBase::preconditioner_solve(), oomph::TrilinosAztecOOSolver::resolve(), oomph::TrilinosAztecOOSolver::solve(), oomph::MatrixVectorProduct::trilinos_multiply_helper(), and oomph::MatrixVectorProduct::trilinos_multiply_transpose_helper().
Epetra_CrsMatrix * oomph::TrilinosEpetraHelpers::create_distributed_epetra_matrix | ( | const CRDoubleMatrix * | oomph_matrix_pt, |
const LinearAlgebraDistribution * | dist_pt | ||
) |
create an Epetra_CrsMatrix from an oomph-lib CRDoubleMatrix. If oomph_matrix_pt is NOT distributed (i.e. locally replicated) and on more than one processor, then the returned Epetra_Vector will be uniformly distributed. If the oomph_matrix_pt is distributed then the Epetra_CrsMatrix returned will have the same distribution as oomph_matrix_pt. The LinearAlgebraDistribution argument dist_pt should specify the distribution of the object this matrix will operate on.
Definition at line 289 of file trilinos_helpers.cc.
References oomph::CRDoubleMatrix::built(), oomph::CRDoubleMatrix::column_index(), oomph::LinearAlgebraDistribution::communicator_pt(), create_epetra_map(), oomph::LinearAlgebraDistribution::distributed(), oomph::DistributableLinearAlgebraObject::distributed(), oomph::DistributableLinearAlgebraObject::distribution_pt(), oomph::LinearAlgebraDistribution::first_row(), oomph::LinearAlgebraDistribution::nrow(), oomph::CRDoubleMatrix::nrow(), oomph::LinearAlgebraDistribution::nrow_local(), oomph::CRDoubleMatrix::row_start(), and oomph::CRDoubleMatrix::value().
Referenced by multiply(), oomph::TrilinosPreconditionerBase::setup(), oomph::MatrixVectorProduct::setup(), and oomph::TrilinosAztecOOSolver::solver_setup().
Epetra_CrsMatrix * oomph::TrilinosEpetraHelpers::create_distributed_epetra_matrix_for_aztecoo | ( | CRDoubleMatrix * | oomph_matrix_pt | ) |
create and Epetra_CrsMatrix from an oomph-lib CRDoubleMatrix. Specialisation for Trilinos AztecOO. If oomph_matrix_pt is NOT distributed (i.e. locally replicated) and on more than one processor, then the returned Epetra_Vector will be uniformly distributed. If the oomph_matrix_pt is distributed then the Epetra_CrsMatrix returned will have the same distribution as oomph_matrix_pt. For AztecOO, the column map is ordered such that the local rows are first.
Definition at line 473 of file trilinos_helpers.cc.
References oomph::CRDoubleMatrix::built(), oomph::CRDoubleMatrix::column_index(), oomph::LinearAlgebraDistribution::communicator_pt(), create_epetra_map(), oomph::DistributableLinearAlgebraObject::distributed(), oomph::DistributableLinearAlgebraObject::distribution_pt(), oomph::LinearAlgebraDistribution::first_row(), oomph::DistributableLinearAlgebraObject::first_row(), oomph::CRDoubleMatrix::ncol(), oomph::CRDoubleMatrix::nnz(), oomph::CRDoubleMatrix::nrow(), oomph::LinearAlgebraDistribution::nrow_local(), oomph::DistributableLinearAlgebraObject::nrow_local(), oomph::CRDoubleMatrix::row_start(), and oomph::CRDoubleMatrix::value().
Referenced by oomph::TrilinosAztecOOSolver::solver_setup().
Epetra_Vector * oomph::TrilinosEpetraHelpers::create_distributed_epetra_vector | ( | const DoubleVector & | oomph_vec | ) |
create an Epetra_Vector from an oomph-lib DoubleVector. If oomph_vec is NOT distributed (i.e. locally replicated) and on more than one processor, then the returned Epetra_Vector will be uniformly distributed. If the oomph_vec is distributed then the Epetra_Vector returned will have the same distribution as oomp_vec.
create an Epetra_Vector from an oomph-lib DoubleVector. If oomph_vec is NOT distributed (i.e. locally replicated) and on more than one processor, then the returned Epetra_Vector will be uniformly distributed. If the oomph_vec is distributed then the Epetra_Vector returned will have the same distribution as oomph_vec.
Definition at line 41 of file trilinos_helpers.cc.
References oomph::DoubleVector::built(), oomph::LinearAlgebraDistribution::communicator_pt(), create_epetra_map(), oomph::DistributableLinearAlgebraObject::distributed(), oomph::DistributableLinearAlgebraObject::distribution_pt(), oomph::LinearAlgebraDistribution::first_row(), oomph::DistributableLinearAlgebraObject::nrow(), and oomph::DoubleVector::values_pt().
Referenced by multiply(), oomph::TrilinosPreconditionerBase::preconditioner_solve(), oomph::TrilinosAztecOOSolver::resolve(), oomph::TrilinosAztecOOSolver::solve(), oomph::MatrixVectorProduct::trilinos_multiply_helper(), and oomph::MatrixVectorProduct::trilinos_multiply_transpose_helper().
Epetra_Vector * oomph::TrilinosEpetraHelpers::create_distributed_epetra_vector | ( | const LinearAlgebraDistribution * | dist_pt | ) |
create an Epetra_Vector based on the argument oomph-lib LinearAlgebraDistribution If dist is NOT distributed and on more than one processor, then the returned Epetra_Vector will be uniformly distributed. If dist is distributed then the Epetra_Vector returned will have the same distribution as dist. The coefficient values are not set.
Definition at line 100 of file trilinos_helpers.cc.
References oomph::LinearAlgebraDistribution::built(), oomph::LinearAlgebraDistribution::communicator_pt(), create_epetra_map(), oomph::LinearAlgebraDistribution::distributed(), and oomph::LinearAlgebraDistribution::nrow().
Epetra_Map * oomph::TrilinosEpetraHelpers::create_epetra_map | ( | const LinearAlgebraDistribution *const | dist | ) |
create an Epetra_Map corresponding to the LinearAlgebraDistribution
Definition at line 977 of file trilinos_helpers.cc.
References oomph::LinearAlgebraDistribution::communicator_pt(), oomph::LinearAlgebraDistribution::distributed(), oomph::LinearAlgebraDistribution::first_row(), i, oomph::LinearAlgebraDistribution::nrow(), and oomph::LinearAlgebraDistribution::nrow_local().
Referenced by create_distributed_epetra_matrix(), create_distributed_epetra_matrix_for_aztecoo(), create_distributed_epetra_vector(), create_epetra_vector_view_data(), and oomph::OomphLibPreconditionerEpetraOperator::OomphLibPreconditionerEpetraOperator().
Epetra_Vector * oomph::TrilinosEpetraHelpers::create_epetra_vector_view_data | ( | DoubleVector & | oomph_vec | ) |
create an Epetra_Vector equivalent of DoubleVector The argument DoubleVector must be built. The Epetra_Vector will point to, and NOT COPY the underlying data in the DoubleVector. The oomph-lib DoubleVector and the returned Epetra_Vector will have the the same distribution.
Create an Epetra_Vector equivalent of DoubleVector The argument DoubleVector must be built. The Epetra_Vector will point to, and NOT COPY the underlying data in the DoubleVector. The oomph-lib DoubleVector and the returned Epetra_Vector will have the the same distribution.
Definition at line 146 of file trilinos_helpers.cc.
References oomph::DoubleVector::built(), create_epetra_map(), oomph::DistributableLinearAlgebraObject::distribution_pt(), and oomph::DoubleVector::values_pt().
void oomph::TrilinosEpetraHelpers::multiply | ( | const CRDoubleMatrix & | matrix_1, |
const CRDoubleMatrix & | matrix_2, | ||
CRDoubleMatrix & | matrix_soln, | ||
const bool & | use_ml = false |
||
) |
Function to perform a matrix-matrix multiplication on oomph-lib matrices by using Trilinos functionality. NOTE 1. There are two Trilinos matrix-matrix multiplication methods available, using either the EpetraExt::MatrixMatrix class (if use_ml == false) or using ML (Epetra_MatrixMult method) NOTE 2. the solution matrix (matrix_soln) will be returned with the same distribution as matrix1 NOTE 3. All matrices must share the same communicator.
Definition at line 753 of file trilinos_helpers.cc.
References oomph::CRDoubleMatrix::build(), oomph::CRDoubleMatrix::build_without_copy(), oomph::LinearAlgebraDistribution::built(), oomph::CRDoubleMatrix::built(), oomph::LinearAlgebraDistribution::communicator_pt(), create_distributed_epetra_matrix(), oomph::DistributableLinearAlgebraObject::distribution_pt(), oomph::DistributableLinearAlgebraObject::first_row(), oomph::CRDoubleMatrix::ncol(), oomph::CRDoubleMatrix::nrow(), and oomph::DistributableLinearAlgebraObject::nrow_local().
void oomph::TrilinosEpetraHelpers::multiply | ( | const CRDoubleMatrix * | matrix, |
const DoubleVector & | x, | ||
DoubleVector & | soln | ||
) |
Function to perform a matrix-vector multiplication on a oomph-lib matrix and vector using Trilinos functionality. NOTE 1. the matrix and the vectors must have the same communicator. NOTE 2. The vector will be returned with the same distribution as the matrix, unless a distribution is predefined in the solution vector in which case the vector will be returned with that distribution.
Definition at line 657 of file trilinos_helpers.cc.
References oomph::DoubleVector::build(), oomph::DoubleVector::built(), oomph::LinearAlgebraDistribution::built(), oomph::CRDoubleMatrix::built(), copy_to_oomphlib_vector(), create_distributed_epetra_matrix(), create_distributed_epetra_vector(), and oomph::DistributableLinearAlgebraObject::distribution_pt().
Referenced by oomph::CRDoubleMatrix::multiply(), and oomph::CRDoubleMatrix::multiply_transpose().