53 int *iparm,
double *rparm,
54 int *iwork,
double *rwork,
56 double *xf,
double *yf,
double *zf,
57 double *gxcf,
double *gycf,
double *gzcf,
58 double *a1cf,
double *a2cf,
double *a3cf,
59 double *ccf,
double *fcf,
double *tcf) {
102 nlev = VAT(iparm, 6);
105 VASSERT_MSG0(nlev > 0,
"The nlev parameter must be positive");
106 VASSERT_MSG0(nx > 0,
"The nx parameter must be positive");
107 VASSERT_MSG0(ny > 0,
"The ny parameter must be positive");
108 VASSERT_MSG0(nz > 0,
"The nz parameter must be positive");
110 mxlv = Vmaxlev(nx,ny,nz);
112 VASSERT_MSG1(nlev <= mxlv,
"Max lev for your grid size is: %d", mxlv);
115 mgcoar = VAT(iparm, 18);
116 mgdisc = VAT(iparm, 19);
117 mgsolv = VAT(iparm, 21);
119 Vmgsz(&mgcoar, &mgdisc, &mgsolv,
125 &n_rpc, &n_iz, &n_ipc,
129 iretot = iretot + 2 *
nf;
132 VASSERT_MSG1( nrwk >= iretot,
"Real work space must be: %d", iretot );
133 VASSERT_MSG1( niwk >= iintot,
"Integer work space must be: %d", iintot );
141 k_cc = k_rpc +
n_rpc;
146 k_ac = k_pc + 27 *
narrc;
153 RAT(rwork, k_w1), RAT(rwork, k_w2),
154 RAT(iwork, k_ipc), RAT(rwork, k_rpc),
155 RAT(rwork, k_pc), RAT(rwork, k_ac), RAT(rwork, k_cc), RAT(rwork, k_fc),
165 int *
nx,
int *
ny,
int *
nz,
167 double *w1,
double *w2,
168 int *ipc,
double *rpc,
169 double *pc,
double *ac,
double *cc,
double *fc,
170 double *xf,
double *yf,
double *zf,
171 double *gxcf,
double *gycf,
double *gzcf,
172 double *a1cf,
double *a2cf,
double *a3cf,
173 double *ccf,
double *fcf,
double *tcf) {
223 nlev = VAT(iparm, 6);
226 mgkey = VAT(iparm, 9);
227 itmax = VAT(iparm, 10);
228 istop = VAT(iparm, 11);
229 iinfo = VAT(iparm, 12);
230 ipkey = VAT(iparm, 14);
231 mgprol = VAT(iparm, 17);
232 mgcoar = VAT(iparm, 18);
233 mgdisc = VAT(iparm, 19);
234 mgsmoo = VAT(iparm, 20);
235 mgsolv = VAT(iparm, 21);
237 errtol = VAT(rparm, 1);
238 omegal = VAT(rparm, 9);
239 omegan = VAT(rparm, 10);
241 Vprtstp(0, -99, 0.0, 0.0, 0.0);
247 Vnm_tstart(30,
"Vnewdrv2: fine problem setup");
252 &nlev, &ipkey, &iinfo, &ido, iz,
253 &mgprol, &mgcoar, &mgsolv, &mgdisc,
262 Vnm_tstop(30,
"Vnewdrv2: fine problem setup");
265 Vnm_tstart(30,
"Vnewdrv2: coarse problem setup");
270 &nlev, &ipkey, &iinfo, &ido, iz,
271 &mgprol, &mgcoar, &mgsolv, &mgdisc,
280 Vnm_tstop(30,
"Vnewdrv2: coarse problem setup");
290 if (istop == 4 || istop == 5) {
292 Vbuildalg(nx, ny, nz,
294 ipc, rpc, ac, cc, ccf, tcf, fc, fcf);
300 epsiln = Vnm_epsmac();
306 Vnm_tstart(30,
"Vnewdrv2: solve");
316 &istop, &itmax, &iters, &ierror,
317 &nlev, &ilev, &nlev_real, &mgsolv,
319 &epsiln, &errtol, &omegan,
323 pc, ac, cc, fc, tcf);
324 }
else if (mgkey == 1) {
326 u, iz, ccf, fcf, w1, w2,
327 &istop, &itmax, &iters, &ierror,
328 &nlev, &ilev, &nlev_real, &mgsolv,
330 &epsiln, &errtol, &omegan,
334 pc, ac, cc, fc, tcf);
336 VABORT_MSG1(
"Bad mgkey given: %d", mgkey);
340 Vnm_tstop(30,
"Vnewdrv2: solve");
344 VfboundPMG(&ibound, nx, ny, nz, u, gxcf, gycf, gzcf);
VPUBLIC void VfboundPMG00(int *nx, int *ny, int *nz, double *x)
Initialize a grid function to have a zero boundary value.
VPUBLIC void Vfnewton(int *nx, int *ny, int *nz, double *x, int *iz, double *w0, double *w1, double *w2, double *w3, int *istop, int *itmax, int *iters, int *ierror, int *nlev, int *ilev, int *nlev_real, int *mgsolv, int *iok, int *iinfo, double *epsiln, double *errtol, double *omega, int *nu1, int *nu2, int *mgsmoo, double *cprime, double *rhs, double *xtmp, int *ipc, double *rpc, double *pc, double *ac, double *cc, double *fc, double *tru)
Driver routines for the Newton method.
VPUBLIC void Vmgsz(int *mgcoar, int *mgdisc, int *mgsolv, int *nx, int *ny, int *nz, int *nlev, int *nxc, int *nyc, int *nzc, int *nf, int *nc, int *narr, int *narrc, int *n_rpc, int *n_iz, int *n_ipc, int *iretot, int *iintot)
This routine computes the required sizes of the real and integer work arrays for the multigrid code...
VPUBLIC void VfboundPMG(int *ibound, int *nx, int *ny, int *nz, double *x, double *gxc, double *gyc, double *gzc)
Initialize a grid function to have a certain boundary value,.
VEXTERNC void Vnewdriv(int *iparm, double *rparm, int *iwork, double *rwork, double *u, double *xf, double *yf, double *zf, double *gxcf, double *gycf, double *gzcf, double *a1cf, double *a2cf, double *a3cf, double *ccf, double *fcf, double *tcf)
Driver for the Newton Solver.
VPUBLIC void Vnewdriv2(int *iparm, double *rparm, int *nx, int *ny, int *nz, double *u, int *iz, double *w1, double *w2, int *ipc, double *rpc, double *pc, double *ac, double *cc, double *fc, double *xf, double *yf, double *zf, double *gxcf, double *gycf, double *gzcf, double *a1cf, double *a2cf, double *a3cf, double *ccf, double *fcf, double *tcf)
Solves using Newton's Method.
VPUBLIC void Vnewton(int *nx, int *ny, int *nz, double *x, int *iz, double *w0, double *w1, double *w2, double *w3, int *istop, int *itmax, int *iters, int *ierror, int *nlev, int *ilev, int *nlev_real, int *mgsolv, int *iok, int *iinfo, double *epsiln, double *errtol, double *omega, int *nu1, int *nu2, int *mgsmoo, double *cprime, double *rhs, double *xtmp, int *ipc, double *rpc, double *pc, double *ac, double *cc, double *fc, double *tru)
Inexact-newton-multilevel method.
VPUBLIC void Vbuildops(int *nx, int *ny, int *nz, int *nlev, int *ipkey, int *iinfo, int *ido, int *iz, int *mgprol, int *mgcoar, int *mgsolv, int *mgdisc, int *ipc, double *rpc, double *pc, double *ac, double *cc, double *fc, double *xf, double *yf, double *zf, double *gxcf, double *gycf, double *gzcf, double *a1cf, double *a2cf, double *a3cf, double *ccf, double *fcf, double *tcf)
Build operators, boundary arrays, modify affine vectors ido==0: do only fine level ido==1: do only co...
VPUBLIC void Vbuildstr(int *nx, int *ny, int *nz, int *nlev, int *iz)
Build the nexted operator framework in the array iz.