Dear Arndt
Thank you for answer. I want to solve the system during a time step using a
split method. First assembling block(0,0) and solving the displacement
field, then using the updated displacement, the second field must be solved
and so block(1,1) of system matrix is determined. I have not any problem
when working with BlockSparseMatrix<double>
<https://www.dealii.org/8.4.0/doxygen/deal.II/classBlockSparseMatrix.html>
system_matrix and a BlockVector<double>
<https://www.dealii.org/8.4.0/doxygen/deal.II/classBlockVector.html>
solution, for splitting the system (similar to step-22). The problem occurs
when working with Trilinos.
For example when a direct solver is used as bellow,
*if* (direct_solver)
{
SolverControl cn;
TrilinosWrappers::SolverDirect solver(cn);
solver.*solve*(system_pde_matrix.block(0,0),
newton_update.block(0), system_pde_residual.block(0));
constraints_update.distribute(newton_update);
*return* 1;
}
block(0,0) of system matrix and block(0) of residual and Newton update
vectors are selected but all block is solved simultaneously!! So I cant
solve specific block using direct solver and it is the first problem.
The second problem is when working with iterative solver. I cant set an AMG
Precondition for specific block of the system. For example I define a class
like this:
*template* <*class* *PreconditionerA*>
*class* BlockDiagonalPreconditioner_one
{
*public*:
*BlockDiagonalPreconditioner_one*(*const* LA::MPI::BlockSparseMatrix &M,
*const* *PreconditionerA* &pre_A)
: matrix(M),
prec_A (pre_A)
{
}
*void* *vmult* (LA::MPI::BlockVector &dst,
*const* LA::MPI::BlockVector &src) *const*
{
prec_A.vmult(dst.block(0), src.block(0));
}
*const* LA::MPI::BlockSparseMatrix &matrix;
*const* *PreconditionerA* &prec_A;
};
for solving block(0,0) as,
BlockDiagonalPreconditioner_one<LA::MPI::PreconditionAMG>
preconditioner(system_pde_matrix.block(0,0), preconditioner_solid);
solver.*solve*(system_pde_matrix.block(0,0), newton_update.block(0),
system_pde_residual.block(0), preconditioner);
But there are two errors:
1) no matching function for call to
‘BlockDiagonalPreconditioner_one<dealii::TrilinosWrappers::PreconditionAMG>::BlockDiagonalPreconditioner_one(dealii::BlockMatrixBase<dealii::TrilinosWrappers::SparseMatrix>::BlockType&,
dealii::LinearAlgebraTrilinos::MPI::PreconditionAMG&)’
2) Invalid arguments '
Candidates are:
void solve(const #10000 &, dealii::TrilinosWrappers::MPI::BlockVector &,
const dealii::TrilinosWrappers::MPI::BlockVector &, const #10001 &)
the first error may be due to sending block(0,0) of TrilinosWrappers
BlockMatrix as first argument of *BlockDiagonalPreconditioner_one*
constructor.
Finally how I can set precondition for specific block and how I can solve
that block when working with TrilinosWrappers?
Best
Pasha
On Monday, July 25, 2016 at 10:18:42 PM UTC+4:30, Daniel Arndt wrote:
>
> Pasha,
>
> there are tutorial programs, such as step-22[1], that use BlockMatrices
> and solve for individual blocks.
> What exactly is the problem you are facing? Does it have anything to do
> with Trilinos objects or is it a conceptual problem?
>
> Can you tell us how exactly you want to split solving your system?
>
> Best,
> Daniel
>
> [1] https://www.dealii.org/8.4.0/doxygen/deal.II/step_22.html
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.