@@ -25,19 +25,19 @@ namespace pfasst
2525 public:
2626 virtual ~PolyInterpMixin () { }
2727
28- virtual void interpolate (ISweeper<time>* dst, const ISweeper<time>* src,
28+ virtual void interpolate (shared_ptr< ISweeper<time>> dst, shared_ptr< const ISweeper<time>> src,
2929 bool interp_delta_from_initial,
3030 bool interp_initial)
3131 {
32- EncapSweeper<time>* fine = dynamic_cast <EncapSweeper<time>* >(dst);
33- assert (fine != nullptr );
34- const EncapSweeper<time>* crse = dynamic_cast <const EncapSweeper<time>* >(src);
35- assert (crse != nullptr );
32+ shared_ptr< EncapSweeper<time>> fine = dynamic_pointer_cast <EncapSweeper<time>>(dst);
33+ assert (fine);
34+ shared_ptr< const EncapSweeper<time>> crse = dynamic_pointer_cast <const EncapSweeper<time>>(src);
35+ assert (crse);
3636
3737 this ->interpolate (fine, crse, interp_delta_from_initial, interp_initial);
3838 }
3939
40- virtual void interpolate (EncapSweeper<time>* fine, const EncapSweeper<time>* crse,
40+ virtual void interpolate (shared_ptr< EncapSweeper<time>> fine, shared_ptr< const EncapSweeper<time>> crse,
4141 bool interp_delta_from_initial,
4242 bool interp_initial)
4343 {
@@ -83,17 +83,17 @@ namespace pfasst
8383 for (size_t m = m0; m < nfine; m++) { fine->evaluate (m); }
8484 }
8585
86- virtual void restrict (ISweeper<time>* dst, const ISweeper<time>* src, bool restrict_initial)
86+ virtual void restrict (shared_ptr< ISweeper<time>> dst, shared_ptr< const ISweeper<time>> src, bool restrict_initial)
8787 {
88- EncapSweeper<time>* crse = dynamic_cast <EncapSweeper<time>* >(dst);
89- assert (crse != nullptr );
90- const EncapSweeper<time>* fine = dynamic_cast <const EncapSweeper<time>* >(src);
91- assert (fine != nullptr );
88+ shared_ptr< EncapSweeper<time>> crse = dynamic_pointer_cast <EncapSweeper<time>>(dst);
89+ assert (crse);
90+ shared_ptr< const EncapSweeper<time>> fine = dynamic_pointer_cast <const EncapSweeper<time>>(src);
91+ assert (fine);
9292
9393 this ->restrict (crse, fine, restrict_initial);
9494 }
9595
96- virtual void restrict (EncapSweeper<time>* crse, const EncapSweeper<time>* fine, bool restrict_initial)
96+ virtual void restrict (shared_ptr< EncapSweeper<time>> crse, shared_ptr< const EncapSweeper<time>> fine, bool restrict_initial)
9797 {
9898 auto dnodes = crse->get_nodes ();
9999 auto snodes = fine->get_nodes ();
@@ -115,17 +115,17 @@ namespace pfasst
115115 for (size_t m = m0; m < ncrse; m++) { crse->evaluate (m); }
116116 }
117117
118- virtual void fas (time dt, ISweeper<time>* dst, const ISweeper<time>* src)
118+ virtual void fas (time dt, shared_ptr< ISweeper<time>> dst, shared_ptr< const ISweeper<time>> src)
119119 {
120- EncapSweeper<time>* crse = dynamic_cast <EncapSweeper<time>* >(dst);
121- assert (crse != nullptr );
122- const EncapSweeper<time>* fine = dynamic_cast <const EncapSweeper<time>* >(src);
123- assert (fine != nullptr );
120+ shared_ptr< EncapSweeper<time>> crse = dynamic_pointer_cast <EncapSweeper<time>>(dst);
121+ assert (crse);
122+ shared_ptr< const EncapSweeper<time>> fine = dynamic_pointer_cast <const EncapSweeper<time>>(src);
123+ assert (fine);
124124
125125 this ->fas (dt, crse, fine);
126126 }
127127
128- virtual void fas (time dt, EncapSweeper<time>* crse, const EncapSweeper<time>* fine)
128+ virtual void fas (time dt, shared_ptr< EncapSweeper<time>> crse, shared_ptr< const EncapSweeper<time>> fine)
129129 {
130130 size_t ncrse = crse->get_nodes ().size ();
131131 assert (ncrse > 1 );
0 commit comments