APBS  1.4.1
mgdrvd.c
1 
50 #include "mgdrvd.h"
51 
52 VPUBLIC void Vmgdriv(int* iparm, double* rparm,
53  int* iwork, double* rwork, double* u,
54  double* xf, double* yf, double* zf,
55  double* gxcf, double* gycf, double* gzcf,
56  double* a1cf, double* a2cf, double* a3cf,
57  double* ccf, double* fcf, double* tcf) {
58 
59  // The following variables will be returned from mgsz
60  int nxc = 0;
61  int nyc = 0;
62  int nzc = 0;
63  int nf = 0;
64  int nc = 0;
65  int narr = 0;
66  int narrc = 0;
67  int n_rpc = 0;
68  int n_iz = 0;
69  int n_ipc = 0;
70  int iretot = 0;
71  int iintot = 0;
72 
73  // Miscellaneous variables
74  int nrwk = 0;
75  int niwk = 0;
76  int nx = 0;
77  int ny = 0;
78  int nz = 0;
79  int nlev = 0;
80  int ierror = 0;
81  int mxlv = 0;
82  int mgcoar = 0;
83  int mgdisc = 0;
84  int mgsolv = 0;
85  int k_iz = 0;
86  int k_ipc = 0;
87  int k_rpc = 0;
88  int k_ac = 0;
89  int k_cc = 0;
90  int k_fc = 0;
91  int k_pc = 0;
92 
93  // Utility pointers to help in passing values
94  int *iz = VNULL;
95  int *ipc = VNULL;
96  double *rpc = VNULL;
97  double *pc = VNULL;
98  double *ac = VNULL;
99  double *cc = VNULL;
100  double *fc = VNULL;
101 
102  // Decode some parameters
103  nrwk = VAT(iparm, 1);
104  niwk = VAT(iparm, 2);
105  nx = VAT(iparm, 3);
106  ny = VAT(iparm, 4);
107  nz = VAT(iparm, 5);
108  nlev = VAT(iparm, 6);
109 
110  // Perform some checks on input
111  VASSERT_MSG1(nlev > 0, "nlev must be positive: %d", nlev);
112  VASSERT_MSG1( nx > 0, "nx must be positive: %d", nx);
113  VASSERT_MSG1( ny > 0, "nv must be positive: %d", ny);
114  VASSERT_MSG1( nz > 0, "nz must be positive: %d", nz);
115 
116  mxlv = Vmaxlev(nx, ny, nz);
117  VASSERT_MSG2(
118  nlev <= mxlv,
119  "number of levels exceeds maximum: %d > %d",
120  nlev, mxlv
121  );
122 
123 
124  // Extract basic grid sizes, etc.
125  mgcoar = VAT(iparm, 18);
126  mgdisc = VAT(iparm, 19);
127  mgsolv = VAT(iparm, 21);
128 
129  Vmgsz(&mgcoar, &mgdisc, &mgsolv,
130  &nx, &ny, &nz,
131  &nlev,
132  &nxc, &nyc, &nzc,
133  &nf, &nc,
134  &narr, &narrc,
135  &n_rpc, &n_iz, &n_ipc,
136  &iretot, &iintot);
137 
138  // Perform some more checks on input
139  VASSERT_MSG2(
140  iretot >= nrwk,
141  "real workspace exceeds maximum size: %d > %d",
142  nrwk, iretot
143  );
144  VASSERT_MSG2(
145  iintot >= niwk,
146  "integer workspace exceeds maximum size: %d > %d",
147  niwk, iintot
148  );
149 
150  // Split up the integer work array
151  k_iz = 1;
152  k_ipc = k_iz + n_iz;
153 
154  // Split up the real work array ***
155  k_rpc = 1;
156  k_cc = k_rpc + n_rpc;
157  k_fc = k_cc + narr;
158  k_pc = k_fc + narr;
159  k_ac = k_pc + 27 * narrc;
160  // k_ac_after = 4 * nf + 4 * narrc;
161  // k_ac_after = 4 * nf + 14 * narrc;
162  // k_ac_after = 14 * nf + 14 * narrc;
163 
164  iz = RAT(iwork, k_iz);
165  ipc = RAT(iwork, k_ipc);
166 
167  rpc = RAT(rwork, k_rpc);
168  pc = RAT(rwork, k_pc);
169  ac = RAT(rwork, k_ac);
170  cc = RAT(rwork, k_cc);
171  fc = RAT(rwork, k_fc);
172 
173  // Call the multigrid driver
174  Vmgdriv2(iparm, rparm,
175  &nx, &ny, &nz,
176  u,
177  iz, ipc, rpc,
178  pc, ac, cc, fc,
179  xf, yf, zf,
180  gxcf, gycf, gzcf,
181  a1cf, a2cf, a3cf,
182  ccf, fcf, tcf);
183 }
184 
185 VPUBLIC void Vmgdriv2(int *iparm, double *rparm,
186  int *nx, int *ny, int *nz,
187  double *u,
188  int *iz, int *ipc, double *rpc,
189  double *pc, double *ac, double *cc, double *fc,
190  double *xf, double *yf, double *zf,
191  double *gxcf, double *gycf, double *gzcf,
192  double *a1cf, double *a2cf, double *a3cf,
193  double *ccf, double *fcf, double *tcf) {
194 
195  // @todo Document this function
196 
197  // Miscellaneous Variables
198  int mgkey = 0;
199  int itmax = 0;
200  int iok = 0;
201  int iinfo = 0;
202  int istop = 0;
203  int ipkey = 0;
204  int nu1 = 0;
205  int nu2 = 0;
206  int ilev = 0;
207  int ido = 0;
208  int iters = 0;
209  int ierror = 0;
210  int nlev_real = 0;
211  int ibound = 0;
212  int mgprol = 0;
213  int mgcoar = 0;
214  int mgsolv = 0;
215  int mgdisc = 0;
216  int mgsmoo = 0;
217  int iperf = 0;
218  int mode = 0;
219 
220  double epsiln = 0.0;
221  double epsmac = 0.0;
222  double errtol = 0.0;
223  double omegal = 0.0;
224  double omegan = 0.0;
225  double bf = 0.0;
226  double oh = 0.0;
227  double tsetupf = 0.0;
228  double tsetupc = 0.0;
229  double tsolve = 0.0;
230 
231 
232 
233  // More miscellaneous variables
234  int itmax_p = 0;
235  int iters_p = 0;
236  int iok_p = 0;
237  int iinfo_p = 0;
238 
239  double errtol_p = 0.0;
240  double rho_p = 0.0;
241  double rho_min = 0.0;
242  double rho_max = 0.0;
243  double rho_min_mod = 0.0;
244  double rho_max_mod = 0.0;
245 
246  int nxf = 0;
247  int nyf = 0;
248  int nzf = 0;
249  int nxc = 0;
250  int nyc = 0;
251  int nzc = 0;
252  int level = 0;
253  int nlevd = 0;
254 
255 
256 
257  // Utility variables
258  int numlev = 0;
259 
260  // Get the value of nlev here because it is needed for the iz matrix
261  int nlev = VAT(iparm, 6);
262  MAT2(iz, 50, nlev);
263 
264  // Decode integer parameters from the iparm array
265  nu1 = VAT(iparm, 7);
266  nu2 = VAT(iparm, 8);
267  mgkey = VAT(iparm, 9);
268  itmax = VAT(iparm, 10);
269  istop = VAT(iparm, 11);
270  iinfo = VAT(iparm, 12);
271  ipkey = VAT(iparm, 14);
272  mode = VAT(iparm, 16);
273  mgprol = VAT(iparm, 17);
274  mgcoar = VAT(iparm, 18);
275  mgdisc = VAT(iparm, 19);
276  mgsmoo = VAT(iparm, 20);
277  mgsolv = VAT(iparm, 21);
278  iperf = VAT(iparm, 22);
279 
280  // Decode real parameters from the rparm array
281  errtol = VAT(rparm, 1);
282  omegal = VAT(rparm, 9);
283  omegan = VAT(rparm, 10);
284 
286  Vprtstp(0, -99, 0.0, 0.0, 0.0);
287 
288  // Build the multigrid data structure in iz
289  Vbuildstr(nx, ny, nz, &nlev, iz);
290 
291  // Start the timer
292  Vnm_tstart(30, "Vmgdrv2: fine problem setup");
293 
294  // Build operator and rhs on fine grid
295  ido = 0;
296  Vbuildops(nx, ny, nz,
297  &nlev, &ipkey, &iinfo, &ido, iz,
298  &mgprol, &mgcoar, &mgsolv, &mgdisc,
299  ipc, rpc, pc, ac, cc, fc,
300  xf, yf, zf,
301  gxcf, gycf, gzcf,
302  a1cf, a2cf, a3cf,
303  ccf, fcf, tcf);
304 
305  // Stop the timer
306  Vnm_tstop(30, "Vmgdrv2: fine problem setup");
307 
308  // Start the timer
309  Vnm_tstart(30, "Vmgdrv2: coarse problem setup");
310 
311  // Build operator and rhs on all coarse grids
312  ido = 1;
313  Vbuildops(nx, ny, nz,
314  &nlev, &ipkey, &iinfo, &ido, iz,
315  &mgprol, &mgcoar, &mgsolv, &mgdisc,
316  ipc, rpc, pc, ac, cc, fc,
317  xf, yf, zf,
318  gxcf, gycf, gzcf,
319  a1cf, a2cf, a3cf,
320  ccf, fcf, tcf);
321 
322  // Stop the timer
323  Vnm_tstop(30, "Vmgdrv2: coarse problem setup");
324 
325  // Determine Machine Epsilon
326  epsiln = Vnm_epsmac();
327 
328  /******************************************************************
329  *** analysis ***
330  *** note: we destroy the rhs function "fc" here in "mpower" ***
331  ******************************************************************/
332 
333  // errtol and itmax
334  itmax_p = 1000;
335  iok_p = 0;
336  nlev_real = nlev;
337  nlevd = nlev_real;
338 
339  // Finest level initialization
340  nxf = *nx;
341  nyf = *ny;
342  nzf = *nz;
343 
344  // Go down grids: compute max/min eigenvalues of all operators
345  for (level=1; level <= nlev_real; level++) {
346  nlevd = nlev_real - level + 1;
347 
348  // Move down the grids
349  if (level != 1) {
350 
351  // Find new grid size
352  numlev = 1;
353  Vmkcors(&numlev, &nxf, &nyf, &nzf, &nxc, &nyc, &nzc);
354 
355  // New grid size ***
356  nxf = nxc;
357  nyf = nyc;
358  nzf = nzc;
359  }
360 
361  if (iinfo > 1) {
362  VMESSAGE3("Analysis ==> (%3d, %3d, %3d)", nxf, nyf, nzf);
363  }
364 
365 
366  // Largest eigenvalue of the system matrix A
367  if (iperf == 1 || iperf == 3) {
368 
369  if (iinfo > 1) {
370  VMESSAGE0("Power calculating rho(A)");
371  }
372 
373  iters_p = 0;
374  iinfo_p = iinfo;
375  errtol_p = 1.0e-4;
376 
377  Vpower(&nxf, &nyf, &nzf,
378  iz, &level,
379  ipc, rpc, ac, cc,
380  a1cf, a2cf, a3cf, ccf,
381  &rho_max, &rho_max_mod, &errtol_p,
382  &itmax_p, &iters_p, &iinfo_p);
383 
384  if (iinfo > 1) {
385  VMESSAGE1("Power iters = %d", iters_p);
386  VMESSAGE1("Power eigmax = %f", rho_max);
387  VMESSAGE1("Power (MODEL) = %f", rho_max_mod);
388  }
389 
390  // Smallest eigenvalue of the system matrix A
391  if (iinfo > 1) {
392  VMESSAGE0("Ipower calculating lambda_min(A)...");
393  }
394 
395  iters_p = 0;
396  iinfo_p = iinfo;
397  errtol_p = 1.0e-4;
398 
399  Vazeros(&nxf, &nyf, &nzf, u);
400 
401  Vipower(&nxf, &nyf, &nzf, u, iz,
402  a1cf, a2cf, a3cf, ccf, fcf,
403  &rho_min, &rho_min_mod, &errtol_p, &itmax_p, &iters_p,
404  &nlevd, &level, &nlev_real, &mgsolv,
405  &iok_p, &iinfo_p, &epsiln, &errtol, &omegal,
406  &nu1, &nu2, &mgsmoo,
407  ipc, rpc, pc, ac, cc, tcf);
408 
409  if (iinfo > 1) {
410  VMESSAGE1("Ipower iters = %d", iters_p);
411  VMESSAGE1("Ipower eigmin = %f", rho_min);
412  VMESSAGE1("Ipower (MODEL) = %f", rho_min_mod);
413 
414  // Condition number estimate
415  VMESSAGE1("Condition number = %f", rho_max / rho_min);
416  VMESSAGE1("Condition (MODEL) = %f", rho_max_mod / rho_min_mod);
417  }
418  }
419 
420  // Spectral radius of the multigrid operator M
421  // NOTE: due to lack of vectors, we destroy "fc" in mpower...
422  if (iperf == 2 || iperf == 3) {
423 
424  if (iinfo > 1) {
425  VMESSAGE0("Mpower calculating rho(M)");
426  }
427 
428  iters_p = 0;
429  iinfo_p = iinfo;
430  errtol_p = epsiln;
431 
432  Vazeros(&nxf, &nyf, &nzf, RAT(u, VAT2(iz, 1, level)));
433 
434  WARN_UNTESTED;
435  Vmpower(&nxf, &nyf, &nzf, u, iz,
436  a1cf, a2cf, a3cf, ccf, fcf,
437  &rho_p, &errtol_p, &itmax_p, &iters_p,
438  &nlevd, &level, &nlev_real, &mgsolv,
439  &iok_p, &iinfo_p, &epsiln,
440  &errtol, &omegal, &nu1, &nu2, &mgsmoo,
441  ipc, rpc, pc, ac, cc, fc, tcf);
442 
443  if (iinfo > 1) {
444  VMESSAGE1("Mpower iters = %d", iters_p);
445  VMESSAGE1("Mpower rho(M) = %f", rho_p);
446  }
447  }
448 
449  // Reinitialize the solution function
450 
451  Vazeros(&nxf, &nyf, &nzf, RAT(u, VAT2(iz, 1, level)));
452 
453  // Next grid
454  }
455 
456  // Reinitialize the solution function
457  Vazeros(nx, ny, nz, u);
458 
459  /*******************************************************************
460  *** this overwrites the rhs array provided by pde specification ***
461  ***** compute an algebraically produced rhs for the given tcf *****/
462 
463  if (istop == 4 || istop == 5 || iperf != 0 ) {
464 
465  if (iinfo > 1) {
466  VMESSAGE0("Generating algebraic RHS from your soln...");
467  }
468 
469 
470  WARN_UNTESTED;
471  Vbuildalg(nx, ny, nz, &mode, &nlev, iz,
472  ipc, rpc, ac, cc, ccf, tcf, fc, fcf);
473  }
474 
475  /*******************************************************************/
476 
477  // Impose zero dirichlet boundary conditions (now in source fcn)
478  VfboundPMG00(nx, ny, nz, u);
479 
480  // Start the timer
481  Vnm_tstart(30, "Vmgdrv2: solve");
482 
483  // Call specified multigrid method
484  if (mode == 0 || mode == 2) {
485  nlev_real = nlev;
486  iok = 1;
487  ilev = 1;
488 
489  if (mgkey == 0) {
490 
491  Vmvcs(nx, ny, nz,
492  u, iz, a1cf, a2cf, a3cf, ccf,
493  &istop, &itmax, &iters, &ierror, &nlev,
494  &ilev, &nlev_real, &mgsolv,
495  &iok, &iinfo, &epsiln, &errtol, &omegal,
496  &nu1, &nu2, &mgsmoo,
497  ipc, rpc, pc, ac, cc, fc, tcf);
498 
499  } else if (mgkey == 1) {
500 
501  Vmvcs(nx, ny, nz,
502  u, iz, a1cf, a2cf, a3cf, ccf,
503  &istop, &itmax, &iters, &ierror, &nlev,
504  &ilev, &nlev_real, &mgsolv,
505  &iok, &iinfo, &epsiln, &errtol, &omegal,
506  &nu1, &nu2, &mgsmoo,
507  ipc, rpc, pc, ac, cc, fc, tcf);
508 
509  } else {
510  VABORT_MSG1("Bad mgkey given: %d", mgkey);
511  }
512  }
513 
514  if (mode == 1 || mode == 2) {
515 
516  nlev_real = nlev;
517  iok = 1;
518  ilev = 1;
519 
520  if (mgkey == 0) {
521 
522  Vmvfas(nx, ny, nz,
523  u, iz, a1cf, a2cf, a3cf, ccf, fcf,
524  &istop, &itmax, &iters, &ierror, &nlev,
525  &ilev, &nlev_real, &mgsolv,
526  &iok, &iinfo, &epsiln, &errtol, &omegan,
527  &nu1, &nu2, &mgsmoo,
528  ipc, rpc, pc, ac, cc, fc, tcf);
529 
530  } else if (mgkey == 1) {
531 
532  Vfmvfas(nx, ny, nz,
533  u, iz,
534  a1cf, a2cf, a3cf, ccf, fcf,
535  &istop, &itmax, &iters, &ierror, &nlev,
536  &ilev, &nlev_real, &mgsolv,
537  &iok, &iinfo, &epsiln, &errtol, &omegan,
538  &nu1, &nu2, &mgsmoo,
539  ipc, rpc, pc, ac, cc, fc, tcf);
540 
541  } else {
542  VABORT_MSG1("Bad mgkey given: %d", mgkey);
543  }
544  }
545 
546  // Stop the timer
547  Vnm_tstop(30, "Vmgdrv2: solve");
548 
549  // Restore boundary conditions
550  ibound = 1;
551 
552  VfboundPMG(&ibound, nx, ny, nz, u, gxcf, gycf, gzcf);
553 }
554 
555 
556 
557 VPUBLIC void Vmgsz(int *mgcoar, int *mgdisc, int *mgsolv,
558  int *nx, int *ny, int *nz,
559  int *nlev,
560  int *nxc, int *nyc, int *nzc,
561  int *nf, int *nc,
562  int *narr, int *narrc,
563  int *n_rpc, int *n_iz, int *n_ipc,
564  int *iretot, int *iintot) {
565 
566  // Constants: num of different types of arrays in mg code
567  int num_nf = 0;
568  int num_narr = 2;
569  int num_narrc = 27;
570 
571  // Misc variables
572  int nc_band, num_band, n_band;
573  int nxf, nyf, nzf;
574  int level;
575  int num_nf_oper, num_narrc_oper;
576 
577  // Utility variables
578  int numlev;
579 
580  // Go down grids: compute max/min eigenvalues of all operators
581  *nf = *nx * *ny * *nz;
582 
583  *narr = *nf;
584 
585  nxf = *nx;
586  nyf = *ny;
587  nzf = *nz;
588 
589  *nxc = *nx;
590  *nyc = *ny;
591  *nzc = *nz;
592 
593  for (level=2; level<=*nlev; level++) {
594 
595  //find new grid size ***
596 
597  numlev = 1;
598  Vmkcors(&numlev, &nxf, &nyf, &nzf, nxc, nyc, nzc);
599 
600  // New grid size
601  nxf = *nxc;
602  nyf = *nyc;
603  nzf = *nzc;
604 
605  // Add the unknowns on this level to the total
606  *narr += nxf * nyf * nzf;
607  }
608  *nc = *nxc * *nyc * *nzc;
609  *narrc = *narr - *nf;
610 
611  // Box or fem on fine grid?
612  if (*mgdisc == 0) {
613  num_nf_oper = 4;
614  } else if (*mgdisc == 1) {
615  num_nf_oper = 14;
616  } else {
617  Vnm_print(2, "Vmgsz: invalid mgdisc parameter: %d\n", *mgdisc);
618  }
619 
620  // Galerkin or standard coarsening?
621  if ((*mgcoar == 0 || *mgcoar == 1) && *mgdisc == 0) {
622  num_narrc_oper = 4;
623  } else if (*mgcoar == 2) {
624  num_narrc_oper = 14;
625  } else {
626  Vnm_print(2, "Vmgsz: invalid mgcoar parameter: %d\n", *mgcoar);
627  }
628 
629  // Symmetric banded linpack storage on coarse grid
630  if (*mgsolv == 0) {
631  n_band = 0;
632  } else if (*mgsolv == 1) {
633  if ((*mgcoar == 0 || *mgcoar == 1) && *mgdisc == 0) {
634  num_band = 1 + (*nxc - 2) * (*nyc - 2);
635  } else {
636  num_band = 1 + (*nxc - 2) * (*nyc - 2) + (*nxc - 2) + 1;
637  }
638  nc_band = (*nxc - 2) * (*nyc - 2) * (*nzc - 2);
639  n_band = nc_band * num_band;
640  } else {
641  Vnm_print(2, "Vmgsz: invalid mgsolv parameter: %d\n", *mgsolv);
642  }
643 
644  // Info work array required storage
645  *n_rpc = 100 * (*nlev + 1);
646 
647  // Resulting total required real storage for method
648  *iretot = num_narr * *narr
649  + (num_nf + num_nf_oper) * *nf
650  + (num_narrc + num_narrc_oper) * *narrc
651  + n_band
652  + *n_rpc;
653 
654  // The integer storage parameters ***
655  *n_iz = 50 * (*nlev + 1);
656  *n_ipc = 100 * (*nlev + 1);
657 
658  // Resulting total required integer storage for method
659  *iintot = *n_iz + *n_ipc;
660 }
VPUBLIC void Vmgdriv(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)
Multilevel solver driver.
Definition: mgdrvd.c:52
VPUBLIC void VfboundPMG00(int *nx, int *ny, int *nz, double *x)
Initialize a grid function to have a zero boundary value.
Definition: mikpckd.c:253
int mgsolv
Definition: vpmgp.h:174
int iinfo
Definition: vpmgp.h:130
int nzc
Definition: vpmgp.h:98
VPUBLIC void Vmgdriv2(int *iparm, double *rparm, int *nx, int *ny, int *nz, double *u, int *iz, 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 the pde using the multi-grid method.
Definition: mgdrvd.c:185
int nxc
Definition: vpmgp.h:96
VEXTERNC void Vmvcs(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, int *ipc, double *rpc, double *pc, double *ac, double *cc, double *fc, double *tru)
MG helper functions.
Definition: mgcsd.c:52
int ipkey
Definition: vpmgp.h:109
int mgcoar
Definition: vpmgp.h:170
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...
Definition: mgdrvd.c:557
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,.
Definition: mikpckd.c:204
VPUBLIC void Vfmvfas(int *nx, int *ny, int *nz, double *x, int *iz, double *w0, double *w1, double *w2, double *w3, double *w4, 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, int *ipc, double *rpc, double *pc, double *ac, double *cc, double *fc, double *tru)
Multigrid nonlinear solve iteration routine.
Definition: mgfasd.c:52
int nc
Definition: vpmgp.h:100
VPUBLIC void Vazeros(int *nx, int *ny, int *nz, double *x)
Zero out operation for a grid function, including boundary values.
Definition: mikpckd.c:190
VPUBLIC void Vpower(int *nx, int *ny, int *nz, int *iz, int *ilev, int *ipc, double *rpc, double *ac, double *cc, double *w1, double *w2, double *w3, double *w4, double *eigmax, double *eigmax_model, double *tol, int *itmax, int *iters, int *iinfo)
Power methods for eigenvalue estimation.
Definition: powerd.c:52
int mgdisc
Definition: vpmgp.h:177
int mgsmoo
Definition: vpmgp.h:160
VPUBLIC void Vipower(int *nx, int *ny, int *nz, double *u, int *iz, double *w0, double *w1, double *w2, double *w3, double *w4, double *eigmin, double *eigmin_model, double *tol, int *itmax, int *iters, 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, int *ipc, double *rpc, double *pc, double *ac, double *cc, double *tru)
Standard inverse power method for minimum eigenvalue estimation.
Definition: powerd.c:160
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...
Definition: mgsubd.c:52
VPUBLIC void Vmvfas(int *nx, int *ny, int *nz, double *x, int *iz, double *w0, double *w1, double *w2, double *w3, double *w4, 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, int *ipc, double *rpc, double *pc, double *ac, double *cc, double *fc, double *tru)
Nonlinear multilevel method.
Definition: mgfasd.c:152
int nrwk
Definition: vpmgp.h:106
int nu1
Definition: vpmgp.h:158
int narrc
Definition: vpmgp.h:101
int niwk
Definition: vpmgp.h:107
int n_ipc
Definition: vpmgp.h:104
int iperf
Definition: vpmgp.h:139
int nyc
Definition: vpmgp.h:97
int istop
Definition: vpmgp.h:123
int ny
Definition: vpmgp.h:84
int n_rpc
Definition: vpmgp.h:102
int mgprol
Definition: vpmgp.h:166
int nx
Definition: vpmgp.h:83
double omegan
Definition: vpmgp.h:181
int nu2
Definition: vpmgp.h:159
int nf
Definition: vpmgp.h:99
int itmax
Definition: vpmgp.h:122
int n_iz
Definition: vpmgp.h:103
double omegal
Definition: vpmgp.h:180
int narr
Definition: vpmgp.h:108
VPUBLIC void Vbuildstr(int *nx, int *ny, int *nz, int *nlev, int *iz)
Build the nexted operator framework in the array iz.
Definition: mgsubd.c:252
int mgkey
Definition: vpmgp.h:155
int nlev
Definition: vpmgp.h:86
double errtol
Definition: vpmgp.h:121
int nz
Definition: vpmgp.h:85