CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Thomas Algorithm Testing

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 8, 2001, 02:05
Default Thomas Algorithm Testing
  #1
Out of Ideas
Guest
 
Posts: n/a
I need some advice on the C program i am working on. Currently i am using the ADI scheme to work on my problem. However, i seem to suspect that the thomas algorithm i wrote has some errors. Is there anyway i can test my thomas algorithm? Please advice.
  Reply With Quote

Old   February 8, 2001, 06:00
Default Re: Thomas Algorithm Testing
  #2
andy
Guest
 
Posts: n/a
Download routine from netlib.

Download routine from Numerical Recipes.

Solve a 3x3 matrix with your code and check it by hand.
  Reply With Quote

Old   February 8, 2001, 10:13
Default Re: Thomas Algorithm Testing
  #3
yf yap
Guest
 
Posts: n/a
please refer to Applied Numerical Methods in C by Shoichiro Nakamura. pg. 385. a subroutine for solving tridiagonal matrix, thomas algorithm, is given there. for ADI, you must have at least 2 sweeps in different directions, i suggest that instead of having one subroutine for solving all those tridiagonal matrices, try to code one subroutine for each sweeping direction in order to avoid unnecessary confusion. afterall, the thomas algorithm can be coded in few lines. as suggested by andy, do try a 3x3 matrix manually, it should be pretty easy to detect any possible errors with such small matrix. regards, yfyap
  Reply With Quote

Old   February 8, 2001, 22:45
Default Re: Thomas Algorithm Testing
  #4
T. Matsuzawa
Guest
 
Posts: n/a
hello

In order to check your Thomas Algorithm implementation, Make the check routines like this.

STEP1(Build problem) A x = b where A: (blocked? ) tridiagonal matrix (first some simple matrix, such as identitymatrix, then gradually augment complexitiy)

x_{exact}: any vector you want

then calculate the vector b STEP2(CHECK Tomas)

solve for x_{calc} by A x = b for given A & b in STEP1 using your Thomas. Then compare x_{exact} to x_{calc}.

STEP3 If OK, then change A to more complex matrix until you are confident to your implementation.

Good Luck!!
  Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there an alternative method for TDMA (Thomas algorithm) katakgoreng Main CFD Forum 4 January 19, 2010 06:23
thomas algorithm cvkeshav Main CFD Forum 2 March 29, 2009 05:37
About Phase Coupled SIMPLE (PC-SIMPLE) algorithm Yan Kai Main CFD Forum 0 April 18, 2007 03:48
About Phase Coupled SIMPLE (PC-SIMPLE) algorithm Yan Kai FLUENT 0 April 13, 2007 23:17
Why Thomas Algorithm for tridiagonal systems? Yogesh Talekar Main CFD Forum 6 July 15, 1999 13:56


All times are GMT -4. The time now is 00:53.