62 std::ostringstream error_message;
63 error_message <<
"Preconditioners require a square matrix. "
67 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
76 if (cr_matrix_pt == 0)
79 OOMPH_CURRENT_FUNCTION,
80 OOMPH_EXCEPTION_LOCATION);
107 if (cr_matrix_pt == 0)
109 std::ostringstream error_message;
110 error_message <<
"TrilinosSolver only work with "
111 <<
"DistributedCRDoubleMatrix matrices" << std::endl;
113 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
136 std::ostringstream error_message;
137 error_message <<
"preconditioner_solve requires that solver data has "
138 <<
"been set up" << std::endl;
140 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
145 std::ostringstream error_message;
146 error_message <<
"The rhs vector and the matrix must have the same "
147 <<
"distribution.\n";
149 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
154 Epetra_Vector* epetra_r_pt =
158 Epetra_Vector* epetra_z_pt =
197 Epetra_CrsMatrix* epetra_matrix_pt)
238 Epetra_CrsMatrix* epetra_matrix_pt)
241 Teuchos::ParameterList ifpack_parameters;
248 Ifpack ifpack_factory;
249 Ifpack_Preconditioner* tmp_pt =
252 tmp_pt->SetParameters(ifpack_parameters);
253 tmp_pt->Initialize();
A class for compressed row matrices. This is a distributable object.
LinearAlgebraDistribution * distribution_pt() const
access to the LinearAlgebraDistribution
unsigned nrow() const
access function to the number of global rows.
void build_distribution(const LinearAlgebraDistribution *const dist_pt)
setup the distribution of this distributable linear algebra object
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....
void build(const DoubleVector &old_vector)
Just copys the argument DoubleVector.
An OomphLibError object which should be thrown when an run-time error is encountered....
virtual DoubleMatrixBase * matrix_pt() const
Get function for matrix pointer.
double Absolute_threshold
Value of absolute threshold, used to peturb diagonal.
string Preconditioner_type
Type of ILU preconditioner.
int ILU_fill_level
Level of fill for "ILU".
void setup_trilinos_preconditioner(Epetra_CrsMatrix *epetra_matrix_pt)
Function to set up an IFPACK preconditioner. It is assumed Trilinos_matrix_pt points to a suitable ma...
double ILUT_fill_level
Level of fill for "ILUT".
double Relative_threshold
Value of relative threshold, used to pertub diagonal.
int Overlap
Value of overlap level - used in parallel ILU.
static int Default_n_cycles
Default number of V cycles (one to be consistent with previous default) (It's an int because Trilinos...
Teuchos::ParameterList ML_parameters
void setup_trilinos_preconditioner(Epetra_CrsMatrix *epetra_matrix_pt)
Function to set up the ML preconditioner. It is assumed Trilinos_matrix_pt points to a suitable matri...
Epetra_Operator * Epetra_preconditioner_pt
The preconditioner which will be set up using function setup_trilinos_preconditioner(....
void preconditioner_solve(const DoubleVector &r, DoubleVector &z)
applies the preconditioner
Epetra_CrsMatrix * Epetra_matrix_pt
Pointer used to store the epetra matrix - only used when this preconditioner is setup using the oomph...
void clean_up_memory()
deletes the preconditioner, matrices and maps
static double Cumulative_preconditioner_solve_time
Static double that accumulates the preconditioner solve time of all instantiations of this class....
void setup()
Broken assignment operator.
virtual void setup_trilinos_preconditioner(Epetra_CrsMatrix *epetra_matrix_pt)=0
Function to set up a specific Trilinos preconditioner. This is called by setup(......
double timer()
returns the time in seconds after some point in past
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...
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....
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...