00001 //*****************************************************************// 00002 // Albany 2.0: Copyright 2012 Sandia Corporation // 00003 // This Software is released under the BSD license detailed // 00004 // in the file "license.txt" in the top-level Albany directory // 00005 //*****************************************************************// 00006 #include "MOR_FileReducedBasisSource.hpp" 00007 00008 #include "MOR_MultiVectorInputFile.hpp" 00009 #include "MOR_MultiVectorInputFileFactory.hpp" 00010 #include "MOR_InputFileEpetraMVSource.hpp" 00011 00012 #include "Epetra_MultiVector.h" 00013 00014 #include "Teuchos_Ptr.hpp" 00015 00016 namespace MOR { 00017 00018 namespace Detail { 00019 00020 Teuchos::RCP<Teuchos::ParameterList> 00021 fillDefaultBasisInputParams(const Teuchos::RCP<Teuchos::ParameterList> ¶ms) 00022 { 00023 const std::string defaultFileName = "basis"; 00024 params->get("Input File Group Name", defaultFileName); 00025 params->get("Input File Default Base File Name", defaultFileName); 00026 return params; 00027 } 00028 00029 } // end namespace Detail 00030 00031 00032 EpetraMVSourceInputFileProvider::EpetraMVSourceInputFileProvider(const Epetra_Map &vectorMap) : 00033 vectorMap_(vectorMap) 00034 {} 00035 00036 Teuchos::RCP<BasicEpetraMVSource> 00037 EpetraMVSourceInputFileProvider::operator()(const Teuchos::RCP<Teuchos::ParameterList> ¶ms) 00038 { 00039 MultiVectorInputFileFactory factory(Detail::fillDefaultBasisInputParams(params)); 00040 const Teuchos::RCP<MultiVectorInputFile> file = factory.create(); 00041 return Teuchos::rcp(new InputFileEpetraMVSource(vectorMap_, file)); 00042 } 00043 00044 00045 FileReducedBasisSource::FileReducedBasisSource(const Epetra_Map &basisMap) : 00046 TruncatedReducedBasisSource<EpetraMVSourceInputFileProvider>(basisMap) 00047 {} 00048 00049 } // namespace MOR