FEI Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
fei::Matrix_core Class Referenceabstract

#include <fei_Matrix_core.hpp>

Inheritance diagram for fei::Matrix_core:

Public Member Functions

 Matrix_core (fei::SharedPtr< fei::MatrixGraph > matrixGraph, int numLocalEqns)
 
virtual ~Matrix_core ()
 
virtual int giveToMatrix (int numRows, const int *rows, int numCols, const int *cols, const double *const *values, bool sumInto, int format)=0
 
void setRHS (fei::SharedPtr< fei::Vector > rhsvector)
 
void setSlaveInfo (fei::SharedPtr< fei::MatrixGraph > matrixGraph)
 
fei::SharedPtr< fei::MatrixGraphgetMatrixGraph () const
 
const FillableMatgetRemotelyOwnedMatrix (int proc) const
 
FillableMatgetRemotelyOwnedMatrix (int proc)
 
std::map< int, FillableMat * > & getRemotelyOwnedMatrices ()
 
void putScalar_remotelyOwned (double scalar)
 
void setEqnComm (fei::SharedPtr< fei::EqnComm > eqnComm)
 

Static Public Member Functions

static void copyTransposeToWorkArrays (int numRows, int numCols, const double *const *values, std::vector< double > &work_1D, std::vector< const double * > &work_2D)
 

Protected Member Functions

void parameters (const fei::ParameterSet &paramset)
 
virtual int giveToUnderlyingMatrix (int numRows, const int *rows, int numCols, const int *cols, const double *const *values, bool sumInto, int format)=0
 
virtual int giveToBlockMatrix (int numRows, const int *rows, int numCols, const int *cols, const double *const *values, bool sumInto)=0
 
virtual int giveToUnderlyingBlockMatrix (int row, int rowDim, int numCols, const int *cols, const int *LDAs, const int *colDims, const double *const *values, bool sumInto)=0
 
void setName (const char *name)
 
void setCommSizes ()
 
int gatherFromOverlap (bool accumulate)
 
void setMatrixGraph (fei::SharedPtr< fei::MatrixGraph > matrixGraph)
 
int copyPointRowsToBlockRow (int numPtRows, int numPtCols, const double *const *ptValues, int numBlkCols, const int *blkColDims, double **blkValues)
 
int convertPtToBlk (int numRows, const int *rows, int numCols, const int *cols, int *blkRows, int *blkRowOffsets, int *blkCols, int *blkColOffsets)
 
MPI_Comm getCommunicator () const
 
const fei::SharedPtr< fei::VectorSpacevecSpace () const
 
fei::SharedPtr< fei::VectorSpacevecSpace ()
 
std::vector< int > & globalOffsets ()
 
const std::vector< int > & globalOffsets () const
 
int firstLocalOffset () const
 
int lastLocalOffset () const
 
int numProcs () const
 
int localProc () const
 
bool haveBlockMatrix () const
 
void setBlockMatrix (bool flag)
 
bool haveFEMatrix () const
 
void setFEMatrix (bool flag)
 
int getOwnerProc (int globalEqn) const
 
- Protected Member Functions inherited from fei::Logger
 Logger ()
 
virtual ~Logger ()
 
void setOutputLevel (OutputLevel olevel)
 
void addLogID (int ID)
 
void addLogEqn (int eqn)
 
bool isLogID (int ID)
 
bool isLogEqn (int eqn)
 
std::set< int > & getLogIDs ()
 
std::set< int > & getLogEqns ()
 

Protected Attributes

std::string name_
 
std::vector< int > work_indices_
 
std::vector< int > work_indices2_
 
std::vector< int > work_ints_
 
std::vector< double > work_data1D_
 
std::vector< const double * > work_data2D_
 
fei::SharedPtr< fei::EqnCommeqnComm_
 
- Protected Attributes inherited from fei::Logger
OutputLevel output_level_
 
FEI_OSTREAMoutput_stream_
 
std::set< int > logIDs_
 
std::set< int > logEqns_
 

Private Attributes

fei::SharedPtr< fei::VectorrhsVector_
 
MPI_Comm comm_
 
int localProc_
 
int numProcs_
 
fei::SharedPtr< fei::VectorSpacevecSpace_
 
fei::SharedPtr< fei::MatrixGraphmatrixGraph_
 
std::map< int, FillableMat * > remotelyOwned_
 
FillableMatremotelyOwned_last_requested_
 
std::vector< int > sendProcs_
 
std::vector< int > recvProcs_
 
std::vector< std::vector< char > > recv_chars_
 
std::vector< std::vector< char > > send_chars_
 
bool sendRecvProcsNeedUpdated_
 
int proc_last_requested_
 
