diff --git a/dune/tectonic/problem-data/bc.hh b/dune/tectonic/problem-data/bc.hh index 76a233ecf0fb25dd0149c7d8cdcb49682a5abb4c..a01fde642a054e2e84aad1ca32333983ee76cf84 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> {