[petsc-users] Regarding ksp ex42 - Citations
Barry Smith
bsmith at mcs.anl.gov
Fri Jul 15 22:48:14 CDT 2016
> On Jul 14, 2016, at 12:21 PM, domenico lahaye <domenico_lahaye at yahoo.com> wrote:
>
> Dear PETSc team,
>
> 1) I am looking into ks/examples/tutorials/ex42.c
This example is really written as only a one level solver, making it work with geometric multigrid is not clean
> I am still new to the DMDA structure
> and likely not giving it as much time as it deserves. However, I do not see immediately
> what function is responsible for calling PCMGSetSmoother and PCMGSetResidual.
>
> I tried to call PCMGGetCoarseSolve(pc, &kcpc) and subsequently
> KSPGetOperators (kspc, ... ) to check how the coarse grid operator is defined
> after calling DMCoarsenHierarchy, but that failed.
>
> I am solving Helmholtz with shifted Laplace, and managed to exploit DMDA to perform
> a multigrid solve on the preconditioner. In a next stage I want to implement the deflation
> using DMDA as well.
You should look at ex25.c in the same directory. Here
ierr = KSPSetDM(ksp,da);CHKERRQ(ierr);
ierr = KSPSetComputeRHS(ksp,ComputeRHS,&user);CHKERRQ(ierr);
ierr = KSPSetComputeOperators(ksp,ComputeMatrix,&user);CHKERRQ(ierr);
make it straight forward to work with multigrid. The KSP object can mange the hierarchy of grids since it is provided with the DM
and the ComputeRHS and ComputeMatrix provide a way for the multigrid preconditioner to automatically generate the needed matrix on each level without you having to manage it yourself. For example the rule in the makefile
runex25:
-@${MPIEXEC} -n 1 ./ex25 -pc_type mg -ksp_type fgmres -da_refine 2 -ksp_monitor_short -mg_levels_ksp_monitor_short -mg_levels_ksp_norm_type unpreconditioned -ksp_view -pc_mg_type full > ex25_1.tmp 2>&1; \
if (${DIFF} output/ex25_1.out ex25_1.tmp) then true; \
else printf "${PWD}\nPossible problem with ex25_1, diffs above\n=========================================\n"; fi; \
${RM} -f ex25_1.tmp
shows how to run with two levels. etc.
>
> 2) On http://www.mcs.anl.gov/petsc/documentation/referencing.html I see
>
> @Misc{petsc-web-page,
> author = {Satish Balay and Shrirang Abhyankar and Mark~F. Adams and Jed Brown and Peter Brune
> and Kris Buschelman and Lisandro Dalcin and Victor Eijkhout and William~D. Gropp
> and Dinesh Kaushik and Matthew~G. Knepley
> and Lois Curfman McInnes and Karl Rupp and Barry~F. Smith
> and Stefano Zampini and Hong Zhang and Hong Zhang},
> title = {{PETS}c {W}eb page},
> url = {http://www.mcs.anl.gov/petsc},
> howpublished = {\url{http://www.mcs.anl.gov/petsc}},
> year = {2016}
> }
>
>
>
> Is the last author mentioned twice intentionally?
>
> 3) On http://www.mcs.anl.gov/petsc/publications/petscapps-bib.html#OpenFOAM%202.2.1 I see
>
> @misc{OpenFOAM
> ,
>
>
> title = "OpenFOAM",
>
> howpublished = "\url{http://www.openfoam.com}",
>
> url = {http://www.openfoam.com},
>
> note = "OpenFOAM is a free, open source CFD software package. It allows PETSc linear algebra and solvers to be used underneath.",
>
> key = "OpenFOAM 2.2.1"
>
> }
>
>
> Do you have more information on the use of PETSc within OpenFoam?
>
> 4) @matt in response to a question he raised in Vienna
>
> MIPSE is a BEM solver. Details are on:
> http://www.g2elab.grenoble-inp.fr/plateforms/mipse-modeling-of-interconnected-power-systems-632862.kjsp?RH=G2ELAB_R-MAGE
>
> Cheers, Domenico Lahaye.
>
More information about the petsc-users
mailing list