diff --git a/src/rate/rateupdater.cc b/src/rate/rateupdater.cc index 2de879b3744708d05425f3400b9a192633c03053..765b6b64732fa45a8a47503ae705481ec4f5f677 100644 --- a/src/rate/rateupdater.cc +++ b/src/rate/rateupdater.cc @@ -49,6 +49,15 @@ void RateUpdater<Vector, Matrix, Function, dim>::extractOldVelocity( oldVelocity = v_o; } +template <class Vector, class Matrix, class Function, size_t dim> +void RateUpdater<Vector, Matrix, Function, dim>::extractAcceleration( + Vector &acceleration) const { + if (!postProcessCalled) + DUNE_THROW(Dune::Exception, "It seems you forgot to call postProcess!"); + + acceleration = a; +} + #include "backward_euler.cc" #include "newmark.cc" #include "rateupdater_tmpl.cc" diff --git a/src/rate/rateupdater.hh b/src/rate/rateupdater.hh index 7b382e2e533e26341fe8d257b7771f1df90310c7..19ec717d27f0d903cf9bd4bcaa2608bba70e653e 100644 --- a/src/rate/rateupdater.hh +++ b/src/rate/rateupdater.hh @@ -24,6 +24,7 @@ class RateUpdater { void extractDisplacement(Vector &displacement) const; void extractVelocity(Vector &velocity) const; void extractOldVelocity(Vector &velocity) const; + void extractAcceleration(Vector &acceleration) const; std::shared_ptr<RateUpdater<Vector, Matrix, Function, dim>> virtual clone() const = 0; diff --git a/src/sand-wedge.cc b/src/sand-wedge.cc index bd7b8182f9493797e0ed3af45da1e33a9b29e847..481e17ebc8ec9b48c84ac7879b9b9e621dcf0c36 100644 --- a/src/sand-wedge.cc +++ b/src/sand-wedge.cc @@ -331,6 +331,7 @@ int main(int argc, char *argv[]) { programState.relativeTau = adaptiveTimeStepper.getRelativeTau(); current.second->extractDisplacement(programState.u); current.second->extractVelocity(programState.v); + current.second->extractAcceleration(programState.a); current.first->extractAlpha(programState.alpha); report();