Rythmos_SmartInterpolationBufferAppender.hpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef RYTHMOS_SMART_INTERPOLATION_BUFFER_APPENDER_HPP
00030 #define RYTHMOS_SMART_INTERPOLATION_BUFFER_APPENDER_HPP
00031
00032 #include "Rythmos_InterpolationBufferAppenderBase.hpp"
00033
00034
00035 namespace Rythmos {
00036
00037
00039 template<class Scalar>
00040 class SmartInterpolationBufferAppender
00041 : virtual public InterpolationBufferAppenderBase<Scalar>
00042 {
00043 public:
00048 void append(
00049 const InterpolationBufferBase<Scalar>& interpBuffSource,
00050 const TimeRange<Scalar>& range,
00051 const Ptr<InterpolationBufferBase<Scalar> > &interpBuffSink
00052 );
00053 };
00054
00055
00056
00057
00058
00059
00060
00061 template<class Scalar>
00062 void SmartInterpolationBufferAppender<Scalar>::append(
00063 const InterpolationBufferBase<Scalar>& interpBuffSource,
00064 const TimeRange<Scalar>& range,
00065 const Ptr<InterpolationBufferBase<Scalar> > &interpBuffSink
00066 )
00067 {
00068 TEST_FOR_EXCEPTION(
00069 true, std::logic_error,
00070 "This class has never been tested before and should not be used\n"
00071 "until it is"
00072 );
00073
00074
00075 #ifdef TEUCHOS_DEBUG
00076 this->assertAppendPreconditions(interpBuffSource,range,*interpBuffSink);
00077 #endif // TEUCHOS_DEBUG
00078 if (interpBuffSink->getOrder() >= interpBuffSource.getOrder()) {
00079
00080
00081
00082 PointwiseInterpolationBufferAppender<Scalar> defaultAppender;
00083 defaultAppender.append(interpBuffSink,interpBuffSource,range);
00084 } else {
00085
00086
00087
00088 TEST_FOR_EXCEPTION(
00089 true,std::logic_error,
00090 "Error, the smart interpolation buffer appender is not implemented\n"
00091 "for appending interpolation buffers with higher order interpolation\n"
00092 "into interpolation buffers with a lower order of interpolation yet!"
00093 );
00094
00095
00096
00097 }
00098 }
00099
00100
00101 }
00102
00103
00104 #endif //RYTHMOS_SMART_INTERPOLATION_BUFFER_APPENDER_HPP