FEI Package Browser (Single Doxygen Collection)
Version of the Day
|
#include <fei_Reducer.hpp>
Public Member Functions | |
void | setLocalUnreducedEqns (const std::vector< int > &localUnreducedEqns) |
void | addGraphEntries (fei::SharedPtr< fei::SparseRowGraph > matrixGraph) |
void | addGraphIndices (int numRows, const int *rows, int numCols, const int *cols, fei::Graph &graph) |
void | addSymmetricGraphIndices (int numIndices, const int *indices, bool diagonal, fei::Graph &graph) |
int | addMatrixValues (int numRows, const int *rows, int numCols, const int *cols, const double *const *values, bool sum_into, fei::Matrix &feimat, int format) |
int | addVectorValues (int numValues, const int *globalIndices, const double *values, bool sum_into, bool soln_vector, int vectorIndex, fei::Vector &feivec) |
int | copyOutVectorValues (int numValues, const int *globalIndices, double *values, bool soln_vector, int vectorIndex, fei::Vector &feivec) |
void | getSlaveMasterEqns (int slaveEqn, std::vector< int > &masterEqns) |
bool | isSlaveEqn (int unreducedEqn) const |
bool | isSlaveCol (int unreducedEqn) const |
int | translateToReducedEqn (int unreducedEqn) const |
int | translateFromReducedEqn (int reduced_eqn) const |
void | assembleReducedGraph (fei::Graph *graph, bool global_gather=true) |
void | assembleReducedGraph (fei::SparseRowGraph *srgraph) |
void | assembleReducedMatrix (fei::Matrix &matrix) |
void | assembleReducedVector (bool soln_vector, fei::Vector &feivec) |
std::vector< int > & | getLocalReducedEqns () |
void | initialize () |
Private Member Functions | |
void | expand_work_arrays (int size) |
Private 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 () |
Definition at line 27 of file fei_Reducer.hpp.
fei::Reducer::Reducer | ( | fei::SharedPtr< FillableMat > | globalSlaveDependencyMatrix, |
fei::SharedPtr< CSVec > | g_vector, | ||
MPI_Comm | comm | ||
) |
Definition at line 24 of file fei_Reducer.cpp.
References csg_, csrD_, fei::SharedPtr< T >::get(), and initialize().
fei::Reducer::Reducer | ( | fei::SharedPtr< fei::MatrixGraph > | matrixGraph | ) |
Definition at line 148 of file fei_Reducer.cpp.
References comm_, fei::VectorSpace::getCommunicator(), fei::VectorSpace::getIndices_Owned(), fei::MatrixGraph::getRowSpace(), initialize(), and setLocalUnreducedEqns().
|
virtual |
Destructor.
Definition at line 194 of file fei_Reducer.cpp.
References array_len_, bool_array_, double_array_, int_array_, and isSlaveEqn_.
void fei::Reducer::setLocalUnreducedEqns | ( | const std::vector< int > & | localUnreducedEqns | ) |
Definition at line 204 of file fei_Reducer.cpp.
References fei::binarySearch(), fei::BRIEF_LOGS, comm_, csrD_, dbgprefix_, FEI_ENDL, FEI_OSTREAM, firstLocalReducedEqn_, fei::CSRMat::getGraph(), isSlaveEqn_, lastLocalReducedEqn_, localProc_, localReducedEqns_, localUnreducedEqns_, numGlobalSlaves_, numLocalSlaves_, numProcs_, fei::Logger::output_level_, fei::Logger::output_stream_, fei::SparseRowGraph::packedColumnIndices, fei::SparseRowGraph::rowOffsets, and slavesPtr_.
Referenced by Reducer().
void fei::Reducer::addGraphEntries | ( | fei::SharedPtr< fei::SparseRowGraph > | matrixGraph | ) |
Set the matrix-graph structure. This is the nonzero structure for locally-owned matrix rows.
Definition at line 305 of file fei_Reducer.cpp.
References fei::add_entry(), fei::BRIEF_LOGS, fei::FillableMat::create_or_getRow(), dbgprefix_, FEI_ENDL, FEI_OSTREAM, isSlaveEqn(), Kdd_, Kdi_, Kid_, Kii_, fei::Logger::output_level_, fei::Logger::output_stream_, fei::SparseRowGraph::packedColumnIndices, fei::SparseRowGraph::rowNumbers, and fei::SparseRowGraph::rowOffsets.
void fei::Reducer::addGraphIndices | ( | int | numRows, |
const int * | rows, | ||
int | numCols, | ||
const int * | cols, | ||
fei::Graph & | graph | ||
) |
Definition at line 379 of file fei_Reducer.cpp.
References fei::add_entry(), fei::Graph::addIndices(), assembleReducedGraph(), bool_array_, fei::FillableMat::create_or_getRow(), expand_work_arrays(), int_array_, isSlaveEqn(), Kdd_, Kdi_, Kid_, mat_counter_, and translateToReducedEqn().
Referenced by addSymmetricGraphIndices().
void fei::Reducer::addSymmetricGraphIndices | ( | int | numIndices, |
const int * | indices, | ||
bool | diagonal, | ||
fei::Graph & | graph | ||
) |
Definition at line 439 of file fei_Reducer.cpp.
References addGraphIndices().
int fei::Reducer::addMatrixValues | ( | int | numRows, |
const int * | rows, | ||
int | numCols, | ||
const int * | cols, | ||
const double *const * | values, | ||
bool | sum_into, | ||
fei::Matrix & | feimat, | ||
int | format | ||
) |
Put a C-style table (array of pointers) of coefficient data into the matrix. This is a rectangular array of coefficients for rows/columns defined by the 'rows' and 'cols' lists. If the sum_into argument is true, values should be added to any that already exist at the specified locations. Otherwise (if sum_into is false) incoming values should overwrite already-existing values.
Definition at line 682 of file fei_Reducer.cpp.
References fei::add_entry(), assembleReducedMatrix(), bool_array_, fei::BRIEF_LOGS, fei::Matrix::copyIn(), fei::Matrix_core::copyTransposeToWorkArrays(), fei::FillableMat::create_or_getRow(), dbgprefix_, double_array_, expand_work_arrays(), FEI_DENSE_COL, FEI_DENSE_ROW, FEI_ENDL, FEI_OSTREAM, int_array_, isSlaveEqn(), Kdd_, Kdi_, Kid_, mat_counter_, fei::Logger::output_level_, fei::Logger::output_stream_, fei::Matrix::sumIn(), translateToReducedEqn(), work_1D_, and work_2D_.
Referenced by fei::MatrixReducer::copyIn(), fei::MatrixReducer::sumIn(), and fei::MatrixReducer::sumInFieldData().
int fei::Reducer::addVectorValues | ( | int | numValues, |
const int * | globalIndices, | ||
const double * | values, | ||
bool | sum_into, | ||
bool | soln_vector, | ||
int | vectorIndex, | ||
fei::Vector & | feivec | ||
) |
Put coefficient data into a vector at the specified global indices. If any specified indices are out of range (negative or too large) the corresponding positions in the values array will not be referenced, and a positive warning code will be returned.
numValues | Length of caller-allocated 'globalIndices' and 'values' arrays. |
globalIndices | List of global-indices specifying the locations in the vector for incoming values to be placed. |
values | List of incoming values. |
sum_into | If true, incoming values should be added to values that may already be in the specified locations. If sum_into is false, then incoming values should overwrite existing values. |
soln_vector | If true, incoming values should be placed in the solution vector. Otherwise, they should be placed in the rhs vector. |
vectorIndex | If the linear system has multiple rhs/soln vectors, then this parameter specifies which vector the incoming values should be put into. |
Definition at line 804 of file fei_Reducer.cpp.
References fei::add_entry(), assembleReducedVector(), fei::BRIEF_LOGS, fei::Vector::copyIn(), dbgprefix_, fd_, FEI_ENDL, FEI_OSTREAM, isSlaveEqn(), fei::Logger::output_level_, fei::Logger::output_stream_, fei::put_entry(), rhs_vec_counter_, fei::Vector::sumIn(), and translateToReducedEqn().
Referenced by fei::VectorReducer::copyIn(), fei::VectorReducer::giveToUnderlyingVector(), and fei::VectorReducer::sumIn().
int fei::Reducer::copyOutVectorValues | ( | int | numValues, |
const int * | globalIndices, | ||
double * | values, | ||
bool | soln_vector, | ||
int | vectorIndex, | ||
fei::Vector & | feivec | ||
) |
Definition at line 892 of file fei_Reducer.cpp.
References fei::add_entry(), fei::binarySearch(), fei::BRIEF_LOGS, fei::CSVec::clear(), fei::CSVec::coefs(), fei::Vector::copyOut(), csg_, csrD_, dbgprefix_, FEI_ENDL, FEI_OSTREAM, g_nonzero_, fei::CSVec::indices(), isSlaveEqn(), fei::multiply_CSRMat_CSVec(), fei::multiply_trans_CSRMat_CSVec(), fei::Logger::output_level_, fei::Logger::output_stream_, fei::put_entry(), fei::CSVec::size(), tmpVec1_, tmpVec2_, and translateToReducedEqn().
Referenced by fei::VectorReducer::copyOut().
void fei::Reducer::getSlaveMasterEqns | ( | int | slaveEqn, |
std::vector< int > & | masterEqns | ||
) |
Definition at line 607 of file fei_Reducer.cpp.
References csrD_, fei::CSRMat::getGraph(), fei::SparseRowGraph::packedColumnIndices, fei::SparseRowGraph::rowNumbers, and fei::SparseRowGraph::rowOffsets.
Referenced by fei::VectorReducer::VectorReducer().
bool fei::Reducer::isSlaveEqn | ( | int | unreducedEqn | ) | const |
Definition at line 594 of file fei_Reducer.cpp.
References isSlaveCol(), isSlaveEqn_, and localUnreducedEqns_.
Referenced by addGraphEntries(), addGraphIndices(), addMatrixValues(), addVectorValues(), fei::MatrixReducer::copyOutRow(), copyOutVectorValues(), snl_fei::LinearSystem_General::enforceEssentialBC_step_2(), fei::DirichletBCManager::finalizeBCEqns(), fei::MatrixReducer::getRowLength(), and fei::VectorReducer::VectorReducer().
bool fei::Reducer::isSlaveCol | ( | int | unreducedEqn | ) | const |
Definition at line 632 of file fei_Reducer.cpp.
References fei::binarySearch(), numGlobalSlaves_, and slavesPtr_.
Referenced by isSlaveEqn().
int fei::Reducer::translateToReducedEqn | ( | int | unreducedEqn | ) | const |
Given an equation-number in the caller's unreduced index-space, return the corresponding equation in the reduced space. If unreducedEqn is a slave, an exception will be thrown.
Definition at line 641 of file fei_Reducer.cpp.
References fei::binarySearch(), highestGlobalSlaveEqn_, lowestGlobalSlaveEqn_, numGlobalSlaves_, and slavesPtr_.
Referenced by addGraphIndices(), addMatrixValues(), addVectorValues(), fei::MatrixReducer::copyOutRow(), copyOutVectorValues(), fei::MatrixReducer::getRowLength(), fei::impl_utils::translate_to_reduced_eqns(), and fei::VectorReducer::VectorReducer().
int fei::Reducer::translateFromReducedEqn | ( | int | reduced_eqn | ) | const |
Definition at line 663 of file fei_Reducer.cpp.
References fei::binarySearch(), nonslaves_, and reverse_.
Referenced by fei::MatrixReducer::copyOutRow(), snl_fei::LinearSystem_General::enforceEssentialBC_step_1(), and snl_fei::LinearSystem_General::enforceEssentialBC_step_2().
void fei::Reducer::assembleReducedGraph | ( | fei::Graph * | graph, |
bool | global_gather = true |
||
) |
Definition at line 454 of file fei_Reducer.cpp.
References fei::impl_utils::add_to_graph(), fei::BRIEF_LOGS, fei::FillableMat::clear(), csrD_, csrKdd, csrKdi, csrKid, csrKii, dbgprefix_, FEI_ENDL, FEI_OSTREAM, fei::FULL_LOGS, fei::Graph::gatherFromOverlap(), Kdd_, Kdi_, Kid_, Kii_, mat_counter_, fei::multiply_CSRMat_CSRMat(), fei::multiply_trans_CSRMat_CSRMat(), fei::Logger::output_level_, fei::Logger::output_stream_, tmpMat1_, tmpMat2_, and fei::impl_utils::translate_to_reduced_eqns().
Referenced by addGraphIndices(), and assembleReducedGraph().
void fei::Reducer::assembleReducedGraph | ( | fei::SparseRowGraph * | srgraph | ) |
Definition at line 512 of file fei_Reducer.cpp.
References assembleReducedGraph(), fei::BRIEF_LOGS, comm_, fei::copyToSparseRowGraph(), dbgprefix_, FEI_ENDL, FEI_OSTREAM, firstLocalReducedEqn_, fei::Graph_Impl::getLocalGraph(), lastLocalReducedEqn_, fei::Logger::output_level_, and fei::Logger::output_stream_.
void fei::Reducer::assembleReducedMatrix | ( | fei::Matrix & | matrix | ) |
Definition at line 525 of file fei_Reducer.cpp.
References fei::impl_utils::add_to_matrix(), fei::BRIEF_LOGS, fei::FillableMat::clear(), csg_, csrD_, csrKdd, csrKdi, csrKid, csrKii, dbgprefix_, FEI_ENDL, FEI_OSTREAM, fi_, fei::FULL_LOGS, g_nonzero_, Kdd_, Kdi_, Kid_, Kii_, mat_counter_, fei::multiply_CSRMat_CSRMat(), fei::multiply_CSRMat_CSVec(), fei::multiply_trans_CSRMat_CSRMat(), fei::Logger::output_level_, fei::Logger::output_stream_, fei::CSVec::subtract(), tmpMat1_, tmpMat2_, tmpVec1_, and fei::impl_utils::translate_to_reduced_eqns().
Referenced by addMatrixValues(), fei::MatrixReducer::gatherFromOverlap(), and fei::MatrixReducer::globalAssemble().
void fei::Reducer::assembleReducedVector | ( | bool | soln_vector, |
fei::Vector & | feivec | ||
) |
Definition at line 847 of file fei_Reducer.cpp.
References fei::BRIEF_LOGS, fei::CSVec::clear(), fei::CSVec::coefs(), csrD_, csvec, csvec_i, dbgprefix_, fd_, FEI_ENDL, FEI_OSTREAM, fi_, fei::CSVec::indices(), fei::multiply_trans_CSRMat_CSVec(), fei::Logger::output_level_, fei::Logger::output_stream_, rhs_vec_counter_, fei::CSVec::size(), fei::Vector::sumIn(), tmpVec1_, and fei::impl_utils::translate_to_reduced_eqns().
Referenced by addVectorValues(), and fei::VectorReducer::gatherFromOverlap().
std::vector< int > & fei::Reducer::getLocalReducedEqns | ( | ) |
Definition at line 960 of file fei_Reducer.cpp.
References localReducedEqns_.
Referenced by Factory_Aztec::createVector(), snl_fei::LinearSystem_General::enforceEssentialBC_LinSysCore(), extractDirichletBCs(), fei::MatrixReducer::MatrixReducer(), snl_fei::Broker_LinSysCore::setGlobalOffsets(), and fei::MatrixReducer::writeToFile().
void fei::Reducer::initialize | ( | ) |
Definition at line 80 of file fei_Reducer.cpp.
References fei::BRIEF_LOGS, fei::CSVec::coefs(), comm_, csg_, csrD_, dbgprefix_, FEI_ENDL, FEI_OSTREAM, g_nonzero_, fei::CSRMat::getGraph(), fei::CSRMat::getNumRows(), highestGlobalSlaveEqn_, localProc_, lowestGlobalSlaveEqn_, nonslaves_, numGlobalSlaves_, numProcs_, fei::Logger::output_level_, fei::Logger::output_stream_, reverse_, fei::SparseRowGraph::rowNumbers, fei::CSVec::size(), and slavesPtr_.
Referenced by Reducer().
|
private |
Definition at line 365 of file fei_Reducer.cpp.
References array_len_, bool_array_, double_array_, and int_array_.
Referenced by addGraphIndices(), and addMatrixValues().
|
private |
Definition at line 136 of file fei_Reducer.hpp.
Referenced by assembleReducedGraph(), assembleReducedMatrix(), assembleReducedVector(), copyOutVectorValues(), getSlaveMasterEqns(), initialize(), Reducer(), and setLocalUnreducedEqns().
|
private |
Definition at line 137 of file fei_Reducer.hpp.
Referenced by initialize(), isSlaveCol(), setLocalUnreducedEqns(), and translateToReducedEqn().
|
private |
Definition at line 138 of file fei_Reducer.hpp.
Referenced by addGraphEntries(), assembleReducedGraph(), and assembleReducedMatrix().
|
private |
Definition at line 138 of file fei_Reducer.hpp.
Referenced by addGraphEntries(), addGraphIndices(), addMatrixValues(), assembleReducedGraph(), and assembleReducedMatrix().
|
private |
Definition at line 138 of file fei_Reducer.hpp.
Referenced by addGraphEntries(), addGraphIndices(), addMatrixValues(), assembleReducedGraph(), and assembleReducedMatrix().
|
private |
Definition at line 138 of file fei_Reducer.hpp.
Referenced by addGraphEntries(), addGraphIndices(), addMatrixValues(), assembleReducedGraph(), and assembleReducedMatrix().
|
private |
Definition at line 139 of file fei_Reducer.hpp.
Referenced by assembleReducedGraph(), and assembleReducedMatrix().
|
private |
Definition at line 139 of file fei_Reducer.hpp.
Referenced by assembleReducedGraph(), and assembleReducedMatrix().
|
private |
Definition at line 139 of file fei_Reducer.hpp.
Referenced by assembleReducedGraph(), and assembleReducedMatrix().
|
private |
Definition at line 139 of file fei_Reducer.hpp.
Referenced by assembleReducedGraph(), and assembleReducedMatrix().
|
private |
Definition at line 140 of file fei_Reducer.hpp.
Referenced by assembleReducedMatrix(), and assembleReducedVector().
|
private |
Definition at line 140 of file fei_Reducer.hpp.
Referenced by addVectorValues(), and assembleReducedVector().
|
private |
Definition at line 141 of file fei_Reducer.hpp.
Referenced by assembleReducedVector().
|
private |
Definition at line 141 of file fei_Reducer.hpp.
Referenced by assembleReducedVector().
|
private |
Definition at line 142 of file fei_Reducer.hpp.
Referenced by assembleReducedGraph(), and assembleReducedMatrix().
|
private |
Definition at line 142 of file fei_Reducer.hpp.
Referenced by assembleReducedGraph(), and assembleReducedMatrix().
|
private |
Definition at line 143 of file fei_Reducer.hpp.
Referenced by assembleReducedMatrix(), assembleReducedVector(), and copyOutVectorValues().
|
private |
Definition at line 143 of file fei_Reducer.hpp.
Referenced by copyOutVectorValues().
|
private |
Definition at line 145 of file fei_Reducer.hpp.
Referenced by assembleReducedMatrix(), copyOutVectorValues(), initialize(), and Reducer().
|
private |
Definition at line 146 of file fei_Reducer.hpp.
Referenced by assembleReducedMatrix(), copyOutVectorValues(), and initialize().
|
private |
Definition at line 148 of file fei_Reducer.hpp.
Referenced by isSlaveEqn(), and setLocalUnreducedEqns().
|
private |
Definition at line 149 of file fei_Reducer.hpp.
Referenced by getLocalReducedEqns(), and setLocalUnreducedEqns().
|
private |
Definition at line 150 of file fei_Reducer.hpp.
Referenced by initialize(), and translateFromReducedEqn().
|
private |
Definition at line 151 of file fei_Reducer.hpp.
Referenced by initialize(), and translateFromReducedEqn().
|
private |
Definition at line 152 of file fei_Reducer.hpp.
Referenced by isSlaveEqn(), setLocalUnreducedEqns(), and ~Reducer().
|
private |
Definition at line 153 of file fei_Reducer.hpp.
Referenced by initialize(), isSlaveCol(), setLocalUnreducedEqns(), and translateToReducedEqn().
|
private |
Definition at line 154 of file fei_Reducer.hpp.
Referenced by setLocalUnreducedEqns().
|
private |
Definition at line 155 of file fei_Reducer.hpp.
Referenced by assembleReducedGraph(), and setLocalUnreducedEqns().
|
private |
Definition at line 156 of file fei_Reducer.hpp.
Referenced by assembleReducedGraph(), and setLocalUnreducedEqns().
|
private |
Definition at line 157 of file fei_Reducer.hpp.
Referenced by initialize(), and translateToReducedEqn().
|
private |
Definition at line 158 of file fei_Reducer.hpp.
Referenced by initialize(), and translateToReducedEqn().
|
private |
Definition at line 160 of file fei_Reducer.hpp.
Referenced by initialize(), and setLocalUnreducedEqns().
|
private |
Definition at line 161 of file fei_Reducer.hpp.
Referenced by initialize(), and setLocalUnreducedEqns().
|
private |
Definition at line 162 of file fei_Reducer.hpp.
Referenced by assembleReducedGraph(), initialize(), Reducer(), and setLocalUnreducedEqns().
|
private |
Definition at line 163 of file fei_Reducer.hpp.
Referenced by addGraphEntries(), addMatrixValues(), addVectorValues(), assembleReducedGraph(), assembleReducedMatrix(), assembleReducedVector(), copyOutVectorValues(), initialize(), and setLocalUnreducedEqns().
|
private |
Definition at line 164 of file fei_Reducer.hpp.
Referenced by addGraphIndices(), addMatrixValues(), assembleReducedGraph(), and assembleReducedMatrix().
|
private |
Definition at line 165 of file fei_Reducer.hpp.
Referenced by addVectorValues(), and assembleReducedVector().
|
private |
Definition at line 167 of file fei_Reducer.hpp.
Referenced by addGraphIndices(), addMatrixValues(), expand_work_arrays(), and ~Reducer().
|
private |
Definition at line 168 of file fei_Reducer.hpp.
Referenced by addGraphIndices(), addMatrixValues(), expand_work_arrays(), and ~Reducer().
|
private |
Definition at line 169 of file fei_Reducer.hpp.
Referenced by addMatrixValues(), expand_work_arrays(), and ~Reducer().
|
private |
Definition at line 170 of file fei_Reducer.hpp.
Referenced by expand_work_arrays(), and ~Reducer().
|
private |
Definition at line 172 of file fei_Reducer.hpp.
Referenced by addMatrixValues().
|
private |
Definition at line 173 of file fei_Reducer.hpp.
Referenced by addMatrixValues().