# Thomas Algorithm Testing

 Register Blogs Members List Search Today's Posts Mark Forums Read

 February 8, 2001, 03:05 Thomas Algorithm Testing #1 Out of Ideas Guest   Posts: n/a Sponsored Links 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 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.

 February 8, 2001, 11:13 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

 February 8, 2001, 23:45 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!!

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post katakgoreng Main CFD Forum 4 January 19, 2010 07:23 cvkeshav Main CFD Forum 2 March 29, 2009 05:37 Yan Kai Main CFD Forum 0 April 18, 2007 03:48 Yan Kai FLUENT 0 April 13, 2007 23:17 Yogesh Talekar Main CFD Forum 6 July 15, 1999 13:56