Barry-<br>Maybe i'd better provide more details on what I'm trying to do<br><br>*) I'm modeling current flowing through several different "block types", each of which describes a section of a semiconductor device. Each block type has a different geometry, which is triangulated to create an AIJ matrix (Each row/column in the matrix represents a coordinate, and the matrix values represent electrical admittance). There are about 100 different types of these blocks, and since they have quite convoluted geometries , their triangulation takes quite a while.<br><br>*) My complete problem is composed of many (up to 10K) tiles, each of which is one of the 100 blocks . I want to reuse the triangulation which was done for each of the block, do I'd like to have a way of taking the matrix objects of the individual blcks, and combine them into a large matrix, taking into account their relative locations.<br><br>*) This means that for each block instance, I would need to to translate every internal coordinate/node, and map it to a global coordinate/node.<br><br>*) Once I have a mapping of local to global indices, I'd like to take the matrix values of the instances, and combine them to form a large matrix which describes the complete problem.<br><br><br>So my question is :<br>*) What data structures (DA/IS/AO/???) should I use to achieve the above?<br><br>Best Regards<br>Yaron<br>
<br>
<br>
<table class="readtext" border="0" cellpadding="1" cellspacing="7"><tbody><tr><td bgcolor="black"></td><td>-------Original Message-------<br>
From: Barry Smith <bsmith@mcs.anl.gov><br>
Subject: Re: Non-uniform 2D mesh questions<br>
Sent: 02 Feb '07 13:38<br>
<br>
<br>
  Yaron,<br>
<br>
   Anything is possible :-) and maybe not terribly difficult to get started.<br>
<br>
You could use DAGetMatrx() to give you the properly pre-allocated "huge" Mat.<br>
<br>
Have each process loop over the "rectangular portion[s] of the domain" that<br>
it mostly owns (that is if a rectangular portion lies across two processes just<br>
assign it to one of them for this loop.)<br>
<br>
Then loop over the locations inside the rectangular portion calling<br>
MatSetValuesStencil() for that row of the huge matrix to put the entries from <br>
the smaller matrix INTO the huge matrix using the natural grid i,j coordindates <br>
(so not have to map the coordinates from the grid location to the location in <br>
the matrix).<br>
<br>
This may require some thought to get right but should require little coding<br>
(if you are writting hundreds and hundreds of lines of code then likely <br>
something is wrong).<br>
<br>
  Good luck,<br>
<br>
   Barry<br>
