FEI Package Browser (Single Doxygen Collection)
Version of the Day
|
#include <fei_MatrixReducer.hpp>
Public Member Functions | |
MatrixReducer (fei::SharedPtr< fei::Reducer > reducer, fei::SharedPtr< fei::Matrix > target) | |
virtual | ~MatrixReducer () |
fei::SharedPtr< fei::Matrix > | getTargetMatrix () |
const char * | typeName () |
int | parameters (const fei::ParameterSet ¶mset) |
fei::SharedPtr< fei::MatrixGraph > | getMatrixGraph () const |
void | setMatrixGraph (fei::SharedPtr< fei::MatrixGraph > matrixGraph) |
int | getGlobalNumRows () const |
int | getLocalNumRows () const |
int | putScalar (double scalar) |
int | getRowLength (int row, int &length) const |
int | copyOutRow (int row, int len, double *coefs, int *indices) const |
int | sumIn (int numRows, const int *rows, int numCols, const int *cols, const double *const *values, int format=0) |
int | copyIn (int numRows, const int *rows, int numCols, const int *cols, const double *const *values, int format=0) |
int | sumInFieldData (int fieldID, int idType, int rowID, int colID, const double *const *data, int format=0) |
int | sumInFieldData (int fieldID, int idType, int rowID, int colID, const double *data, int format=0) |
int | sumIn (int blockID, int connectivityID, const double *const *values, int format=0) |
int | globalAssemble () |
int | multiply (fei::Vector *x, fei::Vector *y) |
void | setCommSizes () |
int | gatherFromOverlap (bool accumulate=true) |
int | writeToFile (const char *filename, bool matrixMarketFormat=true) |
int | writeToStream (FEI_OSTREAM &ostrm, bool matrixMarketFormat=true) |
bool | usingBlockEntryStorage () |
int | giveToUnderlyingMatrix (int numRows, const int *rows, int numCols, const int *cols, const double *const *values, bool sumInto, int format) |
int | giveToUnderlyingBlockMatrix (int row, int rowDim, int numCols, const int *cols, const int *LDAs, const int *colDims, const double *const *values, bool sumInto) |
void | markState () |
bool | changedSinceMark () |
Public Member Functions inherited from fei::Matrix | |
virtual | ~Matrix () |
virtual double * | getBeginPointer () |
virtual int | getOffset (int row, int col) |
Private Member Functions | |
int | giveToMatrix (int numRows, const int *rows, int numCols, const int *cols, const double *const *values, bool sumInto, int format) |
int | giveToBlockMatrix (int numRows, const int *rows, int numCols, const int *cols, const double *const *values, bool sumInto) |
Private Attributes | |
fei::SharedPtr< fei::Reducer > | reducer_ |
fei::SharedPtr< fei::Matrix > | target_ |
bool | globalAssembleCalled_ |
bool | changedSinceMark_ |
Definition at line 27 of file fei_MatrixReducer.hpp.
fei::MatrixReducer::MatrixReducer | ( | fei::SharedPtr< fei::Reducer > | reducer, |
fei::SharedPtr< fei::Matrix > | target | ||
) |
Constructor
Definition at line 19 of file fei_MatrixReducer.cpp.
References fei::SharedPtr< T >::get(), fei::VectorSpace::getCommunicator(), fei::Reducer::getLocalReducedEqns(), fei::Matrix::getMatrixGraph(), fei::MatrixGraph::getRowSpace(), MPI_Comm, reducer_, fei::Matrix_core::setEqnComm(), and target_.
|
virtual |
Destructor
Definition at line 40 of file fei_MatrixReducer.cpp.
|
inline |
Query for the underlying target matrix.
Definition at line 37 of file fei_MatrixReducer.hpp.
References target_.
Referenced by snl_fei::LinearSystem_General::enforceEssentialBC_LinSysCore(), fei::utils::get_LinearSystemCore(), and snl_fei::LinearSystem_General::parameters().
|
inlinevirtual |
Return a name describing the run-time type
of this object.
Implements fei::Matrix.
Definition at line 43 of file fei_MatrixReducer.hpp.
References target_, and fei::Matrix::typeName().
|
virtual |
Parameters method
Implements fei::Matrix.
Definition at line 45 of file fei_MatrixReducer.cpp.
References fei::Matrix::parameters(), and target_.
|
inlinevirtual |
Obtain the fei::MatrixGraph associated with this matrix
Implements fei::Matrix.
Definition at line 49 of file fei_MatrixReducer.hpp.
References fei::Matrix::getMatrixGraph(), and target_.
Referenced by sumIn(), and writeToFile().
|
virtual |
Set the fei::MatrixGraph associated with this matrix
Implements fei::Matrix.
Definition at line 51 of file fei_MatrixReducer.cpp.
References fei::Matrix::setMatrixGraph(), and target_.
|
virtual |
Get the global number of rows in the matrix.
Implements fei::Matrix.
Definition at line 57 of file fei_MatrixReducer.cpp.
References fei::VectorSpace::getGlobalNumIndices(), fei::Matrix::getMatrixGraph(), fei::MatrixGraph::getRowSpace(), and target_.
|
virtual |
Get the local number of rows in the matrix.
Implements fei::Matrix.
Definition at line 63 of file fei_MatrixReducer.cpp.
References fei::Matrix::getMatrixGraph(), fei::VectorSpace::getNumIndices_Owned(), fei::MatrixGraph::getRowSpace(), and target_.
|
virtual |
Set a specified scalar throughout the matrix.
Implements fei::Matrix.
Definition at line 68 of file fei_MatrixReducer.cpp.
References fei::Matrix::putScalar(), and target_.
|
virtual |
Get the length of a row of the matrix.
row | Global 0-based equation number |
length | Output. Length of the row. |
Implements fei::Matrix.
Definition at line 72 of file fei_MatrixReducer.cpp.
References FEI_OSTRINGSTREAM, fei::Matrix::getRowLength(), fei::Reducer::isSlaveEqn(), reducer_, target_, and fei::Reducer::translateToReducedEqn().
|
virtual |
Obtain a copy of the coefficients and indices for a row of the matrix.
row | Global 0-based equation number |
len | Length of the caller-allocated coefs and indices arrays |
coefs | Caller-allocated array, length 'len', to be filled with coefficients |
indices | Caller-allocated array, length 'len', to be filled with indices. (These indices will be global 0-based equation numbers.) |
Implements fei::Matrix.
Definition at line 85 of file fei_MatrixReducer.cpp.
References fei::Matrix::copyOutRow(), FEI_OSTRINGSTREAM, fei::Reducer::isSlaveEqn(), reducer_, target_, fei::Reducer::translateFromReducedEqn(), and fei::Reducer::translateToReducedEqn().
|
virtual |
Sum coefficients into the matrix, adding them to any coefficients that
may already exist at the specified row/column locations.
numRows | |
rows | |
numCols | |
cols | |
values | |
format | For compatibility with old FEI elemFormat... 0 means row-wise or row-major, 3 means column-major. Others not recognized |
Implements fei::Matrix.
Definition at line 103 of file fei_MatrixReducer.cpp.
References fei::Reducer::addMatrixValues(), reducer_, and target_.
Referenced by sumIn().
|
virtual |
Copy coefficients into the matrix, overwriting any coefficients that
may already exist at the specified row/column locations.
numRows | |
rows | |
numCols | |
cols | |
values | |
format | For compatibility with old FEI elemFormat... 0 means row-wise or row-major, 3 means column-major. Others not recognized |
Implements fei::Matrix.
Definition at line 114 of file fei_MatrixReducer.cpp.
References fei::Reducer::addMatrixValues(), reducer_, and target_.
|
virtual |
Sum coefficients into the matrix, specifying row/column locations by
identifier/fieldID pairs.
fieldID | Input. field-identifier for which data is being input. |
idType | Input. The identifier-type of the identifiers. |
rowID | Input. Identifier in row-space, for which data is being input. |
colID | Input. Identifier in column-space, for which data is being input. |
data | Input. C-style table of data. num-rows is the field-size (i.e., number of scalar components that make up the field) of 'fieldID', as is num-columns. |
format | For compatibility with old FEI elemFormat... 0 means row-wise or row-major, 3 means column-major. Others not recognized |
Implements fei::Matrix.
Definition at line 125 of file fei_MatrixReducer.cpp.
References fei::Reducer::addMatrixValues(), FEI_DENSE_ROW, fei::MatrixGraph::getColSpace(), fei::VectorSpace::getFieldSize(), fei::VectorSpace::getGlobalIndices(), fei::Matrix::getMatrixGraph(), fei::MatrixGraph::getRowSpace(), reducer_, and target_.
Referenced by sumInFieldData().
|
virtual |
Sum coefficients into the matrix, specifying row/column locations by
identifier/fieldID pairs.
fieldID | Input. field-identifier for which data is being input. |
idType | Input. The identifier-type of the identifiers. |
rowID | Input. Identifier in row-space, for which data is being input. |
colID | Input. Identifier in column-space, for which data is being input. |
data | Input. 1-D list representing a packed table of data. Data may be backed in row-major or column-major order and this may be specified with the 'format' argument. The "table" of data is of size num-rows X num-columns and num-rows is the field-size (i.e., number of scalar components that make up the field) of 'fieldID', as is num-columns. |
format | For compatibility with old FEI elemFormat... 0 means row-wise or row-major, 3 means column-major. Others not recognized |
Implements fei::Matrix.
Definition at line 156 of file fei_MatrixReducer.cpp.
References fei::VectorSpace::getFieldSize(), fei::Matrix::getMatrixGraph(), fei::MatrixGraph::getRowSpace(), sumInFieldData(), and target_.
|
virtual |
Sum coefficients, associated with a connectivity-block that was
initialized on the MatrixGraph object, into this matrix.
blockID | |
connectivityID | |
values | |
format | For compatibility with old FEI elemFormat... 0 means row-wise or row-major, 3 means column-major. Others not recognized |
Implements fei::Matrix.
Definition at line 177 of file fei_MatrixReducer.cpp.
References fei::MatrixGraph::getConnectivityIndices(), fei::MatrixGraph::getConnectivityNumIndices(), getMatrixGraph(), and sumIn().
|
virtual |
Perform any necessary internal communications/synchronizations or other
operations appropriate at end of data input. For some implementations this will be a no-op.
Implements fei::Matrix.
Definition at line 198 of file fei_MatrixReducer.cpp.
References fei::Reducer::assembleReducedMatrix(), fei::Matrix::globalAssemble(), reducer_, and target_.
|
virtual |
Form a matrix-vector product y = 'this' * x
Implements fei::Matrix.
Definition at line 204 of file fei_MatrixReducer.cpp.
References fei::Matrix::multiply(), and target_.
|
inlinevirtual |
perform initial communication to establish message sizes that will be needed for exchanging shared-node data. Called from within gatherFromOverlap usually, doesn't usually need to be explicitly called by client code. (Power users only...)
Implements fei::Matrix.
Definition at line 186 of file fei_MatrixReducer.hpp.
References fei::Matrix::setCommSizes(), and target_.
|
virtual |
After local overlapping data has been input, (e.g., element-data for a
finite-element application) call this method to have data that corresponds to shared identifiers be communicated from sharing-but-not- owning processors, to owning processors.
Implements fei::Matrix.
Definition at line 207 of file fei_MatrixReducer.cpp.
References fei::Reducer::assembleReducedMatrix(), fei::Matrix::gatherFromOverlap(), reducer_, fei::Matrix::setCommSizes(), and target_.
|
virtual |
Implementation of fei::Matrix::writeToFile
Implements fei::Matrix.
Definition at line 214 of file fei_MatrixReducer.cpp.
References fei::Barrier(), CHK_ERR, CHK_MPI, fei::Matrix::copyOutRow(), FEI_ENDL, FEI_OFSTREAM, fei::VectorSpace::getCommunicator(), fei::Reducer::getLocalReducedEqns(), getMatrixGraph(), fei::Matrix::getRowLength(), fei::MatrixGraph::getRowSpace(), fei::GlobalSum(), IOS_APP, IOS_FLOATFIELD, IOS_OUT, IOS_SCIENTIFIC, fei::localProc(), MPI_Comm, fei::numProcs(), reducer_, and target_.
|
virtual |
Implementation of fei::Matrix::writeToStream
Implements fei::Matrix.
Definition at line 292 of file fei_MatrixReducer.cpp.
References target_, and fei::Matrix::writeToStream().
|
inlinevirtual |
Query whether the underlying matrix object is a block-entry matrix.
Implements fei::Matrix.
Definition at line 204 of file fei_MatrixReducer.hpp.
References target_, and fei::Matrix::usingBlockEntryStorage().
int fei::MatrixReducer::giveToUnderlyingMatrix | ( | int | numRows, |
const int * | rows, | ||
int | numCols, | ||
const int * | cols, | ||
const double *const * | values, | ||
bool | sumInto, | ||
int | format | ||
) |
for experts only
int fei::MatrixReducer::giveToUnderlyingBlockMatrix | ( | int | row, |
int | rowDim, | ||
int | numCols, | ||
const int * | cols, | ||
const int * | LDAs, | ||
const int * | colDims, | ||
const double *const * | values, | ||
bool | sumInto | ||
) |
for experts only
|
virtual |
Set a "mark" point on the current state of the matrix, so that later a query can be made to see if the matrix has changed since this mark was set.
Implements fei::Matrix.
Definition at line 298 of file fei_MatrixReducer.cpp.
References fei::Matrix::markState(), and target_.
|
virtual |
Query whether the matrix has changed since markState() was called. If markState() hasn't been called since the matrix was constructed, then this query will return true.
Implements fei::Matrix.
Definition at line 301 of file fei_MatrixReducer.cpp.
References fei::Matrix::changedSinceMark(), and target_.
|
private |
|
private |
|
private |
Definition at line 240 of file fei_MatrixReducer.hpp.
Referenced by copyIn(), copyOutRow(), gatherFromOverlap(), getRowLength(), globalAssemble(), MatrixReducer(), sumIn(), sumInFieldData(), and writeToFile().
|
private |
Definition at line 241 of file fei_MatrixReducer.hpp.
Referenced by changedSinceMark(), copyIn(), copyOutRow(), gatherFromOverlap(), getGlobalNumRows(), getLocalNumRows(), getMatrixGraph(), getRowLength(), getTargetMatrix(), globalAssemble(), markState(), MatrixReducer(), multiply(), parameters(), putScalar(), setCommSizes(), setMatrixGraph(), sumIn(), sumInFieldData(), typeName(), usingBlockEntryStorage(), writeToFile(), and writeToStream().
|
private |
Definition at line 242 of file fei_MatrixReducer.hpp.
|
private |
Definition at line 243 of file fei_MatrixReducer.hpp.