diff --git a/dune/gfe/cosseratenergystiffness.hh b/dune/gfe/cosseratenergystiffness.hh index df4749eb9be221a20381c136f34bfa3218e99013..1aca4d04ea179e7efe604f6bc2e942c13c58435c 100644 --- a/dune/gfe/cosseratenergystiffness.hh +++ b/dune/gfe/cosseratenergystiffness.hh @@ -3,10 +3,16 @@ #include <dune/common/fmatrix.hh> #include <dune/common/parametertree.hh> +#include <dune/common/version.hh> + #include <dune/geometry/quadraturerules.hh> #include <dune/fufem/boundarypatch.hh> +#if DUNE_VERSION_LT(DUNE_COMMON, 2, 9) +#include <dune/matrix-vector/transpose.hh> +#endif + #include <dune/gfe/localenergy.hh> #include <dune/gfe/mixedlocalgeodesicfestiffness.hh> #ifdef PROJECTED_INTERPOLATION @@ -267,9 +273,17 @@ public: Dune::FieldMatrix<field_type,3,3> wryness(0); +#if DUNE_VERSION_LT(DUNE_COMMON, 2, 9) + Dune::FieldMatrix<field_type,dim,dim> transposeR; + Dune::MatrixVector::transpose(R,transposeR); + auto axialVectorx1 = SkewMatrix<field_type,3>(transposeR*dRx1).axial(); + auto axialVectorx2 = SkewMatrix<field_type,3>(transposeR*dRx2).axial(); + auto axialVectorx3 = SkewMatrix<field_type,3>(transposeR*dRx3).axial(); +#else auto axialVectorx1 = SkewMatrix<field_type,3>(transpose(R)*dRx1).axial(); auto axialVectorx2 = SkewMatrix<field_type,3>(transpose(R)*dRx2).axial(); auto axialVectorx3 = SkewMatrix<field_type,3>(transpose(R)*dRx3).axial(); +#endif for (int i=0; i<3; i++) { wryness[i][0] = axialVectorx1[i]; wryness[i][1] = axialVectorx2[i]; diff --git a/dune/gfe/localprojectedfefunction.hh b/dune/gfe/localprojectedfefunction.hh index f551047e6306808bbd34abd3c708b2491e2b970b..46c4a686972f3741ea96be9d79c969f31da3bfc2 100644 --- a/dune/gfe/localprojectedfefunction.hh +++ b/dune/gfe/localprojectedfefunction.hh @@ -4,6 +4,7 @@ #include <vector> #include <dune/common/fvector.hh> +#include <dune/common/version.hh> #include <dune/geometry/type.hh> @@ -176,6 +177,11 @@ namespace Dune { auto derivativeOfProjection = TargetSpace::derivativeOfProjection(embeddedInterpolation); +#if ! DUNE_VERSION_GTE(DUNE_ISTL, 2, 9) + if constexpr (std::is_same_v<decltype(derivativeOfProjection), ScaledIdentityMatrix<RT,embeddedDim> >) + return derivativeOfProjection.scalar()*derivative; + else +#endif return derivativeOfProjection*derivative; } diff --git a/src/cosserat-continuum.cc b/src/cosserat-continuum.cc index 8de0a6ce0c8fdcbfe1e71c7c1c62ea14da6cf9af..d23443bbd6904207e4d95a12be53920f0382cc01 100644 --- a/src/cosserat-continuum.cc +++ b/src/cosserat-continuum.cc @@ -393,7 +393,7 @@ int main (int argc, char *argv[]) try resultPath + "mixed-cosserat_homotopy_0"); } else { #if MIXED_SPACE - for (int i = 0; i < displacement.size(); i++) { + for (std::size_t i = 0; i < displacement.size(); i++) { for (int j = 0; j < 3; j++) displacement[i][j] = x[_0][i][j]; displacement[i] -= identity[i]; @@ -472,7 +472,7 @@ int main (int argc, char *argv[]) try } x[_0][i] = x0i; } - for (int i = 0; i < compositeBasis.size({1}); i++) + for (std::size_t i = 0; i < compositeBasis.size({1}); i++) if (orientationDirichletDofs[i][0]) x[_1][i].set(dOV[i]); @@ -620,7 +620,7 @@ int main (int argc, char *argv[]) try //Therefore, x and the dirichletDofs are converted to a RigidBodyMotion structure, as well as the Hessian and Gradient that are returned by the assembler std::vector<TargetSpace> xTargetSpace(compositeBasis.size({0})); BitSetVector<TargetSpace::TangentVector::dimension> dirichletDofsTargetSpace(compositeBasis.size({0}), false); - for (int i = 0; i < compositeBasis.size({0}); i++) { + for (std::size_t i = 0; i < compositeBasis.size({0}); i++) { for (int j = 0; j < 3; j ++) { // Displacement part xTargetSpace[i].r[j] = x[_0][i][j]; dirichletDofsTargetSpace[i][j] = deformationDirichletDofs[i][j]; @@ -668,7 +668,7 @@ int main (int argc, char *argv[]) try xTargetSpace = solver.getSol(); } - for (int i = 0; i < xTargetSpace.size(); i++) { + for (std::size_t i = 0; i < xTargetSpace.size(); i++) { x[_0][i] = xTargetSpace[i].r; x[_1][i] = xTargetSpace[i].q; } @@ -683,7 +683,7 @@ int main (int argc, char *argv[]) try resultPath + "mixed-cosserat_homotopy_" + iAsAscii.str()); } else { #if MIXED_SPACE - for (int i = 0; i < displacement.size(); i++) { + for (std::size_t i = 0; i < displacement.size(); i++) { for (int j = 0; j < 3; j++) { displacement[i][j] = x[_0][i][j]; } diff --git a/src/simofoxshell.cc b/src/simofoxshell.cc index 6ccf3678adc8ca31884a81a8b9598809012edd2b..fee050e214a1f3ee476ff1678bad960a58ad2c1f 100644 --- a/src/simofoxshell.cc +++ b/src/simofoxshell.cc @@ -376,7 +376,7 @@ int main(int argc, char *argv[]) try using TargetSpace = Dune::GFE::ProductManifold<RealTuple<double,3>,UnitVector<double,3>>; std::vector<TargetSpace> xTargetSpace(compositeBasis.size({0})); BitSetVector<TargetSpace::TangentVector::dimension> dirichletDofsTargetSpace(compositeBasis.size({0}), false); - for (int i = 0; i < compositeBasis.size({0}); i++) { + for (std::size_t i = 0; i < compositeBasis.size({0}); i++) { xTargetSpace[i][_0] = x[_0][i]; // Displacement part xTargetSpace[i][_1] = x[_1][i]; // Rotation part for (int j = 0; j < 3; j ++) @@ -398,7 +398,7 @@ int main(int argc, char *argv[]) try solver.setInitialIterate(xTargetSpace); solver.solve(); xTargetSpace = solver.getSol(); - for (int i = 0; i < xTargetSpace.size(); i++) { + for (std::size_t i = 0; i < xTargetSpace.size(); i++) { x[_0][i] = xTargetSpace[i][_0]; x[_1][i] = xTargetSpace[i][_1]; }