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

Simplify transformation from matrix-valued to quaternion-valued function

parent 29ec5a7c
No related branches found
No related tags found
1 merge request!167Simplify interface of CosseratVTKWriter
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include <dune/functions/functionspacebases/lagrangebasis.hh> #include <dune/functions/functionspacebases/lagrangebasis.hh>
#include <dune/functions/functionspacebases/powerbasis.hh> #include <dune/functions/functionspacebases/powerbasis.hh>
#include <dune/functions/gridfunctions/analyticgridviewfunction.hh> #include <dune/functions/gridfunctions/analyticgridviewfunction.hh>
#include <dune/functions/gridfunctions/composedgridfunction.hh>
#include <dune/gfe/cosseratvtkwriter.hh> #include <dune/gfe/cosseratvtkwriter.hh>
#include <dune/gfe/assemblers/nonplanarcosseratshellenergy.hh> #include <dune/gfe/assemblers/nonplanarcosseratshellenergy.hh>
...@@ -79,18 +78,14 @@ double calculateEnergy(const FlatGridView& flatGridView, ...@@ -79,18 +78,14 @@ double calculateEnergy(const FlatGridView& flatGridView,
lagrange<2>() lagrange<2>()
)); ));
// The orientation function needs to become a GridViewFunction, otherwise it cannot be composed. // Turn matrix-valued function into quaternion-valued function
auto orientationGridViewFunction = Functions::makeAnalyticGridViewFunction(orientationFunction, curvedGridView); auto orientationQuaternionFunction
= [&orientationFunction](FieldVector<double,3> x) -> FieldVector<double,4>
auto matrixToQuaternion = [](FieldMatrix<double,3,3> matrix) -> FieldVector<double,4> {
{ Rotation<double,3> rotation;
Rotation<double,3> rotation; rotation.set(orientationFunction(x));
rotation.set(matrix); return rotation;
return rotation; };
};
auto orientationQuaternionFunction = Functions::makeComposedGridFunction(matrixToQuaternion,
orientationGridViewFunction);
BlockVector<FieldVector<double,4> > orientationAsVector(flatFEBasis.size()); BlockVector<FieldVector<double,4> > orientationAsVector(flatFEBasis.size());
Functions::interpolate(curvedGridQuaternionBasis, orientationAsVector, orientationQuaternionFunction); Functions::interpolate(curvedGridQuaternionBasis, orientationAsVector, orientationQuaternionFunction);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment