FEI Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
fei::Reducer Class Reference

#include <fei_Reducer.hpp>

Inheritance diagram for fei::Reducer:
Inheritance graph
[legend]

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 ()
 

Private Attributes

fei::CSRMat csrD_
 
int * slavesPtr_
 
fei::FillableMat Kii_
 
fei::FillableMat Kid_
 
fei::FillableMat Kdi_
 
fei::FillableMat Kdd_
 
fei::CSRMat csrKii
 
fei::CSRMat csrKid
 
fei::CSRMat csrKdi
 
fei::CSRMat csrKdd
 
fei::CSVec fi_
 
fei::CSVec fd_
 
fei::CSVec csvec
 
fei::CSVec csvec_i
 
fei::CSRMat tmpMat1_
 
fei::CSRMat tmpMat2_
 
fei::CSVec tmpVec1_
 
fei::CSVec tmpVec2_
 
fei::CSVec csg_
 
bool g_nonzero_
 
std::vector< int > localUnreducedEqns_
 
std::vector< int > localReducedEqns_
 
std::vector< int > nonslaves_
 
std::vector< int > reverse_
 
bool * isSlaveEqn_
 
int numGlobalSlaves_
 
int numLocalSlaves_
 
int firstLocalReducedEqn_
 
int lastLocalReducedEqn_
 
int lowestGlobalSlaveEqn_
 
int highestGlobalSlaveEqn_
 
int localProc_
 
int numProcs_
 
MPI_Comm comm_
 
std::string dbgprefix_
 
unsigned mat_counter_
 
unsigned rhs_vec_counter_
 
bool * bool_array_
 
int * int_array_
 
double * double_array_
 
int array_len_
 
std::vector< double > work_1D_
 
std::vector< const double * > work_2D_
 
- Private Attributes inherited from fei::Logger
OutputLevel output_level_
 
FEI_OSTREAMoutput_stream_
 
std::set< int > logIDs_
 
std::set< int > logEqns_
 
 Reducer (fei::SharedPtr< FillableMat > globalSlaveDependencyMatrix, fei::SharedPtr< CSVec > g_vector, MPI_Comm comm)
 
 Reducer (fei::SharedPtr< fei::MatrixGraph > matrixGraph)
 
virtual ~Reducer ()
 

Detailed Description

Definition at line 27 of file fei_Reducer.hpp.

Constructor & Destructor Documentation

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)
fei::Reducer::~Reducer ( )
virtual

Destructor.

Definition at line 194 of file fei_Reducer.cpp.

References array_len_, bool_array_, double_array_, int_array_, and isSlaveEqn_.

Member Function Documentation

void fei::Reducer::setLocalUnreducedEqns ( const std::vector< int > &  localUnreducedEqns)
void fei::Reducer::addGraphEntries ( fei::SharedPtr< fei::SparseRowGraph matrixGraph)
void fei::Reducer::addGraphIndices ( int  numRows,
const int *  rows,
int  numCols,
const int *  cols,
fei::Graph graph 
)
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.

Parameters
numValuesLength of caller-allocated 'globalIndices' and 'values' arrays.
globalIndicesList of global-indices specifying the locations in the vector for incoming values to be placed.
valuesList of incoming values.
sum_intoIf 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_vectorIf true, incoming values should be placed in the solution vector. Otherwise, they should be placed in the rhs vector.
vectorIndexIf 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 
)
void fei::Reducer::getSlaveMasterEqns ( int  slaveEqn,
std::vector< int > &  masterEqns 
)
bool fei::Reducer::isSlaveEqn ( int  unreducedEqn) const
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
void fei::Reducer::assembleReducedGraph ( fei::Graph graph,
bool  global_gather = true 
)
void fei::Reducer::assembleReducedGraph ( fei::SparseRowGraph srgraph)
void fei::Reducer::assembleReducedMatrix ( fei::Matrix matrix)
void fei::Reducer::assembleReducedVector ( bool  soln_vector,
fei::Vector feivec 
)
std::vector< int > & fei::Reducer::getLocalReducedEqns ( )
void fei::Reducer::initialize ( )
void fei::Reducer::expand_work_arrays ( int  size)
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().

Member Data Documentation

fei::CSRMat fei::Reducer::csrD_
private
int* fei::Reducer::slavesPtr_
private
fei::FillableMat fei::Reducer::Kii_
private

Definition at line 138 of file fei_Reducer.hpp.

Referenced by addGraphEntries(), assembleReducedGraph(), and assembleReducedMatrix().

fei::FillableMat fei::Reducer::Kid_
private
fei::FillableMat fei::Reducer::Kdi_
private
fei::FillableMat fei::Reducer::Kdd_
private
fei::CSRMat fei::Reducer::csrKii
private

Definition at line 139 of file fei_Reducer.hpp.

Referenced by assembleReducedGraph(), and assembleReducedMatrix().

fei::CSRMat fei::Reducer::csrKid
private

Definition at line 139 of file fei_Reducer.hpp.

Referenced by assembleReducedGraph(), and assembleReducedMatrix().

fei::CSRMat fei::Reducer::csrKdi
private

Definition at line 139 of file fei_Reducer.hpp.

Referenced by assembleReducedGraph(), and assembleReducedMatrix().

fei::CSRMat fei::Reducer::csrKdd
private

Definition at line 139 of file fei_Reducer.hpp.

Referenced by assembleReducedGraph(), and assembleReducedMatrix().

fei::CSVec fei::Reducer::fi_
private

Definition at line 140 of file fei_Reducer.hpp.

Referenced by assembleReducedMatrix(), and assembleReducedVector().

fei::CSVec fei::Reducer::fd_
private

Definition at line 140 of file fei_Reducer.hpp.

Referenced by addVectorValues(), and assembleReducedVector().

fei::CSVec fei::Reducer::csvec
private

Definition at line 141 of file fei_Reducer.hpp.

Referenced by assembleReducedVector().

fei::CSVec fei::Reducer::csvec_i
private

Definition at line 141 of file fei_Reducer.hpp.

Referenced by assembleReducedVector().

fei::CSRMat fei::Reducer::tmpMat1_
private

Definition at line 142 of file fei_Reducer.hpp.

Referenced by assembleReducedGraph(), and assembleReducedMatrix().

fei::CSRMat fei::Reducer::tmpMat2_
private

Definition at line 142 of file fei_Reducer.hpp.

Referenced by assembleReducedGraph(), and assembleReducedMatrix().

fei::CSVec fei::Reducer::tmpVec1_
private
fei::CSVec fei::Reducer::tmpVec2_
private

Definition at line 143 of file fei_Reducer.hpp.

Referenced by copyOutVectorValues().

fei::CSVec fei::Reducer::csg_
private

Definition at line 145 of file fei_Reducer.hpp.

Referenced by assembleReducedMatrix(), copyOutVectorValues(), initialize(), and Reducer().

bool fei::Reducer::g_nonzero_
private

Definition at line 146 of file fei_Reducer.hpp.

Referenced by assembleReducedMatrix(), copyOutVectorValues(), and initialize().

std::vector<int> fei::Reducer::localUnreducedEqns_
private

Definition at line 148 of file fei_Reducer.hpp.

Referenced by isSlaveEqn(), and setLocalUnreducedEqns().

std::vector<int> fei::Reducer::localReducedEqns_
private

Definition at line 149 of file fei_Reducer.hpp.

Referenced by getLocalReducedEqns(), and setLocalUnreducedEqns().

std::vector<int> fei::Reducer::nonslaves_
private

Definition at line 150 of file fei_Reducer.hpp.

Referenced by initialize(), and translateFromReducedEqn().

std::vector<int> fei::Reducer::reverse_
private

Definition at line 151 of file fei_Reducer.hpp.

Referenced by initialize(), and translateFromReducedEqn().

bool* fei::Reducer::isSlaveEqn_
private

Definition at line 152 of file fei_Reducer.hpp.

Referenced by isSlaveEqn(), setLocalUnreducedEqns(), and ~Reducer().

int fei::Reducer::numGlobalSlaves_
private
int fei::Reducer::numLocalSlaves_
private

Definition at line 154 of file fei_Reducer.hpp.

Referenced by setLocalUnreducedEqns().

int fei::Reducer::firstLocalReducedEqn_
private

Definition at line 155 of file fei_Reducer.hpp.

Referenced by assembleReducedGraph(), and setLocalUnreducedEqns().

int fei::Reducer::lastLocalReducedEqn_
private

Definition at line 156 of file fei_Reducer.hpp.

Referenced by assembleReducedGraph(), and setLocalUnreducedEqns().

int fei::Reducer::lowestGlobalSlaveEqn_
private

Definition at line 157 of file fei_Reducer.hpp.

Referenced by initialize(), and translateToReducedEqn().

int fei::Reducer::highestGlobalSlaveEqn_
private

Definition at line 158 of file fei_Reducer.hpp.

Referenced by initialize(), and translateToReducedEqn().

int fei::Reducer::localProc_
private

Definition at line 160 of file fei_Reducer.hpp.

Referenced by initialize(), and setLocalUnreducedEqns().

int fei::Reducer::numProcs_
private

Definition at line 161 of file fei_Reducer.hpp.

Referenced by initialize(), and setLocalUnreducedEqns().

MPI_Comm fei::Reducer::comm_
private

Definition at line 162 of file fei_Reducer.hpp.

Referenced by assembleReducedGraph(), initialize(), Reducer(), and setLocalUnreducedEqns().

std::string fei::Reducer::dbgprefix_
private
unsigned fei::Reducer::mat_counter_
private
unsigned fei::Reducer::rhs_vec_counter_
private

Definition at line 165 of file fei_Reducer.hpp.

Referenced by addVectorValues(), and assembleReducedVector().

bool* fei::Reducer::bool_array_
private

Definition at line 167 of file fei_Reducer.hpp.

Referenced by addGraphIndices(), addMatrixValues(), expand_work_arrays(), and ~Reducer().

int* fei::Reducer::int_array_
private

Definition at line 168 of file fei_Reducer.hpp.

Referenced by addGraphIndices(), addMatrixValues(), expand_work_arrays(), and ~Reducer().

double* fei::Reducer::double_array_
private

Definition at line 169 of file fei_Reducer.hpp.

Referenced by addMatrixValues(), expand_work_arrays(), and ~Reducer().

int fei::Reducer::array_len_
private

Definition at line 170 of file fei_Reducer.hpp.

Referenced by expand_work_arrays(), and ~Reducer().

std::vector<double> fei::Reducer::work_1D_
private

Definition at line 172 of file fei_Reducer.hpp.

Referenced by addMatrixValues().

std::vector<const double*> fei::Reducer::work_2D_
private

Definition at line 173 of file fei_Reducer.hpp.

Referenced by addMatrixValues().


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