> > > step-40 tries to allow switching between Trilinos and PETSc as easy as > possible by using the deal.II/lac/generic_linear_algebra.h header and the > defining the LA::MPI namespace. >
Thanks for your answer, Daniel. Even with that example I find it a little harder than I expected to use classes from PETSc instead of Trilinos. For instance: const LinearSolvers::InverseMatrix<PETScWrappers::SparseMatrix, PETScWrappers::PreconditionICC> mp_inverse(stokes_preconditioner_matrix.block(1, 1), *Mp_preconditioner); Cannot compile, I am trying to use a static_cast<PETScWrappers::SparseMatrix>(stokes_preconditioner_matrix.block(1, 1)) now, but I don't think it will be a good idea. Another weak point in my porting is template <class PreconditionerTypeA, class PreconditionerTypeMp> BlockSchurPreconditioner<PreconditionerTypeA, PreconditionerTypeMp>:: BlockSchurPreconditioner( const PETScWrappers::MPI::BlockSparseMatrix &S, const InverseMatrix<PETScWrappers::SparseMatrix, PreconditionerTypeMp> &Mpinv, const PreconditionerTypeA & Apreconditioner) : stokes_matrix(&S) , m_inverse(&Mpinv) , a_preconditioner(Apreconditioner) , tmp(complete_index_set(stokes_matrix->block(1, 1).m())) {} where tmp (a mutable PETScWrappers::MPI::Vector) cannot be initialized. Adding MPI_COMM_WORLD make it compile, though. Again with matrices, I have made the following changes: //temperature_matrix.copy_from(temperature_mass_matrix); temperature_matrix = 0; temperature_matrix.add(1.0, temperature_mass_matrix); I hope the change works... Can I ask why there are some discrepancies between those two wrappers? Apart from an obvious one, that they're different libraries, but uniformity may help a lot IMO. > >> [...] >> std::shared_ptr<PETScWrappers::PreconditionILU> Amg_preconditioner; >> > > This looks inappropriate. Probably it should rather be > PETScWrappers::PreconditionBoomerAMG; > Yes, I know :) I am first trying to make it compile, then I will try to use a good preconditioner (Boomer requires Hypre, and it needs MPI, so right now it is not an option). Thanks! Franco -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/0bce36bd-19a1-4f62-8be8-75eb3965e7ce%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.