9 #ifndef Tempus_InterpolatorFactory_hpp
10 #define Tempus_InterpolatorFactory_hpp
12 #include "Teuchos_ParameterList.hpp"
13 #include "Tempus_InterpolatorLagrange.hpp"
22 template<
class Scalar>
28 static Teuchos::RCP<Interpolator<Scalar> >
31 if (interpolatorType ==
"")
32 interpolatorType =
"Lagrange";
37 static Teuchos::RCP<Interpolator<Scalar> >
40 std::string interpolatorType =
41 interpolatorPL->get<std::string>(
"Interpolator Type",
"Lagrange");
48 static Teuchos::RCP<Interpolator<Scalar> >
50 const Teuchos::RCP<Teuchos::ParameterList>& interpolatorPL)
54 Teuchos::RCP<Interpolator<Scalar> > interpolator;
55 if (interpolatorType ==
"Lagrange")
58 TEUCHOS_TEST_FOR_EXCEPTION(
true, std::logic_error,
59 "Unknown 'Interpolator Type' = " << interpolatorType);
61 interpolator->setParameterList(interpolatorPL);
69 #endif // Tempus_InterpolatorFactory_hpp
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.