|
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 Preconditioner_mod 00024 use Preconditioner_base_mod 00025 00026 implicit none 00027 00028 contains 00029 00030 ! Apply preconditioner. 00031 subroutine FinePreconditioner_Apply(FP, sol, rhs) 00032 use FinePreconditioner_complete_mod 00033 use FinePreconditioner_sgs_mod 00034 type(FinePreconditioner),intent(inout) :: FP 00035 real(kind=rk),dimension(:),pointer :: sol !< solution 00036 real(kind=rk),dimension(:),pointer :: rhs !< right hand side 00037 00038 ! delegate to different implementations 00039 if (FP%type==FINE_PRECONDITIONER_TYPE_NONE) then 00040 sol = rhs 00041 else if (FP%type==FINE_PRECONDITIONER_TYPE_COMPLETE) then 00042 call FinePreconditioner_complete_Apply(FP, sol, rhs) 00043 else if (FP%type==FINE_PRECONDITIONER_TYPE_SGS) then 00044 call FinePreconditioner_sgs_Apply(FP, sol, rhs) 00045 else 00046 call DOUG_abort("Unknown fine preconditioner type") 00047 end if 00048 end subroutine FinePreconditioner_Apply 00049 00050 end module Preconditioner_mod
1.7.3-20110217