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