Tempus  Version of the Day
Time Integration
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Tempus_InterpolatorLagrange_decl.hpp
Go to the documentation of this file.
1 //@HEADER
2 // *****************************************************************************
3 // Tempus: Time Integration and Sensitivity Analysis Package
4 //
5 // Copyright 2017 NTESS and the Tempus contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 //@HEADER
9 
10 #ifndef Tempus_InterpolatorLagrange_decl_hpp
11 #define Tempus_InterpolatorLagrange_decl_hpp
12 
13 #include "Tempus_config.hpp"
14 #include "Tempus_Interpolator.hpp"
15 
16 namespace Tempus {
17 
21 template <class Scalar>
22 class InterpolatorLagrange : virtual public Interpolator<Scalar> {
23  public:
26 
29 
31 
32 
34  void setNodes(
35  const Teuchos::RCP<
36  const std::vector<Teuchos::RCP<SolutionState<Scalar> > > >& nodes)
37  {
38  nodes_ = nodes;
39  }
40 
42  void interpolate(const Scalar& t, SolutionState<Scalar>* state_out) const;
43 
45  int order() const { return order_; }
46 
48 
50 
51  std::string description() const { return "Tempus::InterpolatorLagrange"; }
53  const Teuchos::EVerbosityLevel /* verbLevel */) const
54  {
55  out.setOutputToRootOnly(0);
56  out << description() << "::describe" << std::endl;
57  }
59 
61 
67 
68  private:
69  void lagrange(const int p, const Scalar& t,
70  SolutionState<Scalar>* state_out) const;
71 
75  int order_;
76 };
77 
78 // Nonmember constructor
79 template <class Scalar>
81 {
83 }
84 
85 } // namespace Tempus
86 
87 #endif // Tempus_InterpolatorLagrange_decl_hpp
Teuchos::RCP< const std::vector< Teuchos::RCP< SolutionState< Scalar > > > > nodes_
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel) const
Teuchos::RCP< Teuchos::ParameterList > pl_
Teuchos::RCP< Teuchos::ParameterList > getNonconstParameterList()
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Base strategy class for interpolation functionality.
Teuchos::RCP< Teuchos::ParameterList > unsetParameterList()
basic_FancyOStream & setOutputToRootOnly(const int rootRank)
void setNodes(const Teuchos::RCP< const std::vector< Teuchos::RCP< SolutionState< Scalar > > > > &nodes)
Store pointer to interpolation nodes.
Teuchos::RCP< InterpolatorLagrange< Scalar > > lagrangeInterpolator()
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
void lagrange(const int p, const Scalar &t, SolutionState< Scalar > *state_out) const
void interpolate(const Scalar &t, SolutionState< Scalar > *state_out) const
Perform an interpolation.
Concrete implemenation of Interpolator that does simple lagrange interpolation.
Solution state for integrators and steppers.
void setParameterList(const Teuchos::RCP< Teuchos::ParameterList > &paramList)
int order() const
Return the order of the interpolation.