<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.6000.17080" name=GENERATOR>
<STYLE>@font-face {
        font-family: ËÎÌå;
}
@font-face {
        font-family: Verdana;
}
@font-face {
        font-family: @ËÎÌå;
}
@page Section1 {size: 595.3pt 841.9pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; layout-grid: 15.6pt; }
P.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify
}
LI.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify
}
DIV.MsoNormal {
        TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
        FONT-WEIGHT: normal; COLOR: windowtext; FONT-STYLE: normal; FONT-FAMILY: Verdana; TEXT-DECORATION: none; mso-style-type: personal-compose
}
DIV.Section1 {
        page: Section1
}
UNKNOWN {
        FONT-SIZE: 10pt
}
BLOCKQUOTE {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em
}
OL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
UL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
</STYLE>
</HEAD>
<BODY style="FONT-SIZE: 10pt; MARGIN: 10px; FONT-FAMILY: verdana"><FONT
face=Verdana color=#000000 size=2>
<DIV>Dear Hong, Thank you very much for your patient explanations. I got
that. Thank you!</DIV>
<DIV>Feng-Chao</DIV>
<DIV> </DIV>
<DIV><FONT face=Verdana color=#c0c0c0 size=2>2011-12-28</FONT></DIV>
<DIV align=left>
<HR style="WIDTH: 100px" color=#b5c4df SIZE=1>
</DIV>
<DIV><FONT face=Verdana color=#c0c0c0 size=2><SPAN>Feng-Chao
Wang</SPAN></FONT></DIV>
<HR color=#b5c4df SIZE=1>
<DIV><FONT face=Verdana size=2>
<DIV></DIV>Message: 2</DIV>
<DIV>
<DIV>Date: Tue, 27 Dec 2011 10:16:10 -0600</DIV>
<DIV>From: Hong Zhang <hzhang@mcs.anl.gov></DIV>
<DIV>Subject: Re: [petsc-users] Question about</DIV>
<DIV>petsc-3.2-p5/src/ts/examples/tutorials/ex15.c</DIV>
<DIV>To: PETSc users list <petsc-users@mcs.anl.gov></DIV>
<DIV>Message-ID:</DIV>
<DIV><CAGCphBu6GsUaZty1vseHwhLDJeKX2=ViM=VFUMLaHtnbY+Nhpg@mail.gmail.com></DIV>
<DIV>Content-Type: text/plain; charset=ISO-8859-1</DIV>
<DIV></DIV>
<DIV>Feng-Chao,</DIV>
<DIV>Jtype == 1 is for /* slow finite difference J; */</DIV>
<DIV>computes dense Jacobian one column at a time, taking prohibitively</DIV>
<DIV>long time for large</DIV>
<DIV>matrices. For 101*101 matrix, i.e., it evaluates 1.e+4 columns</DIV>
<DIV>(evaluate function 1.e+4 times).</DIV>
<DIV>Running it on my Mac, the execution terminates after a hang with error</DIV>
<DIV>timestep 0: time 0, solution norm 391.65, max 1, min 0</DIV>
<DIV>[0]PETSC ERROR: --------------------- Error Message</DIV>
<DIV>------------------------------------</DIV>
<DIV>[0]PETSC ERROR: !</DIV>
<DIV>[0]PETSC ERROR: TSStep has failed due to DIVERGED_NONLINEAR_SOLVE!</DIV>
<DIV></DIV>
<DIV>With -da_grid_x 51 -da_grid_y 51, it runs, but is extremely slow.</DIV>
<DIV></DIV>
<DIV>As stated in the petsc manual, SNESDefaultComputeJacobian() is not</DIV>
<DIV>recommended for general use in large-scale applications. It only works on</DIV>
<DIV>tiny matrices for checking the correctness of a user-provided Jacobian.</DIV>
<DIV>For ex15.c, it obviously only works for up to 51x51 grids on the</DIV>
<DIV>machine we tested.</DIV>
<DIV></DIV>
<DIV>Hong</DIV>
<DIV></DIV>
<DIV></DIV>
<DIV>On Tue, Dec 27, 2011 at 12:32 AM, Fatcharm <wolfshow@gmail.com> wrote:</DIV>
<DIV>> Dear all,</DIV>
<DIV>></DIV>
<DIV>> I am working with an example of "petsc-3.2-p5/src/ts/examples/tutorials/ex15.c"</DIV>
<DIV>></DIV>
<DIV>> I noticed that in ex15.c,</DIV>
<DIV>></DIV>
<DIV>> Jtype == 0 means ?that /* use user provided Jacobian evaluation routine */</DIV>
<DIV>> Jtype == 1 is for /* slow finite difference J; */</DIV>
<DIV>> and Jtype == 2 is /* Use coloring to compute ?finite difference J efficiently */</DIV>
<DIV>></DIV>
<DIV>> I found a problem, when I run ex15 with</DIV>
<DIV>></DIV>
<DIV>> mpiexec -n 8 ./ex15 -da_grid_x 101 -da_grid_y 101 -Jtype 0 -drawcontours</DIV>
<DIV>></DIV>
<DIV>> or</DIV>
<DIV>></DIV>
<DIV>> mpiexec -n 8 ./ex15 -da_grid_x 101 -da_grid_y 101 -Jtype 2 -drawcontours</DIV>
<DIV>></DIV>
<DIV>> , it works well.</DIV>
<DIV>></DIV>
<DIV>> However, when I run ex15 with</DIV>
<DIV>></DIV>
<DIV>> mpiexec -n 8 ./ex15 -da_grid_x 101 -da_grid_y 101 -Jtype 1 -drawcontours</DIV>
<DIV>></DIV>
<DIV>> the solution remains the same as the initial condition.</DIV>
<DIV>></DIV>
<DIV>> If I reduced the da_grid_x and da_grid_y, the command</DIV>
<DIV>></DIV>
<DIV>> mpiexec -n 8 ./ex15 -da_grid_x 51 -da_grid_y 51 -Jtype 1 -drawcontours</DIV>
<DIV>></DIV>
<DIV>> works well.</DIV>
<DIV>></DIV>
<DIV>> The manual tells me that "Although SNESDefaultComputeJacobian() is not</DIV>
<DIV>> recommended for general use in large-scale applications, It can be</DIV>
<DIV>> useful in checking the correctness of a user-provided Jacobian."</DIV>
<DIV>></DIV>
<DIV>> I am confused that if SNESDefaultComputeJacobian() can not give the</DIV>
<DIV>> correct Jacobian when using "mpiexec -n 8 ./ex15 -da_grid_x 101</DIV>
<DIV>> -da_grid_y 101 -Jtype 1 -drawcontours", then how can it be used to</DIV>
<DIV>> check the user-provided Jacobian?</DIV>
<DIV>></DIV>
<DIV>> Is there somebody encountering the same problem or give me some advice?</DIV>
<DIV>></DIV>
<DIV>> Thank you very much!</DIV>
<DIV>></DIV>
<DIV>> Feng-Chao Wang</DIV>
<DIV></DIV>
<DIV></DIV>
<DIV>------------------------------</DIV>
<DIV></DIV>
<DIV>_______________________________________________</DIV>
<DIV>petsc-users mailing list</DIV>
<DIV>petsc-users@mcs.anl.gov</DIV>
<DIV>https://lists.mcs.anl.gov/mailman/listinfo/petsc-users</DIV>
<DIV></DIV>
<DIV></DIV>
<DIV>End of petsc-users Digest, Vol 36, Issue 80</DIV>
<DIV>*******************************************</DIV></FONT></DIV></FONT></BODY></HTML>