<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Feb 2, 2016 at 3:01 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">Thanks again Matt. Unfortunately got the same errors with '0'. I think<br>
both are valid in Fortran.<br></blockquote><div><br></div><div>Then you will have to go in the debugger and see why its not creating 4 splits, since this is exactly</div><div>what it does in our tests. This is how all the SNES tests that I use work. I am sure its a Fortran</div><div>problem.</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">
Hom Nath<br>
<br>
On Tue, Feb 2, 2016 at 3:42 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> wrote:<br>
> On Tue, Feb 2, 2016 at 2:35 PM, Hom Nath Gharti <<a href="mailto:hng.email@gmail.com">hng.email@gmail.com</a>> wrote:<br>
>><br>
>> Thank you so much Matt.<br>
>><br>
>> I now tried the following:<br>
>><br>
>> ======================================================<br>
>> call KSPCreate(PETSC_COMM_WORLD,ksp,ierr)<br>
>> call KSPGetPC(ksp,pc,ierr)<br>
>><br>
>> 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>
>> ! Amat changes in each time steps<br>
>> call KSPSetOperators(ksp,Amat,Amat,ierr) !version >= 3.5.0<br>
>><br>
>> call KSPSolve(ksp,bvec,xvec,ierr)<br>
>> ======================================================<br>
><br>
><br>
> I am guessing that "0" is not a valid string for your Fortran compiler. Are<br>
> you sure<br>
> its not single quotes '0'?<br>
><br>
> Matt<br>
><br>
>><br>
>> But I get the following error:<br>
>><br>
>> [0]PETSC ERROR: --------------------- Error Message<br>
>> --------------------------------------------------------------<br>
>> [0]PETSC ERROR: Petsc has generated inconsistent data<br>
>> [0]PETSC ERROR: Unhandled case, must have at least two fields, not 1<br>
>> [0]PETSC ERROR: See<br>
>> <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble<br>
>> shooting.<br>
>> [0]PETSC ERROR: Petsc Release Version 3.6.3, Dec, 03, 2015<br>
>> [0]PETSC ERROR:<br>
>> /tigress/hgharti/gitwork/SPECFEM3D_GLOBEVSPP/./bin/xspecfem3D on a<br>
>> arch-linux2-c-debug named tiger-r3c1n7 by hgharti Tue Feb 2 15:<br>
>> 29:30 2016<br>
>> [0]PETSC ERROR: Configure options<br>
>> --with-blas-lapack-dir=/opt/intel/composer_xe_2015.2.164/mkl/lib/intel64/<br>
>> --with-cc=mpicc --with-cxx=mpicxx --wit<br>
>> h-fc=mpif90 --with-mpiexec=mpiexec --with-debugging=1<br>
>> --download-scalapack --download-mumps --download-pastix<br>
>> --download-superlu --download-superlu_dist --download-metis<br>
>> --download-parmetis --download-ptscotch --download-hypre<br>
>> [0]PETSC ERROR: #1 PCFieldSplitSetDefaults() line 469 in<br>
>><br>
>> /home/hgharti/lsoft/petsc-3.6.3-intel16-mpi5/src/ksp/pc/impls/fieldsplit/fieldsplit.c<br>
>> [0]PETSC ERROR: #2 PCSetUp_FieldSplit() line 486 in<br>
>><br>
>> /home/hgharti/lsoft/petsc-3.6.3-intel16-mpi5/src/ksp/pc/impls/fieldsplit/fieldsplit.c<br>
>> [0]PETSC ERROR: #3 PCSetUp() line 983 in<br>
>> /home/hgharti/lsoft/petsc-3.6.3-intel16-mpi5/src/ksp/pc/interface/precon.c<br>
>> [0]PETSC ERROR: #4 KSPSetUp() line 332 in<br>
>><br>
>> /home/hgharti/lsoft/petsc-3.6.3-intel16-mpi5/src/ksp/ksp/interface/itfunc.c<br>
>> [0]PETSC ERROR: #5 KSPSolve() line 546 in<br>
>><br>
>> /home/hgharti/lsoft/petsc-3.6.3-intel16-mpi5/src/ksp/ksp/interface/itfunc.c<br>
>> forrtl: error (76): Abort trap signal<br>
>><br>
>> Am I missing something?<br>
>><br>
>> Thanks,<br>
>> Hom Nath<br>
>><br>
>> On Tue, Feb 2, 2016 at 3:24 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> wrote:<br>
>> > On Tue, Feb 2, 2016 at 2:20 PM, Hom Nath Gharti <<a href="mailto:hng.email@gmail.com">hng.email@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> 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>
>> ><br>
>> ><br>
>> > You do not need the statement above.<br>
>> ><br>
>> >><br>
>> >> 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>
>> ><br>
>> ><br>
>> > These SetOperators() calls are wrong. I am not sure why you want them<br>
>> > here.<br>
>> > Also, that means you do not need the call above.<br>
>> ><br>
>> > Thanks,<br>
>> ><br>
>> > Matt<br>
>> ><br>
>> >><br>
>> >> 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>><br>
>> >> 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>><br>
>> >> > wrote:<br>
>> >> >> On Fri, Jan 22, 2016 at 2:19 PM, Hom Nath Gharti<br>
>> >> >> <<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<br>
>> >> >>> 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<br>
>> >> >>> 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>
>> >> >><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>
>> >> >><br>
>> >> >> --<br>
>> >> >> What most experimenters take for granted before they begin their<br>
>> >> >> experiments<br>
>> >> >> is infinitely more interesting than any results to which their<br>
>> >> >> experiments<br>
>> >> >> lead.<br>
>> >> >> -- Norbert Wiener<br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> > --<br>
>> > What most experimenters take for granted before they begin their<br>
>> > experiments<br>
>> > is infinitely more interesting than any results to which their<br>
>> > experiments<br>
>> > lead.<br>
>> > -- Norbert Wiener<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>