On Mon, Sep 21, 2009 at 5:31 PM, Fredrik Bengzon <span dir="ltr"><<a href="mailto:fredrik.bengzon@math.umu.se">fredrik.bengzon@math.umu.se</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Matt,<br>
Clearly, I must be missing something. If I loop over the elements and record all edges between the nodes in a face by adding to the vectors "on" and "off" as the algorithm says, won't an edge be counted more than two times in general, thus giving a too big value in "on" and "off"?<br>
</blockquote><div><br>You do not loop over edges ever that I see. He loops over nodes, and checks nodes that share an<br>edge (in 2D) or face (in 3D).<br><br> Matt<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
/Fredrik<br>
<br>
<br>
Matthew Knepley wrote:<div><div></div><div class="h5"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Mon, Sep 21, 2009 at 4:53 PM, Fredrik Bengzon <<a href="mailto:fredrik.bengzon@math.umu.se" target="_blank">fredrik.bengzon@math.umu.se</a> <mailto:<a href="mailto:fredrik.bengzon@math.umu.se" target="_blank">fredrik.bengzon@math.umu.se</a>>> wrote:<br>
<br>
Hi,<br>
Ryan, I'm aware of Barry's post<br>
<br>
<a href="https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2008-May/003020.html" target="_blank">https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2008-May/003020.html</a><br>
<br>
and it workes fine for triangle meshes. However, I do not see how<br>
this can be used for tetrahedral meshes.<br>
<br>
<br>
It is the same for tetrahedra. In fact, this algorithm can be generalized to work<br>
for any topology:<br>
<br>
<a href="http://arxiv.org/abs/0908.4427" target="_blank">http://arxiv.org/abs/0908.4427</a><br>
<br>
Matt<br>
<br>
/Fredrik<br>
<br>
<br>
Ryan Yan wrote:<br>
<br>
Hi Fredrik,<br>
If I understand correctly, I have the same issue as what you<br>
have here.<br>
<br>
I do not have the code yet(It is also depends on how your<br>
store your matrix data.). But I can forward Barry's idea to<br>
you. Hope this is helpful to you.<br>
<br>
Yan,<br>
<br>
Simply read through the ASCII file(s) twice. The first time<br>
count the number of blocks per row, then preallocate then read<br>
through the ASCII file again reading and setting the values.<br>
This will be very fast.<br>
<br>
Barry<br>
- Hide quoted text -<br>
<br>
<br>
On Sep 20, 2009, at 10:20 AM, Ryan Yan wrote:<br>
<br>
Hi All,<br>
I have a large size application. Mesh size is 30000 nodes, with<br>
dof 25 on each vertex. And it's 3d unstructured, Tet, and Hex<br>
mesh. In the following I will denote blksize=25<br>
<br>
I am testing how to build up a PETSc matrix object quick<br>
and fast.<br>
<br>
The data I have is Block Compressed Sparse Row(BCSR) files.<br>
And my<br>
objective is to read BCSR files and generate PETSc Binaries<br>
<br>
Firstly, I choose the MATMPIAIJ, I opened the BCSR data<br>
files on<br>
each processor, and set up the preallocation use<br>
MatMPIAIJSetPreallocation(A,blksize,PETSC_NULL,blksize,PETSC_NULL);<br>
The reason why I choose 25 as the number for d_nz and o_nz<br>
is that<br>
I do not have access to the ordering of the vertices. So<br>
it's the<br>
worst case set up, and it takes about 7 minutes on 30 MIPS<br>
node(180 processors) to write the output into PETSc binaries.<br>
<br>
Secondly, I choose the MatMPIBAIJ, and same procedure as above,<br>
but also set up<br>
MatMPIBAIJSetPreallocation(A,blksize,blksize,PETSC_NULL,blksize,PETSC_NULL),<br>
here blksize = 25 and it's also the worst case; This<br>
experiments<br>
takes forever and could not generate the PETSc binaries.<br>
<br>
I guess the reason why it takes so long in the MATMPIBAIJ<br>
case is<br>
that I did not set up the preallocation accurately. Alougth I<br>
think the preallocation is also not accurate in the MATMPIAIJ<br>
case, but it seems like the preallocation effect is not as<br>
serious<br>
as for the MPIBAIJ. Correct me please, if there are other<br>
reasons.<br>
<br>
Can I anyone please give a hint on how to set up the<br>
preallocation<br>
right for a unstructured mesh without knowing the mesh<br>
ordering?<br>
<br>
Thank you very much in advance,<br>
<br>
Yan<br>
<br>
<br>
<br>
<br>
<br>
On Mon, Sep 21, 2009 at 4:24 PM, Fredrik Bengzon<br>
<<a href="mailto:fredrik.bengzon@math.umu.se" target="_blank">fredrik.bengzon@math.umu.se</a><br>
<mailto:<a href="mailto:fredrik.bengzon@math.umu.se" target="_blank">fredrik.bengzon@math.umu.se</a>><br>
<mailto:<a href="mailto:fredrik.bengzon@math.umu.se" target="_blank">fredrik.bengzon@math.umu.se</a><br>
<mailto:<a href="mailto:fredrik.bengzon@math.umu.se" target="_blank">fredrik.bengzon@math.umu.se</a>>>> wrote:<br>
<br>
Hi,<br>
This is probably the wrong forum to ask, but does anyone have a<br>
piece of code for computing the correct ndnz and nodnz vectors<br>
needed for assembly of the stiffness (MPIAIJ) matrix on an<br>
unstructured tetrahedral mesh given the node-to-element<br>
adjacency?<br>
Thanks,<br>
Fredrik<br>
<br>
<br>
<br>
<br>
<br>
<br>
-- <br>
What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>
</blockquote>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>