FEI Package Browser (Single Doxygen Collection)
Version of the Day
|
#include <fei_MatrixTraits.hpp>
Static Public Member Functions | |
static const char * | typeName () |
static double * | getBeginPointer (T *) |
static int | getOffset (T *, int, int) |
static int | setValues (T *mat, double scalar) |
static int | getNumLocalRows (T *mat, int &numRows) |
static int | getRowLength (T *mat, int row, int &length) |
static int | copyOutRow (T *mat, int row, int len, double *coefs, int *indices) |
static int | putValuesIn (T *mat, int numRows, const int *rows, int numCols, const int *cols, const double *const *values, bool sum_into) |
static int | globalAssemble (T *A) |
static int | matvec (T *A, fei::Vector *x, fei::Vector *y) |
Define a struct of matrix access traits. The fei matrix implementation class fei::Matrix_Impl is essentially a filter which passes data to library-specific matrix objects (such as Trilinos/Epetra's Epetra_CrsMatrix). fei::Matrix_Impl is a template, and the template parameter is the matrix object. In order to use an arbitrary matrix object with fei::Matrix_Impl, it is only necessary to define a specialization of this MatrixTraits struct for the matrix object.
For an example specialization, see support-Trilinos/fei_MatrixTraits_Epetra.hpp.
This "base" MatrixTraits struct provides function stubs for default type "T", which will catch the use of any matrix type for which specialized traits have not been defined.
Note: Several functions accept row-numbers and/or column-numbers. These are always global indices. In a parallel setting, the fei defines a global set of row-indices which are partitioned across processors so that each processor owns a unique subset of the global row space. (Ownership of column-indices is not unique, a given column-index may appear in rows on multiple processors.)
Note2: Implementers can safely assume that these functions will only be called with locally-owned row-numbers.
Definition at line 45 of file fei_MatrixTraits.hpp.
|
inlinestatic |
Return a string type-name for the underlying matrix. May appear in
debug-output logs, etc. Does not need to exactly correspond to the type, but should be descriptive.
Definition at line 51 of file fei_MatrixTraits.hpp.
|
inlinestatic |
Definition at line 54 of file fei_MatrixTraits.hpp.
Referenced by fei::Matrix_Impl< T >::getBeginPointer().
|
inlinestatic |
Definition at line 59 of file fei_MatrixTraits.hpp.
Referenced by fei::Matrix_Impl< T >::getOffset().
|
inlinestatic |
Set a specified scalar value throughout the matrix.
Definition at line 66 of file fei_MatrixTraits.hpp.
Referenced by fei::Matrix_core::putScalar_remotelyOwned().
|
inlinestatic |
Query the number of local rows. This is expected to be the number of point-entry rows on the local processor.
Definition at line 72 of file fei_MatrixTraits.hpp.
|
inlinestatic |
Given a locally-owned global row number, query the length (number of nonzeros) of that row.
Definition at line 78 of file fei_MatrixTraits.hpp.
Referenced by fei::Matrix_Impl< T >::getRowLength().
|
inlinestatic |
Given a locally-owned global row number, pass out a copy of the contents of that row.
mat | |
row | Global row number |
len | Length of the user-allocated arrays coefs and indices. |
coefs | User-allocated array which will hold matrix coefficients on output. |
indices | User-allocated array which will hold column-indices on output. |
Definition at line 93 of file fei_MatrixTraits.hpp.
Referenced by fei::Matrix_Impl< T >::copyOutRow().
|
inlinestatic |
Sum a C-style table of coefficient data into the underlying matrix.
This is a rectangular array of coefficients for rows/columns defined by the 'rows' and 'cols' lists.
Definition at line 101 of file fei_MatrixTraits.hpp.
Referenced by fei::Matrix_Impl< T >::giveToUnderlyingMatrix().
|
inlinestatic |
Perform any necessary internal communications/synchronizations or other operations appropriate at end of data input. For some implementations this will be a no-op, so this "default implementation" returns 0. (The Trilinos/Epetra traits specialization calls A->FillComplete() at this point.)
Definition at line 114 of file fei_MatrixTraits.hpp.
|
inlinestatic |
Compute the matrix-vector product y = A*x. It is expected that the underlying matrix object will form the local portion of the result 'y' on the local processor.
Definition at line 120 of file fei_MatrixTraits.hpp.