<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Feb 2, 2016 at 2:20 PM, Hom Nath Gharti <span dir="ltr"><<a href="mailto:hng.email@gmail.com" target="_blank">hng.email@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Matt, hi all,<br>
<br>
I am trying to use PCFIELDSPLIT for my solver which consists of 4<br>
different variables, namely, u (displacement vector), \chi<br>
(displacement potential), p(pressure), and \phi (gravity potential).<br>
<br>
My code segment looks like the following:<br>
======================================================<br>
call KSPCreate(PETSC_COMM_WORLD,ksp,ierr)<br>
call KSPGetPC(ksp,pc,ierr)<br>
nsplit=4<br>
call PCFieldSplitSetBlockSize(pc,nsplit,ierr);<br></blockquote><div><br></div><div>You do not need the statement above.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
call PCFieldSplitSetIS(pc,"0",gdofu_is,ierr);<br>
call ISDestroy(gdofu_is,ierr)<br>
call PCFieldSplitSetIS(pc,"1",gdofchi_is,ierr);<br>
call ISDestroy(gdofchi_is,ierr)<br>
call PCFieldSplitSetIS(pc,"2",gdofp_is,ierr);<br>
call ISDestroy(gdofp_is,ierr)<br>
call PCFieldSplitSetIS(pc,"3",gdofphi_is,ierr);<br>
call ISDestroy(gdofphi_is,ierr)<br>
<br>
call PCFieldSplitGetSubKSP(pc,nsplit,subksp,ierr);<br></blockquote><div><br></div><div>These SetOperators() calls are wrong. I am not sure why you want them here.</div><div>Also, that means you do not need the call above.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
call KSPSetOperators(subksp(1),Amat,Amat,ierr);<br>
call KSPSetOperators(subksp(2),Amat,Amat,ierr);<br>
call KSPSetOperators(subksp(3),Amat,Amat,ierr);<br>
call KSPSetOperators(subksp(4),Amat,Amat,ierr);<br>
<br>
call KSPSolve(ksp,bvec,xvec,ierr)<br>
======================================================<br>
<br>
But I am getting the following error:<br>
[79]PETSC ERROR: Null argument, when expecting valid pointer<br>
[79]PETSC ERROR: Null Object: Parameter # 1<br>
[79]PETSC ERROR: #1 KSPSetOperators() line 536 in<br>
/home/hgharti/lsoft/petsc-3.6.3-intel16-mpi5/src/ksp/ksp/interf<br>
<br>
It looks like I am doing something wrong in "call KSPSetOperators" but<br>
I could not figure that out.<br>
<br>
Could anybody help me to fix this problem? I looked into almost all<br>
related examples but I could not really figure out the correct steps<br>
after "call PCFieldSplitSetIS".<br>
<br>
Any help will be greatly appreciated.<br>
<br>
Best,<br>
Hom nath<br>
<br>
On Sun, Jan 24, 2016 at 7:14 PM, Hom Nath Gharti <<a href="mailto:hng.email@gmail.com">hng.email@gmail.com</a>> wrote:<br>
> Thank you so much Matt! I will try.<br>
><br>
> Hom Nath<br>
><br>
> On Sun, Jan 24, 2016 at 6:26 AM, Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> wrote:<br>
>> On Fri, Jan 22, 2016 at 2:19 PM, Hom Nath Gharti <<a href="mailto:hng.email@gmail.com">hng.email@gmail.com</a>><br>
>> wrote:<br>
>>><br>
>>> Dear all,<br>
>>><br>
>>> I am new to PcFieldSplit.<br>
>>><br>
>>> I have a matrix formed using MATMPIAIJ. Is it possible to use<br>
>>> PCFIELDSPLIT operations in this type of matrix? Or does it have to be<br>
>>> MATMPIBIJ or MATNEST format?<br>
>><br>
>><br>
>> Yes, you can split AIJ.<br>
>><br>
>>><br>
>>> If possible for MATMPIAIJ, could anybody provide me a simple example<br>
>>> or few steps? Variables in the equations are displacement vector,<br>
>>> scalar potential and pressure.<br>
>><br>
>><br>
>> If you do not have a collocated discretization, then you have to use<br>
>><br>
>><br>
>> <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCFieldSplitSetIS.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCFieldSplitSetIS.html</a><br>
>><br>
>> Thanks,<br>
>><br>
>> Matt<br>
>><br>
>>><br>
>>> Thanks for help.<br>
>>><br>
>>> Hom Nath<br>
>><br>
>><br>
>><br>
<span class="HOEnZb"><font color="#888888">>><br>
>> --<br>
>> What most experimenters take for granted before they begin their experiments<br>
>> is infinitely more interesting than any results to which their experiments<br>
>> lead.<br>
>> -- Norbert Wiener<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">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</div>
</div></div>