From a3277bf1a29d22622d3b68697e810fe573d8109b Mon Sep 17 00:00:00 2001
From: Oliver Sander <oliver.sander@tu-dresden.de>
Date: Tue, 12 Jul 2022 11:46:11 +0200
Subject: [PATCH] Fix all typos found by 'codespell'

---
 dune/gfe/averageinterface.hh               |  2 +-
 dune/gfe/embeddedglobalgfefunction.hh      |  2 +-
 dune/gfe/geodesicfeassemblerwrapper.hh     |  2 +-
 dune/gfe/globalgeodesicfefunction.hh       |  2 +-
 dune/gfe/linearalgebra.hh                  |  4 ++--
 dune/gfe/localquickanddirtyfefunction.hh   |  4 ++--
 dune/gfe/mixedriemanniantrsolver.cc        |  2 +-
 dune/gfe/polardecomposition.hh             |  4 ++--
 dune/gfe/realtuple.hh                      |  2 +-
 dune/gfe/riemannianpnsolver.cc             |  2 +-
 dune/gfe/riemanniantrsolver.cc             |  2 +-
 dune/gfe/rigidbodymotion.hh                |  2 +-
 dune/gfe/rotation.hh                       |  4 ++--
 dune/gfe/skewmatrix.hh                     |  2 +-
 dune/gfe/surfacecosseratenergy.hh          |  2 +-
 dune/gfe/surfacecosseratstressassembler.hh |  4 ++--
 dune/gfe/svd.hh                            |  2 +-
 dune/gfe/targetspacertrsolver.cc           |  2 +-
 dune/gfe/unitvector.hh                     | 10 +++++-----
 src/rodobstacle.cc                         |  2 +-
 test/polardecompositiontest.cc             |  2 +-
 test/surfacecosseratstressassemblertest.cc |  4 ++--
 22 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/dune/gfe/averageinterface.hh b/dune/gfe/averageinterface.hh
