From f758aefb57a637a38837a45660dbe30935b8fe33 Mon Sep 17 00:00:00 2001 From: Oliver Sander <oliver.sander@tu-dresden.de> Date: Wed, 11 Apr 2018 16:13:53 +0200 Subject: [PATCH] Use crossProduct method from dune-matrix-vector The one in the Arithmetic namespace does not exist anymore. --- dune/gfe/averageinterface.hh | 4 +++- dune/gfe/nonplanarcosseratshellenergy.hh | 4 +++- dune/gfe/rodfactory.hh | 4 +++- dune/gfe/vertexnormals.hh | 6 ++++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/dune/gfe/averageinterface.hh b/dune/gfe/averageinterface.hh index cdcd8e83..c57c98a5 100644 --- a/dune/gfe/averageinterface.hh +++ b/dune/gfe/averageinterface.hh @@ -9,6 +9,8 @@ #include <dune/istl/solvers.hh> #include <dune/istl/preconditioners.hh> +#include dune/matrix-vector/crossproduct.hh> + #include <dune/fufem/dgindexset.hh> #include <dune/fufem/arithmetic.hh> #include <dune/fufem/surfmassmatrix.hh> @@ -500,7 +502,7 @@ void computeTotalForceAndTorque(const BoundaryPatch<GridView>& interface, neumannFunction.evaluateLocal(*it->inside(), quadPos, value); totalForce.axpy(quad[ip].weight() * integrationElement, value); - totalTorque.axpy(quad[ip].weight() * integrationElement, Arithmetic::crossProduct(worldPos-center,value)); + totalTorque.axpy(quad[ip].weight() * integrationElement, MatrixVector::crossProduct(worldPos-center,value)); } diff --git a/dune/gfe/nonplanarcosseratshellenergy.hh b/dune/gfe/nonplanarcosseratshellenergy.hh index b995ccaa..d2bdf188 100644 --- a/dune/gfe/nonplanarcosseratshellenergy.hh +++ b/dune/gfe/nonplanarcosseratshellenergy.hh @@ -5,6 +5,8 @@ #include <dune/common/parametertree.hh> #include <dune/geometry/quadraturerules.hh> +#include <dune/matrix-vector/crossproduct.hh> + #include <dune/fufem/functions/virtualgridfunction.hh> #include <dune/fufem/boundarypatch.hh> @@ -351,7 +353,7 @@ energy(const typename Basis::LocalView& localView, aCovariant[i][j] = 0.0; } - aCovariant[2] = Arithmetic::crossProduct(aCovariant[0], aCovariant[1]); + aCovariant[2] = Dune::MatrixVector::crossProduct(aCovariant[0], aCovariant[1]); aCovariant[2] /= aCovariant[2].two_norm(); auto aContravariant = aCovariant; diff --git a/dune/gfe/rodfactory.hh b/dune/gfe/rodfactory.hh index edfd4770..94e06e45 100644 --- a/dune/gfe/rodfactory.hh +++ b/dune/gfe/rodfactory.hh @@ -5,6 +5,8 @@ #include <dune/common/fvector.hh> #include <dune/fufem/arithmetic.hh> +#include <dune/matrix-vector/crossproduct.hh> + #include <dune/gfe/rigidbodymotion.hh> #include <dune/gfe/localgeodesicfefunction.hh> @@ -39,7 +41,7 @@ template <int dim> Dune::FieldVector<double,3> zAxis(0); zAxis[2] = 1; - Dune::FieldVector<double,3> axis = Arithmetic::crossProduct(Dune::FieldVector<double,3>(end-beginning), zAxis); + Dune::FieldVector<double,3> axis = MatrixVector::crossProduct(Dune::FieldVector<double,3>(end-beginning), zAxis); if (axis.two_norm() != 0) axis /= -axis.two_norm(); diff --git a/dune/gfe/vertexnormals.hh b/dune/gfe/vertexnormals.hh index fb899e0e..49896216 100644 --- a/dune/gfe/vertexnormals.hh +++ b/dune/gfe/vertexnormals.hh @@ -9,6 +9,8 @@ #include <dune/geometry/referenceelements.hh> +#include <dune/matrix-vector/crossproduct.hh> + #include <dune/gfe/unitvector.hh> /** \brief Compute averaged vertex normals for a 2d-in-3d grid @@ -29,7 +31,7 @@ std::vector<UnitVector<typename GridView::ctype,3> > computeVertexNormals(const { auto cornerPos = Dune::ReferenceElements<double,2>::general(element.type()).position(i,2); auto tangent = element.geometry().jacobianTransposed(cornerPos); - auto cornerNormal = Arithmetic::crossProduct(tangent[0], tangent[1]); + auto cornerNormal = Dune::MatrixVector::crossProduct(tangent[0], tangent[1]); cornerNormal /= cornerNormal.two_norm(); unscaledNormals[indexSet.subIndex(element,i,2)] += cornerNormal; @@ -50,4 +52,4 @@ std::vector<UnitVector<typename GridView::ctype,3> > computeVertexNormals(const } -#endif \ No newline at end of file +#endif -- GitLab