• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

MOR_SampleDofListFactory.cpp

Go to the documentation of this file.
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 
00007 #include "MOR_SampleDofListFactory.hpp"
00008 
00009 #include "Teuchos_TestForException.hpp"
00010 
00011 #include <stdexcept>
00012 
00013 namespace MOR {
00014 
00015 SampleDofListFactory::SampleDofListFactory()
00016 {
00017   // Nothing to do
00018 }
00019 
00020 Teuchos::Array<int>
00021 SampleDofListFactory::create(const Teuchos::RCP<Teuchos::ParameterList> &params)
00022 {
00023   const std::string providerId = params->get("Source Type", "");
00024 
00025   const ProviderMap::const_iterator it = providers_.find(providerId);
00026   TEUCHOS_TEST_FOR_EXCEPTION(
00027       it == providers_.end(),
00028       std::out_of_range,
00029       "Unknown sample dof provider type: " << providerId);
00030 
00031   return (*it->second)(params);
00032 }
00033 
00034 void
00035 SampleDofListFactory::extend(const std::string &id, const Teuchos::RCP<DofListProvider> &provider)
00036 {
00037   providers_[id] = provider;
00038 }
00039 
00040 } // namespace MOR

Generated on Wed Mar 26 2014 18:36:40 for Albany: a Trilinos-based PDE code by  doxygen 1.7.1