| 1 |
c* /////////////////////////////////////////////////////////////////////////// |
| 2 |
c* @file smoothd.f |
| 3 |
c* @author Michael Holst |
| 4 |
c* @brief Generic linear smoothing iteration. |
| 5 |
c* @version $Id: smoothd.f,v 1.2 2010/08/12 05:45:41 fetk Exp $ |
| 6 |
c* @attention |
| 7 |
c* @verbatim |
| 8 |
c* |
| 9 |
c* PMG -- Parallel algebraic MultiGrid |
| 10 |
c* Copyright (C) 1994-- Michael Holst. |
| 11 |
c* |
| 12 |
c* Michael Holst <[email protected]> |
| 13 |
c* University of California, San Diego |
| 14 |
c* Department of Mathematics, 5739 AP&M |
| 15 |
c* 9500 Gilman Drive, Dept. 0112 |
| 16 |
c* La Jolla, CA 92093-0112 USA |
| 17 |
c* http://math.ucsd.edu/~mholst |
| 18 |
c* |
| 19 |
c* This file is part of PMG. |
| 20 |
c* |
| 21 |
c* PMG is free software; you can redistribute it and/or modify |
| 22 |
c* it under the terms of the GNU General Public License as published by |
| 23 |
c* the Free Software Foundation; either version 2 of the License, or |
| 24 |
c* (at your option) any later version. |
| 25 |
c* |
| 26 |
c* PMG is distributed in the hope that it will be useful, |
| 27 |
c* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 28 |
c* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 29 |
c* GNU General Public License for more details. |
| 30 |
c* |
| 31 |
c* You should have received a copy of the GNU General Public License |
| 32 |
c* along with PMG; if not, write to the Free Software |
| 33 |
c* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 34 |
c* |
| 35 |
c* Linking PMG statically or dynamically with other modules is making a |
| 36 |
c* combined work based on PMG. Thus, the terms and conditions of the GNU |
| 37 |
c* General Public License cover the whole combination. |
| 38 |
c* |
| 39 |
c* SPECIAL GPL EXCEPTION |
| 40 |
c* In addition, as a special exception, the copyright holders of PMG |
| 41 |
c* give you permission to combine the PMG program with free software |
| 42 |
c* programs and libraries that are released under the GNU LGPL or with |
| 43 |
c* code included in releases of ISIM, PMV, PyMOL, SMOL, VMD, and Vision. |
| 44 |
c* Such combined software may be linked with PMG and redistributed together |
| 45 |
c* in original or modified form as mere aggregation without requirement that |
| 46 |
c* the entire work be under the scope of the GNU General Public License. |
| 47 |
c* This special exception permission is also extended to any software listed |
| 48 |
c* in the SPECIAL GPL EXCEPTION clauses by the FEtk and APBS libraries. |
| 49 |
c* |
| 50 |
c* Note that people who make modified versions of PMG are not obligated |
| 51 |
c* to grant this special exception for their modified versions; it is |
| 52 |
c* their choice whether to do so. The GNU General Public License gives |
| 53 |
c* permission to release a modified version without this exception; this |
| 54 |
c* exception also makes it possible to release a modified version which |
| 55 |
c* carries forward this exception. |
| 56 |
c* |
| 57 |
c* @endverbatim |
| 58 |
c* /////////////////////////////////////////////////////////////////////////// |
| 59 |
subroutine smooth(nx,ny,nz,ipc,rpc,ac,cc,fc,x,w1,w2,r, |
| 60 |
2 itmax,iters,errtol,omega,iresid,iadjoint,meth) |
| 61 |
c* ********************************************************************* |
| 62 |
c* purpose: |
| 63 |
c* |
| 64 |
c* call the appropriate linear smoothing routine. |
| 65 |
c* |
| 66 |
c* author: michael holst |
| 67 |
c* ********************************************************************* |
| 68 |
implicit none |
| 69 |
integer ipc(*),itmax,iters,iresid,iadjoint,nx,ny,nz,meth |
| 70 |
double precision omega,errtol |
| 71 |
double precision rpc(*),ac(nx*ny*nz,*),cc(nx,ny,nz),fc(nx,ny,nz) |
| 72 |
double precision x(nx,ny,nz),w1(nx,ny,nz),w2(nx,ny,nz) |
| 73 |
double precision r(nx,ny,nz) |
| 74 |
c* |
| 75 |
cmdir 0 0 |
| 76 |
c* |
| 77 |
c* *** do in one step *** |
| 78 |
if (meth .eq. 0) then |
| 79 |
call wjac(nx,ny,nz,ipc,rpc,ac,cc,fc,x,w1,w2,r, |
| 80 |
2 itmax,iters,errtol,omega,iresid,iadjoint) |
| 81 |
elseif (meth .eq. 1) then |
| 82 |
call gsrb(nx,ny,nz,ipc,rpc,ac,cc,fc,x,w1,w2,r, |
| 83 |
2 itmax,iters,errtol,omega,iresid,iadjoint) |
| 84 |
elseif (meth .eq. 2) then |
| 85 |
call sor(nx,ny,nz,ipc,rpc,ac,cc,fc,x,w1,w2,r, |
| 86 |
2 itmax,iters,errtol,omega,iresid,iadjoint) |
| 87 |
elseif (meth .eq. 3) then |
| 88 |
call rich(nx,ny,nz,ipc,rpc,ac,cc,fc,x,w1,w2,r, |
| 89 |
2 itmax,iters,errtol,omega,iresid,iadjoint) |
| 90 |
elseif (meth .eq. 4) then |
| 91 |
call cghs(nx,ny,nz,ipc,rpc,ac,cc,fc,x,w1,w2,r, |
| 92 |
2 itmax,iters,errtol,omega,iresid,iadjoint) |
| 93 |
else |
| 94 |
print*,'% SMOOTH: bad smoothing routine specified...' |
| 95 |
endif |
| 96 |
c* |
| 97 |
c* *** return and end *** |
| 98 |
return |
| 99 |
end |
| 100 |
|