10 #ifndef Tempus_InterpolatorFactory_hpp
11 #define Tempus_InterpolatorFactory_hpp
14 #include "Tempus_config.hpp"
15 #include "Tempus_InterpolatorLagrange.hpp"
24 template <
class Scalar>
29 std::string interpolatorType =
"")
31 if (interpolatorType ==
"") interpolatorType =
"Lagrange";
39 std::string interpolatorType =
40 interpolatorPL->
get<std::string>(
"Interpolator Type",
"Lagrange");
47 const std::string& interpolatorType,
53 if (interpolatorType ==
"Lagrange")
57 true, std::logic_error,
58 "Unknown 'Interpolator Type' = " << interpolatorType);
60 interpolator->setParameterList(interpolatorPL);
67 #endif // Tempus_InterpolatorFactory_hpp
T & get(const std::string &name, T def_value)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
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").
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
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.