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

Do not inherit from Nonlinearity

Necessitates implementation of directionDomain
parent 20f6f4a4
No related branches found
No related tags found
No related merge requests found
......@@ -7,24 +7,24 @@
#include <dune/common/fvector.hh>
#include <dune/common/fmatrix.hh>
#include <dune/istl/bcrsmatrix.hh>
#include <dune/istl/bvector.hh>
#include <dune/fufem/interval.hh>
#include <dune/tnnmg/problem-classes/nonlinearity.hh>
#include "properscalarincreasingconvexfunction.hh"
#include <limits>
template <int dimension, class OuterFunction = TrivialFunction>
class MyNonlinearity
: public Nonlinearity<Dune::FieldVector<double, dimension>,
Dune::FieldMatrix<double, dimension, dimension>> {
class MyNonlinearity {
public:
typedef Dune::FieldVector<double, dimension> SmallVector;
typedef Dune::FieldMatrix<double, dimension, dimension> SmallMatrix;
void directionalSubDiff(SmallVector u, SmallVector v, Interval<double> &D) {
typedef Dune::BlockVector<SmallVector> VectorType;
typedef Dune::BlockVector<SmallMatrix> MatrixType;
void directionalSubDiff(SmallVector u, SmallVector v, Interval<double>& D) {
if (u == SmallVector(0.0)) {
D[0] = D[1] = func_.rightDifferential(0);
} else if (u * v > 0) {
......@@ -36,17 +36,11 @@ class MyNonlinearity
}
}
double operator()(const Dune::BlockVector<SmallVector> &) const { return 3; }
void addGradient(const Dune::BlockVector<SmallVector> &,
Dune::BlockVector<SmallVector> &) const {}
void addHessian(const Dune::BlockVector<SmallVector> &,
Dune::BCRSMatrix<SmallMatrix> &) const {}
void addHessianIndices(Dune::MatrixIndexSet &) const {}
void setVector(const Dune::BlockVector<SmallVector> &) {}
void updateEntry(int, double, int) {}
void subDiff(int, double, Interval<double> &, int) const {}
double regularity(int, double, int) const { return 3; }
void domain(int, Interval<double> &, int) const {}
void directionalDomain(const VectorType&, const VectorType&,
Interval<double>& dom) const {
dom[0] = std::numeric_limits<double>::min();
dom[1] = std::numeric_limits<double>::max();
}
OuterFunction func_;
};
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