bool haveBlockMatrix_
 
bool haveFEMatrix_
 
std::vector< int > globalOffsets_
 
int firstLocalOffset_
 
int lastLocalOffset_
 

Detailed Description

Definition at line 25 of file fei_Matrix_core.hpp.

Constructor & Destructor Documentation

◆ Matrix_core()

◆ ~Matrix_core()

fei::Matrix_core::~Matrix_core ( )
virtual

Definition at line 113 of file fei_Matrix_core.cpp.

References remotelyOwned_.

Member Function Documentation

◆ giveToMatrix()

virtual int fei::Matrix_core::giveToMatrix ( int numRows,
const int * rows,
int numCols,
const int * cols,
const double *const * values,
bool sumInto,
int format )
pure virtual

Implemented in fei::Matrix_Impl< T >.

◆ copyTransposeToWorkArrays()

void fei::Matrix_core::copyTransposeToWorkArrays ( int numRows,
int numCols,
const double *const * values,
std::vector< double > & work_1D,
std::vector< const double * > & work_2D )
static

Given a 2-D table (C-style list-of-pointers) of size numRows X numCols, copy the transpose of the data into the given 1-D work array and set the given 2-D array of pointers to point into the 1-D data. In other words, columns in the input will be rows in the output, and the entries in work_2D will point to the beginnings of those rows (former columns).

Parameters
numRowsFirst dimension of 'values'. i.e., number of pointers in the list of pointers.
numColsSecond dimension of 'values'. i.e., the length of each of the rows (all rows have the same length).
values2-D C-style table of data. List of pointers of length numRows, with each pointer pointing to 'numCols' items.
work_1Don exit, will have length numRows X numCols, and will contain the data from values. The data from 'values' will be transposed such that the entries from each column of 'values' will now lie contiguously.
work_2Don exit, will have length numCols, and will represent a C-style list-of-pointers where work_2D[i] = &(work_1D[i*numRows]). In other words, each entry of work_2D points to a row which was a column of 'values'. work_2D represents a table with 'numCols' rows, each of length 'numRows'.

Definition at line 320 of file fei_Matrix_core.cpp.

Referenced by fei::Reducer::addMatrixValues(), fei::Matrix_Impl< T >::giveToMatrix(), fei::Matrix_Local::giveToMatrix(), and test_matrix_unit1().

◆ setRHS()

void fei::Matrix_core::setRHS ( fei::SharedPtr< fei::Vector > rhsvector)

If slave-constraints have been registered with the matrix-graph, and if the constraints have a non-zero right-hand-side coefficient, then this matrix needs access to the linear-system's right-hand-side vector for assembling data into. For more details, see the SAND report that documents the FEI's constraint reduction.

Definition at line 166 of file fei_Matrix_core.cpp.

References rhsVector_.

◆ setSlaveInfo()

void fei::Matrix_core::setSlaveInfo ( fei::SharedPtr< fei::MatrixGraph > matrixGraph)

Instruct the Matrix_core to set its slave-constraint information (such as dependency matrix and constraint-right-hand-side vector) from the specified matrix-graph object.

◆ getMatrixGraph()

fei::SharedPtr< fei::MatrixGraph > fei::Matrix_core::getMatrixGraph ( ) const
inline

Definition at line 81 of file fei_Matrix_core.hpp.

References matrixGraph_.

Referenced by fei::Matrix_Impl< T >::getMatrixGraph().

◆ getRemotelyOwnedMatrix() [1/2]

◆ getRemotelyOwnedMatrix() [2/2]

FillableMat * fei::Matrix_core::getRemotelyOwnedMatrix ( int proc)
inline

◆ getRemotelyOwnedMatrices()

std::map< int, fei::FillableMat * > & fei::Matrix_core::getRemotelyOwnedMatrices ( )

Definition at line 87 of file fei_Matrix_core.cpp.

References remotelyOwned_.

Referenced by snl_fei::LinearSystem_FEData::implementBCs().

◆ putScalar_remotelyOwned()

void fei::Matrix_core::putScalar_remotelyOwned ( double scalar)

◆ setEqnComm()

void fei::Matrix_core::setEqnComm ( fei::SharedPtr< fei::EqnComm > eqnComm)

◆ parameters()

◆ giveToUnderlyingMatrix()

virtual int fei::Matrix_core::giveToUnderlyingMatrix ( int numRows,
const int * rows,
int numCols,
const int * cols,
const double *const * values,
bool sumInto,
int format )
protectedpure virtual

Implemented in fei::Matrix_Impl< T >.

Referenced by gatherFromOverlap().

◆ giveToBlockMatrix()

virtual int fei::Matrix_core::giveToBlockMatrix ( int numRows,
const int * rows,
int numCols,
const int * cols,
const double *const * values,
bool sumInto )
protectedpure virtual

Implemented in fei::Matrix_Impl< T >.

Referenced by gatherFromOverlap().

◆ giveToUnderlyingBlockMatrix()

virtual int fei::Matrix_core::giveToUnderlyingBlockMatrix ( int row,
int rowDim,
int numCols,
const int * cols,
const int * LDAs,
const int * colDims,
const double *const * values,
bool sumInto )
protectedpure virtual

Implemented in fei::Matrix_Impl< T >.

◆ setName()

void fei::Matrix_core::setName ( const char * name)
protected

Definition at line 143 of file fei_Matrix_core.cpp.

References name_.

Referenced by Matrix_core(), and parameters().

◆ setCommSizes()

◆ gatherFromOverlap()

◆ setMatrixGraph()

void fei::Matrix_core::setMatrixGraph ( fei::SharedPtr< fei::MatrixGraph > matrixGraph)
protected

Definition at line 399 of file fei_Matrix_core.cpp.

References matrixGraph_, and vecSpace_.

Referenced by fei::Matrix_Impl< T >::setMatrixGraph().

◆ copyPointRowsToBlockRow()

int fei::Matrix_core::copyPointRowsToBlockRow ( int numPtRows,
int numPtCols,
const double *const * ptValues,
int numBlkCols,
const int * blkColDims,
double ** blkValues )
protected

Copy a rectangular (non-ragged) table of coefficients representing a set of point-entry matrix rows into a block-entry matrix row which is laid out as follows: blkValues[i], i in [0 .. numBlkCols-1], is an array containing the values for a single block-entry. The dimensions of the block-entry are numPtRows X blkColDims[i], and the block-entry values will be arranged in column-major order, meaning that each column of the block-entry occupies contiguous memory.

Definition at line 376 of file fei_Matrix_core.cpp.

◆ convertPtToBlk()

int fei::Matrix_core::convertPtToBlk ( int numRows,
const int * rows,
int numCols,
const int * cols,
int * blkRows,
int * blkRowOffsets,
int * blkCols,
int * blkColOffsets )
protected

◆ getCommunicator()

MPI_Comm fei::Matrix_core::getCommunicator ( ) const
inlineprotected

◆ vecSpace() [1/2]

const fei::SharedPtr< fei::VectorSpace > fei::Matrix_core::vecSpace ( ) const
inlineprotected

◆ vecSpace() [2/2]

fei::SharedPtr< fei::VectorSpace > fei::Matrix_core::vecSpace ( )
inlineprotected

Definition at line 181 of file fei_Matrix_core.hpp.

References vecSpace_.

◆ globalOffsets() [1/2]

std::vector< int > & fei::Matrix_core::globalOffsets ( )
inlineprotected

◆ globalOffsets() [2/2]

const std::vector< int > & fei::Matrix_core::globalOffsets ( ) const
inlineprotected

Definition at line 184 of file fei_Matrix_core.hpp.

References globalOffsets_.

◆ firstLocalOffset()

◆ lastLocalOffset()

◆ numProcs()

int fei::Matrix_core::numProcs ( ) const
inlineprotected

Definition at line 189 of file fei_Matrix_core.hpp.

References numProcs_.

Referenced by fei::Matrix_Impl< T >::getGlobalNumRows().

◆ localProc()

int fei::Matrix_core::localProc ( ) const
inlineprotected

Definition at line 190 of file fei_Matrix_core.hpp.

References localProc_.

Referenced by fei::Matrix_Impl< T >::sumIn().

◆ haveBlockMatrix()

◆ setBlockMatrix()

void fei::Matrix_core::setBlockMatrix ( bool flag)
inlineprotected

Definition at line 193 of file fei_Matrix_core.hpp.

References haveBlockMatrix_.

Referenced by fei::Matrix_Impl< T >::Matrix_Impl().

◆ haveFEMatrix()

◆ setFEMatrix()

void fei::Matrix_core::setFEMatrix ( bool flag)
inlineprotected

Definition at line 196 of file fei_Matrix_core.hpp.

References haveFEMatrix_.

Referenced by fei::Matrix_Impl< T >::Matrix_Impl().

◆ getOwnerProc()

int fei::Matrix_core::getOwnerProc ( int globalEqn) const
protected

Member Data Documentation

◆ name_

std::string fei::Matrix_core::name_
protected

Definition at line 200 of file fei_Matrix_core.hpp.

Referenced by Matrix_core(), and setName().

◆ work_indices_

◆ work_indices2_

std::vector<int> fei::Matrix_core::work_indices2_
protected

