<!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&nbsp;explanations. I got 
that. Thank you!</DIV>
<DIV>Feng-Chao</DIV>
<DIV>&nbsp;</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:&nbsp;2</DIV>
<DIV>
<DIV>Date:&nbsp;Tue,&nbsp;27&nbsp;Dec&nbsp;2011&nbsp;10:16:10&nbsp;-0600</DIV>
<DIV>From:&nbsp;Hong&nbsp;Zhang&nbsp;&lt;hzhang@mcs.anl.gov&gt;</DIV>
<DIV>Subject:&nbsp;Re:&nbsp;[petsc-users]&nbsp;Question&nbsp;about</DIV>
<DIV>petsc-3.2-p5/src/ts/examples/tutorials/ex15.c</DIV>
<DIV>To:&nbsp;PETSc&nbsp;users&nbsp;list&nbsp;&lt;petsc-users@mcs.anl.gov&gt;</DIV>
<DIV>Message-ID:</DIV>
<DIV>&lt;CAGCphBu6GsUaZty1vseHwhLDJeKX2=ViM=VFUMLaHtnbY+Nhpg@mail.gmail.com&gt;</DIV>
<DIV>Content-Type:&nbsp;text/plain;&nbsp;charset=ISO-8859-1</DIV>
<DIV></DIV>
<DIV>Feng-Chao,</DIV>
<DIV>Jtype&nbsp;==&nbsp;1&nbsp;is&nbsp;for&nbsp;/*&nbsp;slow&nbsp;finite&nbsp;difference&nbsp;J;&nbsp;*/</DIV>
<DIV>computes&nbsp;dense&nbsp;Jacobian&nbsp;one&nbsp;column&nbsp;at&nbsp;a&nbsp;time,&nbsp;taking&nbsp;prohibitively</DIV>
<DIV>long&nbsp;time&nbsp;for&nbsp;large</DIV>
<DIV>matrices.&nbsp;For&nbsp;101*101&nbsp;matrix,&nbsp;i.e.,&nbsp;it&nbsp;evaluates&nbsp;1.e+4&nbsp;columns</DIV>
<DIV>(evaluate&nbsp;function&nbsp;1.e+4&nbsp;times).</DIV>
<DIV>Running&nbsp;it&nbsp;on&nbsp;my&nbsp;Mac,&nbsp;the&nbsp;execution&nbsp;terminates&nbsp;after&nbsp;a&nbsp;hang&nbsp;with&nbsp;error</DIV>
<DIV>timestep&nbsp;0:&nbsp;time&nbsp;0,&nbsp;solution&nbsp;norm&nbsp;391.65,&nbsp;max&nbsp;1,&nbsp;min&nbsp;0</DIV>
<DIV>[0]PETSC&nbsp;ERROR:&nbsp;---------------------&nbsp;Error&nbsp;Message</DIV>
<DIV>------------------------------------</DIV>
<DIV>[0]PETSC&nbsp;ERROR:&nbsp;&nbsp;&nbsp;!</DIV>
<DIV>[0]PETSC&nbsp;ERROR:&nbsp;TSStep&nbsp;has&nbsp;failed&nbsp;due&nbsp;to&nbsp;DIVERGED_NONLINEAR_SOLVE!</DIV>
<DIV></DIV>
<DIV>With&nbsp;-da_grid_x&nbsp;51&nbsp;-da_grid_y&nbsp;51,&nbsp;it&nbsp;runs,&nbsp;but&nbsp;is&nbsp;extremely&nbsp;slow.</DIV>
<DIV></DIV>
<DIV>As&nbsp;stated&nbsp;in&nbsp;the&nbsp;petsc&nbsp;manual,&nbsp;SNESDefaultComputeJacobian()&nbsp;is&nbsp;not</DIV>
<DIV>recommended&nbsp;for&nbsp;general&nbsp;use&nbsp;in&nbsp;large-scale&nbsp;applications.&nbsp;It&nbsp;only&nbsp;works&nbsp;on</DIV>
<DIV>tiny&nbsp;matrices&nbsp;for&nbsp;checking&nbsp;the&nbsp;correctness&nbsp;of&nbsp;a&nbsp;user-provided&nbsp;Jacobian.</DIV>
<DIV>For&nbsp;ex15.c,&nbsp;it&nbsp;obviously&nbsp;only&nbsp;works&nbsp;for&nbsp;up&nbsp;to&nbsp;51x51&nbsp;grids&nbsp;on&nbsp;the</DIV>
<DIV>machine&nbsp;we&nbsp;tested.</DIV>
<DIV></DIV>
<DIV>Hong</DIV>
<DIV></DIV>
<DIV></DIV>
<DIV>On&nbsp;Tue,&nbsp;Dec&nbsp;27,&nbsp;2011&nbsp;at&nbsp;12:32&nbsp;AM,&nbsp;Fatcharm&nbsp;&lt;wolfshow@gmail.com&gt;&nbsp;wrote:</DIV>
<DIV>&gt;&nbsp;Dear&nbsp;all,</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;&nbsp;I&nbsp;am&nbsp;working&nbsp;with&nbsp;an&nbsp;example&nbsp;of&nbsp;"petsc-3.2-p5/src/ts/examples/tutorials/ex15.c"</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;&nbsp;I&nbsp;noticed&nbsp;that&nbsp;in&nbsp;ex15.c,</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;&nbsp;Jtype&nbsp;==&nbsp;0&nbsp;means&nbsp;?that&nbsp;/*&nbsp;use&nbsp;user&nbsp;provided&nbsp;Jacobian&nbsp;evaluation&nbsp;routine&nbsp;*/</DIV>
<DIV>&gt;&nbsp;Jtype&nbsp;==&nbsp;1&nbsp;is&nbsp;for&nbsp;/*&nbsp;slow&nbsp;finite&nbsp;difference&nbsp;J;&nbsp;*/</DIV>
<DIV>&gt;&nbsp;and&nbsp;Jtype&nbsp;==&nbsp;2&nbsp;is&nbsp;/*&nbsp;Use&nbsp;coloring&nbsp;to&nbsp;compute&nbsp;?finite&nbsp;difference&nbsp;J&nbsp;efficiently&nbsp;*/</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;&nbsp;I&nbsp;found&nbsp;a&nbsp;problem,&nbsp;when&nbsp;I&nbsp;run&nbsp;ex15&nbsp;with</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;&nbsp;mpiexec&nbsp;-n&nbsp;8&nbsp;./ex15&nbsp;-da_grid_x&nbsp;101&nbsp;-da_grid_y&nbsp;101&nbsp;-Jtype&nbsp;0&nbsp;-drawcontours</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;&nbsp;or</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;&nbsp;mpiexec&nbsp;-n&nbsp;8&nbsp;./ex15&nbsp;-da_grid_x&nbsp;101&nbsp;-da_grid_y&nbsp;101&nbsp;-Jtype&nbsp;2&nbsp;-drawcontours</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;&nbsp;,&nbsp;it&nbsp;works&nbsp;well.</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;&nbsp;However,&nbsp;when&nbsp;I&nbsp;run&nbsp;ex15&nbsp;with</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;&nbsp;mpiexec&nbsp;-n&nbsp;8&nbsp;./ex15&nbsp;-da_grid_x&nbsp;101&nbsp;-da_grid_y&nbsp;101&nbsp;-Jtype&nbsp;1&nbsp;-drawcontours</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;&nbsp;the&nbsp;solution&nbsp;remains&nbsp;the&nbsp;same&nbsp;as&nbsp;the&nbsp;initial&nbsp;condition.</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;&nbsp;If&nbsp;I&nbsp;reduced&nbsp;the&nbsp;da_grid_x&nbsp;and&nbsp;da_grid_y,&nbsp;the&nbsp;command</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;&nbsp;mpiexec&nbsp;-n&nbsp;8&nbsp;./ex15&nbsp;-da_grid_x&nbsp;51&nbsp;-da_grid_y&nbsp;51&nbsp;-Jtype&nbsp;1&nbsp;-drawcontours</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;&nbsp;works&nbsp;well.</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;&nbsp;The&nbsp;manual&nbsp;tells&nbsp;me&nbsp;that&nbsp;"Although&nbsp;SNESDefaultComputeJacobian()&nbsp;is&nbsp;not</DIV>
<DIV>&gt;&nbsp;recommended&nbsp;for&nbsp;general&nbsp;use&nbsp;in&nbsp;large-scale&nbsp;applications,&nbsp;It&nbsp;can&nbsp;be</DIV>
<DIV>&gt;&nbsp;useful&nbsp;in&nbsp;checking&nbsp;the&nbsp;correctness&nbsp;of&nbsp;a&nbsp;user-provided&nbsp;Jacobian."</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;&nbsp;I&nbsp;am&nbsp;confused&nbsp;that&nbsp;if&nbsp;SNESDefaultComputeJacobian()&nbsp;can&nbsp;not&nbsp;give&nbsp;the</DIV>
<DIV>&gt;&nbsp;correct&nbsp;Jacobian&nbsp;when&nbsp;using&nbsp;"mpiexec&nbsp;-n&nbsp;8&nbsp;./ex15&nbsp;-da_grid_x&nbsp;101</DIV>
<DIV>&gt;&nbsp;-da_grid_y&nbsp;101&nbsp;-Jtype&nbsp;1&nbsp;-drawcontours",&nbsp;then&nbsp;how&nbsp;can&nbsp;it&nbsp;be&nbsp;used&nbsp;to</DIV>
<DIV>&gt;&nbsp;check&nbsp;the&nbsp;user-provided&nbsp;Jacobian?</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;&nbsp;Is&nbsp;there&nbsp;somebody&nbsp;encountering&nbsp;the&nbsp;same&nbsp;problem&nbsp;or&nbsp;give&nbsp;me&nbsp;some&nbsp;advice?</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;&nbsp;Thank&nbsp;you&nbsp;very&nbsp;much!</DIV>
<DIV>&gt;</DIV>
<DIV>&gt;&nbsp;Feng-Chao&nbsp;Wang</DIV>
<DIV></DIV>
<DIV></DIV>
<DIV>------------------------------</DIV>
<DIV></DIV>
<DIV>_______________________________________________</DIV>
<DIV>petsc-users&nbsp;mailing&nbsp;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&nbsp;of&nbsp;petsc-users&nbsp;Digest,&nbsp;Vol&nbsp;36,&nbsp;Issue&nbsp;80</DIV>
<DIV>*******************************************</DIV></FONT></DIV></FONT></BODY></HTML>