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