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

Add MyGlobalNonlinearity class

parent 5a4a5567
No related branches found
No related tags found
No related merge requests found
/* -*- 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
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