Definition at line 203 of file fei_Matrix_core.hpp.

Referenced by Matrix_core(), and fei::Matrix_Impl< T >::sumIn().

◆ work_ints_

std::vector<int> fei::Matrix_core::work_ints_
protected

Definition at line 205 of file fei_Matrix_core.hpp.

Referenced by fei::Matrix_Impl< T >::giveToMatrix(), and Matrix_core().

◆ work_data1D_

std::vector<double> fei::Matrix_core::work_data1D_
protected

◆ work_data2D_

std::vector<const double*> fei::Matrix_core::work_data2D_
protected

◆ eqnComm_

◆ rhsVector_

fei::SharedPtr<fei::Vector> fei::Matrix_core::rhsVector_
private

Definition at line 214 of file fei_Matrix_core.hpp.

Referenced by Matrix_core(), and setRHS().

◆ comm_

MPI_Comm fei::Matrix_core::comm_
private

Definition at line 216 of file fei_Matrix_core.hpp.

Referenced by gatherFromOverlap(), getCommunicator(), Matrix_core(), and setCommSizes().

◆ localProc_

int fei::Matrix_core::localProc_
private

Definition at line 218 of file fei_Matrix_core.hpp.

Referenced by localProc(), Matrix_core(), setCommSizes(), and setEqnComm().

◆ numProcs_

int fei::Matrix_core::numProcs_
private

Definition at line 218 of file fei_Matrix_core.hpp.

Referenced by Matrix_core(), and numProcs().

◆ vecSpace_

fei::SharedPtr<fei::VectorSpace> fei::Matrix_core::vecSpace_
private

Definition at line 220 of file fei_Matrix_core.hpp.

Referenced by convertPtToBlk(), Matrix_core(), setMatrixGraph(), vecSpace(), and vecSpace().

◆ matrixGraph_

fei::SharedPtr<fei::MatrixGraph> fei::Matrix_core::matrixGraph_
private

Definition at line 221 of file fei_Matrix_core.hpp.

Referenced by getMatrixGraph(), Matrix_core(), and setMatrixGraph().

◆ remotelyOwned_

◆ remotelyOwned_last_requested_

FillableMat* fei::Matrix_core::remotelyOwned_last_requested_
mutableprivate

◆ sendProcs_

std::vector<int> fei::Matrix_core::sendProcs_
private

Definition at line 225 of file fei_Matrix_core.hpp.

Referenced by gatherFromOverlap(), Matrix_core(), and setCommSizes().

◆ recvProcs_

std::vector<int> fei::Matrix_core::recvProcs_
private

Definition at line 226 of file fei_Matrix_core.hpp.

Referenced by gatherFromOverlap(), Matrix_core(), and setCommSizes().

◆ recv_chars_

std::vector<std::vector<char> > fei::Matrix_core::recv_chars_
private

Definition at line 227 of file fei_Matrix_core.hpp.

Referenced by gatherFromOverlap(), Matrix_core(), and setCommSizes().

◆ send_chars_

std::vector<std::vector<char> > fei::Matrix_core::send_chars_
private

Definition at line 228 of file fei_Matrix_core.hpp.

Referenced by gatherFromOverlap(), Matrix_core(), and setCommSizes().

◆ sendRecvProcsNeedUpdated_

bool fei::Matrix_core::sendRecvProcsNeedUpdated_
private

Definition at line 229 of file fei_Matrix_core.hpp.

Referenced by gatherFromOverlap(), Matrix_core(), setCommSizes(), and setEqnComm().

◆ proc_last_requested_

int fei::Matrix_core::proc_last_requested_
mutableprivate

◆ haveBlockMatrix_

bool fei::Matrix_core::haveBlockMatrix_
private

Definition at line 232 of file fei_Matrix_core.hpp.

Referenced by haveBlockMatrix(), Matrix_core(), and setBlockMatrix().

◆ haveFEMatrix_

bool fei::Matrix_core::haveFEMatrix_
private

Definition at line 233 of file fei_Matrix_core.hpp.

Referenced by haveFEMatrix(), Matrix_core(), and setFEMatrix().

◆ globalOffsets_

std::vector<int> fei::Matrix_core::globalOffsets_
private

◆ firstLocalOffset_

int fei::Matrix_core::firstLocalOffset_
private

Definition at line 236 of file fei_Matrix_core.hpp.

Referenced by firstLocalOffset(), Matrix_core(), and setEqnComm().

◆ lastLocalOffset_

int fei::Matrix_core::lastLocalOffset_
private

Definition at line 236 of file fei_Matrix_core.hpp.

Referenced by lastLocalOffset(), Matrix_core(), and setEqnComm().


The documentation for this class was generated from the following files: