44 #include "fei_trilinos_macros.hpp"
46 #include <fei_Factory_Aztec.hpp>
48 #include <fei_VectorReducer.hpp>
49 #include <fei_MatrixReducer.hpp>
51 Factory_Aztec::Factory_Aztec(MPI_Comm comm)
55 blockEntryMatrix_(false),
60 Factory_Aztec::~Factory_Aztec()
64 int Factory_Aztec::parameters(
int numParams,
65 const char*
const* paramStrings)
67 std::vector<std::string> stdstrings;
83 bool blkGraph =
false;
84 bool blkMatrix =
false;
89 blockEntryMatrix_ = (blkGraph || blkMatrix);
103 bool isSolutionVector,
106 std::vector<int> indices;
107 int err = 0, localSize = 0;
108 if (reducer_.get() != NULL) {
109 indices = reducer_->getLocalReducedEqns();
110 localSize = indices.size();
113 if (blockEntryMatrix_) {
115 indices.resize(localSize*2);
116 err = vecSpace->
getBlkIndices_Owned(localSize, &indices[0], &indices[localSize], localSize);
124 throw std::runtime_error(
"fei::Factory_Aztec: error in vecSpace->getIndices_Owned");
129 if (reducer_.get() != NULL) {
130 feivec.
reset(
new fei::VectorReducer(reducer_,
131 tmpvec, isSolutionVector));
144 bool isSolnVector =
false;
145 return(createVector(vecSpace, isSolnVector, numVectors));
152 bool isSolnVector =
false;
153 return(createVector(matrixGraph, isSolnVector, numVectors));
158 bool isSolutionVector,
163 if (globalNumSlaves > 0 && reducer_.get()==NULL) {
169 std::vector<int> indices;
170 int err = 0, localSize;
172 if (reducer_.get() != NULL) {
173 indices = reducer_->getLocalReducedEqns();
174 localSize = indices.size();
178 indices.resize(localSize);
182 throw std::runtime_error(
"error in vecSpace->getIndices_Owned");
185 if (reducer_.get() != NULL) {
186 feivec.
reset(
new fei::VectorReducer(reducer_, tmpvec, isSolutionVector));
201 if (globalNumSlaves > 0 && reducer_.get()==NULL) {
209 Factory_Aztec::createSolver(
const char* name)
void char_ptrs_to_strings(int numStrings, const char *const *charstrings, std::vector< std::string > &stdstrings)
int getBlkIndices_Owned(int lenBlkIndices, int *globalBlkIndices, int *blkSizes, int &numBlkIndices)
virtual int getGlobalNumSlaveConstraints() const =0
virtual void parameters(const fei::ParameterSet ¶mset)
virtual fei::SharedPtr< fei::Reducer > getReducer()=0
int getBoolParamValue(const char *name, bool ¶mValue) const
virtual fei::SharedPtr< fei::VectorSpace > getRowSpace()=0
virtual fei::SharedPtr< fei::MatrixGraph > createMatrixGraph(fei::SharedPtr< fei::VectorSpace > rowSpace, fei::SharedPtr< fei::VectorSpace > columnSpace, const char *name)
int getIndices_Owned(std::vector< int > &globalIndices) const
void parse_strings(std::vector< std::string > &stdstrings, const char *separator_string, fei::ParameterSet ¶mset)
int getNumBlkIndices_Owned() const
int getNumIndices_Owned() const
int getIntParamValue(const char *name, int ¶mValue) const