<br>
<br>
On Tue, 30 Jan 2007, <a mce_real_href="http://webmail.oak-research.com/compose.php?to=yaron@oak-research.com" href="http://webmail.oak-research.com/compose.php?to=yaron@oak-research.com" target="_top" style="text-decoration: underline;">yaron@oak-research.com</a> wrote:<br>
<br>
&gt; Barry-<br>
&gt; So far I only thought of having a single large sparse matrix.<br>
&gt; <br>
&gt; Yaron<br>
&gt; <br>
&gt; <br>
&gt;          -------Original Message-------<br>
&gt;   From: Barry Smith<br>
&gt;   Subject: Re: Non-uniform 2D mesh questions<br>
&gt;   Sent: 30 Jan '07 10:58<br>
&gt; <br>
&gt; <br>
&gt;    Yaron,<br>
&gt; <br>
&gt;    Do you want to end up generating a single large sparse matrix? Like a<br>
&gt; MPIAIJ<br>
&gt;   matrix? Or do you want to somehow not store the entire huge matrix but<br>
&gt; still<br>
&gt;   be able to solve with the composed matrix? Or both?<br>
&gt; <br>
&gt;    Barry<br>
&gt; <br>
&gt; <br>
&gt;   On Mon, 29 Jan 2007, [LINK:<br>
&gt; <a mce_real_href="http://webmail.oak-research.com/compose.php?to=yaron@oak-research.com" href="http://webmail.oak-research.com/compose.php?to=yaron@oak-research.com" target="_blank" style="text-decoration: underline;">http://webmail.oak-research.com/compose.php?to=yaron@oak-research.com</a>]<br>
&gt; <a mce_real_href="http://webmail.oak-research.com/compose.php?to=yaron@oak-research.com" href="http://webmail.oak-research.com/compose.php?to=yaron@oak-research.com" target="_top" style="text-decoration: underline;">yaron@oak-research.com</a> wrote:<br>
&gt; <br>
&gt;   &gt; Barry-<br>
&gt;   &gt; Yes, each block is a rectangular portion of the domain. Not so small<br>
&gt;   &gt; though (more like 100 x 100 nodes)<br>
&gt;   &gt;<br>
&gt;   &gt; Yaron<br>
&gt;   &gt;<br>
&gt;   &gt;<br>
&gt;   &gt;           -------Original Message-------<br>
&gt;   &gt; From: Barry Smith<br>
&gt;   &gt; Subject: Re: Non-uniform 2D mesh questions<br>
&gt;   &gt; Sent: 29 Jan '07 19:40<br>
&gt;   &gt;<br>
&gt;   &gt;<br>
&gt;   &gt; Yaron,<br>
&gt;   &gt;<br>
&gt;   &gt; Is each one of these "blocks" a small rectangular part of the<br>
&gt;   &gt; domain (like a 4 by 5 set of nodes)? I don't understand what you<br>
&gt;   &gt; want to do.<br>
&gt;   &gt;<br>
&gt;   &gt; Barry<br>
&gt;   &gt;<br>
&gt;   &gt;<br>
&gt;   &gt; On Mon, 29 Jan 2007, [LINK:<br>
&gt;   &gt; [LINK:<br>
&gt; <a mce_real_href="http://webmail.oak-research.com/compose.php?to=yaron@oak-research.com" href="http://webmail.oak-research.com/compose.php?to=yaron@oak-research.com" target="_blank" style="text-decoration: underline;">http://webmail.oak-research.com/compose.php?to=yaron@oak-research.com</a>]<br>
&gt; <a mce_real_href="http://webmail.oak-research.com/compose.php?to=yaron@oak-research.com" href="http://webmail.oak-research.com/compose.php?to=yaron@oak-research.com" target="_blank" style="text-decoration: underline;">http://webmail.oak-research.com/compose.php?to=yaron@oak-research.com</a>]<br>
&gt;   &gt; [LINK:<br>
&gt; <a mce_real_href="http://webmail.oak-research.com/compose.php?to=yaron@oak-research.com" href="http://webmail.oak-research.com/compose.php?to=yaron@oak-research.com" target="_blank" style="text-decoration: underline;">http://webmail.oak-research.com/compose.php?to=yaron@oak-research.com</a>]<br>
&gt; <a mce_real_href="http://webmail.oak-research.com/compose.php?to=yaron@oak-research.com" href="http://webmail.oak-research.com/compose.php?to=yaron@oak-research.com" target="_top" style="text-decoration: underline;">yaron@oak-research.com</a> wrote:<br>
&gt;   &gt;<br>
&gt;   &gt; &gt; Hi all<br>
&gt;   &gt; &gt; I have a laplace-type problem that's physically built from repeating<br>
&gt;   &gt; &gt; instances of the same block.<br>
&gt;   &gt; &gt; I'm creaing matrices for the individual blocks, and I'd like to<br>
&gt; reuse<br>
&gt;   &gt; &gt; the individual block matrices in order to compose the complete<br>
&gt;   &gt; problem.<br>
&gt;   &gt; &gt; (i.e if there 10K instances of 20 blocks, I'd like to build 20<br>
&gt;   &gt; matrices,<br>
&gt;   &gt; &gt; then use them to compose the large complete matrix)<br>
&gt;   &gt; &gt; Is a 2D DA the right object to do that? And if so, where can I find<br>
&gt; a<br>
&gt;   &gt; &gt; small example of building the DA object in parallel, then using the<br>
&gt;   &gt; &gt; different (for every instance) mappings of local nodes to global<br>
&gt; nodes<br>
&gt;   &gt; in<br>
&gt;   &gt; &gt; order to build the complete matrix?<br>
&gt;   &gt; &gt;<br>
&gt;   &gt; &gt;<br>
&gt;   &gt; &gt; Thanks<br>
&gt;   &gt; &gt; Yaron<br>
&gt;   &gt; &gt;<br>
&gt;   &gt;<br>
&gt; <br>
<br>
</bsmith@mcs.anl.gov></td></tr></tbody></table>