diff --git a/src/timestepping.org b/src/timestepping.org index 7f044a97daa5926041b1e5d95d8530c07bcdb913..a234d86ebfd83e909525e6d39aa31b075228550d 100644 --- a/src/timestepping.org +++ b/src/timestepping.org @@ -26,6 +26,9 @@ void virtual postProcess(VectorType const &); void virtual extractDisplacement(VectorType &) const; void virtual extractVelocity(VectorType &) const; + + virtual TimeSteppingScheme<VectorType, MatrixType, FunctionType, dim> * + clone(); #+end_src #+name: dirichletCondition #+begin_src c++ @@ -70,6 +73,9 @@ void virtual postProcess(VectorType const &problem_iterate) = 0; void virtual extractDisplacement(VectorType &displacement) const = 0; void virtual extractVelocity(VectorType &velocity) const = 0; + + virtual TimeSteppingScheme<VectorType, MatrixType, FunctionType, dim> * + clone() = 0; }; #+end_src * TimeSteppingScheme: Implicit Euler @@ -184,6 +190,12 @@ velocity = ud; } + template <class VectorType, class MatrixType, class FunctionType, int dim> + TimeSteppingScheme<VectorType, MatrixType, FunctionType, dim> * + ImplicitEuler<VectorType, MatrixType, FunctionType, dim>:: + clone() { + return new ImplicitEuler<VectorType, MatrixType, FunctionType, dim>(*this); + } #+end_src * TimeSteppingScheme: Implicit Two-Step #+begin_src latex :tangle twostep.tex :noweb yes @@ -357,6 +369,13 @@ velocity = ud; } + + template <class VectorType, class MatrixType, class FunctionType, int dim> + TimeSteppingScheme<VectorType, MatrixType, FunctionType, dim> * + ImplicitTwoStep<VectorType, MatrixType, FunctionType, dim>:: + clone() { + return new ImplicitTwoStep<VectorType, MatrixType, FunctionType, dim>(*this); + } #+end_src * TimeSteppingScheme: Newmark #+begin_src latex :tangle newmark.tex :noweb yes @@ -527,6 +546,13 @@ velocity = ud; } + + template <class VectorType, class MatrixType, class FunctionType, int dim> + TimeSteppingScheme<VectorType, MatrixType, FunctionType, dim> * + Newmark<VectorType, MatrixType, FunctionType, dim>:: + clone() { + return new Newmark<VectorType, MatrixType, FunctionType, dim>(*this); + } #+end_src * C++ code generation #+begin_src c++ :tangle timestepping.hh :noweb yes