|
DOUG 0.2
|
00001 ! DOUG - Domain decomposition On Unstructured Grids 00002 ! Copyright (C) 1998-2006 Faculty of Computer Science, University of Tartu and 00003 ! Department of Mathematics, University of Bath 00004 ! 00005 ! This library is free software; you can redistribute it and/or 00006 ! modify it under the terms of the GNU Lesser General Public 00007 ! License as published by the Free Software Foundation; either 00008 ! version 2.1 of the License, or (at your option) any later version. 00009 ! 00010 ! This library is distributed in the hope that it will be useful, 00011 ! but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 ! Lesser General Public License for more details. 00014 ! 00015 ! You should have received a copy of the GNU Lesser General Public 00016 ! License along with this library; if not, write to the Free Software 00017 ! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00018 ! or contact the authors (University of Tartu, Faculty of Computer Science, Chair 00019 ! of Distributed Systems, Liivi 2, 50409 Tartu, Estonia, http://dougdevel.org, 00020 ! mailto:info(at)dougdevel.org) 00021 00023 module CoarsePreconditioner_robust_mod 00024 use Preconditioner_base_mod 00025 use RobustCoarseMtx_mod 00026 use pcgRobust_mod 00027 use CoarseMtx_mod 00028 00029 private 00030 public :: CoarsePreconditioner_robust_Init 00031 contains 00032 00034 subroutine CoarsePreconditioner_robust_Init(CP, D, P) 00035 type(CoarsePreconditioner),intent(inout) :: CP 00036 type(Distribution),intent(inout) :: D 00037 type(Partitionings),intent(in) :: P 00038 00039 type(SumOfInversedSubMtx) :: B_RCS !< B matrix for the Robust Coarse Spaces 00040 type(RobustPreconditionMtx) :: C 00041 real(kind=rk), pointer :: rhs_1(:), g(:) 00042 00043 if (numprocs>1) call DOUG_abort("Robust coarse spaces are only allowed with numprocs=1") 00044 00045 CP%type = COARSE_PRECONDITIONER_TYPE_ROBUST 00046 00047 call IntRestBuild(D%A,P%fAggr%inner,CP%R) 00048 00049 B_RCS = CoarseProjectionMtxsBuild(D%A,CP%R,P%fAggr%inner%nagr) 00050 allocate(rhs_1(D%A%nrows)) 00051 allocate(g(D%A%ncols)) 00052 00053 rhs_1 = 1.0 00054 call pcg_forRCS(B_RCS,rhs_1,g) 00055 00056 if(sctls%verbose>5) then 00057 write (stream, *) "Solution g = ", g 00058 end if 00059 00060 call RobustRestrictMtxBuild(B_RCS,g,CP%R) 00061 call CoarseMtxBuild(D%A,CP%AC,CP%R,D%mesh%ninner) 00062 00063 end subroutine CoarsePreconditioner_robust_Init 00064 00065 end module CoarsePreconditioner_robust_mod
1.7.3-20110217