index 76c447ea..60a47d36 100644
--- a/dune/gfe/averageinterface.hh
+++ b/dune/gfe/averageinterface.hh
@@ -660,7 +660,7 @@ void computeAveragePressure(const typename RigidBodyMotion<double,GridView::dime
     app->Options()->SetStringValue("jac_c_constant", "yes");
     app->Options()->SetIntegerValue("print_level", 0);
 
-    // Intialize the IpoptApplication and process the options
+    // Initialize the IpoptApplication and process the options
     Ipopt::ApplicationReturnStatus status;
     status = app->Initialize();
     if (status != Ipopt::Solve_Succeeded)
diff --git a/dune/gfe/embeddedglobalgfefunction.hh b/dune/gfe/embeddedglobalgfefunction.hh
index 3d770b15..dd2ab52c 100644
--- a/dune/gfe/embeddedglobalgfefunction.hh
+++ b/dune/gfe/embeddedglobalgfefunction.hh
@@ -36,7 +36,7 @@ public:
 
     static constexpr auto dimworld = GridView::dimensionworld;
 
-    //! Dimension of the embedded tanget space
+    //! Dimension of the embedded tangent space
     constexpr static int embeddedDim = EmbeddedTangentVector::dimension;
 
 
diff --git a/dune/gfe/geodesicfeassemblerwrapper.hh b/dune/gfe/geodesicfeassemblerwrapper.hh
index eb15d7dc..2f68e912 100644
--- a/dune/gfe/geodesicfeassemblerwrapper.hh
+++ b/dune/gfe/geodesicfeassemblerwrapper.hh
@@ -124,7 +124,7 @@ assembleGradientAndHessian(const std::vector<TargetSpace>& sol,
     // Get a split up version of the input
     auto solutionSplit = splitVector(sol);
 
-    // Define the Matrix and the Gradient in Block Stucture
+    // Define the matrix and the gradient in the block structure
     Dune::BlockVector<Dune::FieldVector<double, blocksize0> > gradient0(n);
     Dune::BlockVector<Dune::FieldVector<double, blocksize1> > gradient1(n);
     
diff --git a/dune/gfe/globalgeodesicfefunction.hh b/dune/gfe/globalgeodesicfefunction.hh
index beba422c..1ed94f1a 100644
--- a/dune/gfe/globalgeodesicfefunction.hh
+++ b/dune/gfe/globalgeodesicfefunction.hh
@@ -46,7 +46,7 @@ public:
     //! Dimension of the grid.
     constexpr static int gridDim = GridView::dimension;
 
-    //! Dimension of the embedded tanget space
+    //! Dimension of the embedded tangent space
     constexpr static int embeddedDim = EmbeddedTangentVector::dimension;
 
 
diff --git a/dune/gfe/linearalgebra.hh b/dune/gfe/linearalgebra.hh
index 27b4c8e3..2d6f7433 100644
--- a/dune/gfe/linearalgebra.hh
+++ b/dune/gfe/linearalgebra.hh
@@ -195,7 +195,7 @@ namespace Dune {
     }
 
     /** \brief Return a segment of a FieldVector from lower up to lower+size-1
-     * lower is unkown at compile time*/
+     * lower is unknown at compile time*/
     template< int size,typename field_type,int n>
     static FieldVector<field_type,size> segmentAt(const FieldVector<field_type,n>& v,const size_t lower)
     {
@@ -218,7 +218,7 @@ namespace Dune {
     }
 
         /** \brief Return a block of a FieldMatrix  (lower1...lower1+size1-1,lower2...lower2+size2-1
-         * * lower1 and lower2 is unkown at compile time*/
+         * * lower1 and lower2 are unknown at compile time*/
         template< int size1,int size2,typename field_type,int n,int m>
         static auto blockAt(const FieldMatrix<field_type,n,m>& v, const size_t& lower1, const size_t& lower2)
         {
diff --git a/dune/gfe/localquickanddirtyfefunction.hh b/dune/gfe/localquickanddirtyfefunction.hh
index 5f46c8ad..2679b110 100644
--- a/dune/gfe/localquickanddirtyfefunction.hh
+++ b/dune/gfe/localquickanddirtyfefunction.hh
@@ -17,7 +17,7 @@ namespace Dune {
     /** \brief Interpolate on a manifold, as fast as we can
      *
      * This class implements interpolation of values on a manifold in a 'quick-and-dirty' way.
-     * No particular interpolation rule is used consistenly for all manifolds.  Rather, it is
+     * No particular interpolation rule is used consistently for all manifolds.  Rather, it is
      * used whatever is quickest and 'reasonable' for any given space.  The reason to have this
      * is to provide initial iterates for the iterative solvers used to solve the local
      * geodesic-FE minimization problems.
@@ -117,7 +117,7 @@ namespace Dune {
       // The averaging can give you singular matrices quite quickly (try two matrices that
       // differ by a rotation of pi/2).  Then, the QR factorization of the identity may
       // not be the identity (but differ in sign)!  I tried that with the implementation
-      // from Numerical recipies.
+      // from Numerical Recipes.
       //
       // What do we do instead?  We start from the coefficient that produces the lowest
       // value of the objective functional.
diff --git a/dune/gfe/mixedriemanniantrsolver.cc b/dune/gfe/mixedriemanniantrsolver.cc
index 4673e4bd..4bae4f0e 100644
--- a/dune/gfe/mixedriemanniantrsolver.cc
+++ b/dune/gfe/mixedriemanniantrsolver.cc
@@ -521,7 +521,7 @@ void MixedRiemannianTrustRegionSolver<GridType,Basis,Basis0,TargetSpace0,Basis1,
 
             if (energy >= oldEnergy and rank==0) {
                 if (this->verbosity_ == NumProc::FULL)
-                    printf("Richtung ist keine Abstiegsrichtung!\n");
+                    std::cout << "Direction is not a descent direction!" << std::endl;
             }
 
             if (energy >= oldEnergy &&
diff --git a/dune/gfe/polardecomposition.hh b/dune/gfe/polardecomposition.hh
index 7d48b9be..cc6944d8 100644
--- a/dune/gfe/polardecomposition.hh
+++ b/dune/gfe/polardecomposition.hh
@@ -233,14 +233,14 @@ namespace Dune::GFE {
 
             // Find Pivotmatrix
             for (int i = 0; i < 4; ++i) // going through the diagonal searching for the maximum
-                if ( Bdiag[maxi] < Bdiag[i] )  // found a bigger one but smaler than the older ones 
+                if ( Bdiag[maxi] < Bdiag[i] )  // found a bigger one but smaller than the older ones
                     maxi = i;
 
             Pleft[0][maxi]  = 1;
             Pright[maxi][0] = 1;        // Largest element to the first position
 
             for (int i = 0; i < 4; ++i) // going through the diagonal searching for the minimum
-                if ( Bdiag[mini] > Bdiag[i] )  // found a smaler one but smaler than the older ones 
+                if ( Bdiag[mini] > Bdiag[i] )  // found a smaller one but smaller than the older ones
                     mini = i;
 
             Pleft[3][mini]  = 1;
diff --git a/dune/gfe/realtuple.hh b/dune/gfe/realtuple.hh
index 7f28cc85..1fdba416 100644
--- a/dune/gfe/realtuple.hh
+++ b/dune/gfe/realtuple.hh
@@ -77,7 +77,7 @@ public:
         return *this;
     }
 
-    /** \brief Assigment from RealTuple with different type -- used for automatic differentiation with ADOL-C */
+    /** \brief Assignment from RealTuple with different type -- used for automatic differentiation with ADOL-C */
     template <class T2>
     RealTuple& operator <<= (const RealTuple<T2,N>& other) {
         for (size_t i=0; i<N; i++)
diff --git a/dune/gfe/riemannianpnsolver.cc b/dune/gfe/riemannianpnsolver.cc
index 932f1d65..64125625 100644
--- a/dune/gfe/riemannianpnsolver.cc
+++ b/dune/gfe/riemannianpnsolver.cc
@@ -429,7 +429,7 @@ void RiemannianProximalNewtonSolver<Basis,TargetSpace,Assembler>::solve()
 
                 if (energy >= oldEnergy and rank==0) {
                     if (this->verbosity_ == NumProc::FULL)
-                        printf("Richtung ist keine Abstiegsrichtung!\n");
+                        std::cout << "Direction is not a descent direction!" << std::endl;
                 }
 
                 if (energy >= oldEnergy &&
diff --git a/dune/gfe/riemanniantrsolver.cc b/dune/gfe/riemanniantrsolver.cc
index 4b4e68ba..a7169a14 100644
--- a/dune/gfe/riemanniantrsolver.cc
+++ b/dune/gfe/riemanniantrsolver.cc
@@ -604,7 +604,7 @@ void RiemannianTrustRegionSolver<Basis,TargetSpace,Assembler>::solve()
 
                 if (energy >= oldEnergy and rank==0) {
                     if (this->verbosity_ == NumProc::FULL)
-                        printf("Richtung ist keine Abstiegsrichtung!\n");
+                        std::cout << "Direction is not a descent direction!" << std::endl;
                 }
 
                 if (energy >= oldEnergy &&
diff --git a/dune/gfe/rigidbodymotion.hh b/dune/gfe/rigidbodymotion.hh
index 4a4704ff..b77a6bc8 100644
--- a/dune/gfe/rigidbodymotion.hh
+++ b/dune/gfe/rigidbodymotion.hh
@@ -56,7 +56,7 @@ public:
         q.normalize();
     }
 
-    /** \brief Assigment from RigidBodyMotion with different type -- used for automatic differentiation with ADOL-C */
+    /** \brief Assignment from RigidBodyMotion with different type -- used for automatic differentiation with ADOL-C */
     template <class T2>
     RigidBodyMotion& operator <<= (const RigidBodyMotion<T2,N>& other) {
         for (int i=0; i<N; i++)
diff --git a/dune/gfe/rotation.hh b/dune/gfe/rotation.hh
index 139a3034..371ef40c 100644
--- a/dune/gfe/rotation.hh
+++ b/dune/gfe/rotation.hh
@@ -169,7 +169,7 @@ class Rotation<T,3> : public Quaternion<T>
     static T sincOfSquare(const T& x) {
         using std::sin;
         using std::sqrt;
-        // we need here lots of terms to be sure that the numerical derivatives are also within maschine precission
+        // we need here lots of terms to be sure that the numerical derivatives are also within maschine precision
         return (x < 1e-2) ?
         1-x/6
         +x*x/120
@@ -247,7 +247,7 @@ public:
       return *this;
     }
 
-    /** \brief Assigment from Rotation with different type -- used for automatic differentiation with ADOL-C */
+    /** \brief Assignment from Rotation with different type -- used for automatic differentiation with ADOL-C */
     template <class T2>
     Rotation& operator <<= (const Rotation<T2,3>& other) {
         for (int i=0; i<4; i++)
diff --git a/dune/gfe/skewmatrix.hh b/dune/gfe/skewmatrix.hh
index 76614d7c..b194759f 100644
--- a/dune/gfe/skewmatrix.hh
+++ b/dune/gfe/skewmatrix.hh
@@ -76,7 +76,7 @@ public:
         return ConstIterator(data_,3);
     }
 
-    /** \brief Embedd the skey-symmetric matrix in R^3x3 */ 
+    /** \brief Embed the skew-symmetric matrix in R^3x3 */
     Dune::FieldMatrix<T,3,3> toMatrix() const
     {
         Dune::FieldMatrix<T,3,3> mat;
diff --git a/dune/gfe/surfacecosseratenergy.hh b/dune/gfe/surfacecosseratenergy.hh
index 0f4315c9..4fad540f 100644
--- a/dune/gfe/surfacecosseratenergy.hh
+++ b/dune/gfe/surfacecosseratenergy.hh
@@ -129,7 +129,7 @@ RT energy(const typename Basis::LocalView& localView,
   const auto& deformationLocalFiniteElement = localView.tree().child(_0,0).finiteElement();
   const auto& orientationLocalFiniteElement = localView.tree().child(_1,0).finiteElement();
     
-  // to construt a local GFE function, in case they are the shape functions are the same, we can use use one GFE-Function
+  // to construct a local GFE function, in case they are the shape functions are the same, we can use use one GFE-Function
 #if MIXED_SPACE
     std::vector<RBM0> localSolutionRBM0(localSolution0.size());
     std::vector<RBM1> localSolutionRBM1(localSolution1.size());
diff --git a/dune/gfe/surfacecosseratstressassembler.hh b/dune/gfe/surfacecosseratstressassembler.hh
index 1c9b6e9b..a939256d 100644
--- a/dune/gfe/surfacecosseratstressassembler.hh
+++ b/dune/gfe/surfacecosseratstressassembler.hh
@@ -172,7 +172,7 @@ namespace Dune::GFE {
         \param rot Coefficient vector for the rotation
         \param x Coefficient vector for the displacement
         \param xInitial Coefficient vector for the stress-free configuration of the shell, used to calculate nablaTheta
-        \param lameF Function assinging the lamé parameters to a given point
+        \param lameF Function assigning the Lamé parameters to a given point
         \param mu_c Cosserat couple modulus
         \param shellBoundary BoundaryPatch containing the elements that actually belong to the shell
         \param order Order of the quadrature rule
@@ -302,4 +302,4 @@ namespace Dune::GFE {
       }
   };
 }
-#endif
\ No newline at end of file
+#endif
diff --git a/dune/gfe/svd.hh b/dune/gfe/svd.hh
index 1f07c3c3..763ab070 100644
--- a/dune/gfe/svd.hh
+++ b/dune/gfe/svd.hh
@@ -42,7 +42,7 @@ void svdcmp(Dune::FieldMatrix<T,m,n>& a_, Dune::FieldVector<T,n>& w, Dune::Field
 
     int flag,i,its,j,jj,k,l,nm;
     T anorm,c,f,g,h,s,scale,x,y,z;
-    T rv1[n+1];  // 1 too large to accomodate fortran numbering
+    T rv1[n+1];  // 1 too large to accommodate fortran numbering
 
     //Householder reduction to bidiagonal form.
     g=scale=anorm=0.0;
diff --git a/dune/gfe/targetspacertrsolver.cc b/dune/gfe/targetspacertrsolver.cc
index 7af60d32..02e317c7 100644
--- a/dune/gfe/targetspacertrsolver.cc
+++ b/dune/gfe/targetspacertrsolver.cc
@@ -92,7 +92,7 @@ void TargetSpaceRiemannianTRSolver<TargetSpace>::solve()
             field_type energy    = assembler_->value(newIterate);
 
             if (energy >= oldEnergy)
-                printf("Richtung ist keine Abstiegsrichtung!\n");
+                std::cout << "Direction is not a descent direction!" << std::endl;
         }
 
         //  Actually take the step
diff --git a/dune/gfe/unitvector.hh b/dune/gfe/unitvector.hh
index 7a41e843..3d1eb4c5 100644
--- a/dune/gfe/unitvector.hh
+++ b/dune/gfe/unitvector.hh
@@ -34,7 +34,7 @@ class UnitVector
         using std::acos;
         const T eps = 1e-2;
         if (x > 1-eps) {  // acos is not differentiable, use the series expansion instead,
-            // we need here lots of terms to be sure that the numerical derivatives are also within maschine precission
+            // we need here lots of terms to be sure that the numerical derivatives are also within maschine precision
             //return -2 * (x-1) + 1.0/3 * (x-1)*(x-1) - 4.0/45 * (x-1)*(x-1)*(x-1);
             return 11665028.0/4729725.0
             -141088.0/45045.0*x
@@ -55,7 +55,7 @@ class UnitVector
         using std::sqrt;
         const T eps = 1e-2;
         if (x > 1-eps) {  // regular expression is unstable, use the series expansion instead
-            // we need here lots of terms to be sure that the numerical derivatives are also within maschine precission
+            // we need here lots of terms to be sure that the numerical derivatives are also within maschine precision
             //return -2 + 2*(x-1)/3 - 4/15*(x-1)*(x-1);
             return -47104.0/15015.0
             +12614.0/6435.0*x
@@ -78,7 +78,7 @@ class UnitVector
         using std::pow;
         const T eps = 1e-2;
         if (x > 1-eps) {  // regular expression is unstable, use the series expansion instead
-            // we need here lots of terms to be sure that the numerical derivatives are also within maschine precission
+            // we need here lots of terms to be sure that the numerical derivatives are also within maschine precision
             //return 2.0/3 - 8*(x-1)/15;
             return 1350030.0/676039.0+5632.0/2028117.0*Dune::power(x,10)
             -1039056896.0/334639305.0*x
@@ -102,7 +102,7 @@ class UnitVector
         using std::sqrt;
         const T eps = 1e-2;
         if (x > 1-eps) {  // regular expression is unstable, use the series expansion instead
-            // we need here lots of terms to be sure that the numerical derivatives are also within maschine precission
+            // we need here lots of terms to be sure that the numerical derivatives are also within maschine precision
             //return -8.0/15 + 24*(x-1)/35;
             return -1039056896.0/334639305.0
             +301752.0/39767.0*x
@@ -170,7 +170,7 @@ public:
         data_ /= data_.two_norm();
     }
 
-    /** \brief Assigment from UnitVector with different type -- used for automatic differentiation with ADOL-C */
+    /** \brief Assignment from UnitVector with different type -- used for automatic differentiation with ADOL-C */
     template <class T2>
     UnitVector& operator <<= (const UnitVector<T2,N>& other) {
         for (int i=0; i<N; i++)
diff --git a/src/rodobstacle.cc b/src/rodobstacle.cc
index 118383b6..d4b62e05 100644
--- a/src/rodobstacle.cc
+++ b/src/rodobstacle.cc
@@ -300,7 +300,7 @@ int main (int argc, char *argv[]) try
              double energy    = rodAssembler.computeEnergy(newIterate);
 
              if (energy >= oldEnergy)
-                 DUNE_THROW(SolverError, "Richtung ist keine Abstiegsrichtung!");
+                 DUNE_THROW(SolverError, "Direction is not a descent direction!");
 
              //  Add correction to the current solution
              for (int j=0; j<x.size(); j++)
diff --git a/test/polardecompositiontest.cc b/test/polardecompositiontest.cc
index 779d929c..b7f67cef 100644
--- a/test/polardecompositiontest.cc
+++ b/test/polardecompositiontest.cc
@@ -111,7 +111,7 @@ static double timeTest(double perturbationFromSO3 = 1.0) {
 
     for (int j = 0; j < numberOfTests; ++j) { // testing loop
         FieldMatrix<field_type,3,3> N;
-        // Only measure the time if the decomposition is unique and if both algorithms will retun an orthogonal matrix!
+        // Only measure the time if the decomposition is unique and if both algorithms will return an orthogonal matrix!
         // Attention: For matrices that are quite far away from an orthogonal matrix, Dune::GFE::PolarDecomposition() might return a matrix with determinant = -1 !
         double normOfDifference = 10;
         FieldMatrix<field_type,3,3> Q1;
diff --git a/test/surfacecosseratstressassemblertest.cc b/test/surfacecosseratstressassemblertest.cc
index 9e2ea960..f44ff097 100644
--- a/test/surfacecosseratstressassemblertest.cc
+++ b/test/surfacecosseratstressassemblertest.cc
@@ -168,7 +168,7 @@ int main (int argc, char *argv[])
   bool rotationIsSymmetric = symmetryTest<dimRotation>(rotationMap, 30);
 
   if (!deformationIsSymmetric) {
-    std::cerr << "The stressAssemblerTest checking for symmetry only works with a symmetric deformation intput file! Please check the file for symmetry!" << std::endl;
+    std::cerr << "The stressAssemblerTest checking for symmetry only works with a symmetric deformation input file! Please check the file for symmetry!" << std::endl;
     return 1;
   }
   if (!rotationIsSymmetric) {
@@ -306,4 +306,4 @@ int main (int argc, char *argv[])
 
   std::cerr << "The modified functions still returned symmetric stress values!" << std::endl;
   return 1;
-}
\ No newline at end of file
+}
-- 
GitLab