Mohammad,<br>You could also look into p4est, which also interfaces with the deal II library (and deal II has wrappers for calling either PETSc or Trilinos). <br><br>"The p4est software library enables the dynamic management of
a collection of adaptive octrees, conveniently called a forest of
octrees. p4est is designed to work in parallel and scale to
hundreds of thousands of processor cores." <a href="http://p4est.org/" target="_blank">http://p4est.org/</a> <br><br>Best,<br>Pearl Flath<br><br><div class="gmail_quote">On Sat, Oct 30, 2010 at 10:32 AM, Aron Ahmadia <span dir="ltr"><<a href="mailto:aron.ahmadia@kaust.edu.sa" target="_blank">aron.ahmadia@kaust.edu.sa</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Mohammad,<br>
<br>
I am sure some of the other users and developers here will have<br>
different opinions on the correct way to approach this.<br>
<br>
It sounds like you may benefit even more from investigating several of<br>
the packages that manage meshes and grids on parallel architectures.<br>
There are some very general toolkits for managing adaptive grids and<br>
meshes out there, one could start with Sieve or deal.ii. If one of<br>
these packages is suitable for you, I strongly suggest you consider<br>
reusing as much of their frameworks as possible to avoid "rewriting<br>
the wheel" so to speak.<br>
<br>
Cheers,<br>
Aron<br>
<br>
On Sat, Oct 30, 2010 at 9:07 AM, Mohammad Mirzadeh <<a href="mailto:mirzadeh@gmail.com" target="_blank">mirzadeh@gmail.com</a>> wrote:<br>
> Aron,<br>
> Thanks for the quick reply. It's really great that PETSc has such an awesome<br>
> community.<br>
> Anyway, I am working on adaptive Cartesian grids for which I use<br>
> Octree/Quadtree data structures. Naturally, then, I have components like<br>
> cells, nodes, neighbors, child/parent, etc and my whole domain is consisted<br>
> of arrays of these types. That is, if I happen to have 100 cells and 200<br>
> nodes, for example, I create an array for the whole domain by calling,<br>
> Array<Cell> *CellArray = new Array<Cell> [100];<br>
> Array<Node> *NodeArray = new Array<Node> [200];<br>
> Now the problem is I want to be able to distribute this in parallel and have<br>
> an array of cells or nodes. I understand that one of doing this is to change<br>
> my data structure such that is consistent with PETSc only accepting double.<br>
> I was hoping I could prevent that by using a package that allow for<br>
> templates. That being said, I am not an expert on PETSc by any measure! As a<br>
> result I highly appreciate any ideas and comments if you think this is<br>
> possible to do with PETSc.<br>
> All the best,<br>
> Mohammad<br>
><br>
> On Fri, Oct 29, 2010 at 10:44 PM, Aron Ahmadia <<a href="mailto:aron.ahmadia@kaust.edu.sa" target="_blank">aron.ahmadia@kaust.edu.sa</a>><br>
> wrote:<br>
>><br>
>> Dear Mohammad,<br>
>><br>
>> As a user of PETSc for the last 8 years, since my days as an<br>
>> undergraduate, and now as a professional staff scientist at a<br>
>> supercomputing center, I can say with some confidence that there are<br>
>> no codes like PETSc in C++ or any other language in terms of quality<br>
>> of implementation, documentation, and support. Can you tell us a<br>
>> little more about your current implementation? It is true that PETSc<br>
>> does not support multiple types in the same build, but you do get your<br>
>> choice of floating-point values and real or complex types. Also,<br>
>> PETSc has several C++ components within it, and one of the supported<br>
>> ways of building it is in 'C++' mode, see -c-language in the configure<br>
>> options.<br>
>><br>
>> If you insist on departing us (we'll miss you), I suggest you look at<br>
>> Sandia's Trilinos package: <a href="http://trilinos.sandia.gov/" target="_blank">http://trilinos.sandia.gov/</a><br>
>><br>
>> Good Luck,<br>
>> Aron<br>
>><br>
>> On Sat, Oct 30, 2010 at 7:54 AM, Mohammad Mirzadeh<br>
>> <<a href="mailto:m.mirzadeh@engineering.ucsb.edu" target="_blank">m.mirzadeh@engineering.ucsb.edu</a>> wrote:<br>
>> > Dear all,<br>
>> > I was wondering if anyone can refer me to a package similar to PETSc but<br>
>> > that is written in c++? Right now I have a large code written in c++ for<br>
>> > doing CFD simulations that I need to transform from serial to parallel.<br>
>> > Initially I was thinking of PETSc and tried using it but found that<br>
>> > PETSc is<br>
>> > written in C and thus does not allow to have arrays (in parallel) of<br>
>> > arbitrary type. I have a big data structure and it is much easier for me<br>
>> > to<br>
>> > retain the current structure and form of the code. As a result I was<br>
>> > wondering if you guys know of any similar package in C++ ?(in the sense<br>
>> > that<br>
>> > it can provide with efficient linear solvers in parallel while hiding<br>
>> > most<br>
>> > of MPI from the user)<br>
>> > I could think of HYPRE but then again I am not sure it is written in<br>
>> > C++.<br>
>> > Thanks,<br>
>> > Mohammad<br>
><br>
><br>
</blockquote></div><br>