question on solving the transpose of a system
Randall Mackie
randy at geosystem.us
Mon Sep 25 14:41:16 CDT 2006
I'm only running on one processor at the moment, this is the behavior I'm talking about:
(note that KSPSolve on the original matrix works great)
0 KSP preconditioned resid norm 1.390903128574e-04 true resid norm 7.071067811865e-01
1 KSP preconditioned resid norm 4.599763143217e-05 true resid norm 8.322371331683e-01
2 KSP preconditioned resid norm 1.654272381302e-04 true resid norm 8.003440639371e-01
3 KSP preconditioned resid norm 7.136279098867e-02 true resid norm 4.349303771363e+01
4 KSP preconditioned resid norm 5.796284088553e-03 true resid norm 4.955296676945e-01
5 KSP preconditioned resid norm 4.768750713012e-03 true resid norm 3.137347590723e-01
6 KSP preconditioned resid norm 3.408688625913e-03 true resid norm 1.945847883068e-01
7 KSP preconditioned resid norm 2.583172643288e-03 true resid norm 7.634413690787e-01
8 KSP preconditioned resid norm 2.019037806077e-03 true resid norm 2.514111815705e-01
9 KSP preconditioned resid norm 1.000916210470e-03 true resid norm 1.149340854362e-01
10 KSP preconditioned resid norm 6.961789967280e-04 true resid norm 7.473089637106e-02
11 KSP preconditioned resid norm 5.318821017005e-04 true resid norm 6.819674638097e-02
12 KSP preconditioned resid norm 5.102845585294e-04 true resid norm 7.504782304994e-02
13 KSP preconditioned resid norm 4.827530166955e-04 true resid norm 6.961251586046e-02
14 KSP preconditioned resid norm 4.650489781850e-04 true resid norm 7.105110351352e-02
15 KSP preconditioned resid norm 7.554860350168e-04 true resid norm 1.362292692709e-01
16 KSP preconditioned resid norm 3.856120189896e-04 true resid norm 8.611614029207e-02
17 KSP preconditioned resid norm 3.388301062554e-04 true resid norm 7.937086351967e-02
18 KSP preconditioned resid norm 3.941150978725e-04 true resid norm 8.480487700195e-02
19 KSP preconditioned resid norm 2.618186602635e-04 true resid norm 8.182966564123e-02
20 KSP preconditioned resid norm 2.329131506171e-04 true resid norm 8.529721065137e-02
21 KSP preconditioned resid norm 2.290962719325e-04 true resid norm 8.698456707472e-02
22 KSP preconditioned resid norm 2.288880028982e-04 true resid norm 8.540349746618e-02
23 KSP preconditioned resid norm 2.054973204158e-04 true resid norm 8.959104987193e-02
24 KSP preconditioned resid norm 1.959904943582e-04 true resid norm 9.045567512559e-02
25 KSP preconditioned resid norm 1.952418586285e-04 true resid norm 9.007738434662e-02
26 KSP preconditioned resid norm 2.251677392651e-04 true resid norm 9.589901454236e-02
27 KSP preconditioned resid norm 2.333244796735e-04 true resid norm 9.566927017538e-02
28 KSP preconditioned resid norm 2.415316032032e-04 true resid norm 9.646694389042e-02
29 KSP preconditioned resid norm 2.486845824748e-04 true resid norm 9.739660339140e-02
30 KSP preconditioned resid norm 3.496031881750e-04 true resid norm 9.191874052601e-02
31 KSP preconditioned resid norm 2.742098425944e-04 true resid norm 1.036225649385e-01
32 KSP preconditioned resid norm 2.918732801969e-04 true resid norm 1.061810009699e-01
33 KSP preconditioned resid norm 2.911510984457e-04 true resid norm 1.067104526588e-01
34 KSP preconditioned resid norm 2.812031840107e-04 true resid norm 1.060861749923e-01
35 KSP preconditioned resid norm 2.736426511632e-04 true resid norm 1.062681091319e-01
36 KSP preconditioned resid norm 2.452982568345e-04 true resid norm 1.058722690723e-01
37 KSP preconditioned resid norm 2.636619237574e-04 true resid norm 1.045871337618e-01
38 KSP preconditioned resid norm 2.363085860212e-04 true resid norm 1.061122603986e-01
39 KSP preconditioned resid norm 2.307147509961e-04 true resid norm 1.164653200787e-01
40 KSP preconditioned resid norm 2.076585793357e-04 true resid norm 1.036395343938e-01
41 KSP preconditioned resid norm 9.748011400474e-05 true resid norm 1.217755590404e-01
42 KSP preconditioned resid norm 8.044274057205e-05 true resid norm 1.308671247290e-01
43 KSP preconditioned resid norm 3.704513052916e-05 true resid norm 1.418486616816e-01
44 KSP preconditioned resid norm 1.808370336561e-05 true resid norm 1.462866580439e-01
45 KSP preconditioned resid norm 1.007327518499e-05 true resid norm 1.469533395294e-01
46 KSP preconditioned resid norm 7.474203323248e-06 true resid norm 1.471196722197e-01
47 KSP preconditioned resid norm 3.104362804334e-06 true resid norm 1.464133558701e-01
48 KSP preconditioned resid norm 3.916281651035e-06 true resid norm 1.459108432786e-01
49 KSP preconditioned resid norm 2.125266913518e-06 true resid norm 1.459915674565e-01
50 KSP preconditioned resid norm 1.278372472354e-06 true resid norm 1.460058114531e-01
51 KSP preconditioned resid norm 1.154265590044e-06 true resid norm 1.460037010751e-01
52 KSP preconditioned resid norm 8.377365056555e-07 true resid norm 1.461658296202e-01
53 KSP preconditioned resid norm 6.259258415049e-07 true resid norm 1.461829228733e-01
54 KSP preconditioned resid norm 4.864836311168e-07 true resid norm 1.460741388015e-01
55 KSP preconditioned resid norm 3.193814690832e-07 true resid norm 1.461503915286e-01
56 KSP preconditioned resid norm 3.117670096628e-07 true resid norm 1.461442206620e-01
57 KSP preconditioned resid norm 2.794649220494e-08 true resid norm 1.462036860889e-01
58 KSP preconditioned resid norm 5.305003844821e-08 true resid norm 1.461952341641e-01
59 KSP preconditioned resid norm 4.858416309274e-08 true resid norm 1.461955191337e-01
60 KSP preconditioned resid norm 4.961086764514e-08 true resid norm 1.461980523947e-01
61 KSP preconditioned resid norm 3.593919110530e-08 true resid norm 1.462003890061e-01
62 KSP preconditioned resid norm 1.654302376661e-08 true resid norm 1.462081188051e-01
63 KSP preconditioned resid norm 1.616013993598e-08 true resid norm 1.462087103241e-01
64 KSP preconditioned resid norm 1.629058386377e-08 true resid norm 1.462088185303e-01
65 KSP preconditioned resid norm 1.642015568778e-08 true resid norm 1.462086724918e-01
66 KSP preconditioned resid norm 1.702949256327e-08 true resid norm 1.462088581780e-01
67 KSP preconditioned resid norm 1.701842873848e-08 true resid norm 1.462087329483e-01
68 KSP preconditioned resid norm 1.695944590616e-08 true resid norm 1.462087098414e-01
69 KSP preconditioned resid norm 1.696929117551e-08 true resid norm 1.462086881118e-01
70 KSP preconditioned resid norm 1.700242718414e-08 true resid norm 1.462087228929e-01
71 KSP preconditioned resid norm 1.658065137177e-08 true resid norm 1.462086814880e-01
72 KSP preconditioned resid norm 1.662100494981e-08 true resid norm 1.462087581058e-01
73 KSP preconditioned resid norm 1.629897996614e-08 true resid norm 1.462088048567e-01
74 KSP preconditioned resid norm 1.625741596991e-08 true resid norm 1.462088774477e-01
75 KSP preconditioned resid norm 1.624765824983e-08 true resid norm 1.462089036067e-01
76 KSP preconditioned resid norm 1.626897149810e-08 true resid norm 1.462085483495e-01
77 KSP preconditioned resid norm 1.635255659489e-08 true resid norm 1.462065713317e-01
78 KSP preconditioned resid norm 1.628063309886e-08 true resid norm 1.462070325450e-01
79 KSP preconditioned resid norm 1.632101341913e-08 true resid norm 1.462054785290e-01
80 KSP preconditioned resid norm 1.650324175189e-08 true resid norm 1.462015895771e-01
81 KSP preconditioned resid norm 1.648384674574e-08 true resid norm 1.462009093701e-01
82 KSP preconditioned resid norm 1.646363445772e-08 true resid norm 1.462001938088e-01
83 KSP preconditioned resid norm 1.642895250869e-08 true resid norm 1.462001704846e-01
84 KSP preconditioned resid norm 1.696723246615e-08 true resid norm 1.461858749698e-01
85 KSP preconditioned resid norm 1.856665593258e-08 true resid norm 1.462124281091e-01
86 KSP preconditioned resid norm 1.841962116850e-08 true resid norm 1.462148912533e-01
87 KSP preconditioned resid norm 1.698558241454e-08 true resid norm 1.461781897268e-01
88 KSP preconditioned resid norm 1.905123320211e-08 true resid norm 1.466101067430e-01
89 KSP preconditioned resid norm 1.711173152252e-08 true resid norm 1.463386042754e-01
90 KSP preconditioned resid norm 1.784287144041e-08 true resid norm 1.464641485021e-01
91 KSP preconditioned resid norm 1.808297575000e-08 true resid norm 1.464123027903e-01
92 KSP preconditioned resid norm 1.820795767966e-08 true resid norm 1.463642823300e-01
93 KSP preconditioned resid norm 1.811029186150e-08 true resid norm 1.464525930488e-01
94 KSP preconditioned resid norm 1.837449132765e-08 true resid norm 1.467284100358e-01
95 KSP preconditioned resid norm 1.799274687142e-08 true resid norm 1.467334617102e-01
96 KSP preconditioned resid norm 1.780871897998e-08 true resid norm 1.467508060173e-01
97 KSP preconditioned resid norm 1.780933765924e-08 true resid norm 1.466991064681e-01
98 KSP preconditioned resid norm 1.693611578188e-08 true resid norm 1.468053166786e-01
Barry Smith wrote:
> Randy,
>
> Do you have this problem on one process?
>
> Barry
>
>
> On Mon, 25 Sep 2006, Randall Mackie wrote:
>
>>
>> Barry Smith wrote:
>>> Randy,
>>>
>>>> Now, if I want to solve (2) above, do I simply make a call to
>>>> KSPSolveTranspose(ksp,b,xsol), where I've set b to the right
>>>> hand side of (2)
>>> Yes, this is the way we intend it to be used. You should not
>>> have to construct the transposed matrices.
>>>
>>> Questions:
>>>
>>> Are you using KSPSetNullSpace()?
>> No
>>
>>> Are you using right or left preconditioning? Or not setting it?
>> I'm not setting it, just using the default
>>
>>
>>> What KSP method are you using?
>>> What preconditioner are you using?
>> -em_ksp_truemonitor \
>> -em_ksp_type bcgs \
>> -em_pc_type bjacobi \
>> -em_sub_pc_type ilu \
>> -em_sub_pc_factor_levels 3 \
>> -em_sub_pc_factor_fill 6 \
>>
>>> Barry
>>>
>>>
>>>
>>> On Mon, 25 Sep 2006, Randall Mackie wrote:
>>>
>>>> I have a situation where I have to solve the following problems:
>>>>
>>>> 1) Ax=b
>>>>
>>>> 2) (A)^T u = c
>>>>
>>>> A is not symmetric.
>>>>
>>>>
>>>> After I set up my A matrix and the preconditioner P (which is NOT the same
>>>> as
>>>> A),
>>>> I solve it like so:
>>>>
>>>>
>>>> call set_P(da,P,l,m,n,period,resist,x,y,z)
>>>> call set_A(da,A,l,m,n,period,resist,x,y,z)
>>>>
>>>> call MatSetBlockSize(A,3,ierr)
>>>> call MatSetBlockSize(P,3,ierr)
>>>>
>>>> call KSPSetOperators(ksp,A,P,DIFFERENT_NONZERO_PATTERN,ierr)
>>>> call KSPSetInitialGuessNonzero(ksp,PETSC_TRUE,ierr)
>>>>
>>>> call KSPSolve(ksp,b,xsol,ierr)
>>>> call KSPGetIterationNumber(ksp,its,ierr)
>>>> call KSPGetConvergedReason(ksp,reason,ierr)
>>>>
>>>>
>>>> Now, if I want to solve (2) above, do I simply make a call to
>>>> KSPSolveTranspose(ksp,b,xsol), where I've set b to the right
>>>> hand side of (2), or do I have to create the transposes of both
>>>> A and the preconditioner and just use KSPSolve?
>>>>
>>>>
>>>> When I've tried just using KSPSolveTranspose, the preconditioned residual
>>>> norm falls, but not as rapidly as when doing (1), and the true residual
>>>> norm
>>>> seems not to change much at all.
>>>>
>>>>
>>>> Thanks, Randy
>>>>
>>>>
>>>>
>>
>
--
Randall Mackie
GSY-USA, Inc.
PMB# 643
2261 Market St.,
San Francisco, CA 94114-1600
Tel (415) 469-8649
Fax (415) 469-5044
California Registered Geophysicist
License No. GP 1034
More information about the petsc-users
mailing list