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 #include "Teuchos_ParameterListAcceptorDefaultBase.hpp"
00034
00035
00036 namespace Rythmos {
00037
00038
00040 template<class Scalar>
00041 class SmartInterpolationBufferAppender
00042 : virtual public InterpolationBufferAppenderBase<Scalar>,
00043 virtual public Teuchos::ParameterListAcceptorDefaultBase
00044 {
00045 public:
00050 void append(
00051 const InterpolationBufferBase<Scalar>& interpBuffSource,
00052 const TimeRange<Scalar>& range,
00053 const Ptr<InterpolationBufferBase<Scalar> > &interpBuffSink
00054 );
00055
00058
00060 void setParameterList(RCP<Teuchos::ParameterList> const& paramList);
00061
00063 RCP<const Teuchos::ParameterList> getValidParameters() const;
00064
00066 };
00067
00068
00069
00070
00071
00072
00073
00074 template<class Scalar>
00075 void SmartInterpolationBufferAppender<Scalar>::append(
00076 const InterpolationBufferBase<Scalar>& interpBuffSource,
00077 const TimeRange<Scalar>& range,
00078 const Ptr<InterpolationBufferBase<Scalar> > &interpBuffSink
00079 )
00080 {
00081 TEST_FOR_EXCEPTION(
00082 true, std::logic_error,
00083 "This class has never been tested before and should not be used\n"
00084 "until it is"
00085 );
00086
00087
00088 #ifdef RYTHMOS_DEBUG
00089 this->assertAppendPreconditions(interpBuffSource,range,*interpBuffSink);
00090 #endif // RYTHMOS_DEBUG
00091 if (interpBuffSink->getOrder() >= interpBuffSource.getOrder()) {
00092
00093
00094
00095 PointwiseInterpolationBufferAppender<Scalar> defaultAppender;
00096 defaultAppender.append(interpBuffSink,interpBuffSource,range);
00097 } else {
00098
00099
00100
00101 TEST_FOR_EXCEPTION(
00102 true,std::logic_error,
00103 "Error, the smart interpolation buffer appender is not implemented\n"
00104 "for appending interpolation buffers with higher order interpolation\n"
00105 "into interpolation buffers with a lower order of interpolation yet!"
00106 );
00107
00108
00109
00110 }
00111 }
00112
00113 template<class Scalar>
00114 void SmartInterpolationBufferAppender<Scalar>::setParameterList(RCP<Teuchos::ParameterList> const& paramList)
00115 {
00116 TEST_FOR_EXCEPT( is_null(paramList) );
00117 paramList->validateParameters(*this->getValidParameters());
00118 setMyParamList(paramList);
00119 Teuchos::readVerboseObjectSublist(&*paramList,this);
00120 }
00121
00122 template<class Scalar>
00123 RCP<const Teuchos::ParameterList> SmartInterpolationBufferAppender<Scalar>::getValidParameters() const
00124 {
00125 static RCP<Teuchos::ParameterList> validPL;
00126 if (is_null(validPL)) {
00127 RCP<Teuchos::ParameterList> pl = Teuchos::parameterList();
00128 Teuchos::setupVerboseObjectSublist(&*pl);
00129 validPL = pl;
00130 }
00131 return (validPL);
00132 }
00133
00134 }
00135
00136
00137 #endif //RYTHMOS_SMART_INTERPOLATION_BUFFER_APPENDER_HPP