DOUG 0.2

FinePreconditioner_complete.F90

Go to the documentation of this file.
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 FinePreconditioner_complete_mod
00024   use Preconditioner_base_mod
00025   use subsolvers
00026 
00027   implicit none
00028 
00029 contains
00031   subroutine FinePreconditioner_complete_Init(FP)
00032     type(FinePreconditioner),intent(inout) :: FP
00033     
00034     FP%type = FINE_PRECONDITIONER_TYPE_COMPLETE
00035     allocate(FP%complete)
00036     FP%complete%factored = .false.
00037     FP%complete%nsubsolves = 0
00038     FP%complete%subsolve_ids => NULL()
00039   end subroutine FinePreconditioner_complete_Init
00040 
00042   subroutine FinePreconditioner_complete_Apply(FP, sol, rhs)
00043     type(FinePreconditioner),intent(inout) :: FP
00044     real(kind=rk),dimension(:),pointer :: sol !< solution
00045     real(kind=rk),dimension(:),pointer :: rhs !< right hand side
00046     
00047     if (.not.FP%complete%factored) then!{
00048       if (sctls%verbose>4) write(stream,*) "Factorizing 1. level"
00049       call Factorise_subdomains(FP%domains, FP%distr%A, FP%distr%A_ghost, &
00050            FP%complete%subsolve_ids)
00051       FP%complete%factored=.true.
00052     end if
00053 
00054     ! solve
00055     if (sctls%verbose>4) write(stream,*) "Solving 1. level"
00056     call solve_subdomains(sol,FP%domains,FP%complete%subsolve_ids,rhs)
00057 
00058   end subroutine FinePreconditioner_complete_Apply
00059 end module FinePreconditioner_complete_mod