53 #ifdef HAVE_FEI_AZTECOO
59 #ifdef HAVE_FEI_AMESOS
63 #ifdef HAVE_FEI_EPETRA
70 use_lpm_epetrabasic_(false),
73 use_feiMatrixLocal_(false),
74 blockEntryMatrix_(false),
75 orderRowsWithLocalColsFirst_(false),
85 const char*
const* paramStrings)
87 std::vector<std::string> stdstrings;
103 bool blkGraph =
false;
104 bool blkMatrix =
false;
111 const fei::Param* param = parameterset.
get(
"Trilinos_Solver");
115 std::string::size_type ii = strval.find(
"Amesos");
116 if (ii != std::string::npos) {
119 ii = strval.find(
"Belos");
120 if (ii != std::string::npos) {
162 multiVec->Map().NumMyPoints(),
false));
172 multiVec->Map().NumMyPoints()) {
179 multiVec->Map().NumMyPoints(),
false));
185 bool isSolutionVector,
197 std::vector<int> indices;
198 int err = 0, localSize;
201 localSize = indices.size();
206 indices.resize(localSize*2);
207 err = vecSpace->
getBlkIndices_Owned(localSize, &indices[0], &indices[localSize], localSize);
211 indices.resize(localSize);
216 throw std::runtime_error(
"error in vecSpace->getIndices_Owned");
223 Trilinos_Helpers::create_Epetra_BlockMap(vecSpace) :
226 Epetra_MultiVector* emvec =
new Epetra_MultiVector(emap, numVectors);
230 isSolutionVector,
true));
232 catch(std::runtime_error& exc) {
234 << exc.what() <<
"', re-throwing..." <<
FEI_ENDL;
246 tmpvec, isSolutionVector));
259 bool isSolnVector =
false;
260 return(
createVector(vecSpace, isSolnVector, numVectors));
267 bool isSolnVector =
false;
268 return(
createVector(matrixGraph, isSolnVector, numVectors));
273 bool isSolutionVector,
289 std::vector<int> indices;
290 int err = 0, localSize;
294 localSize = indices.size();
298 indices.resize(localSize);
302 throw std::runtime_error(
"error in vecSpace->getIndices_Owned");
306 #ifdef HAVE_FEI_EPETRA
309 Trilinos_Helpers::create_Epetra_BlockMap(vecSpace) :
312 Epetra_MultiVector* emvec =
new Epetra_MultiVector(emap, numVectors);
315 localSize, isSolutionVector,
true));
317 catch(std::runtime_error& exc) {
319 << exc.what() <<
"', re-throwing..." <<
FEI_ENDL;
323 fei::console_out() <<
"fei_Factory_Trilinos::createVector ERROR, HAVE_FEI_EPETRA not defined."
328 #ifdef HAVE_FEI_EPETRA
351 #ifdef HAVE_FEI_EPETRA
360 Trilinos_Helpers::create_from_LPM_EpetraBasic(matrixGraph,
376 fei::console_out() <<
"fei_Factory_Trilinos::createMatrix ERROR, HAVE_FEI_EPETRA "
387 std::string::size_type ii_amesos = std::string::npos;
388 std::string::size_type ii_belos = std::string::npos;
391 std::string sname(name);
392 ii_amesos = sname.find(
"Amesos");
393 ii_belos = sname.find(
"Belos");
396 if (
useAmesos_ || ii_amesos != std::string::npos) {
397 #ifdef HAVE_FEI_AMESOS
398 solver.
reset(
new Solver_Amesos);
401 fei::console_out() <<
"fei_Factory_Trilinos::createSolver: ERROR, Amesos not available (not enabled at compile-time?)"<<
FEI_ENDL;
405 if (
useBelos_ || ii_belos != std::string::npos) {
406 #ifdef HAVE_FEI_BELOS
407 solver.
reset(
new Solver_Belos);
410 fei::console_out() <<
"fei_Factory_Trilinos::createSolver: ERROR, Belos not available (not enabled at compile-time?)"<<
FEI_ENDL;
414 #ifdef HAVE_FEI_AZTECOO
415 solver.
reset(
new Solver_AztecOO);
418 fei::console_out() <<
"fei_Factory_Trilinos::createSolver: ERROR, AztecOO not "
430 bool need_to_create_lpm =
false;
433 need_to_create_lpm =
true;
436 if (replace_if_already_created) {
437 need_to_create_lpm =
true;
440 if (need_to_create_lpm) {
441 #ifdef HAVE_FEI_EPETRA
447 fei::console_out() <<
"fei_Factory_Trilinos::create_LinProbMgr ERROR, HAVE_FEI_EPETRA"