00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #include "Teuchos_ParameterList.hpp"
00043
00044 #include "LOCA_Epetra_Factory.H"
00045 #include "LOCA_Parameter_SublistParser.H"
00046 #include "LOCA_BorderedSolver_EpetraHouseholder.H"
00047 #include "LOCA_BorderedSolver_EpetraAugmented.H"
00048 #ifdef HAVE_MPI
00049 #include "LOCA_Epetra_AnasaziOperator_Floquet.H"
00050 #endif
00051
00052 LOCA::Epetra::Factory::Factory() :
00053 globalData()
00054 {
00055 }
00056
00057 LOCA::Epetra::Factory::~Factory()
00058 {
00059 }
00060
00061 void
00062 LOCA::Epetra::Factory::init(
00063 const Teuchos::RCP<LOCA::GlobalData>& global_data)
00064 {
00065 globalData = global_data;
00066 }
00067
00068 bool
00069 LOCA::Epetra::Factory::createBorderedSolverStrategy(
00070 const string& strategyName,
00071 const Teuchos::RCP<LOCA::Parameter::SublistParser>& topParams,
00072 const Teuchos::RCP<Teuchos::ParameterList>& solverParams,
00073 Teuchos::RCP<LOCA::BorderedSolver::AbstractStrategy>& strategy)
00074 {
00075
00076 if (strategyName == "Householder") {
00077 strategy =
00078 Teuchos::rcp(new LOCA::BorderedSolver::EpetraHouseholder(globalData,
00079 topParams,
00080 solverParams));
00081 return true;
00082 }
00083
00084 else if (strategyName == "Augmented") {
00085 strategy =
00086 Teuchos::rcp(new LOCA::BorderedSolver::EpetraAugmented(globalData,
00087 topParams,
00088 solverParams));
00089 return true;
00090 }
00091 else
00092 return false;
00093 }
00094
00095 bool
00096 LOCA::Epetra::Factory::createAnasaziOperatorStrategy(
00097 const string& strategyName,
00098 const Teuchos::RCP<LOCA::Parameter::SublistParser>& topParams,
00099 const Teuchos::RCP<Teuchos::ParameterList>& eigenParams,
00100 const Teuchos::RCP<Teuchos::ParameterList>& solverParams,
00101 const Teuchos::RCP<NOX::Abstract::Group>& grp,
00102 Teuchos::RCP<LOCA::AnasaziOperator::AbstractStrategy>& strategy)
00103 {
00104 #ifdef HAVE_MPI
00105 if (strategyName == "Floquet") {
00106
00107 strategy =
00108 Teuchos::rcp(new LOCA::Epetra::AnasaziOperator::Floquet(globalData,
00109 topParams, eigenParams, solverParams, grp));
00110 return true;
00111 }
00112 else
00113 #endif
00114 return false;
00115 }
00116
00117