CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Wiki > Biconjugate gradient stabilized method

Biconjugate gradient stabilized method

From CFD-Wiki

(Difference between revisions)
Jump to: navigation, search
Line 12: Line 12:
=== Algorithm ===
=== Algorithm ===
-
 
+
----
-
  Allocate temperary vectors p, phat, s, shat, t, v, rtilde  <br>
+
Allocate temperary vectors p, phat, s, shat, t, v, rtilde  <br>
-
  Allocate temerary reals rho_1, rho_2 , alpha, beta, omega <br>
+
Allocate temerary reals rho_1, rho_2 , alpha, beta, omega <br>
-
  r := b - A<math>\bullet</math>x <br>
+
: <br>
-
  rtilde = r <br>
+
r := b - A<math>\bullet</math>x <br>
-
  for i := 1 step 1 until max_itr do
+
rtilde = r <br>
-
      rho_1 = rtilde<math>\bullet</math>r <br>
+
: <br>
-
      if i = 1 then p := r else <br>
+
for i := 1 step 1 until max_itr do
-
        beta = (rho_1/rho_2) * (alpha/omega)<br>
+
::      rho_1 = rtilde<math>\bullet</math>r <br>
-
        p = r + beta * (p - omega * v) <br>
+
::      if i = 1 then p := r else <br>
-
      end if <br>
+
:::        beta = (rho_1/rho_2) * (alpha/omega)<br>
-
      solve (M<math>\bullet</math>phat  = p ) <br>
+
:::        p = r + beta * (p - omega * v) <br>
-
      v = A<math>\bullet</math>phat <br>
+
::      end if <br>
-
      alpha = rho_1 / (rtilde<math>\bullet</math>v) <br>
+
::      solve (M<math>\bullet</math>phat  = p ) <br>
-
      s = r - alpha * v <br>
+
::      v = A<math>\bullet</math>phat <br>
-
      solve (M<math>\bullet</math>shat = s ) <br>
+
::      alpha = rho_1 / (rtilde<math>\bullet</math>v) <br>
-
      t = A * shat;
+
::      s = r - alpha * v <br>
-
      omega = (t<math>\bullet</math>s) / (t<math>\bullet</math>t) <br>
+
::      solve (M<math>\bullet</math>shat = s ) <br>
-
      x = x + alpha * phat + omega * shat <br>
+
::      t = A * shat;
-
      r = s - omega * t <br>
+
::      omega = (t<math>\bullet</math>s) / (t<math>\bullet</math>t) <br>
-
      rho_2 = rho_1 <br>
+
::      x = x + alpha * phat + omega * shat <br>
-
  end (i-loop)
+
::      r = s - omega * t <br>
-
 
+
::      rho_2 = rho_1 <br>
-
  deallocate all temp memory <br>
+
end (i-loop)
-
  return TRUE <br>
+
:  <br> 
 +
deallocate all temp memory <br>
 +
return TRUE <br>
 +
----

Revision as of 08:18, 14 September 2005

Biconjugate gradient stabilized method

Biconjugate gradient stabilized method could be summarized as follows

System of equation

For the given system of equation
Ax = b ;
b = source vector
x = solution variable for which we seek the solution
A = coefficient matrix

M = the precondioning matrix constructued by matrix A


Algorithm


Allocate temperary vectors p, phat, s, shat, t, v, rtilde
Allocate temerary reals rho_1, rho_2 , alpha, beta, omega

r := b - A\bulletx
rtilde = r

for i := 1 step 1 until max_itr do
rho_1 = rtilde\bulletr
if i = 1 then p := r else
beta = (rho_1/rho_2) * (alpha/omega)
p = r + beta * (p - omega * v)
end if
solve (M\bulletphat = p )
v = A\bulletphat
alpha = rho_1 / (rtilde\bulletv)
s = r - alpha * v
solve (M\bulletshat = s )
t = A * shat;
omega = (t\bullets) / (t\bullett)
x = x + alpha * phat + omega * shat
r = s - omega * t
rho_2 = rho_1
end (i-loop)

deallocate all temp memory
return TRUE

My wiki