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

[Cleanup]: Move/Ren. convexCombination -> midpoint

parent 12ce2c58
No related branches found
No related tags found
No related merge requests found
#ifndef SRC_MIDPOINT_HH
#define SRC_MIDPOINT_HH
#include <dune/solvers/common/arithmetic.hh>
template <class Vector> Vector midPoint(Vector const &x, Vector const &y) {
Vector ret{ 0 };
Arithmetic::addProduct(ret, 0.5, x);
Arithmetic::addProduct(ret, 0.5, y);
return ret;
}
#endif
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
#include <dune/common/fvector.hh> #include <dune/common/fvector.hh>
#include <dune/fufem/arithmetic.hh>
#ifdef HAVE_CAIROMM #ifdef HAVE_CAIROMM
#include <cairomm/context.h> #include <cairomm/context.h>
#include <cairomm/fontface.h> #include <cairomm/fontface.h>
#include <cairomm/surface.h> #include <cairomm/surface.h>
#endif #endif
#include "midpoint.hh"
namespace MyGeometry { namespace MyGeometry {
namespace { namespace {
using LocalVector2D = Dune::FieldVector<double, 2>; using LocalVector2D = Dune::FieldVector<double, 2>;
...@@ -35,14 +35,6 @@ namespace { ...@@ -35,14 +35,6 @@ namespace {
ret[1][1] = a22; ret[1][1] = a22;
return ret; return ret;
} }
LocalVector2D convexCombination(LocalVector2D const &x,
LocalVector2D const &y) {
LocalVector2D ret{ 0 };
Arithmetic::addProduct(ret, 0.5, x);
Arithmetic::addProduct(ret, 0.5, y);
return ret;
}
} }
namespace reference { namespace reference {
...@@ -67,9 +59,9 @@ namespace reference { ...@@ -67,9 +59,9 @@ namespace reference {
createVector(B[0] - leftLeg * viscoHeight / rightLeg, B[1] + viscoHeight); createVector(B[0] - leftLeg * viscoHeight / rightLeg, B[1] + viscoHeight);
LocalVector2D const M = createVector(B[0], B[1] + viscoHeight); LocalVector2D const M = createVector(B[0], B[1] + viscoHeight);
LocalVector2D const G = convexCombination(A, X); LocalVector2D const G = midPoint(A, X);
LocalVector2D const H = convexCombination(X, Y); LocalVector2D const H = midPoint(X, Y);
LocalVector2D const J = convexCombination(Y, B); LocalVector2D const J = midPoint(Y, B);
LocalVector2D const I = createVector(Y[0] + G[0], Y[1] + G[1]); LocalVector2D const I = createVector(Y[0] + G[0], Y[1] + G[1]);
......
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