<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div>You would most likely want to use an Algebraic Multigrid method. See HYPRE's Boomeramg or ML. Both can be downloaded <div>through the configure line when you configure PETSc. Of course the performance is going to depend on what type of equations</div><div>you are solving.</div><div><br></div><div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</div><div>Travis Austin, Ph.D.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Tech-X Corporation</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">5621 Arapahoe Ave, Suite A</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Boulder, CO 80303</div><div><a href="mailto:austin@txcorp.com">austin@txcorp.com</a></div><div>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</div><br class="Apple-interchange-newline"></span></span>
</div>
<br><div><div>On May 17, 2011, at 3:26 PM, Shiyuan wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Is there any support in PETSC (with other packages) for finite element multigrid on unstructured meshes? Any recommended way to do that? Any tutorial or examples? Thanks. <br><br>------------------------------<br>
<br>
Message: 3<br>
Date: Mon, 16 May 2011 14:08:12 -0500<br>
From: Barry Smith <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>><br>
Subject: Re: [petsc-users] Can you provide a basic example of using<br>
PCMG for multigrid applications?<br>
To: PETSc users list <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>><br>
Message-ID: <<a href="mailto:E727136F-395E-4E88-9D0A-6C8E07177DD4@mcs.anl.gov">E727136F-395E-4E88-9D0A-6C8E07177DD4@mcs.anl.gov</a>><br>
Content-Type: text/plain; charset=us-ascii<br>
<br>
<br>
On May 16, 2011, at 1:36 AM, Li, Zhisong (lizs) wrote:<br>
<br>
> Hi, Petsc Team,<br>
><br>
> In my knowledge of Petsc, the PCMG object is the main tool for
general multigrid calculations, as DMMG only works for simple constant
matrix and RHS.<br>
<br>
This is not correct. DMMG can be used for non-constant matrix. DMMG
is restricted to structured grids only. But if your problem is on a two
or three dimensional structured grid you can use it and it is much
easier than coding the pieces directly.<br>
<br>
<br>
<br>
> But it's difficult to find any example code for using PCMG. I
checked out the petsc-user mail archive on this topic but still not find
a good description on it. I encounter similar errors in the practice
as some previous question-raisers did.<br>
><br>
> Here is my simple code implementing the PCMG based on my
understanding from the user manual and tutorial. It is supposed to have
multigrid of only two levels (finest and coarsest grid). The error
message indicates SEGV segmentation violation because of this part of
code. Anything wrong with this implementation?<br>
><br>
<br>
This code looks more or less correct. You need to run with -start_in_debugger to track down what is trigger the SEGV<br>
<br>
src/ksp/ksp/examples/<div id=":1iz">tutorials/ex19.c is a simple example that runs on two levels.<br>
<br>
<br>
Barry<br>
<br>
<br>
><br>
> DAGetMatrix(da, MATAIJ, &M);<br>
><br>
> KSPCreate(PETSC_COMM_WORLD, &ksp);<br>
> KSPSetType(ksp, KSPGMRES);<br>
> KSPGetPC(ksp, &pcmg);<br>
> PCSetType(pcmg, PCMG);<br>
><br>
> PCMGSetLevels(pcmg, 2, &PETSC_COMM_WORLD);<br>
> PCMGSetType(pcmg, PC_MG_MULTIPLICATIVE);<br>
> PCMGSetCycleType(pcmg, PC_MG_CYCLE_W);<br>
> PCMGSetCyclesOnLevel(pcmg, 0, 1);<br>
> PCMGSetCyclesOnLevel(pcmg, 1, 1);<br>
><br>
> PCMGGetCoarseSolve(pcmg, &ksp);<br>
><br>
> PCMGGetSmoother(pcmg, 0, &ksp);<br>
> PCMGGetSmoother(pcmg, 1, &ksp);<br>
> PCMGSetInterpolation(pcmg, 1, M);<br>
> PCMGSetRestriction(pcmg, 1, M);<br>
><br>
> PCMGSetResidual(pcmg, 0, PCMGDefaultResidual, M);<br>
> PCMGSetResidual(pcmg, 1, PCMGDefaultResidual, M);<br>
><br>
><br>
> The mandatory remaining PCMGSetRhs( ), PCMGSetX( ) and PCMGSetR( ) functions should be generated by Petsc automatically.<br>
><br>
> It is tough to learn some Petsc functions when no detailed example
and few guidance is provided. I wish you can add some tutorials codes
on PCMG usage in the future version of Petsc.<br>
><br>
><br>
> Thank you very much.<br>
><br>
><br>
> Zhisong Li<br>
><br>
><br>
><br>
<br>
<br>
<br>
------------------------------</div>
</blockquote></div><br></div></body></html>