FEI Package Browser (Single Doxygen Collection)
Version of the Day
|
#include <fei_EqnBuffer.hpp>
Public Member Functions | |
EqnBuffer () | |
EqnBuffer (const EqnBuffer &src) | |
virtual | ~EqnBuffer () |
EqnBuffer * | deepCopy () |
EqnBuffer & | operator= (const EqnBuffer &src) |
int | getNumEqns () |
std::vector< int > & | eqnNumbers () |
std::vector< fei::CSVec * > & | eqns () |
int | getNumRHSs () |
void | setNumRHSs (int n) |
int | addRHS (int eqnNumber, int rhsIndex, double value, bool accumulate=true) |
std::vector< std::vector < double > * > * | rhsCoefsPtr () |
int | getEqnIndex (int eqn) |
int | isInIndices (int eqn) |
int | addEqn (int eqnNumber, const double *coefs, const int *indices, int len, bool accumulate, bool create_indices_union=false) |
int | addEqns (EqnBuffer &inputEqns, bool accumulate) |
int | getCoef (int eqnNumber, int colIndex, double &coef) |
int | removeIndex (int eqnNumber, int colIndex) |
int | getCoefAndRemoveIndex (int eqnNumber, int colIndex, double &coef) |
void | resetCoefs () |
int | addIndices (int eqnNumber, const int *indices, int len) |
Public Attributes | |
int | newCoefData_ |
int | newRHSData_ |
Private Member Functions | |
void | deleteMemory () |
int | insertNewEqn (int eqn, int insertPoint) |
int | internalAddEqn (int index, const double *coefs, const int *indices, int len, bool accumulate) |
Private Attributes | |
std::vector< int > | eqnNumbers_ |
std::vector< fei::CSVec * > | eqns_ |
std::vector< int > | indices_union_ |
int | numRHSs_ |
std::vector< std::vector < double > * > | rhsCoefs_ |
bool | setNumRHSsCalled_ |
bool | rhsCoefsAllocated_ |
std::vector< double > | dummyCoefs_ |
A class for holding equation data, along with optional RHS coefficients for the equations.
Definition at line 21 of file fei_EqnBuffer.hpp.
EqnBuffer::EqnBuffer | ( | ) |
EqnBuffer::EqnBuffer | ( | const EqnBuffer & | src | ) |
copy constructor
Definition at line 32 of file fei_EqnBuffer.cpp.
|
virtual |
EqnBuffer * EqnBuffer::deepCopy | ( | ) |
Return a 'clone' of this object, including a copy of all internal data.
Definition at line 83 of file fei_EqnBuffer.cpp.
References EqnBuffer().
Referenced by EqnCommMgr::operator=(), and test_EqnBuffer::test1().
assignment operator
Definition at line 48 of file fei_EqnBuffer.cpp.
References eqnNumbers_, eqns_, numRHSs_, and rhsCoefs_.
|
inline |
Return the number of equations held in this object.
Definition at line 40 of file fei_EqnBuffer.hpp.
References eqnNumbers_.
Referenced by addEqns(), deleteMemory(), EqnCommMgr::exchangeIndices(), EqnCommMgr::exchangeRemEssBCs(), EqnCommMgr::exchangeSoln(), SNL_FEI_Structure::getMasterEqnCoefs(), SNL_FEI_Structure::getMasterEqnNumbers(), SNL_FEI_Structure::getMasterEqnRHS(), EqnCommMgr::getNumLocalEqns(), EqnCommMgr::getNumRemEssBCEqns(), EqnCommMgr::getNumRemoteEqns(), isInIndices(), resetCoefs(), EqnCommMgr::resetCoefs(), setNumRHSs(), SNL_FEI_Structure::translateFromReducedEqn(), and SNL_FEI_Structure::translateToReducedEqns().
|
inline |
Return a list of the equation-numbers held in this object.
Definition at line 43 of file fei_EqnBuffer.hpp.
References eqnNumbers_.
Referenced by addEqns(), EqnCommMgr::addSolnValues(), SNL_FEI_Structure::calculateSlaveEqns(), EqnCommMgr::exchangeIndices(), EqnCommMgr::exchangeRemEssBCs(), fei::FillableMat::FillableMat(), EqnCommMgr::gatherSharedBCs(), LinSysCoreFilter::getEqnsFromMatrix(), LinSysCoreFilter::getEqnsFromRHS(), SNL_FEI_Structure::getMasterEqnCoefs(), SNL_FEI_Structure::getMasterEqnNumbers(), SNL_FEI_Structure::getMasterEqnRHS(), SNL_FEI_Structure::isSlaveEqn(), EqnCommMgr::localEqnNumbers(), operator<<(), EqnCommMgr::remEssBCEqnNumbersPtr(), SNL_FEI_Structure::removeCouplings(), LinSysCoreFilter::resolveConflictingCRs(), EqnCommMgr::sendEqnNumbersPtr(), test_EqnBuffer::test1(), SNL_FEI_Structure::translateFromReducedEqn(), and SNL_FEI_Structure::translateToReducedEqns().
|
inline |
Return a table (actually an array of pointers to fei::CSVecs) of the equations. Number-of-arrays is 'getNumEqns', length of i-th array is 'lengthsPtr()[i]'.
Definition at line 48 of file fei_EqnBuffer.hpp.
References eqns_.
Referenced by addEqns(), SNL_FEI_Structure::calculateSlaveEqns(), EqnCommMgr::exchangeEqnBuffers(), EqnCommMgr::exchangeIndices(), EqnCommMgr::exchangePtToBlkInfo(), EqnCommMgr::exchangeRemEssBCs(), fei::FillableMat::FillableMat(), EqnCommMgr::gatherSharedBCs(), SNL_FEI_Structure::getMasterEqnCoefs(), SNL_FEI_Structure::getMasterEqnNumbers(), EqnCommMgr::localEqns(), operator<<(), EqnCommMgr::remEssBCEqns(), SNL_FEI_Structure::removeCouplings(), test_EqnBuffer::test1(), and SNL_FEI_Structure::translateToReducedEqns().
|
inline |
Return the number of right-hand-side coefficientss stored for each equation.
Definition at line 52 of file fei_EqnBuffer.hpp.
References numRHSs_.
Referenced by addEqns(), EqnCommMgr::exchangeEqnBuffers(), and EqnCommMgr::exchangeIndices().
void EqnBuffer::setNumRHSs | ( | int | n | ) |
Set the number of right-hand-side coefficients to be stored for each equation. This function internally allocates a table to hold the rhs coefficients. This table has number-of-rows == 'getNumEqns()', and number-of-columns == 'n'. Note that this function should not be called after rhs coefficients have been added, because it destroys and re-allocates the rhs-coef table.
n |
Definition at line 112 of file fei_EqnBuffer.cpp.
References getNumEqns(), numRHSs_, and rhsCoefs_.
Referenced by addRHS(), EqnCommMgr::exchangeEqnBuffers(), EqnCommMgr::exchangeIndices(), LinSysCoreFilter::getEqnsFromRHS(), EqnCommMgr::setNumRHSs(), and test_EqnBuffer::test1().
int EqnBuffer::addRHS | ( | int | eqnNumber, |
int | rhsIndex, | ||
double | value, | ||
bool | accumulate = true |
||
) |
Set a right-hand-side coefficient.
eqnNumber | Must correspond to one of the equation-numbers in the list 'eqnNumbers()'. |
rhsIndex | Must be in the range [0 .. getNumRHSs()-1]. |
value | The coefficient. |
Definition at line 127 of file fei_EqnBuffer.cpp.
References fei::binarySearch(), fei::console_out(), eqnNumbers_, FEI_ENDL, rhsCoefs_, and setNumRHSs().
Referenced by addEqns(), EqnCommMgr::addRemoteRHS(), EqnCommMgr::exchangeEqnBuffers(), LinSysCoreFilter::getEqnsFromRHS(), and test_EqnBuffer::test1().
|
inline |
Return the table (actually an array of pointers to arrays) of right-hand-side coefficients. Number-of-arrays == 'getNumEqns()', number-of-columns == 'getNumRHSs()'.
Definition at line 76 of file fei_EqnBuffer.hpp.
References rhsCoefs_.
Referenced by addEqns(), EqnCommMgr::exchangeEqnBuffers(), SNL_FEI_Structure::getMasterEqnRHS(), EqnCommMgr::localRHSsPtr(), and operator<<().
int EqnBuffer::getEqnIndex | ( | int | eqn | ) |
Return an offset into the 'eqnNumbers()' list, being the position at which equation-number 'eqn' is located.
eqn |
Definition at line 106 of file fei_EqnBuffer.cpp.
References fei::binarySearch(), and eqnNumbers_.
Referenced by EqnCommMgr::exchangeEqnBuffers(), EqnCommMgr::exchangeIndices(), and EqnCommMgr::exchangeSoln().
int EqnBuffer::isInIndices | ( | int | eqn | ) |
Query whether 'eqn' is present in the table of column-indices.
eqn |
Definition at line 148 of file fei_EqnBuffer.cpp.
References fei::binarySearch(), eqns_, getNumEqns(), fei::CSVec::indices(), and indices_union_.
Referenced by SNL_FEI_Structure::removeCouplings(), and test_EqnBuffer::test1().
int EqnBuffer::addEqn | ( | int | eqnNumber, |
const double * | coefs, | ||
const int * | indices, | ||
int | len, | ||
bool | accumulate, | ||
bool | create_indices_union = false |
||
) |
Add an equation, with associated coefficients and column-indices.
eqnNumber | |
coefs | |
indices | |
len | Number of coefficients and indices |
accumulate | If this equation is already present, indicate whether incoming coefficients should replace existing ones, or be accumulated into them. Note that this only matters if eqnNumber is already present AND if one or more of 'indices' are already present. |
create_indices_union | defaults to false. If true, adds each set of indices to a union of all indices. This will be used if the 'isInIndices' method is called later. |
Definition at line 172 of file fei_EqnBuffer.cpp.
References fei::binarySearch(), eqnNumbers_, indices_union_, insertNewEqn(), internalAddEqn(), and fei::sortedListInsert().
Referenced by addEqns(), EqnCommMgr::addRemoteEqn(), SNL_FEI_Structure::calculateSlaveEqns(), EqnCommMgr::exchangeEqnBuffers(), EqnCommMgr::exchangeRemEssBCs(), fei::DirichletBCManager::finalizeBCEqns(), EqnCommMgr::gatherSharedBCs(), LinSysCoreFilter::getEqnsFromMatrix(), SNL_FEI_Structure::removeCouplings(), LinSysCoreFilter::resolveConflictingCRs(), and test_EqnBuffer::test1().
int EqnBuffer::addEqns | ( | EqnBuffer & | inputEqns, |
bool | accumulate | ||
) |
Add the equations in inputEqns. Upon completion, the set of equations in 'this' EqnBuffer is the union of the equations that were already present, and the equations in inputEqns.
inputEqns | EqnBuffer containing equations to be added to this EqnBuffer. |
accumulate | If an equation is already present, determines whether to add its coefficients to those already in place, or replace them. |
Definition at line 271 of file fei_EqnBuffer.cpp.
References addEqn(), addRHS(), fei::CSVec::coefs(), eqnNumbers(), eqns(), getNumEqns(), getNumRHSs(), fei::CSVec::indices(), and rhsCoefsPtr().
Referenced by EqnCommMgr::gatherSharedBCs(), and test_EqnBuffer::test1().
int EqnBuffer::getCoef | ( | int | eqnNumber, |
int | colIndex, | ||
double & | coef | ||
) |
Given an equation number and a column-index in that equation, get the corresponding coefficient.
eqnNumber | Input Equation-number |
colIndex | Input Column-index in equation-number. |
coef | Output coefficient corresponding to colIndex in eqnNumber. |
Definition at line 201 of file fei_EqnBuffer.cpp.
References fei::binarySearch(), eqnNumbers_, and eqns_.
Referenced by test_EqnBuffer::test1().
int EqnBuffer::removeIndex | ( | int | eqnNumber, |
int | colIndex | ||
) |
Remove the specified column-index from the specified equation-number.
Definition at line 214 of file fei_EqnBuffer.cpp.
References fei::binarySearch(), eqnNumbers_, and eqns_.
Referenced by test_EqnBuffer::test1().
int EqnBuffer::getCoefAndRemoveIndex | ( | int | eqnNumber, |
int | colIndex, | ||
double & | coef | ||
) |
Combine the functions 'getCoef()' and 'removeIndex()'. Has the same effect as calling those two functions separately, but saves two searches.
Definition at line 242 of file fei_EqnBuffer.cpp.
References fei::binarySearch(), eqnNumbers_, and eqns_.
Referenced by SNL_FEI_Structure::removeCouplings(), and test_EqnBuffer::test1().
void EqnBuffer::resetCoefs | ( | ) |
Reset all coefficients to 0.0
Definition at line 351 of file fei_EqnBuffer.cpp.
References eqns_, getNumEqns(), and fei::set_values().
Referenced by EqnCommMgr::exchangeEqns(), EqnCommMgr::resetCoefs(), and test_EqnBuffer::test1().
int EqnBuffer::addIndices | ( | int | eqnNumber, |
const int * | indices, | ||
int | len | ||
) |
Add an equation, with associated column-indices but not coefficients.
Definition at line 359 of file fei_EqnBuffer.cpp.
References fei::binarySearch(), dummyCoefs_, eqnNumbers_, insertNewEqn(), and internalAddEqn().
Referenced by EqnCommMgr::addRemoteIndices(), EqnCommMgr::exchangeIndices(), LinSysCoreFilter::getEqnsFromRHS(), and test_EqnBuffer::test1().
|
private |
Definition at line 93 of file fei_EqnBuffer.cpp.
References eqns_, getNumEqns(), numRHSs_, and rhsCoefs_.
Referenced by ~EqnBuffer().
|
private |
Definition at line 302 of file fei_EqnBuffer.cpp.
References fei::console_out(), eqnNumbers_, eqns_, FEI_ENDL, numRHSs_, and rhsCoefs_.
Referenced by addEqn(), and addIndices().
|
private |
Definition at line 326 of file fei_EqnBuffer.cpp.
References fei::add_entry(), eqns_, and fei::put_entry().
Referenced by addEqn(), and addIndices().
int EqnBuffer::newCoefData_ |
Definition at line 149 of file fei_EqnBuffer.hpp.
Referenced by EqnCommMgr::addRemoteEqn(), EqnCommMgr::exchangeEqnBuffers(), EqnCommMgr::newCoefData(), and EqnCommMgr::resetCoefs().
int EqnBuffer::newRHSData_ |
Definition at line 149 of file fei_EqnBuffer.hpp.
Referenced by EqnCommMgr::addRemoteRHS(), EqnCommMgr::exchangeEqnBuffers(), EqnCommMgr::newRHSData(), and EqnCommMgr::resetCoefs().
|
private |
Definition at line 158 of file fei_EqnBuffer.hpp.
Referenced by addEqn(), addIndices(), addRHS(), eqnNumbers(), getCoef(), getCoefAndRemoveIndex(), getEqnIndex(), getNumEqns(), insertNewEqn(), operator=(), and removeIndex().
|
private |
Definition at line 160 of file fei_EqnBuffer.hpp.
Referenced by deleteMemory(), eqns(), getCoef(), getCoefAndRemoveIndex(), insertNewEqn(), internalAddEqn(), isInIndices(), operator=(), removeIndex(), and resetCoefs().
|
private |
Definition at line 162 of file fei_EqnBuffer.hpp.
Referenced by addEqn(), and isInIndices().
|
private |
Definition at line 164 of file fei_EqnBuffer.hpp.
Referenced by deleteMemory(), getNumRHSs(), insertNewEqn(), operator=(), and setNumRHSs().
|
private |
Definition at line 165 of file fei_EqnBuffer.hpp.
Referenced by addRHS(), deleteMemory(), insertNewEqn(), operator=(), rhsCoefsPtr(), and setNumRHSs().
|
private |
Definition at line 167 of file fei_EqnBuffer.hpp.
|
private |
Definition at line 168 of file fei_EqnBuffer.hpp.
|
private |
Definition at line 170 of file fei_EqnBuffer.hpp.
Referenced by addIndices().