[petsc-users] Petsc+Chombo example

Mark Adams mfadams at lbl.gov
Wed Aug 12 17:56:59 CDT 2015


On Wed, Aug 12, 2015 at 2:29 PM, Mani Chandra <mc0710 at gmail.com> wrote:

> Hi,
>
>
>> Chombo (me) creates an MPIAIJ matrix.  So automatic Jacobian assembly
>> should work.
>>
>> I have put a SNES in a Chombo code, but did not use automatic Jacobian
>> assembly.
>>
>
> Do you have an example?
>

If you want to make a SNES solver then you need an "apply" call back
function and a way to map Chombo vectors with PETSc vectors.

Chombo has a level solver (classes derived from PetscSolver) and an AMR
composite matrix constructor class (classes derived from PetscCompGrid) in
lib/src/AMRElliptic.  These two class each create these maps, providing
methods to "putChomboInPetsc", and so forth.
 lib/src/AMRElliptic/PetscSolverI.H has an apply_mfree() method that is a
callback function that you give to PETSc to apply an operator.  There are
examples in Chombo on how to use/construct these two classes, or two
installations of them.  Each of these classes has a Poisson and a 2D
Viscous Tensor instantiation.

You probably want to look at PETSc SNES examples if you are not familiar
with SNES to get an idea of what you need to provide.  Then, look at the
appropriate Chombo class as a place start.  I am guessing that you will
want to write your own solver and just use these classes to get these
mapping methods.  Wrapping a Chombo operator (apply) and solver in a SNES
is not hard and PetscSolverI.H has examples.

These codes only have one user each (and they are both ANAG staff members),
so they are pretty immature codes.

Mark


> Thanks,
> Mani
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150812/03c5bf76/attachment.html>


More information about the petsc-users mailing list