| 1 |
/* ./src_f77/smoothd.f -- translated by f2c (version 20030320). |
| 2 |
You must link the resulting object file with the libraries: |
| 3 |
-lf2c -lm (in that order) |
| 4 |
*/ |
| 5 |
|
| 6 |
#include <punc/vf2c.h> |
| 7 |
|
| 8 |
/* Table of constant values */ |
| 9 |
|
| 10 |
static integer c__9 = 9; |
| 11 |
static integer c__1 = 1; |
| 12 |
|
| 13 |
/* * /////////////////////////////////////////////////////////////////////////// */ |
| 14 |
/* * @file smoothd.f */ |
| 15 |
/* * @author Michael Holst */ |
| 16 |
/* * @brief Generic linear smoothing iteration. */ |
| 17 |
/* * @version $Id: smoothd.c,v 1.3 2010/08/12 05:45:29 fetk Exp $ */ |
| 18 |
/* * @attention */ |
| 19 |
/* * @verbatim */ |
| 20 |
/* * */ |
| 21 |
/* * PMG -- Parallel algebraic MultiGrid */ |
| 22 |
/* * Copyright (C) 1994-- Michael Holst. */ |
| 23 |
/* * */ |
| 24 |
/* * Michael Holst <[email protected]> */ |
| 25 |
/* * University of California, San Diego */ |
| 26 |
/* * Department of Mathematics, 5739 AP&M */ |
| 27 |
/* * 9500 Gilman Drive, Dept. 0112 */ |
| 28 |
/* * La Jolla, CA 92093-0112 USA */ |
| 29 |
/* * http://math.ucsd.edu/~mholst */ |
| 30 |
/* * */ |
| 31 |
/* * This file is part of PMG. */ |
| 32 |
/* * */ |
| 33 |
/* * PMG is free software; you can redistribute it and/or modify */ |
| 34 |
/* * it under the terms of the GNU General Public License as published by */ |
| 35 |
/* * the Free Software Foundation; either version 2 of the License, or */ |
| 36 |
/* * (at your option) any later version. */ |
| 37 |
/* * */ |
| 38 |
/* * PMG is distributed in the hope that it will be useful, */ |
| 39 |
/* * but WITHOUT ANY WARRANTY; without even the implied warranty of */ |
| 40 |
/* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ |
| 41 |
/* * GNU General Public License for more details. */ |
| 42 |
/* * */ |
| 43 |
/* * You should have received a copy of the GNU General Public License */ |
| 44 |
/* * along with PMG; if not, write to the Free Software */ |
| 45 |
/* * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ |
| 46 |
/* * */ |
| 47 |
/* * Linking PMG statically or dynamically with other modules is making a */ |
| 48 |
/* * combined work based on PMG. Thus, the terms and conditions of the GNU */ |
| 49 |
/* * General Public License cover the whole combination. */ |
| 50 |
/* * */ |
| 51 |
/* * SPECIAL GPL EXCEPTION */ |
| 52 |
/* * In addition, as a special exception, the copyright holders of PMG */ |
| 53 |
/* * give you permission to combine the PMG program with free software */ |
| 54 |
/* * programs and libraries that are released under the GNU LGPL or with */ |
| 55 |
/* * code included in releases of ISIM, PMV, PyMOL, SMOL, VMD, and Vision. */ |
| 56 |
/* * Such combined software may be linked with PMG and redistributed together */ |
| 57 |
/* * in original or modified form as mere aggregation without requirement that */ |
| 58 |
/* * the entire work be under the scope of the GNU General Public License. */ |
| 59 |
/* * This special exception permission is also extended to any software listed */ |
| 60 |
/* * in the SPECIAL GPL EXCEPTION clauses by the FEtk and APBS libraries. */ |
| 61 |
/* * */ |
| 62 |
/* * Note that people who make modified versions of PMG are not obligated */ |
| 63 |
/* * to grant this special exception for their modified versions; it is */ |
| 64 |
/* * their choice whether to do so. The GNU General Public License gives */ |
| 65 |
/* * permission to release a modified version without this exception; this */ |
| 66 |
/* * exception also makes it possible to release a modified version which */ |
| 67 |
/* * carries forward this exception. */ |
| 68 |
/* * */ |
| 69 |
/* * @endverbatim */ |
| 70 |
/* * /////////////////////////////////////////////////////////////////////////// */ |
| 71 |
/* Subroutine */ int smooth_(integer *nx, integer *ny, integer *nz, integer * |
| 72 |
ipc, doublereal *rpc, doublereal *ac, doublereal *cc, doublereal *fc, |
| 73 |
doublereal *x, doublereal *w1, doublereal *w2, doublereal *r__, |
| 74 |
integer *itmax, integer *iters, doublereal *errtol, doublereal *omega, |
| 75 |
integer *iresid, integer *iadjoint, integer *meth) |
| 76 |
{ |
| 77 |
/* System generated locals */ |
| 78 |
integer ac_dim1, ac_offset, cc_dim1, cc_dim2, cc_offset, fc_dim1, fc_dim2, |
| 79 |
fc_offset, x_dim1, x_dim2, x_offset, w1_dim1, w1_dim2, w1_offset, |
| 80 |
w2_dim1, w2_dim2, w2_offset, r_dim1, r_dim2, r_offset; |
| 81 |
|
| 82 |
/* Builtin functions */ |
| 83 |
integer s_wsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), |
| 84 |
e_wsle(void); |
| 85 |
|
| 86 |
/* Local variables */ |
| 87 |
extern /* Subroutine */ int sor_(integer *, integer *, integer *, integer |
| 88 |
*, doublereal *, doublereal *, doublereal *, doublereal *, |
| 89 |
doublereal *, doublereal *, doublereal *, doublereal *, integer *, |
| 90 |
integer *, doublereal *, doublereal *, integer *, integer *), |
| 91 |
wjac_(integer *, integer *, integer *, integer *, doublereal *, |
| 92 |
doublereal *, doublereal *, doublereal *, doublereal *, |
| 93 |
doublereal *, doublereal *, doublereal *, integer *, integer *, |
| 94 |
doublereal *, doublereal *, integer *, integer *), rich_(integer * |
| 95 |
, integer *, integer *, integer *, doublereal *, doublereal *, |
| 96 |
doublereal *, doublereal *, doublereal *, doublereal *, |
| 97 |
doublereal *, doublereal *, integer *, integer *, doublereal *, |
| 98 |
doublereal *, integer *, integer *), cghs_(integer *, integer *, |
| 99 |
integer *, integer *, doublereal *, doublereal *, doublereal *, |
| 100 |
doublereal *, doublereal *, doublereal *, doublereal *, |
| 101 |
doublereal *, integer *, integer *, doublereal *, doublereal *, |
| 102 |
integer *, integer *), gsrb_(integer *, integer *, integer *, |
| 103 |
integer *, doublereal *, doublereal *, doublereal *, doublereal *, |
| 104 |
doublereal *, doublereal *, doublereal *, doublereal *, integer * |
| 105 |
, integer *, doublereal *, doublereal *, integer *, integer *); |
| 106 |
|
| 107 |
/* Fortran I/O blocks */ |
| 108 |
static cilist io___1 = { 0, 6, 0, 0, 0 }; |
| 109 |
|
| 110 |
|
| 111 |
/* * ********************************************************************* */ |
| 112 |
/* * purpose: */ |
| 113 |
/* * */ |
| 114 |
/* * call the appropriate linear smoothing routine. */ |
| 115 |
/* * */ |
| 116 |
/* * author: michael holst */ |
| 117 |
/* * ********************************************************************* */ |
| 118 |
/* * */ |
| 119 |
/* mdir 0 0 */ |
| 120 |
/* * */ |
| 121 |
/* * *** do in one step *** */ |
| 122 |
/* Parameter adjustments */ |
| 123 |
r_dim1 = *nx; |
| 124 |
r_dim2 = *ny; |
| 125 |
r_offset = 1 + r_dim1 * (1 + r_dim2); |
| 126 |
r__ -= r_offset; |
| 127 |
w2_dim1 = *nx; |
| 128 |
w2_dim2 = *ny; |
| 129 |
w2_offset = 1 + w2_dim1 * (1 + w2_dim2); |
| 130 |
w2 -= w2_offset; |
| 131 |
w1_dim1 = *nx; |
| 132 |
w1_dim2 = *ny; |
| 133 |
w1_offset = 1 + w1_dim1 * (1 + w1_dim2); |
| 134 |
w1 -= w1_offset; |
| 135 |
x_dim1 = *nx; |
| 136 |
x_dim2 = *ny; |
| 137 |
x_offset = 1 + x_dim1 * (1 + x_dim2); |
| 138 |
x -= x_offset; |
| 139 |
fc_dim1 = *nx; |
| 140 |
fc_dim2 = *ny; |
| 141 |
fc_offset = 1 + fc_dim1 * (1 + fc_dim2); |
| 142 |
fc -= fc_offset; |
| 143 |
cc_dim1 = *nx; |
| 144 |
cc_dim2 = *ny; |
| 145 |
cc_offset = 1 + cc_dim1 * (1 + cc_dim2); |
| 146 |
cc -= cc_offset; |
| 147 |
ac_dim1 = *nx * *ny * *nz; |
| 148 |
ac_offset = 1 + ac_dim1; |
| 149 |
ac -= ac_offset; |
| 150 |
--ipc; |
| 151 |
--rpc; |
| 152 |
|
| 153 |
/* Function Body */ |
| 154 |
if (*meth == 0) { |
| 155 |
wjac_(nx, ny, nz, &ipc[1], &rpc[1], &ac[ac_offset], &cc[cc_offset], & |
| 156 |
fc[fc_offset], &x[x_offset], &w1[w1_offset], &w2[w2_offset], & |
| 157 |
r__[r_offset], itmax, iters, errtol, omega, iresid, iadjoint); |
| 158 |
} else if (*meth == 1) { |
| 159 |
gsrb_(nx, ny, nz, &ipc[1], &rpc[1], &ac[ac_offset], &cc[cc_offset], & |
| 160 |
fc[fc_offset], &x[x_offset], &w1[w1_offset], &w2[w2_offset], & |
| 161 |
r__[r_offset], itmax, iters, errtol, omega, iresid, iadjoint); |
| 162 |
} else if (*meth == 2) { |
| 163 |
sor_(nx, ny, nz, &ipc[1], &rpc[1], &ac[ac_offset], &cc[cc_offset], & |
| 164 |
fc[fc_offset], &x[x_offset], &w1[w1_offset], &w2[w2_offset], & |
| 165 |
r__[r_offset], itmax, iters, errtol, omega, iresid, iadjoint); |
| 166 |
} else if (*meth == 3) { |
| 167 |
rich_(nx, ny, nz, &ipc[1], &rpc[1], &ac[ac_offset], &cc[cc_offset], & |
| 168 |
fc[fc_offset], &x[x_offset], &w1[w1_offset], &w2[w2_offset], & |
| 169 |
r__[r_offset], itmax, iters, errtol, omega, iresid, iadjoint); |
| 170 |
} else if (*meth == 4) { |
| 171 |
cghs_(nx, ny, nz, &ipc[1], &rpc[1], &ac[ac_offset], &cc[cc_offset], & |
| 172 |
fc[fc_offset], &x[x_offset], &w1[w1_offset], &w2[w2_offset], & |
| 173 |
r__[r_offset], itmax, iters, errtol, omega, iresid, iadjoint); |
| 174 |
} else { |
| 175 |
s_wsle(&io___1); |
| 176 |
do_lio(&c__9, &c__1, "% SMOOTH: bad smoothing routine specified...", ( |
| 177 |
ftnlen)44); |
| 178 |
e_wsle(); |
| 179 |
} |
| 180 |
/* * */ |
| 181 |
/* * *** return and end *** */ |
| 182 |
return 0; |
| 183 |
} /* smooth_ */ |
| 184 |
|