Tempus
Version of the Day
Time Integration
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Tempus_InterpolatorFactory.hpp
Go to the documentation of this file.
1
// @HEADER
2
// ****************************************************************************
3
// Tempus: Copyright (2017) Sandia Corporation
4
//
5
// Distributed under BSD 3-clause license (See accompanying file Copyright.txt)
6
// ****************************************************************************
7
// @HEADER
8
9
#ifndef Tempus_InterpolatorFactory_hpp
10
#define Tempus_InterpolatorFactory_hpp
11
12
#include "Teuchos_ParameterList.hpp"
13
#include "Tempus_config.hpp"
14
#include "Tempus_InterpolatorLagrange.hpp"
15
16
namespace
Tempus
{
17
23
template
<
class
Scalar>
24
class
InterpolatorFactory
25
{
26
public
:
27
29
static
Teuchos::RCP<Interpolator<Scalar> >
30
createInterpolator
(std::string interpolatorType =
""
)
31
{
32
if
(interpolatorType ==
""
)
33
interpolatorType =
"Lagrange"
;
34
return
createInterpolator
(interpolatorType, Teuchos::null);
35
}
36
38
static
Teuchos::RCP<Interpolator<Scalar> >
39
createInterpolator
(
const
Teuchos::RCP<Teuchos::ParameterList>& interpolatorPL)
40
{
41
std::string interpolatorType =
42
interpolatorPL->get<std::string>(
"Interpolator Type"
,
"Lagrange"
);
43
return
createInterpolator
(interpolatorType, interpolatorPL);
44
}
45
46
private
:
47
49
static
Teuchos::RCP<Interpolator<Scalar> >
50
createInterpolator
(
const
std::string& interpolatorType,
51
const
Teuchos::RCP<Teuchos::ParameterList>& interpolatorPL)
52
{
53
using
Teuchos::rcp;
54
55
Teuchos::RCP<Interpolator<Scalar> > interpolator;
56
if
(interpolatorType ==
"Lagrange"
)
57
interpolator = rcp(
new
InterpolatorLagrange<Scalar>
);
58
else
{
59
TEUCHOS_TEST_FOR_EXCEPTION(
true
, std::logic_error,
60
"Unknown 'Interpolator Type' = "
<< interpolatorType);
61
}
62
interpolator->setParameterList(interpolatorPL);
63
64
return
interpolator;
65
}
66
67
};
68
69
}
// namespace Tempus
70
#endif
// Tempus_InterpolatorFactory_hpp
Tempus::InterpolatorFactory
Interpolator factory.
Definition
Tempus_InterpolatorFactory.hpp:25
Tempus::InterpolatorFactory::createInterpolator
static Teuchos::RCP< Interpolator< Scalar > > createInterpolator(const Teuchos::RCP< Teuchos::ParameterList > &interpolatorPL)
Create interpolator from ParameterList with its details.
Definition
Tempus_InterpolatorFactory.hpp:39
Tempus::InterpolatorFactory::createInterpolator
static Teuchos::RCP< Interpolator< Scalar > > createInterpolator(std::string interpolatorType="")
Create default interpolator from interpolator type (e.g., "Linear").
Definition
Tempus_InterpolatorFactory.hpp:30
Tempus::InterpolatorFactory::createInterpolator
static Teuchos::RCP< Interpolator< Scalar > > createInterpolator(const std::string &interpolatorType, const Teuchos::RCP< Teuchos::ParameterList > &interpolatorPL)
Very simple factory method.
Definition
Tempus_InterpolatorFactory.hpp:50
Tempus::InterpolatorLagrange
Concrete implemenation of Interpolator that does simple lagrange interpolation.
Definition
Tempus_InterpolatorLagrange_decl.hpp:22
Tempus
Definition
Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp:21
Generated by
1.17.0