Skip to content
Snippets Groups Projects
Commit db9bbf00 authored by Oliver Sander's avatar Oliver Sander Committed by sander@PCPOOL.MI.FU-BERLIN.DE
Browse files

make this work for triangular boundary segments as well

[[Imported from SVN: r1608]]
parent 4f50d059
No related branches found
No related tags found
No related merge requests found
...@@ -7,30 +7,30 @@ ...@@ -7,30 +7,30 @@
using namespace Dune; using namespace Dune;
// Solve a small linear system using lapack++ // Solve a small linear system using lapack++
void linearSolver(const FieldMatrix<double,6,12>& A, void linearSolver(const Dune::Matrix<Dune::FieldMatrix<double,1,1> >& A,
FieldVector<double,12>& x, Dune::BlockVector<Dune::FieldVector<double,1> >& x,
const FieldVector<double,6>& b) const FieldVector<double,6>& b)
{ {
int N = 6; assert(A.N()==6);
int M = 12; assert(A.M()%3 == 0);
LaGenMatDouble matrix(6,12); LaGenMatDouble matrix(A.N(),A.M());
for (int i=0; i<N; i++) for (int i=0; i<A.N(); i++)
for (int j=0; j<M; j++) for (int j=0; j<A.M(); j++)
matrix(i,j) = A[i][j]; matrix(i,j) = A[i][j];
LaVectorDouble X(M); LaVectorDouble X(A.M());
for (int i=0; i<M; i++) for (int i=0; i<A.M(); i++)
X(i) = x[i]; X(i) = x[i];
LaVectorDouble B(N); LaVectorDouble B(A.N());
for (int i=0; i<N; i++) for (int i=0; i<A.N(); i++)
B(i) = b[i]; B(i) = b[i];
LaLinearSolve(matrix, X, B); LaLinearSolve(matrix, X, B);
for (int i=0; i<M; i++) for (int i=0; i<A.M(); i++)
x[i] = X(i); x[i] = X(i);
} }
......
...@@ -2,9 +2,10 @@ ...@@ -2,9 +2,10 @@
#define LINEAR_SOLVER_HH #define LINEAR_SOLVER_HH
#include <dune/common/fmatrix.hh> #include <dune/common/fmatrix.hh>
#include <dune/istl/matrix.hh>
void linearSolver(const Dune::FieldMatrix<double,6,12>& A, void linearSolver(const Dune::Matrix<Dune::FieldMatrix<double,1,1> >& A,
Dune::FieldVector<double,12>& x, Dune::BlockVector<Dune::FieldVector<double,1> >& x,
const Dune::FieldVector<double,6>& b); const Dune::FieldVector<double,6>& b);
void lapackSVD(const Dune::FieldMatrix<double,3,3>& A, void lapackSVD(const Dune::FieldMatrix<double,3,3>& A,
......
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