|
Thyra Package Browser (Single Doxygen Collection) Version of the Day
|
Simple example subclass for Spmd tridiagonal matrices. More...
#include <ExampleTridiagSpmdLinearOp.hpp>

Public Member Functions | |
| ExampleTridiagSpmdLinearOp () | |
| ExampleTridiagSpmdLinearOp (const Teuchos::RCP< const Teuchos::Comm< Thyra::Ordinal > > &comm, const Thyra::Ordinal localDim, const Teuchos::ArrayView< const Scalar > &lower, const Teuchos::ArrayView< const Scalar > &diag, const Teuchos::ArrayView< const Scalar > &upper) | |
| void | initialize (const Teuchos::RCP< const Teuchos::Comm< Thyra::Ordinal > > &comm, const Thyra::Ordinal localDim, const Teuchos::ArrayView< const Scalar > &lower, const Teuchos::ArrayView< const Scalar > &diag, const Teuchos::ArrayView< const Scalar > &upper) |
Protected Member Functions | |
| Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > | range () const |
| | |
| Teuchos::RCP< const Thyra::VectorSpaceBase< Scalar > > | domain () const |
| | |
| bool | opSupportedImpl (Thyra::EOpTransp M_trans) const |
| | |
| void | applyImpl (const Thyra::EOpTransp M_trans, const Thyra::MultiVectorBase< Scalar > &X_in, const Teuchos::Ptr< Thyra::MultiVectorBase< Scalar > > &Y_inout, const Scalar alpha, const Scalar beta) const |
| | |
Private Member Functions | |
| void | communicate (const bool first, const bool last, const Teuchos::ArrayView< const Scalar > &x, const Teuchos::Ptr< Scalar > &x_km1, const Teuchos::Ptr< Scalar > &x_kp1) const |
Private Attributes | |
| Teuchos::RCP< const Teuchos::Comm< Thyra::Ordinal > > | comm_ |
| Teuchos::RCP< const Thyra::SpmdVectorSpaceBase < Scalar > > | space_ |
| Teuchos::Array< Scalar > | lower_ |
| Teuchos::Array< Scalar > | diag_ |
| Teuchos::Array< Scalar > | upper_ |
Simple example subclass for Spmd tridiagonal matrices.
This subclass represents a linear operator for tridiagonal matrices of the global form:
If there is only
processes then the arrays lower[], diag[], and upper[] of dimension localDim-1, localDim and localDim-1 respectively are stored (see initialize()).
If there
processes then locally this class stores slightly different arrays of data depending on which process this is and process-to-process communication is required.
On process 0 with
local vector elements the following sub-matrix is stored:
In this case, arrays lower[], diag[], and upper[] of dimension localDim-1, localDim and localDim respectively are stored (see initialize()).
On process
, where
, with local offset
and
local vector elements the following sub-matrix is stored:
In this case, arrays lower[], diag[], and upper[] of dimension localDim, localDim and localDim respectively are stored (see initialize()).
On process
with local offset
and
local vector elements the following sub-matrix is stored:
In this case, arrays lower[], diag[], and upper[] of dimension localDim, localDim and localDim-1 respectively are stored (see initialize()).
See the source code for this simple example by clicking on the link to the definition below.
Definition at line 130 of file ExampleTridiagSpmdLinearOp.hpp.
| ExampleTridiagSpmdLinearOp< Scalar >::ExampleTridiagSpmdLinearOp | ( | ) | [inline] |
Construct to uninitialized.
Definition at line 134 of file ExampleTridiagSpmdLinearOp.hpp.
| ExampleTridiagSpmdLinearOp< Scalar >::ExampleTridiagSpmdLinearOp | ( | const Teuchos::RCP< const Teuchos::Comm< Thyra::Ordinal > > & | comm, |
| const Thyra::Ordinal | localDim, | ||
| const Teuchos::ArrayView< const Scalar > & | lower, | ||
| const Teuchos::ArrayView< const Scalar > & | diag, | ||
| const Teuchos::ArrayView< const Scalar > & | upper | ||
| ) | [inline] |
Calls initialize().
Definition at line 137 of file ExampleTridiagSpmdLinearOp.hpp.
References ExampleTridiagSpmdLinearOp< Scalar >::initialize().
| void ExampleTridiagSpmdLinearOp< Scalar >::initialize | ( | const Teuchos::RCP< const Teuchos::Comm< Thyra::Ordinal > > & | comm, |
| const Thyra::Ordinal | localDim, | ||
| const Teuchos::ArrayView< const Scalar > & | lower, | ||
| const Teuchos::ArrayView< const Scalar > & | diag, | ||
| const Teuchos::ArrayView< const Scalar > & | upper | ||
| ) |
Initialize given lower, diagonal and upper arrays of data.
| comm | [in] Communicator (allowed to be Teuchos::null) |
| localDim | [in] Dimension of this matrix (must be >= 2). |
| lower | [in] Array (length ( procRank == 0 ? localDim - 1 : localDim )) of the lower diagonal elements |
| diag | [in] Array (length localDim) of the central diagonal elements |
| upper | [in] Array (length ( procRank == numProc-1 ? localDim - 1 : localDim )) of the upper diagonal elements |
Preconditions:
localDim >= 2 Postconditions:
Definition at line 219 of file ExampleTridiagSpmdLinearOp.hpp.
Referenced by ExampleTridiagSpmdLinearOp< Scalar >::ExampleTridiagSpmdLinearOp().
| Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> > ExampleTridiagSpmdLinearOp< Scalar >::range | ( | ) | const [inline, protected, virtual] |
Implements Thyra::LinearOpBase< Scalar >.
Definition at line 180 of file ExampleTridiagSpmdLinearOp.hpp.
References ExampleTridiagSpmdLinearOp< Scalar >::space_.
| Teuchos::RCP<const Thyra::VectorSpaceBase<Scalar> > ExampleTridiagSpmdLinearOp< Scalar >::domain | ( | ) | const [inline, protected, virtual] |
Implements Thyra::LinearOpBase< Scalar >.
Definition at line 184 of file ExampleTridiagSpmdLinearOp.hpp.
References ExampleTridiagSpmdLinearOp< Scalar >::space_.
| bool ExampleTridiagSpmdLinearOp< Scalar >::opSupportedImpl | ( | Thyra::EOpTransp | M_trans | ) | const [inline, protected, virtual] |
Implements Thyra::LinearOpBase< Scalar >.
Definition at line 188 of file ExampleTridiagSpmdLinearOp.hpp.
References Thyra::NOTRANS.
| void ExampleTridiagSpmdLinearOp< Scalar >::applyImpl | ( | const Thyra::EOpTransp | M_trans, |
| const Thyra::MultiVectorBase< Scalar > & | X_in, | ||
| const Teuchos::Ptr< Thyra::MultiVectorBase< Scalar > > & | Y_inout, | ||
| const Scalar | alpha, | ||
| const Scalar | beta | ||
| ) | const [protected] |
| void ExampleTridiagSpmdLinearOp< Scalar >::communicate | ( | const bool | first, |
| const bool | last, | ||
| const Teuchos::ArrayView< const Scalar > & | x, | ||
| const Teuchos::Ptr< Scalar > & | x_km1, | ||
| const Teuchos::Ptr< Scalar > & | x_kp1 | ||
| ) | const [private] |
Definition at line 311 of file ExampleTridiagSpmdLinearOp.hpp.
Teuchos::RCP<const Teuchos::Comm<Thyra::Ordinal> > ExampleTridiagSpmdLinearOp< Scalar >::comm_ [private] |
Definition at line 204 of file ExampleTridiagSpmdLinearOp.hpp.
Teuchos::RCP<const Thyra::SpmdVectorSpaceBase<Scalar> > ExampleTridiagSpmdLinearOp< Scalar >::space_ [private] |
Definition at line 205 of file ExampleTridiagSpmdLinearOp.hpp.
Referenced by ExampleTridiagSpmdLinearOp< Scalar >::domain(), and ExampleTridiagSpmdLinearOp< Scalar >::range().
Teuchos::Array<Scalar> ExampleTridiagSpmdLinearOp< Scalar >::lower_ [private] |
Definition at line 206 of file ExampleTridiagSpmdLinearOp.hpp.
Teuchos::Array<Scalar> ExampleTridiagSpmdLinearOp< Scalar >::diag_ [private] |
Definition at line 207 of file ExampleTridiagSpmdLinearOp.hpp.
Teuchos::Array<Scalar> ExampleTridiagSpmdLinearOp< Scalar >::upper_ [private] |
Definition at line 208 of file ExampleTridiagSpmdLinearOp.hpp.
1.7.4