This main page provides the starting point for all of the documentation for Thyra interfaces and software. This documentation is generated using Doxygen.
The documentation for Thyra is broken up into a number of different doxygen collections as described in the next section.
The thrya package is broadly divided into interoperability interfaces and support software and the directory structure and the doxygen documentation is also divided in this way. This organization mirrors the directory structure of thyra.
src/interfacesdirectory define fundamental interoperability interfaces needed to glue code together. This is the most critical aspect of Thyra. In addition, interfaces are also partitioned between fundamental interfaces and extended interfaces.
This minimal set of basic operator/vector interfaces described here forms the foundation for all of the interoperability interfaces related to Abstract Numerical Algorithms (ANAs) provided in the Thyra package.
The fundamental interface classes shown in the above UML class diagram are described below:
Thyra::VectorSpaceFactoryBaseis the basic factory interface for creating
Thyra::VectorSpaceBaseobjects given a dimension.
Thyra::VectorSpaceBaseis the fundamental abstract interface for a vector space that defines the scalar product and factory functions for creating
Thyra::VectorBaseis the fundamental abstract interface for finite-dimensional vectors.
Thyra::LinearOpBaseis the fundamental abstract interface for linear operators.
Thyra::MultiVectorBaseis the fundamental abstract interface for collections of column vectors.
These interface classes rely on a few basic types and basic exception classes.
One important paper describing the RTOp approach, which provides the foundation for
RTOpPack::RTOpT, can be found in this paper. Note that
RTOpPack::RTOpT is a refinement of the C and C++ RTOp interfaces described in the aforementioned paper.
These are some interfaces based on the above Fundamental ANA Operator/Vector Interfaces and provide other pieces of functionality and define new types of interoperability. For example, this is where interfaces to various types of composite subclasses exist for product, or block, vector spaces (
Thyra::ProductVectorSpaceBase), vectors (
Thyra::ProductVectorBase), and multi-vectors (
Thyra::ProductMultiVectorBase). Various interfaces to decorator and composite linear operators are also contained here and include, for example,
Thyra::ProductVectorSpaceBasedefines an interface for a composite product vector space composed from one or more constituent
Thyra::ProductVectorBasedefines an interface for a composite product vector composed from one or more constituent
Thyra::ProductMultiVectorBasedefines an interface for a composite product multi-vector composed from one or more constituent
Note that below, the term "implicit" denotes the fact that the operators are not actually formed. For example, the sum of the implicitly added linear operators is never calculated, but the action of these operators on a vector is computed correctly as the sum of the action of each individual operator on that vector.
Thyra::ScaledAdjointLinearOpBaseis the base class for all decorator subclasses that implicitly scale and/or transpose a
Thyra::ZeroLinearOpBasedefines the interface for a zero linear operator.
Thyra::IdentityLinearOpBasedefines the interface for an identity linear operator .
Thyra::AddedLinearOpBasedefines the interface for implicitly added linear operators.
Thyra::MultipliedLinearOpBasedefines the interface for implicitly added linear operators.
Thyra::DiagonalLinearOpBasedefines the interface for a basic diagonal linear operator.
Thyra::BlockedLinearOpBaseis a base class for a logically blocked
Thyra::PhysicallyBlockedLinearOpBaseis a base class for a physically blocked
LinearOpBaseobject where the blocks can be set externally.
Note: These interfaces are not strictly related to ANAs and therefore may not be appropriate to be placed in this collection. However, they are derived for the ANA interfaces and therefore, very weakly, belong in this collection of code.
Thyra::MpiVectorSpaceBasedefines an interface for getting information about the partitioning of elements to processors in an SPMD program.
Thyra::MultiVectorFileIOBaseis an interface for strategy objects that can read and write (multi)vectors to and from files in a very abstract way.
Thyra::MultiVectorRandomizerBaseis an interface for strategy objects that can produce random vectors and multi-vectors.
Teuchos::PolynomialTraitsis a concrete traits class that is used in the
These are interfaces that provide a high-level interface to preconditioners, linear solvers (
Thyra::LinearOpWithSolveBase), and factories for these (i.e.
Thyra::PreconditionerFactoryBase). Below we use the term "forward" to denote the original operator to which a solver is associated to distinguish it from the "inverse" operator.
Thyra::PreconditionerBasedefines an interface to left, right, split left/right, and otherwise general preconditioners.
Thyra::PreconditionerFactoryBasedefines an interface for generating or updating a
Thyra::PreconditionerBaseobject given a forward
Thyra::LinearOpWithSolveBasedefines a simple interface for performing the inverse linear operator application.
Thyra::LinearOpWithSolveFactoryBasedefines an interface for generating or updating a
Thyra::LinearOpWithSolveBaseobject given a forward
Included here is a variety of extended interfaces that build on the fundamental operator/solve interfaces.
Thyra::BlockedLinearOpWithSolveBaseis a base class for implicitly defined
Thyra::LinearOpWithSolveBaseobjects accessible as one or more
Thyra::PhysicallyBlockedLinearOpWithSolveBaseis a base class for composite
Thyra::BlockedLinearOpBaseobjects that are built for constituent
Thyra::ModelEvaluatorBasedefines basic types used by the model-evaluator.
Thyra::ModelEvaluatorBase::InArgsdefines the input arguments that a
Thyra::ModelEvaluatorobject will accept and is used to pass input arguments to an evaluation.
Thyra::ModelEvaluatorBase::OutArgsdefines the output function/objects that a
Thyra::ModelEvaluatorobject can compute and is used to pass the output functions/objects from an evaluation.
Thyra::ModelEvaluatordefines a very general interface for representing a number of different types of nonlinear problems.
Contained here are interfaces for nonlinear equation solvers.
Thyra::NonlinearSolverBasedefines a very general interface for solving a set of nonlinear equations represented through the
Thyra::LinearOpTester), and concrete product spaces/vectors/multi-vectors (e.g.
Thyra::DefaultProductVectorSpace). Also included is adapter support and concrete implementations for serial and SPMD (Single Program Multiple Data) space/vector/multi-vector implementations (e.g.
Thyra::DefaultSpmdVectorSpace). Another category of software is efficient Java-like handle/wrapper classes (e.g.
Thyra::LinearOperator) that defines a convenient API for the development of ANAs using MATLAB-like operator overloading. Some examples are also provided, including several for the Conjugate Gradient method and the Power Method. This collection of software is really too vast to give a full sense of what it contains in this short description.
Thyra::LinearOpWithSolveTesterand decorator subclasses like
Thyra::EpetraModelEvaluatorclass in this collection of code.
All of the interfaces are templated on a
Scalar (i.e. floating-point) type and therefore almost all of Thyra supports arbitrary scalar types such as complex types (e.g.
std::complex<double>), automatic differentiation types, interval types and extended precision types (i.e.
mpf_class) in addition to simpler real types such as
float. The only requirement for the
Scalar data type is that it have value semantics (i.e. default constructor, copy constructor, assignment operators) and define the basic overloaded operators
operator/(...). The traits class
Teuchos::ScalarTraits provides a means to write type-independent code and all of the Thyra software uses this traits class. Any scalar type that is to be used as a
Scalar must provide a specialization of this traits class (see source code for
Teuchos_ScalarTraits.hpp for examples of how to do this). In addition, if SPMD distributed-memory computing is to be used then specializations of the traits class
Teuchos::SerializationTraits must also be provided.
The Thyra interfaces and related software are not templated on an index (i.e. ordinal) type. Instead, the type
Thyra::Ordinal is used which is just a typedef that is defined at configure time to be an integer type of sufficient size. This type must be able to hold the value of the largest dimension of a vector space that will be used by an executable. For most platforms and use cases,
int is sufficient, but in other cases, for example on some 64 bit platforms,
long int may be necessary. Not templating on the index (ordinal) type does not result in any degradation in usability, runtime speed, or storage usage for any use case. However, certain types of subclasses of the Thyra interfaces, such as sparse matrix subclasses, may need to be templated on a local index (ordinal) type.
All of the code in the Thyra and related packages almost exclusively use the
Teuchos smart reference counted pointer class
Teuchos::RCP to handle dynamically allocated memory with object-oriented programming. Thyra also rigorously uses the idioms described in this report for passing object to and from functions that involve
All error and general exception handling in the Thyra interfaces and related software is performed using the built-in C++ exception handling mechanisms (i.e.
catch) and all thrown exceptions should inherit from the standard base class
std::exception. All exceptions in Thyra software are thrown using the macros
TEST_FOR_EXCEPT(). By consistently using these macros it is easy to set a breakpoint in a debugger just before an exception is thrown by setting a breakpoint on the function
TestForException_break() (e.g. by typing
break TestForException_break in gdb). If Trilinos is configured with
Trilinos_ENABLE_DEBUG=ON then a lot of runtime error checking is performed in Thyra support software, as well as in many other software packages. Whenever development work is being performed this option should always be enabled since a lot of errors will be caught that would be hard to diagnose otherwise. Significant effort has gone into developing this error checking code and in the information that is embedded in the exception objects (all derived from
std::exception) that are thrown when errors are detected.
Teuchos::BLASon which Thyra software depends.
Some of the more important configuration options are:
Trilinos_ENABLE_Thyra=ON: Causes the Thyra package and all of its dependent packages to be enabled and built. Without this option, there will be no Thyra header files or libraries included in the installation of Trilinos, i.e., when one runs
This paper describes the basic principles that go into the design of the Thyra Operator/Vector interface layer (and therefore also for the rest of Thyra).
This paper describes the basics of
Teuchos::RCP and outlines a convention for passing objects to and from functions that all of the code in Thyra adheres to.
This paper describes the need for, and the basic design of,
RTOpPack::RTOpT. The concrete implementation described in this paper used C structs while the current
RTOpPack::RTOpT is a fully templated C++ class implementation.
This short note describes a simple convention for writing function prototypes for linear algebra operations. This convention is used in this set of functions, for instance.
This document describes the coding and documentation guidelines used in the creation of Thyra.
Epetra_RowMatrixobject. However, the Belos implementation allows for the arbitrary implemention of the linear operators and vector spaces.