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>&quot;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.&quot; <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">&lt;<a href="mailto:aron.ahmadia@kaust.edu.sa" target="_blank">aron.ahmadia@kaust.edu.sa</a>&gt;</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 &quot;rewriting<br>
the wheel&quot; so to speak.<br>
<br>
Cheers,<br>
Aron<br>
<br>
On Sat, Oct 30, 2010 at 9:07 AM, Mohammad Mirzadeh &lt;<a href="mailto:mirzadeh@gmail.com" target="_blank">mirzadeh@gmail.com</a>&gt; wrote:<br>
&gt; Aron,<br>
&gt; Thanks for the quick reply. It&#39;s really great that PETSc has such an awesome<br>
&gt; community.<br>
&gt; Anyway, I am working on adaptive Cartesian grids for which I use<br>
&gt; Octree/Quadtree data structures. Naturally, then, I have components like<br>
&gt; cells, nodes, neighbors, child/parent, etc and my whole domain is consisted<br>
&gt; of arrays of these types. That is, if I happen to have 100 cells and 200<br>
&gt; nodes, for example, I create an array for the whole domain by calling,<br>
&gt; Array&lt;Cell&gt; *CellArray = new Array&lt;Cell&gt; [100];<br>
&gt; Array&lt;Node&gt; *NodeArray = new Array&lt;Node&gt; [200];<br>
&gt; Now the problem is I want to be able to distribute this in parallel and have<br>
&gt; an array of cells or nodes. I understand that one of doing this is to change<br>
&gt; my data structure such that is consistent with PETSc only accepting double.<br>
&gt; I was hoping I could prevent that by using a package that allow for<br>
&gt; templates. That being said, I am not an expert on PETSc by any measure! As a<br>
&gt; result I highly appreciate any ideas and comments if you think this is<br>
&gt; possible to do with PETSc.<br>
&gt; All the best,<br>
&gt; Mohammad<br>
&gt;<br>
&gt; On Fri, Oct 29, 2010 at 10:44 PM, Aron Ahmadia &lt;<a href="mailto:aron.ahmadia@kaust.edu.sa" target="_blank">aron.ahmadia@kaust.edu.sa</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Dear Mohammad,<br>
&gt;&gt;<br>
&gt;&gt; As a user of PETSc for the last 8 years, since my days as an<br>
&gt;&gt; undergraduate, and now as a professional staff scientist at a<br>
&gt;&gt; supercomputing center, I can say with some confidence that there are<br>
&gt;&gt; no codes like PETSc in C++ or any other language in terms of quality<br>
&gt;&gt; of implementation, documentation, and support.  Can you tell us a<br>
&gt;&gt; little more about your current implementation?  It is true that PETSc<br>
&gt;&gt; does not support multiple types in the same build, but you do get your<br>
&gt;&gt; choice of floating-point values and real or complex types.  Also,<br>
&gt;&gt; PETSc has several C++ components within it, and one of the supported<br>
&gt;&gt; ways of building it is in &#39;C++&#39; mode, see -c-language in the configure<br>
&gt;&gt; options.<br>
&gt;&gt;<br>
&gt;&gt; If you insist on departing us (we&#39;ll miss you), I suggest you look at<br>
&gt;&gt; Sandia&#39;s Trilinos package: <a href="http://trilinos.sandia.gov/" target="_blank">http://trilinos.sandia.gov/</a><br>
&gt;&gt;<br>
&gt;&gt; Good Luck,<br>
&gt;&gt; Aron<br>
&gt;&gt;<br>
&gt;&gt; On Sat, Oct 30, 2010 at 7:54 AM, Mohammad Mirzadeh<br>
&gt;&gt; &lt;<a href="mailto:m.mirzadeh@engineering.ucsb.edu" target="_blank">m.mirzadeh@engineering.ucsb.edu</a>&gt; wrote:<br>
&gt;&gt; &gt; Dear all,<br>
&gt;&gt; &gt; I was wondering if anyone can refer me to a package similar to PETSc but<br>
&gt;&gt; &gt; that is written in c++? Right now I have a large code written in c++ for<br>
&gt;&gt; &gt; doing CFD simulations that I need to transform from serial to parallel.<br>
&gt;&gt; &gt; Initially I was thinking of PETSc and tried using it but found that<br>
&gt;&gt; &gt; PETSc is<br>
&gt;&gt; &gt; written in C and thus does not allow to have arrays (in parallel) of<br>
&gt;&gt; &gt; arbitrary type. I have a big data structure and it is much easier for me<br>
&gt;&gt; &gt; to<br>
&gt;&gt; &gt; retain the current structure and form of the code. As a result I was<br>
&gt;&gt; &gt; wondering if you guys know of any similar package in C++ ?(in the sense<br>
&gt;&gt; &gt; that<br>
&gt;&gt; &gt; it can provide with efficient linear solvers in parallel while hiding<br>
&gt;&gt; &gt; most<br>
&gt;&gt; &gt; of MPI from the user)<br>
&gt;&gt; &gt; I could think of HYPRE but then again I am not sure it is written in<br>
&gt;&gt; &gt; C++.<br>
&gt;&gt; &gt; Thanks,<br>
&gt;&gt; &gt; Mohammad<br>
&gt;<br>
&gt;<br>
</blockquote></div><br>