![]() |
|
Functions | |
Epetra_Vector * | create_distributed_epetra_vector (const DoubleVector &oomph_vec) |
Epetra_Vector * | create_distributed_epetra_vector (const LinearAlgebraDistribution *dist_pt) |
Epetra_Vector * | create_epetra_vector_view_data (DoubleVector &oomph_vec) |
void | copy_to_oomphlib_vector (const Epetra_Vector *epetra_vec_pt, DoubleVector &oomph_vec) |
Epetra_CrsMatrix * | create_distributed_epetra_matrix (const CRDoubleMatrix *oomph_matrix_pt, const LinearAlgebraDistribution *dist_pt) |
Epetra_CrsMatrix * | create_distributed_epetra_matrix_for_aztecoo (CRDoubleMatrix *oomph_matrix_pt) |
void | multiply (const CRDoubleMatrix *matrix, const DoubleVector &x, DoubleVector &soln) |
void | multiply (const CRDoubleMatrix &matrix_1, const CRDoubleMatrix &matrix_2, CRDoubleMatrix &matrix_soln, const bool &use_ml=false) |
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
References oomph::DoubleVector::built(), oomph::LinearAlgebraDistribution::communicator_pt(), oomph::DistributableLinearAlgebraObject::distributed(), oomph::DistributableLinearAlgebraObject::distribution_pt(), i, oomph::DistributableLinearAlgebraObject::nrow_local(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::DoubleVector::values_pt().
Referenced by multiply(), oomph::TrilinosPreconditionerBase::preconditioner_solve(), oomph::TrilinosAztecOOSolver::resolve(), and oomph::TrilinosAztecOOSolver::solve().
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.
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_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, row(), oomph::CRDoubleMatrix::row_start(), Eigen::value, 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.
References oomph::CRDoubleMatrix::built(), calibrate::c, oomph::CRDoubleMatrix::column_index(), oomph::LinearAlgebraDistribution::communicator_pt(), create_epetra_map(), oomph::DistributableLinearAlgebraObject::distributed(), oomph::DistributableLinearAlgebraObject::distribution_pt(), Eigen::placeholders::end, 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_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, row(), oomph::CRDoubleMatrix::row_start(), Eigen::value, 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.
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(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::DoubleVector::values_pt().
Referenced by multiply(), oomph::TrilinosPreconditionerBase::preconditioner_solve(), oomph::TrilinosAztecOOSolver::resolve(), and oomph::TrilinosAztecOOSolver::solve().
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.
References oomph::LinearAlgebraDistribution::built(), oomph::LinearAlgebraDistribution::communicator_pt(), create_epetra_map(), oomph::LinearAlgebraDistribution::distributed(), oomph::LinearAlgebraDistribution::nrow(), OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.
Epetra_Map * oomph::TrilinosEpetraHelpers::create_epetra_map | ( | const LinearAlgebraDistribution *const | dist | ) |
create an Epetra_Map corresponding to the LinearAlgebraDistribution
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.
References oomph::DoubleVector::built(), create_epetra_map(), oomph::DistributableLinearAlgebraObject::distribution_pt(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, 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.
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(), Eigen::placeholders::last, oomph::CRDoubleMatrix::ncol(), oomph::CRDoubleMatrix::nrow(), oomph::DistributableLinearAlgebraObject::nrow_local(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, row(), and Eigen::value.
void oomph::TrilinosEpetraHelpers::multiply | ( | const CRDoubleMatrix * | oomph_matrix_pt, |
const DoubleVector & | oomph_x, | ||
DoubleVector & | oomph_y | ||
) |
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.
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(), oomph::DistributableLinearAlgebraObject::distribution_pt(), OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.
Referenced by Loadstatistics::load_data_file(), oomph::CRDoubleMatrix::multiply(), and oomph::CRDoubleMatrix::multiply_transpose().