Skip to content
Snippets Groups Projects
Commit f758aefb authored by Sander, Oliver's avatar Sander, Oliver
Browse files

Use crossProduct method from dune-matrix-vector

The one in the Arithmetic namespace does not exist anymore.
parent c2b5f87a
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#include <dune/istl/solvers.hh> #include <dune/istl/solvers.hh>
#include <dune/istl/preconditioners.hh> #include <dune/istl/preconditioners.hh>
#include dune/matrix-vector/crossproduct.hh>
#include <dune/fufem/dgindexset.hh> #include <dune/fufem/dgindexset.hh>
#include <dune/fufem/arithmetic.hh> #include <dune/fufem/arithmetic.hh>
#include <dune/fufem/surfmassmatrix.hh> #include <dune/fufem/surfmassmatrix.hh>
...@@ -500,7 +502,7 @@ void computeTotalForceAndTorque(const BoundaryPatch<GridView>& interface, ...@@ -500,7 +502,7 @@ void computeTotalForceAndTorque(const BoundaryPatch<GridView>& interface,
neumannFunction.evaluateLocal(*it->inside(), quadPos, value); neumannFunction.evaluateLocal(*it->inside(), quadPos, value);
totalForce.axpy(quad[ip].weight() * integrationElement, 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));
} }
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#include <dune/common/parametertree.hh> #include <dune/common/parametertree.hh>
#include <dune/geometry/quadraturerules.hh> #include <dune/geometry/quadraturerules.hh>
#include <dune/matrix-vector/crossproduct.hh>
#include <dune/fufem/functions/virtualgridfunction.hh> #include <dune/fufem/functions/virtualgridfunction.hh>
#include <dune/fufem/boundarypatch.hh> #include <dune/fufem/boundarypatch.hh>
...@@ -351,7 +353,7 @@ energy(const typename Basis::LocalView& localView, ...@@ -351,7 +353,7 @@ energy(const typename Basis::LocalView& localView,
aCovariant[i][j] = 0.0; 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(); aCovariant[2] /= aCovariant[2].two_norm();
auto aContravariant = aCovariant; auto aContravariant = aCovariant;
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#include <dune/common/fvector.hh> #include <dune/common/fvector.hh>
#include <dune/fufem/arithmetic.hh> #include <dune/fufem/arithmetic.hh>
#include <dune/matrix-vector/crossproduct.hh>
#include <dune/gfe/rigidbodymotion.hh> #include <dune/gfe/rigidbodymotion.hh>
#include <dune/gfe/localgeodesicfefunction.hh> #include <dune/gfe/localgeodesicfefunction.hh>
...@@ -39,7 +41,7 @@ template <int dim> ...@@ -39,7 +41,7 @@ template <int dim>
Dune::FieldVector<double,3> zAxis(0); Dune::FieldVector<double,3> zAxis(0);
zAxis[2] = 1; 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) if (axis.two_norm() != 0)
axis /= -axis.two_norm(); axis /= -axis.two_norm();
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#include <dune/geometry/referenceelements.hh> #include <dune/geometry/referenceelements.hh>
#include <dune/matrix-vector/crossproduct.hh>
#include <dune/gfe/unitvector.hh> #include <dune/gfe/unitvector.hh>
/** \brief Compute averaged vertex normals for a 2d-in-3d grid /** \brief Compute averaged vertex normals for a 2d-in-3d grid
...@@ -29,7 +31,7 @@ std::vector<UnitVector<typename GridView::ctype,3> > computeVertexNormals(const ...@@ -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 cornerPos = Dune::ReferenceElements<double,2>::general(element.type()).position(i,2);
auto tangent = element.geometry().jacobianTransposed(cornerPos); 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(); cornerNormal /= cornerNormal.two_norm();
unscaledNormals[indexSet.subIndex(element,i,2)] += cornerNormal; unscaledNormals[indexSet.subIndex(element,i,2)] += cornerNormal;
...@@ -50,4 +52,4 @@ std::vector<UnitVector<typename GridView::ctype,3> > computeVertexNormals(const ...@@ -50,4 +52,4 @@ std::vector<UnitVector<typename GridView::ctype,3> > computeVertexNormals(const
} }
#endif #endif
\ No newline at end of file
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