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

H(|.|) can be regular at zero

parent 764506db
Branches
No related tags found
No related merge requests found
...@@ -27,7 +27,7 @@ template <int dimension> class LocalNonlinearity { ...@@ -27,7 +27,7 @@ template <int dimension> class LocalNonlinearity {
} }
double regularity(VectorType const &x) const { double regularity(VectorType const &x) const {
if (x.two_norm() < 1e-8) // TODO if (!func_->smoothesNorm() && x.two_norm() < 1e-12) // TODO
return std::numeric_limits<double>::infinity(); return std::numeric_limits<double>::infinity();
return func_->regularity(x.two_norm()); return func_->regularity(x.two_norm());
......
...@@ -23,6 +23,9 @@ class NiceFunction : public VirtualFunction<double, double> { ...@@ -23,6 +23,9 @@ class NiceFunction : public VirtualFunction<double, double> {
double virtual regularity(double s) const { double virtual regularity(double s) const {
DUNE_THROW(NotImplemented, "regularity not implemented"); DUNE_THROW(NotImplemented, "regularity not implemented");
} }
// Whether H(|.|) is smooth at zero
bool virtual smoothesNorm() const { return false; }
}; };
class RuinaFunction : public NiceFunction { class RuinaFunction : public NiceFunction {
...@@ -164,6 +167,8 @@ class TrivialFunction : public NiceFunction { ...@@ -164,6 +167,8 @@ class TrivialFunction : public NiceFunction {
double virtual second_deriv(double) const { return 0; } double virtual second_deriv(double) const { return 0; }
double virtual regularity(double) const { return 0; } double virtual regularity(double) const { return 0; }
bool virtual smoothesNorm() const { return true; }
}; };
// slope in [n-1,n] is n // slope in [n-1,n] is n
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment