Skip to content
Snippets Groups Projects
Commit 11448dd3 authored by Christian Engwer's avatar Christian Engwer
Browse files

[bugfix] laplacian.hh test case didn't handle allocators properly

parent 86a3fa86
No related branches found
No related tags found
1 merge request!87[multirhstest] Check with AlignedNumber.
......@@ -5,14 +5,14 @@
#include <dune/istl/bcrsmatrix.hh>
#include <dune/common/fvector.hh>
template<class B>
void setupSparsityPattern(Dune::BCRSMatrix<B>& A, int N)
template<class B, class Alloc>
void setupSparsityPattern(Dune::BCRSMatrix<B,Alloc>& A, int N)
{
typedef typename Dune::BCRSMatrix<B> Matrix;
typedef typename Dune::BCRSMatrix<B,Alloc> Matrix;
A.setSize(N*N, N*N, N*N*5);
A.setBuildMode(Matrix::row_wise);
for (typename Dune::BCRSMatrix<B>::CreateIterator i = A.createbegin(); i != A.createend(); ++i) {
for (typename Dune::BCRSMatrix<B,Alloc>::CreateIterator i = A.createbegin(); i != A.createend(); ++i) {
int x = i.index()%N; // x coordinate in the 2d field
int y = i.index()/N; // y coordinate in the 2d field
......@@ -36,10 +36,10 @@ void setupSparsityPattern(Dune::BCRSMatrix<B>& A, int N)
}
template<class B>
void setupLaplacian(Dune::BCRSMatrix<B>& A, int N)
template<class B, class Alloc>
void setupLaplacian(Dune::BCRSMatrix<B,Alloc>& A, int N)
{
typedef typename Dune::BCRSMatrix<B>::field_type FieldType;
typedef typename Dune::BCRSMatrix<B,Alloc>::field_type FieldType;
setupSparsityPattern(A,N);
......@@ -53,7 +53,7 @@ void setupLaplacian(Dune::BCRSMatrix<B>& A, int N)
b->operator[](b.index())=-1.0;
for (typename Dune::BCRSMatrix<B>::RowIterator i = A.begin(); i != A.end(); ++i) {
for (typename Dune::BCRSMatrix<B,Alloc>::RowIterator i = A.begin(); i != A.end(); ++i) {
int x = i.index()%N; // x coordinate in the 2d field
int y = i.index()/N; // y coordinate in the 2d field
......@@ -92,9 +92,9 @@ void setupLaplacian(Dune::BCRSMatrix<B>& A, int N)
}
}
}
template<int BS>
void setBoundary(Dune::BlockVector<Dune::FieldVector<double,BS> >& lhs,
Dune::BlockVector<Dune::FieldVector<double,BS> >& rhs,
template<int BS, class Alloc>
void setBoundary(Dune::BlockVector<Dune::FieldVector<double,BS>, Alloc>& lhs,
Dune::BlockVector<Dune::FieldVector<double,BS>, Alloc>& rhs,
int N)
{
for(int i=0; i < lhs.size(); ++i) {
......
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