90 oomph_info <<
"Time to generate Jacobian [sec] : "
144 if (matrix_pt->
nrow() != matrix_pt->
ncol())
153 if (matrix_pt->
nrow() !=
rhs.nrow())
157 <<
"The matrix and the rhs vector must have the same number of rows.";
173 <<
"The matrix matrix_pt must have the same communicator as the "
175 <<
" rhs and result must have the same communicator";
192 if (!(*
result.distribution_pt() == *
rhs.distribution_pt()))
196 <<
"The result vector distribution has been setup; it must have the "
197 <<
"same distribution as the rhs vector.";
208 result.build(
rhs.distribution_pt(), 0.0);
248 oomph_info <<
"Time for trilinos solve itself : "
271 oomph_info <<
"Time for complete trilinos solve : "
323 std::ostringstream error_message;
324 error_message <<
"The oomph-lib preconditioner and the solver must "
325 <<
"have the same distribution";
345 TrilinosEpetraHelpers ::create_distributed_epetra_matrix_for_aztecoo(
351 TrilinosEpetraHelpers ::create_distributed_epetra_matrix(
376 oomph_info <<
"Time to generate Trilinos matrix : "
393 std::ostringstream error_message;
394 error_message <<
"Preconditioner_pt == 0. (Remember default "
395 <<
"preconditioner is IdentityPreconditioner)";
472 std::ostringstream error_message;
473 error_message <<
"Solver_type set to incorrect value. "
474 <<
"Acceptable values are " <<
CG <<
", " <<
GMRES
475 <<
" and " <<
BiCGStab <<
". Current value is "
498 std::ostringstream error_message;
500 <<
"The rhs vector and the matrix must have the same number "
502 <<
"The rhs vector has " <<
rhs.nrow() <<
" rows.\n"
512 if (!(*
solution.distribution_pt() == *
rhs.distribution_pt()))
516 <<
"The result vector distribution has been setup; it must have the "
517 <<
"same distribution as the rhs vector.";
577 std::ostringstream error_message;
578 error_message <<
"Solver must be called with solve(...) "
579 <<
"before resolve(...) to set it up.\n";
600 oomph_info <<
"Final relative residual norm : " << norm
The conjugate gradient method.
The conjugate gradient method.
A class for compressed row matrices. This is a distributable object.
LinearAlgebraDistribution * distribution_pt() const
access to the LinearAlgebraDistribution
void build_distribution(const LinearAlgebraDistribution *const dist_pt)
setup the distribution of this distributable linear algebra object
Abstract base class for matrices of doubles – adds abstract interfaces for solving,...
virtual unsigned long ncol() const =0
Return the number of columns of the matrix.
virtual unsigned long nrow() const =0
Return the number of rows of the matrix.
A vector in the mathematical sense, initially developed for linear algebra type applications....
bool Use_iterative_solver_as_preconditioner
Use the iterative solver as preconditioner.
bool First_time_solve_when_used_as_preconditioner
When the iterative solver is used a preconditioner then we call the setup of solver method only once ...
double Tolerance
Convergence tolerance.
Preconditioner * Preconditioner_pt
Pointer to the preconditioner.
unsigned Max_iter
Maximum number of iterations.
bool Setup_preconditioner_before_solve
indicates whether the preconditioner should be setup before solve. Default = true;
Describes the distribution of a distributable linear algebra type object. Typically this is a contain...
bool Doc_time
Boolean flag that indicates whether the time taken.
bool Enable_resolve
Boolean that indicates whether the matrix (or its factors, in the case of direct solver) should be st...
An oomph-lib wrapper to the MPI_Comm communicator object. Just contains an MPI_Comm object (which is ...
An OomphLibError object which should be thrown when an run-time error is encountered....
An Epetra_Operator class for oomph-lib preconditioners. A helper class for TrilinosOomphLibPreconditi...
virtual void setup(DoubleMatrixBase *matrix_pt)
Setup the preconditioner: store the matrix pointer and the communicator pointer then call preconditio...
////////////////////////////////////////////////////////////////// //////////////////////////////////...
virtual void get_jacobian(DoubleVector &residuals, DenseDoubleMatrix &jacobian)
Return the fully-assembled Jacobian and residuals for the problem Interface for the case when the Jac...
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
bool Using_problem_based_solve
Helper flag keeping track of whether we called the linear algebra or problem-based solve function.
void resolve(const DoubleVector &rhs, DoubleVector &solution)
Function to resolve a linear system using the existing solver data, allowing a solve with a new right...
void solver_setup(DoubleMatrixBase *const &matrix_pt)
Helper function for setting up the solver. Converts the oomph-lib matrices to Epetra matrices,...
unsigned Iterations
Stores number of iterations used.
Epetra_CrsMatrix * Epetra_matrix_pt
A pointer for the linear system matrix in Epetra_CrsMatrix format.
void clean_up_memory()
Clean up method - deletes the solver, the matrices and the preconditioner.
void solve_using_AztecOO(Epetra_Vector *&rhs_pt, Epetra_Vector *&soln_pt)
Helper function performs the actual solve once the AztecOO solver is set up.
bool Delete_matrix
Trilinos copies matrix data from oomph-lib's own CRDoubleMatrix or DistributedCRDoubleMatrix to Trili...
DoubleMatrixBase * Oomph_matrix_pt
Oomph lib matrix pointer.
Epetra_Operator * Epetra_preconditioner_pt
A pointer to the Epetra_Operator for the preconditioner. This is only used if the preconditioner NOT ...
void solve(Problem *const &problem_pt, DoubleVector &solution)
Function which uses problem_pt's get_jacobian(...) function to generate a linear system which is then...
unsigned Solver_type
Defines which solver is set up - available types are defined in AztecOO_solver_types.
double Linear_solver_solution_time
Stores time for the solution (excludes time to set up preconditioner)
Problem * Problem_pt
A pointer to the underlying problem (NULL if MATRIX based solve) The problem_pt is stored here in a p...
AztecOO * AztecOO_solver_pt
Pointer to the AztecOO solver.
bool Use_aztecoo_workaround_for_epetra_matrix_setup
Use workaround for creating of epetra matrix that respects aztecoo's ordering requirements.
double Jacobian_setup_time
Stores set up time for Jacobian.
Base class for Trilinos preconditioners as oomph-lib preconditioner.
double timer()
returns the time in seconds after some point in past
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....
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....
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...