Rythmos - Transient Integration for Differential Equations  Version of the Day
 All Classes Functions Variables Typedefs Pages
Rythmos_InterpolatorBase.hpp
1 //@HEADER
2 // ***********************************************************************
3 //
4 // Rythmos Package
5 // Copyright (2006) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // This library is free software; you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as
12 // published by the Free Software Foundation; either version 2.1 of the
13 // License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23 // USA
24 // Questions? Contact Todd S. Coffey (tscoffe@sandia.gov)
25 //
26 // ***********************************************************************
27 //@HEADER
28 
29 #ifndef Rythmos_INTERPOLATOR_BASE_H
30 #define Rythmos_INTERPOLATOR_BASE_H
31 
32 #include "Rythmos_DataStore.hpp"
33 #include "Rythmos_InterpolationBufferHelpers.hpp"
34 
35 
36 namespace Rythmos {
37 
38 
43 template<class Scalar>
45  : virtual public Teuchos::Describable
46  , virtual public Teuchos::ParameterListAcceptor
47  , virtual public Teuchos::VerboseObject<InterpolatorBase<Scalar> >
48 {
49 public:
50 
58  virtual bool supportsCloning() const;
59 
72  virtual Teuchos::RCP<InterpolatorBase<Scalar> > cloneInterpolator() const;
73 
92  virtual void setNodes(
93  const RCP<const typename DataStore<Scalar>::DataStoreVector_t> & nodes
94  ) =0;
95 
117  virtual void interpolate(
118  const Array<Scalar> &t_values,
119  typename DataStore<Scalar>::DataStoreVector_t *data_out
120  ) const =0;
121 
126  virtual int order() const =0;
127 
128 };
129 
130 
131 
132 // ///////////////////////////////
133 // Implementations
134 
135 
136 template<class Scalar>
138 {
139  return false;
140 }
141 
142 
143 template<class Scalar>
144 Teuchos::RCP<InterpolatorBase<Scalar> >
146 {
147  return Teuchos::null;
148 }
149 
150 
151 } // namespace Rythmos
152 
153 
154 #endif //Rythmos_INTERPOLATOR_BASE_H
Base strategy class for interpolation functionality.
virtual int order() const =0
Return the order of the interpolation.
virtual Teuchos::RCP< InterpolatorBase< Scalar > > cloneInterpolator() const
Clone the interpolator object if supported.
virtual void setNodes(const RCP< const typename DataStore< Scalar >::DataStoreVector_t > &nodes)=0
Store pointer to interpolation nodes.
virtual void interpolate(const Array< Scalar > &t_values, typename DataStore< Scalar >::DataStoreVector_t *data_out) const =0
Perform an interpolation.
virtual bool supportsCloning() const
Return if this interpolator supports cloning or not.