[petsc-users] Packages Similar to PETSc in C++?

Barry Smith bsmith at mcs.anl.gov
Sat Oct 30 09:23:16 CDT 2010


On Oct 30, 2010, at 1:07 AM, Mohammad Mirzadeh wrote:

> Aron,
> 
> Thanks for the quick reply. It's really great that PETSc has such an awesome community.
> 
> Anyway, I am working on adaptive Cartesian grids for which I use Octree/Quadtree data structures. Naturally, then, I have components like cells, nodes, neighbors, child/parent, etc and my whole domain is consisted of arrays of these types. That is, if I happen to have 100 cells and 200 nodes, for example, I create an array for the whole domain by calling,
> 
> Array<Cell> *CellArray = new Array<Cell> [100];
> Array<Node> *NodeArray = new Array<Node> [200];
> 
> Now the problem is I want to be able to distribute this in parallel and have an array of cells or nodes. I understand that one of doing this is to change my data structure such that is consistent with PETSc only accepting double. I was hoping I could prevent that by using a package that allow for templates. That being said, I am not an expert on PETSc by any measure! As a result I highly appreciate any ideas and comments if you think this is possible to do with PETSc.

    This is sort of orthogonal to what PETSc provides. You can use PETSc for all of your "sparse" linear algebra but need to manage your parallel data structures (as you indicate above) yourself. I don't know of any package that helps parallelize things like

> rray<Cell> *CellArray = new Array<Cell> [100];
> Array<Node> *NodeArray = new Array<Node> [200];

Trilinos is similar to PETSc in that it does the linear algebra for you but doesn't provide tools useful for parallelizing your data structures.  There is a  Octree type parallel code http://www.cc.gatech.edu/csela/dendro/html/index.html that uses PETSc and STL for managing the mesh. The version of PETSc it uses must be updated.

   Barry



> 
> All the best,
> Mohammad
> 
> On Fri, Oct 29, 2010 at 10:44 PM, Aron Ahmadia <aron.ahmadia at kaust.edu.sa> wrote:
> Dear Mohammad,
> 
> As a user of PETSc for the last 8 years, since my days as an
> undergraduate, and now as a professional staff scientist at a
> supercomputing center, I can say with some confidence that there are
> no codes like PETSc in C++ or any other language in terms of quality
> of implementation, documentation, and support.  Can you tell us a
> little more about your current implementation?  It is true that PETSc
> does not support multiple types in the same build, but you do get your
> choice of floating-point values and real or complex types.  Also,
> PETSc has several C++ components within it, and one of the supported
> ways of building it is in 'C++' mode, see -c-language in the configure
> options.
> 
> If you insist on departing us (we'll miss you), I suggest you look at
> Sandia's Trilinos package: http://trilinos.sandia.gov/
> 
> Good Luck,
> Aron
> 
> On Sat, Oct 30, 2010 at 7:54 AM, Mohammad Mirzadeh
> <m.mirzadeh at engineering.ucsb.edu> wrote:
> > Dear all,
> > I was wondering if anyone can refer me to a package similar to PETSc but
> > that is written in c++? Right now I have a large code written in c++ for
> > doing CFD simulations that I need to transform from serial to parallel.
> > Initially I was thinking of PETSc and tried using it but found that PETSc is
> > written in C and thus does not allow to have arrays (in parallel) of
> > arbitrary type. I have a big data structure and it is much easier for me to
> > retain the current structure and form of the code. As a result I was
> > wondering if you guys know of any similar package in C++ ?(in the sense that
> > it can provide with efficient linear solvers in parallel while hiding most
> > of MPI from the user)
> > I could think of HYPRE but then again I am not sure it is written in C++.
> > Thanks,
> > Mohammad
> 



More information about the petsc-users mailing list