[petsc-users] Interfacing PETSc

Matthew Knepley knepley at gmail.com
Mon May 24 18:07:28 CDT 2010


On Tue, May 25, 2010 at 4:04 AM, Mohammad Mirzadeh <mirzadeh at gmail.com>wrote:

> Dear all,
>
> My name is Mohammad and I am a PhD student at the University of California,
> Santa Barbara. I am currently working on a code that uses OcTree data
> structures to generate adaptive Cartesian grids for finite difference
> approximations to PDEs. I am interested in making my code parallel by using
> PETSc. However there are some issues I am not sure about.
>

Parallelizing an octree is not trivial, and several packages already exist:

  - DealII from Wolfgang Bangreuth, et. al.

  - p4est from Carsten Burstedde and Lucas Wilcox

  - Dendro from George Biros, et. al.

I would first understand why I was not using these packages. That would help
us respond intelligently.
DealII uses PETSc for solvers already, and p4est should be able to interface
soon.

Another example is the PetFMM code which manages a uniform, parallel octree
using the Sieve
communication structures from PETSc to calculate a Fast Multipole transform.

   Matt


> My code is relatively a huge one, above 35-40K of lines, and is written in
> c++ so that it enables us to use all good features like objects and
> templates. There are several places I can benefit from PETSc. The most
> obvious one, and easiest to implement, is just to use PETSc as my linear
> solver. i.e so everything in serial but only solve the linear system in
> parallel using PETSc. However, this is not enough and I'd like to do more.
> The problem, however, is that I am using lots of data structures and objects
> and my question is the possibility of  using PETSc along with them, i.e is
> it possible to write a kind of interface that translates my objects to PETSc
> variables?
>
> For instance, I have an object called OctCell, which is an octree type of
> cell which has a lot of information inside (what are the neighbors, what are
> connected nodes, who is the parent of this cell, who are the childs, etc).
> My grid, is then generated consisting of such (and other objects like
> OctNode and so on) objects, i.e my grid is an array of such objects. Right
> now, the template feature of c++ allows me to do this very naturally. Now
> I'm wondering if it is possible to use array data structures in PETSc
> instead of array types and still pass my objects as some sort of  template?
> (I know PETSc is written in c which does not support template -- still I'm
> hopeful!) This way, my grid generation would also run in parallel which
> saves me a considerable amount of time.
>
> Thanks in advance and sorry for the lengthy email.
>
> -M
>



-- 
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/20100525/3f56fa3f/attachment.htm>


More information about the petsc-users mailing list