Dear all


I am working on a model in which the system matrix is a 
TrilinosWrappers::BlockSparseMatrix with 2*2 blocks. I set the precondition 
as:


{

LA::MPI::PreconditionAMG::AdditionalData data;

data.constant_modes = constant_modes;

data.elliptic = *true*;

data.higher_order_elements = *true*;

data.smoother_sweeps = 2;

data.aggregation_threshold = 0.02;

preconditioner_solid.*initialize*(system_pde_matrix.block(0, 0), data);

}

{

LA::MPI::PreconditionAMG::AdditionalData data;

//data.constant_modes = constant_modes;

data.elliptic = *true*;

data.higher_order_elements = *true*;

data.smoother_sweeps = 2;

data.aggregation_threshold = 0.02;

preconditioner_second.*initialize*(system_pde_matrix.block(1, 1), data);

}


and the solve template function is:


*template* <*int* *dim*>

*unsigned* *int*

*FEM<dim>::solve* ()

{

newton_update = 0;


*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;

}

*else*

{

SolverControl solver_control(200, system_pde_residual.l2_norm() * 1e-8);

SolverGMRES<LA::MPI::BlockVector> solver(solver_control);

BlockDiagonalPreconditioner_two<LA::MPI::PreconditionAMG,LA::MPI::
PreconditionAMG>

preconditioner(system_pde_matrix,preconditioner_solid,

preconditioner_second);


solver.solve(system_pde_matrix, newton_update,

system_pde_residual, preconditioner);

*return* solver_control.*last_step*();

}

}



in which BlockDiagonalPreconditioner_two is defined as:


*template* <*class* *PreconditionerA*, *class* *PreconditionerC*>

*class* BlockDiagonalPreconditioner_two

{

*public*:

*BlockDiagonalPreconditioner_two*(*const* LA::MPI::BlockSparseMatrix &M,

*const* *PreconditionerA* &pre_A, *const* *PreconditionerC* &pre_C)

: matrix(M),

prec_A (pre_A),

prec_C (pre_C)

{

}


*void* *vmult* (LA::MPI::BlockVector &dst,

*const* LA::MPI::BlockVector &src) *const*

{

prec_A.vmult(dst.block(0), src.block(0));

prec_C.vmult(dst.block(1), src.block(1));

}


*const* LA::MPI::BlockSparseMatrix &matrix;

*const* *PreconditionerA* &prec_A;

*const* *PreconditionerC* &prec_C;

};



The system is solved perfectly when all blocks is solved simultaneously. 
However I want to test split method. So I need to solve each block 
separately but I don't know how. Is it possible to solve each block 
separately when the system matrix is a TrilinosWrappers::BlockSparseMatrix?how? 
Please help me. 


Best,

Pasha

-- 
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.

Reply via email to