*/
void solve (MPI::Vector &x, const MPI::Vector &b);
+ /**
+ * Solve the linear system <tt>Ax=b</tt> based on the package set in
+ * intialize() for deal.II's own parallel vectors. Note the matrix is not
+ * refactorized during this call.
+ */
+ void
+ solve (dealii::LinearAlgebra::distributed::Vector<double> &x,
+ const dealii::LinearAlgebra::distributed::Vector<double> &b);
+
/**
* Solve the linear system <tt>Ax=b</tt>. Creates a factorization of the
* matrix with the package chosen from the additional data structure and
// Assign the RHS vector to the Epetra_LinearProblem object
linear_problem->SetRHS(const_cast<Epetra_MultiVector *>(&b.trilinos_vector()));
+ // First set whether we want to print the solver information to screen or
+ // not.
+ ConditionalOStream verbose_cout (std::cout,
+ additional_data.output_solver_details);
+
+
+ verbose_cout << "Starting solve" << std::endl;
+
// Fetch return value of Amesos Solver functions
- int ierr;
+ int ierr = solver->Solve ();
+ AssertThrow (ierr == 0, ExcTrilinosError (ierr));
+
+ // Finally, force the SolverControl object to report convergence
+ solver_control.check (0, 0);
+ }
+
+
+
+ void SolverDirect::solve (dealii::LinearAlgebra::distributed::Vector<double> &x,
+ const dealii::LinearAlgebra::distributed::Vector<double> &b)
+ {
+ Epetra_Vector ep_x (View, linear_problem->GetOperator()->OperatorDomainMap(), x.begin());
+ Epetra_Vector ep_b (View, linear_problem->GetOperator()->OperatorRangeMap(), const_cast<double *>(b.begin()));
+
+ // Assign the empty LHS vector to the Epetra_LinearProblem object
+ linear_problem->SetLHS(&ep_x);
+
+ // Assign the RHS vector to the Epetra_LinearProblem object
+ linear_problem->SetRHS(&ep_b);
// First set whether we want to print the solver information to screen or
// not.
ConditionalOStream verbose_cout (std::cout,
additional_data.output_solver_details);
-
verbose_cout << "Starting solve" << std::endl;
- ierr = solver->Solve ();
+
+ // Fetch return value of Amesos Solver functions
+ int ierr = solver->Solve ();
AssertThrow (ierr == 0, ExcTrilinosError (ierr));
// Finally, force the SolverControl object to report convergence
do_solve();
}
-
}