| 1 |
/* ./src_f77/buildBd.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 |
static integer c__3 = 3; |
| 13 |
|
| 14 |
/* * /////////////////////////////////////////////////////////////////////////// */ |
| 15 |
/* * @file buildBd.f */ |
| 16 |
/* * @author Michael Holst */ |
| 17 |
/* * @brief Routines to build/factor/store a banded coarse grid matrix. */ |
| 18 |
/* * @version $Id: buildBd.c,v 1.3 2010/08/12 05:45:19 fetk Exp $ */ |
| 19 |
/* * @attention */ |
| 20 |
/* * @verbatim */ |
| 21 |
/* * */ |
| 22 |
/* * PMG -- Parallel algebraic MultiGrid */ |
| 23 |
/* * Copyright (C) 1994-- Michael Holst. */ |
| 24 |
/* * */ |
| 25 |
/* * Michael Holst <[email protected]> */ |
| 26 |
/* * University of California, San Diego */ |
| 27 |
/* * Department of Mathematics, 5739 AP&M */ |
| 28 |
/* * 9500 Gilman Drive, Dept. 0112 */ |
| 29 |
/* * La Jolla, CA 92093-0112 USA */ |
| 30 |
/* * http://math.ucsd.edu/~mholst */ |
| 31 |
/* * */ |
| 32 |
/* * This file is part of PMG. */ |
| 33 |
/* * */ |
| 34 |
/* * PMG is free software; you can redistribute it and/or modify */ |
| 35 |
/* * it under the terms of the GNU General Public License as published by */ |
| 36 |
/* * the Free Software Foundation; either version 2 of the License, or */ |
| 37 |
/* * (at your option) any later version. */ |
| 38 |
/* * */ |
| 39 |
/* * PMG is distributed in the hope that it will be useful, */ |
| 40 |
/* * but WITHOUT ANY WARRANTY; without even the implied warranty of */ |
| 41 |
/* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ |
| 42 |
/* * GNU General Public License for more details. */ |
| 43 |
/* * */ |
| 44 |
/* * You should have received a copy of the GNU General Public License */ |
| 45 |
/* * along with PMG; if not, write to the Free Software */ |
| 46 |
/* * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ |
| 47 |
/* * */ |
| 48 |
/* * Linking PMG statically or dynamically with other modules is making a */ |
| 49 |
/* * combined work based on PMG. Thus, the terms and conditions of the GNU */ |
| 50 |
/* * General Public License cover the whole combination. */ |
| 51 |
/* * */ |
| 52 |
/* * SPECIAL GPL EXCEPTION */ |
| 53 |
/* * In addition, as a special exception, the copyright holders of PMG */ |
| 54 |
/* * give you permission to combine the PMG program with free software */ |
| 55 |
/* * programs and libraries that are released under the GNU LGPL or with */ |
| 56 |
/* * code included in releases of ISIM, PMV, PyMOL, SMOL, VMD, and Vision. */ |
| 57 |
/* * Such combined software may be linked with PMG and redistributed together */ |
| 58 |
/* * in original or modified form as mere aggregation without requirement that */ |
| 59 |
/* * the entire work be under the scope of the GNU General Public License. */ |
| 60 |
/* * This special exception permission is also extended to any software listed */ |
| 61 |
/* * in the SPECIAL GPL EXCEPTION clauses by the FEtk and APBS libraries. */ |
| 62 |
/* * */ |
| 63 |
/* * Note that people who make modified versions of PMG are not obligated */ |
| 64 |
/* * to grant this special exception for their modified versions; it is */ |
| 65 |
/* * their choice whether to do so. The GNU General Public License gives */ |
| 66 |
/* * permission to release a modified version without this exception; this */ |
| 67 |
/* * exception also makes it possible to release a modified version which */ |
| 68 |
/* * carries forward this exception. */ |
| 69 |
/* * */ |
| 70 |
/* * @endverbatim */ |
| 71 |
/* * /////////////////////////////////////////////////////////////////////////// */ |
| 72 |
/* Subroutine */ int buildband_(integer *key, integer *nx, integer *ny, |
| 73 |
integer *nz, integer *ipc, doublereal *rpc, doublereal *ac, integer * |
| 74 |
ipcb, doublereal *rpcb, doublereal *acb) |
| 75 |
{ |
| 76 |
/* System generated locals */ |
| 77 |
integer ac_dim1, ac_offset; |
| 78 |
|
| 79 |
/* Builtin functions */ |
| 80 |
integer s_wsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), |
| 81 |
e_wsle(void); |
| 82 |
|
| 83 |
/* Local variables */ |
| 84 |
static integer m, n, lda; |
| 85 |
extern /* Subroutine */ int buildband1_7__(integer *, integer *, integer * |
| 86 |
, integer *, doublereal *, doublereal *, doublereal *, doublereal |
| 87 |
*, doublereal *, integer *, doublereal *, doublereal *, integer *, |
| 88 |
integer *, integer *), buildband1_27__(integer *, integer *, |
| 89 |
integer *, integer *, doublereal *, doublereal *, doublereal *, |
| 90 |
doublereal *, doublereal *, doublereal *, doublereal *, |
| 91 |
doublereal *, doublereal *, doublereal *, doublereal *, |
| 92 |
doublereal *, doublereal *, doublereal *, doublereal *, integer *, |
| 93 |
doublereal *, doublereal *, integer *, integer *, integer *); |
| 94 |
static integer info; |
| 95 |
extern /* Subroutine */ int dpbfa_(doublereal *, integer *, integer *, |
| 96 |
integer *, integer *); |
| 97 |
static integer numdia; |
| 98 |
|
| 99 |
/* Fortran I/O blocks */ |
| 100 |
static cilist io___2 = { 0, 6, 0, 0, 0 }; |
| 101 |
static cilist io___6 = { 0, 6, 0, 0, 0 }; |
| 102 |
static cilist io___7 = { 0, 6, 0, 0, 0 }; |
| 103 |
static cilist io___9 = { 0, 6, 0, 0, 0 }; |
| 104 |
static cilist io___10 = { 0, 6, 0, 0, 0 }; |
| 105 |
static cilist io___11 = { 0, 6, 0, 0, 0 }; |
| 106 |
static cilist io___12 = { 0, 6, 0, 0, 0 }; |
| 107 |
|
| 108 |
|
| 109 |
/* * ********************************************************************* */ |
| 110 |
/* * purpose: */ |
| 111 |
/* * */ |
| 112 |
/* * build and factor a banded matrix given a matrix in diagonal form. */ |
| 113 |
/* * */ |
| 114 |
/* * author: michael holst */ |
| 115 |
/* * ********************************************************************* */ |
| 116 |
/* ZZZZ double precision rcond */ |
| 117 |
/* * */ |
| 118 |
/* mdir 0 0 */ |
| 119 |
/* * */ |
| 120 |
/* * *** do in one step *** */ |
| 121 |
/* Parameter adjustments */ |
| 122 |
ac_dim1 = *nx * *ny * *nz; |
| 123 |
ac_offset = 1 + ac_dim1; |
| 124 |
ac -= ac_offset; |
| 125 |
--ipc; |
| 126 |
--rpc; |
| 127 |
--ipcb; |
| 128 |
--rpcb; |
| 129 |
--acb; |
| 130 |
|
| 131 |
/* Function Body */ |
| 132 |
numdia = ipc[11]; |
| 133 |
if (numdia == 7) { |
| 134 |
s_wsle(&io___2); |
| 135 |
do_lio(&c__9, &c__1, "% BUILDBAND: building 7-pt banded coarse opera" |
| 136 |
"tor...", (ftnlen)52); |
| 137 |
e_wsle(); |
| 138 |
n = (*nx - 2) * (*ny - 2) * (*nz - 2); |
| 139 |
m = (*nx - 2) * (*ny - 2); |
| 140 |
lda = m + 1; |
| 141 |
buildband1_7__(nx, ny, nz, &ipc[1], &rpc[1], &ac[ac_dim1 + 1], &ac[( |
| 142 |
ac_dim1 << 1) + 1], &ac[ac_dim1 * 3 + 1], &ac[(ac_dim1 << 2) |
| 143 |
+ 1], &ipcb[1], &rpcb[1], &acb[1], &n, &m, &lda); |
| 144 |
} else if (numdia == 27) { |
| 145 |
s_wsle(&io___6); |
| 146 |
do_lio(&c__9, &c__1, "% BUILDBAND: building 27-pt banded coarse oper" |
| 147 |
"ator...", (ftnlen)53); |
| 148 |
e_wsle(); |
| 149 |
n = (*nx - 2) * (*ny - 2) * (*nz - 2); |
| 150 |
m = (*nx - 2) * (*ny - 2) + (*nx - 2) + 1; |
| 151 |
lda = m + 1; |
| 152 |
buildband1_27__(nx, ny, nz, &ipc[1], &rpc[1], &ac[ac_dim1 + 1], &ac[( |
| 153 |
ac_dim1 << 1) + 1], &ac[ac_dim1 * 3 + 1], &ac[(ac_dim1 << 2) |
| 154 |
+ 1], &ac[ac_dim1 * 5 + 1], &ac[ac_dim1 * 6 + 1], &ac[ac_dim1 |
| 155 |
* 7 + 1], &ac[(ac_dim1 << 3) + 1], &ac[ac_dim1 * 9 + 1], &ac[ |
| 156 |
ac_dim1 * 10 + 1], &ac[ac_dim1 * 11 + 1], &ac[ac_dim1 * 12 + |
| 157 |
1], &ac[ac_dim1 * 13 + 1], &ac[ac_dim1 * 14 + 1], &ipcb[1], & |
| 158 |
rpcb[1], &acb[1], &n, &m, &lda); |
| 159 |
} else { |
| 160 |
s_wsle(&io___7); |
| 161 |
do_lio(&c__9, &c__1, "% BUILDBAND: invalid stencil type given...", ( |
| 162 |
ftnlen)42); |
| 163 |
e_wsle(); |
| 164 |
} |
| 165 |
/* * */ |
| 166 |
/* * *** print matrices *** */ |
| 167 |
/* ZZZZ call prtmatd(nx,ny,nz,ipc,rpc,ac) */ |
| 168 |
/* ZZZZ call prtmatb(acB,n,m,lda) */ |
| 169 |
/* * */ |
| 170 |
/* * *** factor the system *** */ |
| 171 |
*key = 0; |
| 172 |
info = 0; |
| 173 |
s_wsle(&io___9); |
| 174 |
do_lio(&c__9, &c__1, "% BUILDBAND: dpbfa factoring banded coarse system." |
| 175 |
"..", (ftnlen)52); |
| 176 |
e_wsle(); |
| 177 |
dpbfa_(&acb[1], &lda, &n, &m, &info); |
| 178 |
/* ZZZZ call dpbco(acB,lda,n,m,rcond,w1,info) */ |
| 179 |
ipcb[4] = 1; |
| 180 |
if (info != 0) { |
| 181 |
/* ZZZZ print*,'% BUILDBAND: dpbco rcond: ',rcond */ |
| 182 |
s_wsle(&io___10); |
| 183 |
do_lio(&c__9, &c__1, "% BUILDBAND: dpbfa problem: ", (ftnlen)28); |
| 184 |
do_lio(&c__3, &c__1, (char *)&info, (ftnlen)sizeof(integer)); |
| 185 |
e_wsle(); |
| 186 |
s_wsle(&io___11); |
| 187 |
do_lio(&c__9, &c__1, "% BUILDBAND: leading principle minor not PD...", |
| 188 |
(ftnlen)46); |
| 189 |
e_wsle(); |
| 190 |
*key = 1; |
| 191 |
} |
| 192 |
s_wsle(&io___12); |
| 193 |
do_lio(&c__9, &c__1, "% BUILDBAND: dpbfa banded factorization complete.", |
| 194 |
(ftnlen)49); |
| 195 |
e_wsle(); |
| 196 |
/* * */ |
| 197 |
/* * *** return and end *** */ |
| 198 |
return 0; |
| 199 |
} /* buildband_ */ |
| 200 |
|
| 201 |
/* Subroutine */ int buildband1_7__(integer *nx, integer *ny, integer *nz, |
| 202 |
integer *ipc, doublereal *rpc, doublereal *oc, doublereal *oe, |
| 203 |
doublereal *on, doublereal *uc, integer *ipcb, doublereal *rpcb, |
| 204 |
doublereal *acb, integer *n, integer *m, integer *lda) |
| 205 |
{ |
| 206 |
/* System generated locals */ |
| 207 |
integer acb_dim1, acb_offset, oc_dim1, oc_dim2, oc_offset, oe_dim1, |
| 208 |
oe_dim2, oe_offset, on_dim1, on_dim2, on_offset, uc_dim1, uc_dim2, |
| 209 |
uc_offset, i__1, i__2, i__3; |
| 210 |
|
| 211 |
/* Local variables */ |
| 212 |
static integer i__, j, k, ii, jj, kk; |
| 213 |
|
| 214 |
/* * ********************************************************************* */ |
| 215 |
/* * purpose: */ |
| 216 |
/* * */ |
| 217 |
/* * build the operator in banded form given the 7-diagonal form. */ |
| 218 |
/* * */ |
| 219 |
/* * notes: */ |
| 220 |
/* * */ |
| 221 |
/* * pseudo-code from the banded linpack routines: */ |
| 222 |
/* * */ |
| 223 |
/* * jj = 0 */ |
| 224 |
/* * do 10 k = 2, nz-1 */ |
| 225 |
/* * do 10 j = 2, ny-1 */ |
| 226 |
/* * do 10 i = 2, nx-1 */ |
| 227 |
/* * jj = jj + 1 */ |
| 228 |
/* * i1 = max0(1, jj-m) */ |
| 229 |
/* * do 20 ii = i1, jj */ |
| 230 |
/* * kk = ii - jj + m + 1 */ |
| 231 |
/* * acB(kk,jj) = 0.0e0 */ |
| 232 |
/* * if ((jj-ii).eq.0) acB(kk,jj)=oC(i,j,k) */ |
| 233 |
/* * if ((jj-ii).eq.1) acB(kk,jj)=-oE(i-1,j,k) */ |
| 234 |
/* * if ((jj-ii).eq.(nx-2)) acB(kk,jj)=-oN(i,j-1,k) */ |
| 235 |
/* * if ((jj-ii).eq.(nx-2)*(ny-2)) acB(kk,jj)=-uC(i,j,k-1) */ |
| 236 |
/* * 20 continue */ |
| 237 |
/* * 10 continue */ |
| 238 |
/* * */ |
| 239 |
/* * author: michael holst */ |
| 240 |
/* * ********************************************************************* */ |
| 241 |
/* * */ |
| 242 |
/* mdir 0 0 */ |
| 243 |
/* * */ |
| 244 |
/* * *** doit *** */ |
| 245 |
/* Parameter adjustments */ |
| 246 |
uc_dim1 = *nx; |
| 247 |
uc_dim2 = *ny; |
| 248 |
uc_offset = 1 + uc_dim1 * (1 + uc_dim2); |
| 249 |
uc -= uc_offset; |
| 250 |
on_dim1 = *nx; |
| 251 |
on_dim2 = *ny; |
| 252 |
on_offset = 1 + on_dim1 * (1 + on_dim2); |
| 253 |
on -= on_offset; |
| 254 |
oe_dim1 = *nx; |
| 255 |
oe_dim2 = *ny; |
| 256 |
oe_offset = 1 + oe_dim1 * (1 + oe_dim2); |
| 257 |
oe -= oe_offset; |
| 258 |
oc_dim1 = *nx; |
| 259 |
oc_dim2 = *ny; |
| 260 |
oc_offset = 1 + oc_dim1 * (1 + oc_dim2); |
| 261 |
oc -= oc_offset; |
| 262 |
--ipc; |
| 263 |
--rpc; |
| 264 |
--ipcb; |
| 265 |
--rpcb; |
| 266 |
acb_dim1 = *lda; |
| 267 |
acb_offset = 1 + acb_dim1; |
| 268 |
acb -= acb_offset; |
| 269 |
|
| 270 |
/* Function Body */ |
| 271 |
ipcb[1] = *n; |
| 272 |
ipcb[2] = *m; |
| 273 |
ipcb[3] = *lda; |
| 274 |
ipcb[4] = 0; |
| 275 |
jj = 0; |
| 276 |
/* mdir 3 1 */ |
| 277 |
i__1 = *nz - 1; |
| 278 |
for (k = 2; k <= i__1; ++k) { |
| 279 |
/* mdir 3 2 */ |
| 280 |
i__2 = *ny - 1; |
| 281 |
for (j = 2; j <= i__2; ++j) { |
| 282 |
/* mdir 3 3 */ |
| 283 |
i__3 = *nx - 1; |
| 284 |
for (i__ = 2; i__ <= i__3; ++i__) { |
| 285 |
++jj; |
| 286 |
/* * */ |
| 287 |
/* * *** diagonal term *** */ |
| 288 |
ii = jj; |
| 289 |
kk = ii - jj + *m + 1; |
| 290 |
acb[kk + jj * acb_dim1] = oc[i__ + (j + k * oc_dim2) * |
| 291 |
oc_dim1]; |
| 292 |
/* * */ |
| 293 |
/* * *** east neighbor *** */ |
| 294 |
ii = jj - 1; |
| 295 |
kk = ii - jj + *m + 1; |
| 296 |
acb[kk + jj * acb_dim1] = -oe[i__ - 1 + (j + k * oe_dim2) * |
| 297 |
oe_dim1]; |
| 298 |
/* * */ |
| 299 |
/* * *** north neighbor *** */ |
| 300 |
ii = jj - (*nx - 2); |
| 301 |
kk = ii - jj + *m + 1; |
| 302 |
acb[kk + jj * acb_dim1] = -on[i__ + (j - 1 + k * on_dim2) * |
| 303 |
on_dim1]; |
| 304 |
/* * */ |
| 305 |
/* * *** up neighbor *** */ |
| 306 |
ii = jj - (*nx - 2) * (*ny - 2); |
| 307 |
kk = ii - jj + *m + 1; |
| 308 |
acb[kk + jj * acb_dim1] = -uc[i__ + (j + (k - 1) * uc_dim2) * |
| 309 |
uc_dim1]; |
| 310 |
/* L12: */ |
| 311 |
} |
| 312 |
/* L11: */ |
| 313 |
} |
| 314 |
/* L10: */ |
| 315 |
} |
| 316 |
/* * */ |
| 317 |
/* * *** return and end *** */ |
| 318 |
return 0; |
| 319 |
} /* buildband1_7__ */ |
| 320 |
|
| 321 |
/* Subroutine */ int buildband1_27__(integer *nx, integer *ny, integer *nz, |
| 322 |
integer *ipc, doublereal *rpc, doublereal *oc, doublereal *oe, |
| 323 |
doublereal *on, doublereal *uc, doublereal *one, doublereal *onw, |
| 324 |
doublereal *ue, doublereal *uw, doublereal *un, doublereal *us, |
| 325 |
doublereal *une, doublereal *unw, doublereal *use, doublereal *usw, |
| 326 |
integer *ipcb, doublereal *rpcb, doublereal *acb, integer *n, integer |
| 327 |
*m, integer *lda) |
| 328 |
{ |
| 329 |
/* System generated locals */ |
| 330 |
integer acb_dim1, acb_offset, oc_dim1, oc_dim2, oc_offset, oe_dim1, |
| 331 |
oe_dim2, oe_offset, on_dim1, on_dim2, on_offset, uc_dim1, uc_dim2, |
| 332 |
uc_offset, one_dim1, one_dim2, one_offset, onw_dim1, onw_dim2, |
| 333 |
onw_offset, ue_dim1, ue_dim2, ue_offset, uw_dim1, uw_dim2, |
| 334 |
uw_offset, un_dim1, un_dim2, un_offset, us_dim1, us_dim2, |
| 335 |
us_offset, une_dim1, une_dim2, une_offset, unw_dim1, unw_dim2, |
| 336 |
unw_offset, use_dim1, use_dim2, use_offset, usw_dim1, usw_dim2, |
| 337 |
usw_offset, i__1, i__2, i__3; |
| 338 |
|
| 339 |
/* Local variables */ |
| 340 |
static integer i__, j, k, ii, jj, kk; |
| 341 |
|
| 342 |
/* * ********************************************************************* */ |
| 343 |
/* * purpose: */ |
| 344 |
/* * */ |
| 345 |
/* * build the operator in banded form given the 27-diagonal form. */ |
| 346 |
/* * */ |
| 347 |
/* * author: michael holst */ |
| 348 |
/* * ********************************************************************* */ |
| 349 |
/* * */ |
| 350 |
/* mdir 0 0 */ |
| 351 |
/* * */ |
| 352 |
/* * *** doit *** */ |
| 353 |
/* Parameter adjustments */ |
| 354 |
usw_dim1 = *nx; |
| 355 |
usw_dim2 = *ny; |
| 356 |
usw_offset = 1 + usw_dim1 * (1 + usw_dim2); |
| 357 |
usw -= usw_offset; |
| 358 |
use_dim1 = *nx; |
| 359 |
use_dim2 = *ny; |
| 360 |
use_offset = 1 + use_dim1 * (1 + use_dim2); |
| 361 |
use -= use_offset; |
| 362 |
unw_dim1 = *nx; |
| 363 |
unw_dim2 = *ny; |
| 364 |
unw_offset = 1 + unw_dim1 * (1 + unw_dim2); |
| 365 |
unw -= unw_offset; |
| 366 |
une_dim1 = *nx; |
| 367 |
une_dim2 = *ny; |
| 368 |
une_offset = 1 + une_dim1 * (1 + une_dim2); |
| 369 |
une -= une_offset; |
| 370 |
us_dim1 = *nx; |
| 371 |
us_dim2 = *ny; |
| 372 |
us_offset = 1 + us_dim1 * (1 + us_dim2); |
| 373 |
us -= us_offset; |
| 374 |
un_dim1 = *nx; |
| 375 |
un_dim2 = *ny; |
| 376 |
un_offset = 1 + un_dim1 * (1 + un_dim2); |
| 377 |
un -= un_offset; |
| 378 |
uw_dim1 = *nx; |
| 379 |
uw_dim2 = *ny; |
| 380 |
uw_offset = 1 + uw_dim1 * (1 + uw_dim2); |
| 381 |
uw -= uw_offset; |
| 382 |
ue_dim1 = *nx; |
| 383 |
ue_dim2 = *ny; |
| 384 |
ue_offset = 1 + ue_dim1 * (1 + ue_dim2); |
| 385 |
ue -= ue_offset; |
| 386 |
onw_dim1 = *nx; |
| 387 |
onw_dim2 = *ny; |
| 388 |
onw_offset = 1 + onw_dim1 * (1 + onw_dim2); |
| 389 |
onw -= onw_offset; |
| 390 |
one_dim1 = *nx; |
| 391 |
one_dim2 = *ny; |
| 392 |
one_offset = 1 + one_dim1 * (1 + one_dim2); |
| 393 |
one -= one_offset; |
| 394 |
uc_dim1 = *nx; |
| 395 |
uc_dim2 = *ny; |
| 396 |
uc_offset = 1 + uc_dim1 * (1 + uc_dim2); |
| 397 |
uc -= uc_offset; |
| 398 |
on_dim1 = *nx; |
| 399 |
on_dim2 = *ny; |
| 400 |
on_offset = 1 + on_dim1 * (1 + on_dim2); |
| 401 |
on -= on_offset; |
| 402 |
oe_dim1 = *nx; |
| 403 |
oe_dim2 = *ny; |
| 404 |
oe_offset = 1 + oe_dim1 * (1 + oe_dim2); |
| 405 |
oe -= oe_offset; |
| 406 |
oc_dim1 = *nx; |
| 407 |
oc_dim2 = *ny; |
| 408 |
oc_offset = 1 + oc_dim1 * (1 + oc_dim2); |
| 409 |
oc -= oc_offset; |
| 410 |
--ipc; |
| 411 |
--rpc; |
| 412 |
--ipcb; |
| 413 |
--rpcb; |
| 414 |
acb_dim1 = *lda; |
| 415 |
acb_offset = 1 + acb_dim1; |
| 416 |
acb -= acb_offset; |
| 417 |
|
| 418 |
/* Function Body */ |
| 419 |
ipcb[1] = *n; |
| 420 |
ipcb[2] = *m; |
| 421 |
ipcb[3] = *lda; |
| 422 |
ipcb[4] = 0; |
| 423 |
jj = 0; |
| 424 |
/* mdir 3 1 */ |
| 425 |
i__1 = *nz - 1; |
| 426 |
for (k = 2; k <= i__1; ++k) { |
| 427 |
/* mdir 3 2 */ |
| 428 |
i__2 = *ny - 1; |
| 429 |
for (j = 2; j <= i__2; ++j) { |
| 430 |
/* mdir 3 3 */ |
| 431 |
i__3 = *nx - 1; |
| 432 |
for (i__ = 2; i__ <= i__3; ++i__) { |
| 433 |
++jj; |
| 434 |
/* * */ |
| 435 |
/* * *** diagonal term *** */ |
| 436 |
ii = jj; |
| 437 |
kk = ii - jj + *m + 1; |
| 438 |
acb[kk + jj * acb_dim1] = oc[i__ + (j + k * oc_dim2) * |
| 439 |
oc_dim1]; |
| 440 |
/* * */ |
| 441 |
/* * *** east neighbor *** */ |
| 442 |
ii = jj - 1; |
| 443 |
kk = ii - jj + *m + 1; |
| 444 |
acb[kk + jj * acb_dim1] = -oe[i__ - 1 + (j + k * oe_dim2) * |
| 445 |
oe_dim1]; |
| 446 |
/* * */ |
| 447 |
/* * *** north neighbor *** */ |
| 448 |
ii = jj - (*nx - 2); |
| 449 |
kk = ii - jj + *m + 1; |
| 450 |
acb[kk + jj * acb_dim1] = -on[i__ + (j - 1 + k * on_dim2) * |
| 451 |
on_dim1]; |
| 452 |
/* * */ |
| 453 |
/* * *** north-east neighbor *** */ |
| 454 |
ii = jj - (*nx - 2) + 1; |
| 455 |
kk = ii - jj + *m + 1; |
| 456 |
acb[kk + jj * acb_dim1] = -one[i__ + (j - 1 + k * one_dim2) * |
| 457 |
one_dim1]; |
| 458 |
/* * */ |
| 459 |
/* * *** north-west neighbor *** */ |
| 460 |
ii = jj - (*nx - 2) - 1; |
| 461 |
kk = ii - jj + *m + 1; |
| 462 |
acb[kk + jj * acb_dim1] = -onw[i__ + (j - 1 + k * onw_dim2) * |
| 463 |
onw_dim1]; |
| 464 |
/* * */ |
| 465 |
/* * *** up neighbor *** */ |
| 466 |
ii = jj - (*nx - 2) * (*ny - 2); |
| 467 |
kk = ii - jj + *m + 1; |
| 468 |
acb[kk + jj * acb_dim1] = -uc[i__ + (j + (k - 1) * uc_dim2) * |
| 469 |
uc_dim1]; |
| 470 |
/* * */ |
| 471 |
/* * *** up-east neighbor *** */ |
| 472 |
ii = jj - (*nx - 2) * (*ny - 2) + 1; |
| 473 |
kk = ii - jj + *m + 1; |
| 474 |
acb[kk + jj * acb_dim1] = -ue[i__ + (j + (k - 1) * ue_dim2) * |
| 475 |
ue_dim1]; |
| 476 |
/* * */ |
| 477 |
/* * *** up-west neighbor *** */ |
| 478 |
ii = jj - (*nx - 2) * (*ny - 2) - 1; |
| 479 |
kk = ii - jj + *m + 1; |
| 480 |
acb[kk + jj * acb_dim1] = -uw[i__ + (j + (k - 1) * uw_dim2) * |
| 481 |
uw_dim1]; |
| 482 |
/* * */ |
| 483 |
/* * *** up-north neighbor *** */ |
| 484 |
ii = jj - (*nx - 2) * (*ny - 2) + (*nx - 2); |
| 485 |
kk = ii - jj + *m + 1; |
| 486 |
acb[kk + jj * acb_dim1] = -un[i__ + (j + (k - 1) * un_dim2) * |
| 487 |
un_dim1]; |
| 488 |
/* * */ |
| 489 |
/* * *** up-south neighbor *** */ |
| 490 |
ii = jj - (*nx - 2) * (*ny - 2) - (*nx - 2); |
| 491 |
kk = ii - jj + *m + 1; |
| 492 |
acb[kk + jj * acb_dim1] = -us[i__ + (j + (k - 1) * us_dim2) * |
| 493 |
us_dim1]; |
| 494 |
/* * */ |
| 495 |
/* * *** up-north-east neighbor *** */ |
| 496 |
ii = jj - (*nx - 2) * (*ny - 2) + (*nx - 2) + 1; |
| 497 |
kk = ii - jj + *m + 1; |
| 498 |
acb[kk + jj * acb_dim1] = -une[i__ + (j + (k - 1) * une_dim2) |
| 499 |
* une_dim1]; |
| 500 |
/* * */ |
| 501 |
/* * *** up-north-west neighbor *** */ |
| 502 |
ii = jj - (*nx - 2) * (*ny - 2) + (*nx - 2) - 1; |
| 503 |
kk = ii - jj + *m + 1; |
| 504 |
acb[kk + jj * acb_dim1] = -unw[i__ + (j + (k - 1) * unw_dim2) |
| 505 |
* unw_dim1]; |
| 506 |
/* * */ |
| 507 |
/* * *** up-south-east neighbor *** */ |
| 508 |
ii = jj - (*nx - 2) * (*ny - 2) - (*nx - 2) + 1; |
| 509 |
kk = ii - jj + *m + 1; |
| 510 |
acb[kk + jj * acb_dim1] = -use[i__ + (j + (k - 1) * use_dim2) |
| 511 |
* use_dim1]; |
| 512 |
/* * */ |
| 513 |
/* * *** up-south-west neighbor *** */ |
| 514 |
ii = jj - (*nx - 2) * (*ny - 2) - (*nx - 2) - 1; |
| 515 |
kk = ii - jj + *m + 1; |
| 516 |
acb[kk + jj * acb_dim1] = -usw[i__ + (j + (k - 1) * usw_dim2) |
| 517 |
* usw_dim1]; |
| 518 |
/* L12: */ |
| 519 |
} |
| 520 |
/* L11: */ |
| 521 |
} |
| 522 |
/* L10: */ |
| 523 |
} |
| 524 |
/* * */ |
| 525 |
/* * *** return and end *** */ |
| 526 |
return 0; |
| 527 |
} /* buildband1_27__ */ |
| 528 |
|