30 #ifndef RYTHMOS_RK_BUTCHER_TABLEAU_BUILDER_DEF_HPP
31 #define RYTHMOS_RK_BUTCHER_TABLEAU_BUILDER_DEF_HPP
33 #include "Rythmos_Types.hpp"
35 #include "Rythmos_RKButcherTableauBuilder_decl.hpp"
36 #include "Rythmos_RKButcherTableau.hpp"
41 template<
class Scalar>
42 RCP<RKButcherTableauBuilder<Scalar> > rKButcherTableauBuilder()
44 RCP<RKButcherTableauBuilder<Scalar> > rkbtfn = rcp(
new RKButcherTableauBuilder<Scalar>() );
48 template<
class Scalar>
49 RCP<RKButcherTableauBase<Scalar> > createRKBT(
const std::string& rkbt_name)
51 RCP<RKButcherTableauBuilder<Scalar> > rkbtfn = rKButcherTableauBuilder<Scalar>();
52 RCP<RKButcherTableauBase<Scalar> > rkbt = rkbtfn->create(rkbt_name);
56 template<
class Scalar>
57 RKButcherTableauBuilder<Scalar>::RKButcherTableauBuilder()
59 this->initializeDefaults_();
62 template<
class Scalar>
63 void RKButcherTableauBuilder<Scalar>::setRKButcherTableauFactory(
64 const RCP<
const Teuchos::AbstractFactory<RKButcherTableauBase<Scalar> > > &rkbtFactory,
65 const std::string &rkbtFactoryName
68 builder_.setObjectFactory(rkbtFactory, rkbtFactoryName);
71 template<
class Scalar>
72 void RKButcherTableauBuilder<Scalar>::setParameterList(
73 RCP<Teuchos::ParameterList>
const& paramList
76 builder_.setParameterList(paramList);
79 template<
class Scalar>
80 RCP<Teuchos::ParameterList>
81 RKButcherTableauBuilder<Scalar>::getNonconstParameterList()
83 return builder_.getNonconstParameterList();
87 template<
class Scalar>
88 RCP<Teuchos::ParameterList>
89 RKButcherTableauBuilder<Scalar>::unsetParameterList()
91 return builder_.unsetParameterList();
95 template<
class Scalar>
96 RCP<const Teuchos::ParameterList>
97 RKButcherTableauBuilder<Scalar>::getParameterList()
const
99 return builder_.getParameterList();
103 template<
class Scalar>
104 RCP<const Teuchos::ParameterList>
105 RKButcherTableauBuilder<Scalar>::getValidParameters()
const
107 return builder_.getValidParameters();
110 template<
class Scalar>
111 RCP<RKButcherTableauBase<Scalar> >
112 RKButcherTableauBuilder<Scalar>::create(
113 const std::string &rkbt_name
116 return builder_.create(rkbt_name);
119 template<
class Scalar>
120 void RKButcherTableauBuilder<Scalar>::initializeDefaults_()
123 using Teuchos::abstractFactoryStd;
125 builder_.setObjectName(
"Rythmos::RKButcherTableau");
126 builder_.setObjectTypeName(
"Runge Kutta Butcher Tableau Type");
133 builder_.setObjectFactory(
134 abstractFactoryStd< RKButcherTableauBase<Scalar>,
135 ForwardEuler_RKBT<Scalar> >(),
136 RKBT_ForwardEuler_name());
138 builder_.setObjectFactory(
139 abstractFactoryStd< RKButcherTableauBase<Scalar>,
140 Explicit2Stage2ndOrderRunge_RKBT<Scalar> >(),
141 Explicit2Stage2ndOrderRunge_name());
143 builder_.setObjectFactory(
144 abstractFactoryStd< RKButcherTableauBase<Scalar>,
145 ExplicitTrapezoidal_RKBT<Scalar> >(),
146 ExplicitTrapezoidal_name());
148 builder_.setObjectFactory(
149 abstractFactoryStd< RKButcherTableauBase<Scalar>,
150 Explicit3Stage3rdOrder_RKBT<Scalar> >(),
151 Explicit3Stage3rdOrder_name());
153 builder_.setObjectFactory(
154 abstractFactoryStd< RKButcherTableauBase<Scalar>,
155 Explicit3Stage3rdOrderHeun_RKBT<Scalar> >(),
156 Explicit3Stage3rdOrderHeun_name());
158 builder_.setObjectFactory(
159 abstractFactoryStd< RKButcherTableauBase<Scalar>,
160 Explicit3Stage3rdOrderTVD_RKBT<Scalar> >(),
161 Explicit3Stage3rdOrderTVD_name());
163 builder_.setObjectFactory(
164 abstractFactoryStd< RKButcherTableauBase<Scalar>,
165 Explicit2Stage2ndOrderTVD_RKBT<Scalar> >(),
166 Explicit2Stage2ndOrderTVD_name());
168 builder_.setObjectFactory(
169 abstractFactoryStd< RKButcherTableauBase<Scalar>,
170 Explicit4Stage3rdOrderRunge_RKBT<Scalar> >(),
171 Explicit4Stage3rdOrderRunge_name());
173 builder_.setObjectFactory(
174 abstractFactoryStd< RKButcherTableauBase<Scalar>,
175 Explicit5Stage3rdOrderKandG_RKBT<Scalar> >(),
176 Explicit5Stage3rdOrderKandG_name());
178 builder_.setObjectFactory(
179 abstractFactoryStd< RKButcherTableauBase<Scalar>,
180 Explicit4Stage4thOrder_RKBT<Scalar> >(),
181 Explicit4Stage_name());
183 builder_.setObjectFactory(
184 abstractFactoryStd< RKButcherTableauBase<Scalar>,
185 Explicit3_8Rule_RKBT<Scalar> >(),
186 Explicit3_8Rule_name());
189 builder_.setObjectFactory(
190 abstractFactoryStd< RKButcherTableauBase<Scalar>,
191 BackwardEuler_RKBT<Scalar> >(),
192 RKBT_BackwardEuler_name());
194 builder_.setObjectFactory(
195 abstractFactoryStd< RKButcherTableauBase<Scalar>,
196 IRK1StageTheta_RKBT<Scalar> >(),
197 IRK1StageTheta_name());
199 builder_.setObjectFactory(
200 abstractFactoryStd< RKButcherTableauBase<Scalar>,
201 IRK2StageTheta_RKBT<Scalar> >(),
202 IRK2StageTheta_name());
205 builder_.setObjectFactory(
206 abstractFactoryStd< RKButcherTableauBase<Scalar>,
207 SDIRK2Stage2ndOrder_RKBT<Scalar> >(),
208 SDIRK2Stage2ndOrder_name());
210 builder_.setObjectFactory(
211 abstractFactoryStd< RKButcherTableauBase<Scalar>,
212 SDIRK2Stage3rdOrder_RKBT<Scalar> >(),
213 SDIRK2Stage3rdOrder_name());
215 builder_.setObjectFactory(
216 abstractFactoryStd< RKButcherTableauBase<Scalar>,
217 SDIRK3Stage4thOrder_RKBT<Scalar> >(),
218 SDIRK3Stage4thOrder_name());
220 builder_.setObjectFactory(
221 abstractFactoryStd< RKButcherTableauBase<Scalar>,
222 SDIRK5Stage4thOrder_RKBT<Scalar> >(),
223 SDIRK5Stage4thOrder_name());
225 builder_.setObjectFactory(
226 abstractFactoryStd< RKButcherTableauBase<Scalar>,
227 SDIRK5Stage5thOrder_RKBT<Scalar> >(),
228 SDIRK5Stage5thOrder_name());
231 builder_.setObjectFactory(
232 abstractFactoryStd< RKButcherTableauBase<Scalar>,
233 DIRK2Stage3rdOrder_RKBT<Scalar> >(),
234 DIRK2Stage3rdOrder_name());
237 builder_.setObjectFactory(
238 abstractFactoryStd< RKButcherTableauBase<Scalar>,
239 Implicit1Stage2ndOrderGauss_RKBT<Scalar> >(),
240 Implicit1Stage2ndOrderGauss_name());
242 builder_.setObjectFactory(
243 abstractFactoryStd< RKButcherTableauBase<Scalar>,
244 Implicit2Stage4thOrderGauss_RKBT<Scalar> >(),
245 Implicit2Stage4thOrderGauss_name());
247 builder_.setObjectFactory(
248 abstractFactoryStd< RKButcherTableauBase<Scalar>,
249 Implicit3Stage6thOrderGauss_RKBT<Scalar> >(),
250 Implicit3Stage6thOrderGauss_name());
252 builder_.setObjectFactory(
253 abstractFactoryStd< RKButcherTableauBase<Scalar>,
254 Implicit2Stage4thOrderHammerHollingsworth_RKBT<Scalar> >(),
255 Implicit2Stage4thOrderHammerHollingsworth_name());
257 builder_.setObjectFactory(
258 abstractFactoryStd< RKButcherTableauBase<Scalar>,
259 Implicit3Stage6thOrderKuntzmannButcher_RKBT<Scalar> >(),
260 Implicit3Stage6thOrderKuntzmannButcher_name());
267 builder_.setObjectFactory(
268 abstractFactoryStd< RKButcherTableauBase<Scalar>,
269 Implicit1Stage1stOrderRadauA_RKBT<Scalar> >(),
270 Implicit1Stage1stOrderRadauA_name());
272 builder_.setObjectFactory(
273 abstractFactoryStd< RKButcherTableauBase<Scalar>,
274 Implicit2Stage3rdOrderRadauA_RKBT<Scalar> >(),
275 Implicit2Stage3rdOrderRadauA_name());
277 builder_.setObjectFactory(
278 abstractFactoryStd< RKButcherTableauBase<Scalar>,
279 Implicit3Stage5thOrderRadauA_RKBT<Scalar> >(),
280 Implicit3Stage5thOrderRadauA_name());
282 builder_.setObjectFactory(
283 abstractFactoryStd< RKButcherTableauBase<Scalar>,
284 Implicit1Stage1stOrderRadauB_RKBT<Scalar> >(),
285 Implicit1Stage1stOrderRadauB_name());
287 builder_.setObjectFactory(
288 abstractFactoryStd< RKButcherTableauBase<Scalar>,
289 Implicit2Stage3rdOrderRadauB_RKBT<Scalar> >(),
290 Implicit2Stage3rdOrderRadauB_name());
292 builder_.setObjectFactory(
293 abstractFactoryStd< RKButcherTableauBase<Scalar>,
294 Implicit3Stage5thOrderRadauB_RKBT<Scalar> >(),
295 Implicit3Stage5thOrderRadauB_name());
297 builder_.setObjectFactory(
298 abstractFactoryStd< RKButcherTableauBase<Scalar>,
299 Implicit2Stage2ndOrderLobattoA_RKBT<Scalar> >(),
300 Implicit2Stage2ndOrderLobattoA_name());
302 builder_.setObjectFactory(
303 abstractFactoryStd< RKButcherTableauBase<Scalar>,
304 Implicit3Stage4thOrderLobattoA_RKBT<Scalar> >(),
305 Implicit3Stage4thOrderLobattoA_name());
307 builder_.setObjectFactory(
308 abstractFactoryStd< RKButcherTableauBase<Scalar>,
309 Implicit4Stage6thOrderLobattoA_RKBT<Scalar> >(),
310 Implicit4Stage6thOrderLobattoA_name());
312 builder_.setObjectFactory(
313 abstractFactoryStd< RKButcherTableauBase<Scalar>,
314 Implicit2Stage2ndOrderLobattoB_RKBT<Scalar> >(),
315 Implicit2Stage2ndOrderLobattoB_name());
317 builder_.setObjectFactory(
318 abstractFactoryStd< RKButcherTableauBase<Scalar>,
319 Implicit3Stage4thOrderLobattoB_RKBT<Scalar> >(),
320 Implicit3Stage4thOrderLobattoB_name());
322 builder_.setObjectFactory(
323 abstractFactoryStd< RKButcherTableauBase<Scalar>,
324 Implicit4Stage6thOrderLobattoB_RKBT<Scalar> >(),
325 Implicit4Stage6thOrderLobattoB_name());
327 builder_.setObjectFactory(
328 abstractFactoryStd< RKButcherTableauBase<Scalar>,
329 Implicit2Stage2ndOrderLobattoC_RKBT<Scalar> >(),
330 Implicit2Stage2ndOrderLobattoC_name());
332 builder_.setObjectFactory(
333 abstractFactoryStd< RKButcherTableauBase<Scalar>,
334 Implicit3Stage4thOrderLobattoC_RKBT<Scalar> >(),
335 Implicit3Stage4thOrderLobattoC_name());
337 builder_.setObjectFactory(
338 abstractFactoryStd< RKButcherTableauBase<Scalar>,
339 Implicit4Stage6thOrderLobattoC_RKBT<Scalar> >(),
340 Implicit4Stage6thOrderLobattoC_name());
342 builder_.setDefaultObject(
"None");
352 #define RYTHMOS_RK_BUTCHER_TABLEAU_BUILDER_INSTANT(SCALAR) \
354 template class RKButcherTableauBuilder< SCALAR >; \
356 template RCP<RKButcherTableauBuilder< SCALAR > > rKButcherTableauBuilder(); \
358 template RCP<RKButcherTableauBase< SCALAR > > createRKBT(const std::string& rkbt_name);
364 #endif // RYTHMOS_RK_BUTCHER_TABLEAU_BUILDER_DEF_HPP