1 /**
2  *  @ingroup PMGC
3  *  @author  Tucker Beck [fortran ->c translation], Michael Holst [original]
4  *  @brief
5  *  @version $Id:
6  *
7  *  @attention
8  *  @verbatim
9  *
10  * APBS -- Adaptive Poisson-Boltzmann Solver
11  *
12  * Nathan A. Baker (nathan.baker@pnl.gov)
13  * Pacific Northwest National Laboratory
14  *
15  * Additional contributing authors listed in the code documentation.
16  *
17  * Copyright (c) 2010-2014 Battelle Memorial Institute. Developed at the Pacific Northwest National Laboratory, operated by Battelle Memorial Institute, Pacific Northwest Division for the U.S. Department Energy.  Portions Copyright (c) 2002-2010, Washington University in St. Louis.  Portions Copyright (c) 2002-2010, Nathan A. Baker.  Portions Copyright (c) 1999-2002, The Regents of the University of California. Portions Copyright (c) 1995, Michael Holst.
18  * All rights reserved.
19  *
20  *
21  * Redistribution and use in source and binary forms, with or without
22  * modification, are permitted provided that the following conditions are met:
23  *
24  * -  Redistributions of source code must retain the above copyright notice, this
25  * list of conditions and the following disclaimer.
26  *
27  * - Redistributions in binary form must reproduce the above copyright notice,
28  * this list of conditions and the following disclaimer in the documentation
29  * and/or other materials provided with the distribution.
30  *
31  * - Neither the name of Washington University in St. Louis nor the names of its
32  * contributors may be used to endorse or promote products derived from this
33  * software without specific prior written permission.
34  *
35  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
36  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
37  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
38  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
39  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
40  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
41  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
42  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
43  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
44  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
45  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46  *
47  * @endverbatim
48  */
49 
50 #include "smoothd.h"
51 
Vsmooth(int * nx,int * ny,int * nz,int * ipc,double * rpc,double * ac,double * cc,double * fc,double * x,double * w1,double * w2,double * r,int * itmax,int * iters,double * errtol,double * omega,int * iresid,int * iadjoint,int * meth)52 VEXTERNC void Vsmooth(int *nx, int *ny, int *nz,
53         int *ipc, double *rpc,
54         double *ac, double *cc, double *fc,
55         double *x, double *w1, double *w2, double *r,
56         int *itmax, int *iters,
57         double *errtol, double *omega,
58         int *iresid, int *iadjoint, int *meth) {
59 
60     // Do in one step
61     if (*meth == 0) {
62         VABORT_MSG0( "wjac not yet translated" );
63         //wjac(nx,ny,nz,ipc,rpc,ac,cc,fc,x,w1,w2,r,itmax,iters,errtol,omega,iresid,iadjoint);
64     } else if (*meth == 1) {
65         Vgsrb(nx, ny, nz,
66                 ipc, rpc,
67                 ac, cc, fc,
68                 x, w1, w2, r,
69                 itmax, iters,
70                 errtol, omega,
71                 iresid, iadjoint);
72     } else if (*meth == 2) {
73         VABORT_MSG0( "sor not yet translated" );
74         //sor(nx,ny,nz,ipc,rpc,ac,cc,fc,x,w1,w2,r,itmax,iters,errtol,omega,iresid,iadjoint);
75     } else if (*meth == 3) {
76         VABORT_MSG0( "rich not yet translated" );
77         //rich(nx,ny,nz,ipc,rpc,ac,cc,fc,x,w1,w2,r,itmax,iters,errtol,omega,iresid,iadjoint);
78     } else if (*meth == 4) {
79         Vcghs(nx, ny, nz,
80                 ipc, rpc,
81                 ac, cc, fc,
82                 x, w1, w2, r,
83                 itmax, iters,
84                 errtol, omega,
85                 iresid, iadjoint);
86     } else {
87         VABORT_MSG1("Bad smoothing routine specified = %d", *meth);
88     }
89 }
90 
91 
Vnsmooth(int * nx,int * ny,int * nz,int * ipc,double * rpc,double * ac,double * cc,double * fc,double * x,double * w1,double * w2,double * r,int * itmax,int * iters,double * errtol,double * omega,int * iresid,int * iadjoint,int * meth)92 VEXTERNC void Vnsmooth(int *nx, int *ny, int *nz,
93         int *ipc, double *rpc,
94         double *ac, double *cc, double *fc,
95         double *x, double *w1, double *w2, double *r,
96         int *itmax, int *iters,
97         double *errtol, double *omega,
98         int *iresid, int *iadjoint, int *meth) {
99 
100     WARN_UNTESTED;
101 
102     // Do in one step
103     if (*meth == 0) {
104         VABORT_MSG0( "nwjac not yet translated" );
105         //nwjac(nx,ny,nz,ipc,rpc,ac,cc,fc,x,w1,w2,r,itmax,iters,errtol,omega,iresid,iadjoint)
106     } else if (*meth == 1) {
107         VABORT_MSG0( "ngsrb not yet translated" );
108         //ngsrb(nx,ny,nz,ipc,rpc,ac,cc,fc,x,w1,w2,r,itmax,iters,errtol,omega,iresid,iadjoint)
109     } else if (*meth == 2) {
110         VABORT_MSG0( "nsor not yet translated" );
111         //nsor(nx,ny,nz,ipc,rpc,ac,cc,fc,x,w1,w2,r,itmax,iters,errtol,omega,iresid,iadjoint)
112     } else if (*meth == 3) {
113         VABORT_MSG0( "nrich not yet translated" );
114         //nrich(nx,ny,nz,ipc,rpc,ac,cc,fc,x,w1,w2,r,itmax,iters,errtol,omega,iresid,iadjoint)
115     } else {
116         VABORT_MSG1("Bad smoothing routine specified: %d", *meth );
117     }
118 }
119