<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Dear Barry,</p>
<p><br>
</p>
<p>These operations comes into picture when I have to map a </p>
<p>plane surface to a closed surface (lets say cylinder). As you</p>
<p>can imagine nodes (hence nodal values) at 2 opposite sides </p>
<p>of the plane have to add up to give a closed geometry. </p>
<p>Matrices can be as large as 30,000*30,000 or more depending </p>
<p>on the <span style="font-size:12pt">density of the mesh. Since, in effect different elements sits in </span></p>
<p>different processes doing this in assembly level will be tricky. </p>
<p><br>
</p>
<div id="x_Signature">
<div style="font-family:Tahoma; font-size:13px"><font face="Verdana">Sathwik Bharadwaj<br>
</font></div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Barry Smith <bsmith@mcs.anl.gov><br>
<b>Sent:</b> Sunday, April 9, 2017 3:34:13 PM<br>
<b>To:</b> Daralagodu Dattatreya Jois, Sathwik Bharadw<br>
<b>Cc:</b> petsc-users@mcs.anl.gov<br>
<b>Subject:</b> Re: [petsc-users] Patching in generalized eigen value problems</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText"><br>
> On Apr 9, 2017, at 2:21 PM, Daralagodu Dattatreya Jois, Sathwik Bharadw <sdaralagodudatta@wpi.edu> wrote:<br>
> <br>
> Dear petsc users,<br>
> <br>
> I am solving for generalized eigen value problems using petsc and slepc. <br>
> Our equation will be of the form, <br>
> <br>
> A X=ë B X. <br>
> <br>
> I am constructing the A and B matrix of type MATMPIAIJ. Let us consider that <br>
> both of my matrices are of dimension 10*10. When we are solving for a closed <br>
> geometry, we require to add all the entries of the last (9th) row and column to
<br>
> the first (0th) row and column respectively for both matrices. In a high density mesh,
<br>
> I will have a large number of such row to row and column to column additions. <br>
> For example, I may have to add last 200 rows and columns to first 200 rows and columns<br>
> respectively. We will then zero the copied row and column expect the diagonal<br>
> element (9th row/column in the former case). <br>
<br>
   Where is this "strange" operation coming from?<br>
<br>
   Boundary conditions? <br>
<br>
  Is there any way to assemble matrices initially with these sums instead of doing it after the fact?
<br>
<br>
 Why is it always the "last rows" and the "first rows"? <br>
<br>
  What happens when you run in parallel where first and last rows are on different processes?
<br>
<br>
  How large will the matrices get?<br>
<br>
   Are the matrices symmetric?<br>
<br>
<br>
<br>
<br>
> <br>
> I understand that MatGetRow, MatGetColumnVector, MatGetValues or any other <br>
> MatGet- or VecGet- functions are not collective. Can you suggest any<br>
> efficient algorithm or function to achieve this way of patching? <br>
> <br>
> One way I can think of is to obtain the column vector using MatGetColumnVector and<br>
> row vector by MatZeroRows and then scatter these vectors to all processes. Once we have
<br>
> entire row/column vector entries in each process, we can add the values to the matrix by
<br>
> their global index. Of course, care should be taken to add the values of diagonal element
<br>
> only once. But this will be a quite slow process. <br>
> Any ideas are appreciated. <br>
>  <br>
> Thanks,<br>
> Sathwik Bharadwaj<br>
<br>
</div>
</span></font>
</body>
</html>