CalculiX  2.13
A Free Software Three-Dimensional Structural Finite Element Program
preconditioning.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine preconditioning (ad, au, b, neq, irow, jq, adaux)
 

Function/Subroutine Documentation

◆ preconditioning()

subroutine preconditioning ( real*8, dimension(*), intent(inout)  ad,
real*8, dimension(*), intent(inout)  au,
real*8, dimension(*), intent(inout)  b,
integer, intent(in)  neq,
integer, dimension(*), intent(in)  irow,
integer, dimension(*), intent(in)  jq,
real*8, dimension(*), intent(inout)  adaux 
)
22 !
23  implicit none
24 !
25  integer neq,irow(*),jq(*),i,ic,ir
26 !
27  real*8 ad(*),au(*),b(*),adaux(*),adc
28 !
29  intent(in) neq,irow,jq
30 !
31  intent(inout) ad,au,b,adaux
32 !
33 ! inverse of the square root of the diagonal
34 ! the sign takes care that the diagonal term becomes 1
35 ! (and not -1)
36 !
37  do i=1,neq
38  adaux(i)=dsign(1.d0/dsqrt(dabs(ad(i))),ad(i))
39  enddo
40 c do i=1,neq
41 c adaux(i)=1.d0/dsqrt(dabs(ad(i)))
42 c enddo
43 !
44 ! scaling the matrix and the right hand side
45 !
46  do ic=1,neq
47  adc=dabs(adaux(ic))
48 !
49 ! scaling the diagonal
50 !
51  ad(ic)=ad(ic)*adc*adaux(ic)
52 !
53 ! scaling the off-diagonal terms
54 !
55  do i=jq(ic),jq(ic+1)-1
56  ir=irow(i)
57  au(i)=au(i)*adc*adaux(ir)
58  enddo
59 !
60 ! scaling the right hand side
61 !
62  b(ic)=b(ic)*adaux(ic)
63  enddo
64 !
65 ! taking the absolute value
66 !
67  do i=1,neq
68  adaux(i)=dabs(adaux(i))
69  enddo
70 !
71  return
Hosted by OpenAircraft.com, (Michigan UAV, LLC)