<div dir="ltr">Yes, I don't use DM at all and no information about who is calling DMGetGlobalVector(). When I use snesnewtonls (without constraint on the solution), the code worked fine. I only changed one of code : <div>
ierr = SNESSetType(snes,SNESNEWTONTR );CHKERRQ(ierr);</div><div>--- > ierr = SNESSetType(snes,SNESVINEWTONSSLS );CHKERRQ(ierr);</div><div>and added :</div><div>ierr = SNESVISetVariableBounds(snes, low_b, up_b);CHKERRQ(ierr);<br>
</div><div><br></div><div>and the errors appeared.</div><div><br></div><div>Que</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 29, 2014 at 12:29 PM, Jed Brown <span dir="ltr"><<a href="mailto:jed@jedbrown.org" target="_blank">jed@jedbrown.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="">Que Cat <<a href="mailto:quecat001@gmail.com">quecat001@gmail.com</a>> writes:<br>

<br>
> Hi Jed,<br>
><br>
> I removed only one line from the error message that indicated the<br>
> unnecessary information like directory path, program name, processor type.<br>
><br>
> In this problem, I created the vector using VecCreateMPI, not with DM. Does<br>
> it cause such problem? I have the unstructured grid and can not use DM<br>
<br>
</div>There should be more lines, like who is calling DMGetGlobalVector().<br>
Maybe that is your code and you don't check errors, but why are you<br>
calling that function if you don't use DM (so the DMShell is created<br>
automatically)?<br>
<div class=""><div class="h5"><br>
><br>
> Que<br>
><br>
><br>
> On Tue, Jul 29, 2014 at 12:09 PM, Jed Brown <<a href="mailto:jed@jedbrown.org">jed@jedbrown.org</a>> wrote:<br>
><br>
>> Que Cat <<a href="mailto:quecat001@gmail.com">quecat001@gmail.com</a>> writes:<br>
>><br>
>> > Dear Petsc-Users,<br>
>> ><br>
>> > I called the SNESVISetVariableBounds<br>
>> > <<br>
>> <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESVISetVariableBounds.html#SNESVISetVariableBounds" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESVISetVariableBounds.html#SNESVISetVariableBounds</a><br>

>> ><br>
>> > and<br>
>> > received the following error:<br>
>> ><br>
>> > [0]PETSC ERROR: Must call DMShellSetGlobalVector() or<br>
>> > DMShellSetCreateGlobalVector()<br>
>> > [0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a><br>
>> for<br>
>> > trouble shooting.<br>
>> > [0]PETSC ERROR: Petsc Release Version 3.5.0, Jun, 30, 2014<br>
>> > ....<br>
>><br>
>> It looks like you are truncating the error message.  Please don't ever<br>
>> do that.<br>
>><br>
>> > [0]PETSC ERROR: Configure options --with-x=0 -with-pic<br>
>> ><br>
>> --with-external-packages-dir=/opt/apps/intel13/mvapich2_1_9/petsc/3.5/externalpackages<br>
>> > --with-mpi-compilers=1 --with-mpi-dir=/opt/apps/intel13/mvapich2/1.9<br>
>> > --with-scalar-type=real --with-shared-libraries=1 --with-matlab<br>
>> > --with-matlab-dir=/work/apps/matlab/2013a --with-spai=1 --download-spai<br>
>> > --with-hypre=1 --download-hypre --with-mumps=1 --download-mumps<br>
>> > --with-scalapack=1 --download-scalapack --with-blacs=1 --download-blacs<br>
>> > --with-spooles=1 --download-spooles --with-superlu=1 --download-superlu<br>
>> > --with-superlu_dist=1 --download-superlu_dist --with-parmetis=1<br>
>> > --download-parmetis --with-metis=1 --download-metis --with-hdf5=1<br>
>> > --with-hdf5-dir=/opt/apps/intel13/mvapich2_1_9/phdf5/1.8.9<br>
>> > --with-debugging=no<br>
>> ><br>
>> --with-blas-lapack-dir=/opt/apps/intel/13/composer_xe_2013.3.163/mkl/lib/intel64<br>
>> > --with-mpiexec=mpirun_rsh --COPTFLAGS= --CXXOPTFLAGS= --FOPTFLAGS=<br>
>> > [<br>
>> > 0]PETSC ERROR: #1 DMCreateGlobalVector_Shell() line 245 in<br>
>> > /opt/apps/intel13/mvapich2_1_9/petsc/3.5/src/dm/impls/shell/dmshell.c<br>
>> > [0]PETSC ERROR: #2 DMCreateGlobalVector() line 681 in<br>
>> > /opt/apps/intel13/mvapich2_1_9/petsc/3.5/src/dm/interface/dm.c<br>
>> > [0]PETSC ERROR: #3 DMGetGlobalVector() line 154 in<br>
>> > /opt/apps/intel13/mvapich2_1_9/petsc/3.5/src/dm/interface/dmget.c<br>
>> ><br>
>> > Could anyone give me a hint to the source of the error? Thank you.<br>
>> ><br>
>> > Que<br>
>><br>
</div></div></blockquote></div><br></div></div>