Skip to content
Snippets Groups Projects
Commit 08d37d87 authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

The current globalnonlinearity was Laursen's

parent 9180851a
No related branches found
No related tags found
No related merge requests found
/* -*- mode:c++; mode:semantic -*- */
#ifndef DUNE_TECTONIC_GLOBAL_LAURSEN_NONLINEARITY_HH
#define DUNE_TECTONIC_GLOBAL_LAURSEN_NONLINEARITY_HH
#include <dune/common/fvector.hh>
#include "globalnonlinearity.hh"
namespace Dune {
template <int dim, class OuterFunctionType>
class GlobalLaursenNonlinearity
: public Dune::GlobalNonlinearity<dim, OuterFunctionType> {
public:
GlobalLaursenNonlinearity(
std::vector<double> const &coefficientOfFriction,
std::vector<double> const &normalStress,
std::vector<Dune::FieldVector<double, 1>> const &nodalIntegrals)
: coefficientOfFriction(coefficientOfFriction),
normalStress(normalStress),
nodalIntegrals(nodalIntegrals) {}
/*
Return a restriction of the outer function to the i'th node. If
mu and sigma_n denote the coefficient of friction and the normal
stress, respectively, at the i'th node, this function is given
by
sigma_n [(1/eta \bar Gamma)* + mu id]
TODO: We chose Gamma = id, so that (\bar Gamma)* = \Gamma^{-1}
= id^{-1} = id. The factor 1/eta cancels in this special case, leaving us
with
sigma_n [id + mu id] = sigma_n (1 + mu) id
*/
virtual void restriction(int i, OuterFunctionType &f) const {
double coefficient = nodalIntegrals[i][0];
coefficient *= normalStress[i];
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
......@@ -8,41 +8,10 @@
namespace Dune {
template <int dim, class OuterFunctionType> class GlobalNonlinearity {
public:
GlobalNonlinearity(
std::vector<double> const &coefficientOfFriction,
std::vector<double> const &normalStress,
std::vector<Dune::FieldVector<double, 1>> const &nodalIntegrals)
: coefficientOfFriction(coefficientOfFriction),
normalStress(normalStress),
nodalIntegrals(nodalIntegrals) {}
/*
Return a restriction of the outer function to the i'th node. If
mu and sigma_n denote the coefficient of friction and the normal
stress, respectively, at the i'th node, this function is given
by
sigma_n [(1/eta \bar Gamma)* + mu id]
TODO: We chose Gamma = id, so that (\bar Gamma)* = \Gamma^{-1}
= id^{-1} = id. The factor 1/eta cancels in this special case, leaving us
with
sigma_n [id + mu id] = sigma_n (1 + mu) id
*/
void restriction(int i, OuterFunctionType &f) const {
double coefficient = nodalIntegrals[i][0];
coefficient *= normalStress[i];
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;
virtual void restriction(int i, OuterFunctionType &f) const = 0;
};
}
#endif
......@@ -41,7 +41,7 @@
#include <dune/solvers/solvers/loopsolver.hh>
#include <dune/tnnmg/iterationsteps/genericnonlineargs.hh>
#include <dune/tectonic/globalnonlinearity.hh>
#include <dune/tectonic/globallaursennonlinearity.hh>
#include <dune/tectonic/myconvexproblem.hh>
#include <dune/tectonic/myblockproblem.hh>
......@@ -226,8 +226,8 @@ int main(int argc, char *argv[]) {
std::fill(coefficientOfFriction.begin(), coefficientOfFriction.end(),
parset.get<double>("boundary.mu"));
Dune::GlobalNonlinearity<dim, Dune::LinearFunction> myGlobalNonlinearity(
coefficientOfFriction, normalStress, nodalIntegrals);
Dune::GlobalLaursenNonlinearity<dim, Dune::LinearFunction>
myGlobalNonlinearity(coefficientOfFriction, normalStress, nodalIntegrals);
// }}}
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment