From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DATE_IN_PAST_12_24 autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,ab436e97ff76821f X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Received: by 10.204.129.81 with SMTP id n17mr5424654bks.3.1342043422031; Wed, 11 Jul 2012 14:50:22 -0700 (PDT) Path: m12ni29bkm.0!nntp.google.com!news2.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Ken Thomas Newsgroups: comp.lang.ada Subject: Re: Does Ada need elemental functions to make it suitable for scientific work? Date: Wed, 11 Jul 2012 02:42:15 -0700 (PDT) Organization: http://groups.google.com Message-ID: <1c900926-4706-40a2-ba63-88e8a858feff@googlegroups.com> References: NNTP-Posting-Host: 152.78.66.38 Mime-Version: 1.0 X-Trace: posting.google.com 1342000129 18710 127.0.0.1 (11 Jul 2012 09:48:49 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 11 Jul 2012 09:48:49 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=152.78.66.38; posting-account=B_SmUwoAAAArT7-avjstloPG8dLOABck User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-07-11T02:42:15-07:00 List-Id: On Wednesday, July 11, 2012 9:41:50 AM UTC+1, (unknown) wrote: > Ada novice=A0: >=20 > > In finite element formulations, one will usually end up with sparse = matrices. I do not know whether Ada has support for such matrices. Matlab f= or instance has dedicated solver(s) for the system Ax=3Db when A is a spars= e matrix. I think beside storage consideration, sparse matrices solvers are= faster (I can be wrong though). >=20 > They are fast but it all depends on the problem and the conditioning of t= he matrix. Sometimes you are also well served by band matrices and a good a= lgorithm to rearrange the node numbering so that nodes that are close in th= e mesh end up with close indices and then the matrix has fewer non-zero dia= gonal 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... >=20 > You find a sparse matrix package and appropriate solvers in Mathpaqs pack= there: > http://sf.net/projects/mathpaqs/ > _________________________________________________________________________= _____ > Gautier's Ada programming -- http://gautiersblog.blogspot.com/search/= label/Ada=20 > NB: follow the above link for a valid e-mail address I have written finite element codes in Ada2005 and sparse matrices are esse= ntial. Without these only small toy problems are possible. There are severa= l stages in the method: Given a FEM mesh, assemble mass and stiffness matrices. The matrix structu= re is unknown so I used an instantiation of Ada.Containers.Ordered_Maps. Th= e Key_Type is the indices and the Element_Type a Real type. The ordering fu= nction 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 trie= d) and the best advice is to obtain or write bindings to some of the codes. For iterative solvers, you will need good preconditioning.=20 Ken