|
[Sponsors] |
February 8, 2001, 03:05 |
Thomas Algorithm Testing
|
#1 |
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.
|
|
February 8, 2001, 07:00 |
Re: Thomas Algorithm Testing
|
#2 |
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. |
|
February 8, 2001, 11:13 |
Re: Thomas Algorithm Testing
|
#3 |
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
|
|
February 8, 2001, 23:45 |
Re: Thomas Algorithm Testing
|
#4 |
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!! |
|
|
|
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 07:23 |
thomas algorithm | cvkeshav | Main CFD Forum | 2 | March 29, 2009 06:37 |
About Phase Coupled SIMPLE (PC-SIMPLE) algorithm | Yan Kai | Main CFD Forum | 0 | April 18, 2007 04:48 |
About Phase Coupled SIMPLE (PC-SIMPLE) algorithm | Yan Kai | FLUENT | 0 | April 14, 2007 00:17 |
Why Thomas Algorithm for tridiagonal systems? | Yogesh Talekar | Main CFD Forum | 6 | July 15, 1999 14:56 |