10#ifndef Tempus_InterpolatorFactory_hpp
11#define Tempus_InterpolatorFactory_hpp
13#include "Teuchos_ParameterList.hpp"
14#include "Tempus_config.hpp"
15#include "Tempus_InterpolatorLagrange.hpp"
24template <
class Scalar>
29 std::string interpolatorType =
"")
31 if (interpolatorType ==
"") interpolatorType =
"Lagrange";
37 const Teuchos::RCP<Teuchos::ParameterList>& interpolatorPL)
39 std::string interpolatorType =
40 interpolatorPL->get<std::string>(
"Interpolator Type",
"Lagrange");
47 const std::string& interpolatorType,
48 const Teuchos::RCP<Teuchos::ParameterList>& interpolatorPL)
52 Teuchos::RCP<Interpolator<Scalar> > interpolator;
53 if (interpolatorType ==
"Lagrange")
56 TEUCHOS_TEST_FOR_EXCEPTION(
57 true, std::logic_error,
58 "Unknown 'Interpolator Type' = " << interpolatorType);
60 interpolator->setParameterList(interpolatorPL);
static Teuchos::RCP< Interpolator< Scalar > > createInterpolator(const Teuchos::RCP< Teuchos::ParameterList > &interpolatorPL)
Create interpolator from ParameterList with its details.
static Teuchos::RCP< Interpolator< Scalar > > createInterpolator(std::string interpolatorType="")
Create default interpolator from interpolator type (e.g., "Linear").
static Teuchos::RCP< Interpolator< Scalar > > createInterpolator(const std::string &interpolatorType, const Teuchos::RCP< Teuchos::ParameterList > &interpolatorPL)
Very simple factory method.
Concrete implemenation of Interpolator that does simple lagrange interpolation.