From 5474019f3b6081745c8eec5f17f5e9c334a1ad2c Mon Sep 17 00:00:00 2001 From: podlesny <podlesny@zedat.fu-berlin.de> Date: Fri, 19 Mar 2021 15:33:44 +0100 Subject: [PATCH] add linear dirichlet boundary condition as in Pipping-2013 --- dune/tectonic/problem-data/bc.hh | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/dune/tectonic/problem-data/bc.hh b/dune/tectonic/problem-data/bc.hh index 76a233ec..a01fde64 100644 --- a/dune/tectonic/problem-data/bc.hh +++ b/dune/tectonic/problem-data/bc.hh @@ -37,6 +37,39 @@ class VelocityDirichletCondition const double threshold_; }; + +class VelocityDirichletConditionLinearLoading + : public Dune::VirtualFunction<double, double> { + +public: + VelocityDirichletConditionLinearLoading(const double finalVelocity = 5e-5, const double threshold = 0.1) : + finalVelocity_(finalVelocity), + threshold_(threshold) + {} + + void evaluate(double const &relativeTime, double &y) const { + // Assumed to vanish at time zero + + //std::cout << "VelocityDirichletCondition::evaluate()" << std::endl; + + /*if (relativeTime <= 0.1) + std::cout << "- loading phase" << std::endl; + else + std::cout << "- final velocity reached" << std::endl;*/ + + y = (relativeTime <= threshold_) + ? finalVelocity_ * relativeTime / threshold_ + : finalVelocity_; + + //y = relativeTime * finalVelocity; + + } + +private: + const double finalVelocity_; + const double threshold_; +}; + class VelocityStepDirichletCondition : public Dune::VirtualFunction<double, double> { -- GitLab