tutorial
120 pages
English
Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres
120 pages
English
Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres

Description

SANDIA REPORTSAND2004-2189Unlimited ReleasePrinted May 2004Trilinos TutorialMarzio Sala, Michael Heroux, David DayPrepared bySandia National LaboratoriesAlbuquerque, New Mexico 87185 and Livermore, California 94550Sandia is a multiprogram laboratory operated by Sandia Corporation,a Lockheed Martin Company, for the United States Department of Energy’sNational Nuclear Security Administration under Contract DE-AC04-94-AL85000.Approved for public release; further dissemination unlimited.UYNIGTREEDNSETFAOTETIssued by Sandia National Laboratories, operated for the United States Department ofEnergy by Sandia Corporation.NOTICE: This report was prepared as an account of work sponsored by an agency ofthe United States Government. Neither the United States Government, nor any agencythereof, nor any of their employees, nor any of their contractors, subcontractors, or theiremployees, make any warranty, express or implied, or assume any legal liability or re-sponsibility for the accuracy, completeness, or usefulness of any information, appara-tus, product, or process disclosed, or represent that its use would not infringe privatelyowned rights. Reference herein to any speci c commercial product, process, or serviceby trade name, trademark, manufacturer, or otherwise, does not necessarily constituteor imply its endorsement, recommendation, or favoring by the United States Govern-ment, any agency thereof, or any of their contractors or ...

Informations

Publié par
Nombre de lectures 21
Langue English

Extrait

SANDIA REPORT
SAND2004-2189
Unlimited Release
Printed May 2004
Trilinos Tutorial
Marzio Sala, Michael Heroux, David Day
Prepared by
Sandia National Laboratories
Albuquerque, New Mexico 87185 and Livermore, California 94550
Sandia is a multiprogram laboratory operated by Sandia Corporation,
a Lockheed Martin Company, for the United States Department of Energy’s
National Nuclear Security Administration under Contract DE-AC04-94-AL85000.
Approved for public release; further dissemination unlimited.U
Y
N
I
G
T
R
E
E
D
N
S
E
T
F
A
O
T
E
T
Issued by Sandia National Laboratories, operated for the United States Department of
Energy by Sandia Corporation.
NOTICE: This report was prepared as an account of work sponsored by an agency of
the United States Government. Neither the United States Government, nor any agency
thereof, nor any of their employees, nor any of their contractors, subcontractors, or their
employees, make any warranty, express or implied, or assume any legal liability or re-
sponsibility for the accuracy, completeness, or usefulness of any information, appara-
tus, product, or process disclosed, or represent that its use would not infringe privately
owned rights. Reference herein to any speci c commercial product, process, or service
by trade name, trademark, manufacturer, or otherwise, does not necessarily constitute
or imply its endorsement, recommendation, or favoring by the United States Govern-
ment, any agency thereof, or any of their contractors or subcontractors. The views and
opinions expressed herein do not necessarily state or re ect those of the United States
Government, any agency thereof, or any of their contractors.
Printed in the United States of America. This report has been reproduced directly from
the best available copy.
Available to DOE and DOE contractors from
U.S. Department of Energy
Of ce of Scienti c and Technical Information
P.O. Box 62
Oak Ridge, TN 37831
Telephone: (865) 576-8401
Facsimile: (865) 576-5728
E-Mail: reports@adonis.osti.gov
Online ordering: http://www.doe.gov/bridge
Available to the public from
U.S. Department of Commerce
National Technical Information Service
5285 Port Royal Rd
Spring eld, VA 22161
Telephone: (800) 553-6847
Facsimile: (703) 605-6900
E-Mail: orders@ntis.fedworld.gov
Online ordering: http://www.ntis.gov/help/ordermethods.asp?loc=7-4-0#online
• •
S
N
O
E
F
M
A
T
R
M
A
E
P
R
E
I
C
D
ASAND2004-2189
Unlimited Release
Printed May 2004
Trilinos Tutorial
Marzio Sala, Michael Heroux, David Day
Computational Mathematics and Algorithms Department
Sandia National Laboratories
P.O. Box 5800
Albuquerque, NM 87185-1110
Abstract
The Trilinos Project is an effort to facilitate the design, development, integration and
ongoing support of mathematical software libraries. The goal of the Trilinos Project is to
develop parallel solver algorithms and libraries within an object-oriented software frame-
work for the solution of large-scale, complex multiphysics engineering and scientific ap-
plications. The emphasis is on developing robust, scalable algorithms in a software frame-
work, using abstract interfaces for flexible interoperability of components while providing
a full-featured set of concrete classes that implement all the abstract interfaces.
This document introduces the use of Trilinos, version 4.0. The presented material
includes, among others, the definition of distributed matrices and vectors with Epetra,
the iterative solution of linear systems with AztecOO, incomplete factorizations with IF-
PACK, multilevel and domain decomposition preconditioners with ML, direct solution
of linear system with Amesos, eigenvalues and eigenvectors computations with Anasazi,
and iterative solution of nonlinear systems with NOX.
The tutorial is a self-contained introduction, intented to help computational scientists
effectively apply the appropriate Trilinos package to their applications. Basic examples
are presented that are fit to be imitated.
This document is a companion to the Trilinos User’s Guide [20] and Trilinos Develop-
ment Guides [21, 22]. Please note that the documentation included in each of the Trilinos’
packages is of fundamental importance.
3Acknowledgments
The authors would like to acknowledge the support of the ASCI and LDRD programs that
funded development of Trilinos.
The developers of each Trilinos’ package are acknowledged for providing excellent doc-
umentation and examples, without which this document would have never been possible. In
particular, we thank Heidi Thornquist for the contributions to the Teuchos chapter, and Erik
Boman for the chapter on partitioning and load balancing.
4Trilinos Tutorial
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.1 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.3 Copyright and Licensing of Trilinos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.4 Programming Language Used in this Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.5 Referencing Trilinos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.6 A Note on the Directory Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.7 List of Trilinos Developers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2 Working with Epetra Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.1 Epetra Communicator Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.2 Defining a Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.3 Creating and Assembling Serial Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.4 and a Distributed Vector . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.5 Epetra Import and Epetra Export classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3 Working with Epetra Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.1 Serial Dense Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.2 Distributed Sparse Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.3 Creating Block Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.4 Insert non-local Elements Using FE Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
4 Other Epetra Classes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
4.1 Epetra Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
4.2 Flops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
4.3 Epetra Operator and Epetra RowMatrix Classes . . . . . . . . . . . . . . . . . . . . . . . . . 42
4.4 LinearProblem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
4.5 Concluding Remarks on Epetra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5 Generating Linear Systems with Triutils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.1 Trilinos Util::CommandLineParser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.2 T Util::CrsMatrixGallery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
6 Iterative Solution of Linear Systems with AztecOO . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
6.1 Theoretical Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
6.2 Basic Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
6.3 Overlapping Domain Decomposition Preconditioners . . . . . . . . . . . . . . . . . . . . 62
56.4 AztecOO Problems as Preconditioners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
6.5 Concluding Remarks on AztecOO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
7 Incomplete Factorizations with IFPACK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
7.1 Theoretical Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
7.2 Parallel Incomplete Factorizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
7.3 Incomplete Cholesky F . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
7.4 RILUK Factorizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
7.5 Concluding Remarks on IFPACK . . . . . . . . .

  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents