comp.lang.ada
 help / color / mirror / Atom feed
From: Ken Thomas <kst@ecs.soton.ac.uk>
Subject: Re: Does Ada need elemental functions to make it suitable for scientific work?
Date: Wed, 11 Jul 2012 02:42:15 -0700 (PDT)
Date: 2012-07-11T02:42:15-07:00	[thread overview]
Message-ID: <1c900926-4706-40a2-ba63-88e8a858feff@googlegroups.com> (raw)
In-Reply-To: <c769ecea-8650-4bab-8c2b-6f0799b6dbe1@googlegroups.com>

On Wednesday, July 11, 2012 9:41:50 AM UTC+1, (unknown) wrote:
> Ada novice :
> 
> &gt; In finite element formulations, one will usually end up with sparse matrices. I do not know whether Ada has support for such matrices. Matlab for instance has dedicated solver(s) for the system Ax=b when A is a sparse matrix. I think beside storage consideration, sparse matrices solvers are faster (I can be wrong though).
> 
> They are fast but it all depends on the problem and the conditioning of the matrix. Sometimes you are also well served by band matrices and a good algorithm to rearrange the node numbering so that nodes that are close in the mesh end up with close indices and then the matrix has fewer non-zero diagonal bands around the main diagonal.
> Choice of solvers for sparse matrices are limited - because they need to. e.g. a LU decomposition would require to know where are the non-zeros for having L and U stored as sparse matrices. And probably they are not sparse at all...
> 
> You find a sparse matrix package and appropriate solvers in Mathpaqs pack there:
>   http://sf.net/projects/mathpaqs/
> ______________________________________________________________________________
> Gautier&#39;s Ada programming -- http://gautiersblog.blogspot.com/search/label/Ada 
> NB: follow the above link for a valid e-mail address

I have written finite element codes in Ada2005 and sparse matrices are essential. Without these only small toy problems are possible. There are several  stages in the method:

Given a FEM mesh, assemble mass and stiffness  matrices. The matrix structure is unknown so I used an instantiation of Ada.Containers.Ordered_Maps. The Key_Type is the indices and the Element_Type a Real type. The ordering function can give row or column ordering.

The next stage is the linear algebra; both linear equations and eigenvalues are important. The choices are direct solvers for example http://www.cise.ufl.edu/research/sparse/umfpack
or iterative solvers. Writing direct solvers is very difficult (I have tried) and the best advice is to obtain or write bindings to some of the codes.

For iterative solvers, you will need good preconditioning. 

Ken




      reply	other threads:[~2012-07-11 21:50 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-09 23:27 Does Ada need elemental functions to make it suitable for scientific work? Nasser M. Abbasi
     [not found] ` <d78nv7dhf88bqv7hrd9eft231a4h2scs10@invalid.netcom.com>
2012-07-10  4:22   ` Nasser M. Abbasi
2012-07-10 14:26     ` Marco
2012-07-10  4:24 ` gautier_niouzes
2012-07-10  5:22   ` Ada novice
2012-07-10  7:27     ` Dmitry A. Kazakov
2012-07-10  8:06     ` gautier_niouzes
     [not found]     ` <637de084-0e71-4077-a1c5-fc4200cad3cf@googlegroups.com>
2012-07-10  8:39       ` Nasser M. Abbasi
2012-07-10  8:58         ` Ada novice
2012-07-10  9:07         ` Dmitry A. Kazakov
2012-07-10  9:21           ` Nasser M. Abbasi
2012-07-10  9:26             ` Nasser M. Abbasi
2012-07-10  9:50             ` Dmitry A. Kazakov
2012-07-20  1:56             ` Randy Brukardt
2012-07-20 21:49               ` Adam Beneschan
2012-07-12  0:31           ` robin.vowels
2012-07-12  7:12             ` Dmitry A. Kazakov
2012-07-29 13:39               ` Robin Vowels
2012-07-29 14:22                 ` Dmitry A. Kazakov
2012-07-29 20:54                   ` glen herrmannsfeldt
     [not found]                     ` <apib1897s56dkultqmfl3emvk1os3tfdak@invalid.netcom.com>
2012-07-30  4:15                       ` glen herrmannsfeldt
     [not found]                         ` <nfhd181tv9u87mcqfb7rgd8lm48ihr9f4r@invalid.netcom.com>
2012-07-31  8:53                           ` MATRIX MULTIPLICATION Robin Vowels
2012-07-31  9:05                             ` Robin Vowels
2012-07-30  0:49                   ` Does Ada need elemental functions to make it suitable for scientific work? Robin Vowels
2012-07-12  0:22         ` robin.vowels
2012-07-20  1:51         ` Randy Brukardt
2012-07-29 13:53           ` Robin Vowels
2012-07-29 15:51             ` J-P. Rosen
2012-07-29 16:07               ` Dmitry A. Kazakov
2012-07-29 20:30                 ` Simon Wright
2012-07-29 20:59                   ` glen herrmannsfeldt
2012-07-29 21:44                   ` J-P. Rosen
2012-07-29 22:54                     ` Simon Wright
2012-07-30  0:53               ` Robin Vowels
2012-07-30  2:20               ` Shmuel Metz
2012-07-10 12:46       ` Brian Drummond
2012-07-10 11:06 ` Simon Wright
2012-07-10 11:59 ` Georg Bauhaus
2012-07-10 12:20 ` Brian Drummond
2012-07-10 19:52 ` Ada novice
2012-07-11  8:41   ` gautier_niouzes
2012-07-11  9:42     ` Ken Thomas [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox