diff --git a/dune/tectonic/myglobalnonlinearity.hh b/dune/tectonic/myglobalnonlinearity.hh new file mode 100644 index 0000000000000000000000000000000000000000..dfa47e5ff41d5e004da815290e26bd6c8d3003e5 --- /dev/null +++ b/dune/tectonic/myglobalnonlinearity.hh @@ -0,0 +1,37 @@ +/* -*- mode:c++; mode:semantic -*- */ + +#ifndef MY_GLOBAL_NONLINEARITY_HH +#define MY_GLOBAL_NONLINEARITY_HH + +//#include <dune/common/bitsetvector.hh> +#include <dune/common/fvector.hh> +#include <dune/tectonic/mynonlinearity.hh> + +namespace Dune { +template <int dim, class OuterFunctionType> class MyGlobalNonlinearity { +public: + MyGlobalNonlinearity( + std::vector<double> const &coefficientOfFriction, + std::vector<double> const &normalStress, + std::vector<Dune::FieldVector<double, 1>> const &nodalIntegrals) + : coefficientOfFriction(coefficientOfFriction), + normalStress(normalStress), + nodalIntegrals(nodalIntegrals) {} + + void restriction(int i, OuterFunctionType &f) { + double coefficient = normalStress[i] * nodalIntegrals[i]; + // FIXME: Assume Gamma = id and h_{n+1} = 1 for now; + // We then only have to evaluate (1 + F_xi)(|x|) + coefficient *= 1 + coefficientOfFriction[i]; + f = OuterFunctionType(coefficient); + } + +private: + // TODO: If we're clever, we only store one vector with the precomputed + // results + std::vector<double> coefficientOfFriction; + std::vector<double> normalStress; + std::vector<Dune::FieldVector<double, 1>> nodalIntegrals; +}; +} +#endif