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

Fix GramSchmidtSolver

The computation of the A-orthogonal matrices was wrong,
and for some reason nobody ever really noticed this.
One reason could be that in GFE applications A is frequently
very close to the identity, and then you wouldn't notice
the bug that much.

Anyway, localgeodesicfefunctiontest.cc passes now.
parent e5361df1
No related branches found
No related tags found
No related merge requests found
Pipeline #2860 failed
...@@ -63,13 +63,14 @@ public: ...@@ -63,13 +63,14 @@ public:
{ {
// Use the Gram-Schmidt algorithm to compute a basis that is orthonormal // Use the Gram-Schmidt algorithm to compute a basis that is orthonormal
// with respect to the given matrix. // with respect to the given matrix.
for (int i=0; i<dim; i++) { normalize(matrix, orthonormalBasis_[0]);
normalize(matrix, orthonormalBasis_[i]); for (int i=1; i<dim; i++) {
for (int j=0; j<i; j++) for (int j=0; j<i; j++)
project(matrix, orthonormalBasis_[i], orthonormalBasis_[j]); project(matrix, orthonormalBasis_[j], orthonormalBasis_[i]);
normalize(matrix, orthonormalBasis_[i]);
} }
} }
...@@ -100,14 +101,14 @@ public: ...@@ -100,14 +101,14 @@ public:
// Use the Gram-Schmidt algorithm to compute a basis that is orthonormal // Use the Gram-Schmidt algorithm to compute a basis that is orthonormal
// with respect to the given matrix. // with respect to the given matrix.
Dune::FieldMatrix<field_type,dim,embeddedDim> orthonormalBasis(basis); Dune::FieldMatrix<field_type,dim,embeddedDim> orthonormalBasis(basis);
normalize(matrix, orthonormalBasis[0]);
for (int i=0; i<dim; i++) { for (int i=1; i<dim; i++) {
normalize(matrix, orthonormalBasis[i]);
for (int j=0; j<i; j++) for (int j=0; j<i; j++)
project(matrix, orthonormalBasis[i], orthonormalBasis[j]); project(matrix, orthonormalBasis[j], orthonormalBasis[i]);
normalize(matrix, orthonormalBasis[i]);
} }
// Solve the system in the orthonormal basis // Solve the system in the orthonormal basis
......
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