Skip to content
Snippets Groups Projects
Commit 82675edb authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

Make stateUpdaters cloneable

parent c61008b9
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,8 @@ class DieterichStateUpdater ...@@ -16,6 +16,8 @@ class DieterichStateUpdater
virtual void solve(VectorType const &velocity_field); virtual void solve(VectorType const &velocity_field);
virtual void extractState(SingletonVectorType &state); virtual void extractState(SingletonVectorType &state);
virtual StateUpdater<SingletonVectorType, VectorType> *clone();
private: private:
SingletonVectorType alpha_old; SingletonVectorType alpha_old;
SingletonVectorType alpha; SingletonVectorType alpha;
...@@ -57,4 +59,10 @@ void DieterichStateUpdater<SingletonVectorType, VectorType>::extractState( ...@@ -57,4 +59,10 @@ void DieterichStateUpdater<SingletonVectorType, VectorType>::extractState(
state = alpha; state = alpha;
} }
template <class SingletonVectorType, class VectorType>
StateUpdater<SingletonVectorType, VectorType> *
DieterichStateUpdater<SingletonVectorType, VectorType>::clone() {
return new DieterichStateUpdater<SingletonVectorType, VectorType>(*this);
}
#endif #endif
...@@ -15,6 +15,8 @@ class RuinaStateUpdater : public StateUpdater<SingletonVectorType, VectorType> { ...@@ -15,6 +15,8 @@ class RuinaStateUpdater : public StateUpdater<SingletonVectorType, VectorType> {
virtual void solve(VectorType const &velocity_field); virtual void solve(VectorType const &velocity_field);
virtual void extractState(SingletonVectorType &state); virtual void extractState(SingletonVectorType &state);
virtual StateUpdater<SingletonVectorType, VectorType> *clone();
private: private:
SingletonVectorType alpha_old; SingletonVectorType alpha_old;
SingletonVectorType alpha; SingletonVectorType alpha;
...@@ -55,4 +57,10 @@ void RuinaStateUpdater<SingletonVectorType, VectorType>::extractState( ...@@ -55,4 +57,10 @@ void RuinaStateUpdater<SingletonVectorType, VectorType>::extractState(
state = alpha; state = alpha;
} }
template <class SingletonVectorType, class VectorType>
StateUpdater<SingletonVectorType, VectorType> *
RuinaStateUpdater<SingletonVectorType, VectorType>::clone() {
return new RuinaStateUpdater<SingletonVectorType, VectorType>(*this);
}
#endif #endif
...@@ -7,6 +7,8 @@ template <class SingletonVectorType, class VectorType> class StateUpdater { ...@@ -7,6 +7,8 @@ template <class SingletonVectorType, class VectorType> class StateUpdater {
virtual void setup(double _tau) = 0; virtual void setup(double _tau) = 0;
virtual void solve(VectorType const &velocity_field) = 0; virtual void solve(VectorType const &velocity_field) = 0;
virtual void extractState(SingletonVectorType &state) = 0; virtual void extractState(SingletonVectorType &state) = 0;
virtual StateUpdater<SingletonVectorType, VectorType> *clone() = 0;
}; };
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment