Debian Codegraph @

debian/external_deps/fetk/punc/src/pmg/nsmoothd.c

raw
1 /* ./src_f77/nsmoothd.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 nsmoothd.f */
15 /* * @author Michael Holst */
16 /* * @brief Generic nonlinear smoothing iteration. */
17 /* * @version $Id: nsmoothd.c,v 1.3 2010/08/12 05:45:27 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 nsmooth_(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 nsor_(integer *, integer *, integer *,
88 integer *, doublereal *, doublereal *, doublereal *, doublereal *,
89 doublereal *, doublereal *, doublereal *, doublereal *, integer *
90 , integer *, doublereal *, doublereal *, integer *, integer *),
91 nwjac_(integer *, integer *, integer *, integer *, doublereal *,
92 doublereal *, doublereal *, doublereal *, doublereal *,
93 doublereal *, doublereal *, doublereal *, integer *, integer *,
94 doublereal *, doublereal *, integer *, integer *), nrich_(integer
95 *, integer *, integer *, integer *, doublereal *, doublereal *,
96 doublereal *, doublereal *, doublereal *, doublereal *,
97 doublereal *, doublereal *, integer *, integer *, doublereal *,
98 doublereal *, integer *, integer *), ngsrb_(integer *, integer *,
99 integer *, integer *, doublereal *, doublereal *, doublereal *,
100 doublereal *, doublereal *, doublereal *, doublereal *,
101 doublereal *, integer *, integer *, doublereal *, doublereal *,
102 integer *, integer *);
103
104 /* Fortran I/O blocks */
105 static cilist io___1 = { 0, 6, 0, 0, 0 };
106
107
108 /* * ********************************************************************* */
109 /* * purpose: */
110 /* * */
111 /* * call the appropriate nonlinear smoothing routine. */
112 /* * */
113 /* * author: michael holst */
114 /* * ********************************************************************* */
115 /* * */
116 /* mdir 0 0 */
117 /* * */
118 /* * *** do in one step *** */
119 /* Parameter adjustments */
120 r_dim1 = *nx;
121 r_dim2 = *ny;
122 r_offset = 1 + r_dim1 * (1 + r_dim2);
123 r__ -= r_offset;
124 w2_dim1 = *nx;
125 w2_dim2 = *ny;
126 w2_offset = 1 + w2_dim1 * (1 + w2_dim2);
127 w2 -= w2_offset;
128 w1_dim1 = *nx;
129 w1_dim2 = *ny;
130 w1_offset = 1 + w1_dim1 * (1 + w1_dim2);
131 w1 -= w1_offset;
132 x_dim1 = *nx;
133 x_dim2 = *ny;
134 x_offset = 1 + x_dim1 * (1 + x_dim2);
135 x -= x_offset;
136 fc_dim1 = *nx;
137 fc_dim2 = *ny;
138 fc_offset = 1 + fc_dim1 * (1 + fc_dim2);
139 fc -= fc_offset;
140 cc_dim1 = *nx;
141 cc_dim2 = *ny;
142 cc_offset = 1 + cc_dim1 * (1 + cc_dim2);
143 cc -= cc_offset;
144 ac_dim1 = *nx * *ny * *nz;
145 ac_offset = 1 + ac_dim1;
146 ac -= ac_offset;
147 --ipc;
148 --rpc;
149
150 /* Function Body */
151 if (*meth == 0) {
152 nwjac_(nx, ny, nz, &ipc[1], &rpc[1], &ac[ac_offset], &cc[cc_offset], &
153 fc[fc_offset], &x[x_offset], &w1[w1_offset], &w2[w2_offset], &
154 r__[r_offset], itmax, iters, errtol, omega, iresid, iadjoint);
155 } else if (*meth == 1) {
156 ngsrb_(nx, ny, nz, &ipc[1], &rpc[1], &ac[ac_offset], &cc[cc_offset], &
157 fc[fc_offset], &x[x_offset], &w1[w1_offset], &w2[w2_offset], &
158 r__[r_offset], itmax, iters, errtol, omega, iresid, iadjoint);
159 } else if (*meth == 2) {
160 nsor_(nx, ny, nz, &ipc[1], &rpc[1], &ac[ac_offset], &cc[cc_offset], &
161 fc[fc_offset], &x[x_offset], &w1[w1_offset], &w2[w2_offset], &
162 r__[r_offset], itmax, iters, errtol, omega, iresid, iadjoint);
163 } else if (*meth == 3) {
164 nrich_(nx, ny, nz, &ipc[1], &rpc[1], &ac[ac_offset], &cc[cc_offset], &
165 fc[fc_offset], &x[x_offset], &w1[w1_offset], &w2[w2_offset], &
166 r__[r_offset], itmax, iters, errtol, omega, iresid, iadjoint);
167 } else {
168 s_wsle(&io___1);
169 do_lio(&c__9, &c__1, "% NSMOOTH: bad smoothing routine specified...",
170 (ftnlen)45);
171 e_wsle();
172 }
173 /* * */
174 /* * *** return and end *** */
175 return 0;
176 } /* nsmooth_ */
177