[petsc-users] Coupling HYPRE with PETSc for local grid refinement

Mark F. Adams mark.adams at columbia.edu
Mon Oct 8 16:52:09 CDT 2012


On Oct 8, 2012, at 2:11 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> On Sun, Oct 7, 2012 at 11:59 AM, Alan <zhenglun.wei at gmail.com> wrote:
> Dear Dr. Brown, 
>     I was trying to use PETSc to mimic something like Chombo. The figure in this website represents my thought very well.  (https://commons.lbl.gov/display/chombo/Chombo+-+Software+for+Adaptive+Solutions+of+Partial+Differential+Equations). My code simulates a flow over a objective, i.e. 2D cylinder. Finer resolution is needed near the objective. I can manually define where the finer resolution is needed.
> 
> You could just use Chombo... It's a lot of work to write a good implementation of dynamic AMR. We don't have a fully worked example of doing that, but there are plenty of packages that do AMR and use PETSc.

You should also consider BoxLib, which comes from the same hallway at LBNL and both projects are lead by a member of the NAS.  BoxLib is less C++ and it has a more sophisticated interface to PETSc (better than mine from what I know).  Chombo has support for multi block grids and embedded boundaries.  I've worked a lot with Chombo and it is a nice product but there is definitely a learning curve, especially if you are not experienced with C++.  I've not worked with BoxLib but I'm sure it is good also.

Mark

>  
>     BTW, I wonder if there is any examples for the Vec/Mat interface.
> 
> See src/mat/examples/tutorials, or any of the higher level interfaces. Look at the user's manual.
>  
> Also, is there any examples for PETSc for GPU. 
> 
> http://www.mcs.anl.gov/petsc/features/gpus.html
>  
> 
> thanks,
> Alan
>> On Sat, Oct 6, 2012 at 10:47 PM, Alan <zhenglun.wei at gmail.com> wrote:
>> Dear Dr. Brown, 
>>      Thanks for your reply and sorry for confusing you. 
>>      I was trying to ask if there is an alternative way that I can replace the DMDACreate3d in /src/ksp/ksp/example/tutorials/ex45.c with something from outside of the PETSc (i.e. HYPRE). DMDACreate3d generates a 3D Cartesian grid with uniform grid size. However, I'm trying to import a local refined grid from outside of the PETSc (i.e. HYPRE) to replace this 3D Cartesian grid with unifrom grid size. Is there any examples for me to refer?
>> 
>> Do we have automatic support for this? No. You could of course just use the Vec/Mat interface, but
>> it sounds like a lot of coding on your part. I plan to do this eventually by specifying the data layout over
>> the grid using PetscSection. However, the really important question here is, what do you need from the
>> grid? If you don't need topological queries, just make the Vec/Mat and be done with it. If you do (which
>> I imagine), then you need to be specific about what you need.
>> 
>>    Matt
>>  
>> thanks,
>> Alan
>> 
>>> Run any example with -pc_type hypre. I'm not sure what you're asking for.
>>> 
>>> On Sat, Oct 6, 2012 at 8:04 PM, Alan <zhenglun.wei at gmail.com> wrote:
>>> Dear Folks,
>>> I hope you're having a nice day.
>>> I'm trying to couple HYPRE with PETSc in order to use PETSc solvers to
>>> obtain solutions (Poisson Equation) with local refined grid from HYPRE.
>>> Is there any examples in PETSc that I can refer? or is there any
>>> examples in PETSc which introduce such a way that the Matrix is imported
>>> from external software rather than generated by PETSc.
>>> 
>>> thanks,
>>> Alan
>>> 
>>> 
>> 
>> 
>> 
>> 
>> -- 
>> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
>> -- Norbert Wiener
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20121008/01327810/attachment.html>


More information about the petsc-users mailing list