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

initialize FieldMatrix explicitly

[[Imported from SVN: r1031]]
parent 2f4ab1fc
No related branches found
No related tags found
No related merge requests found
......@@ -79,7 +79,7 @@ template<class M>
void fillValues(int N, M& mat, int overlapStart, int overlapEnd, int start, int end, double eps)
{
typedef typename M::block_type Block;
Block dval = 0, bone=0, bmone=0, beps=0;
Block dval(0), bone(0), bmone(0), beps(0);
for(typename Block::RowIterator b = dval.begin(); b != dval.end(); ++b)
b->operator[](b.index())=2.0+2.0*eps;
......
......@@ -43,8 +43,8 @@ void setupLaplacian(Dune::BCRSMatrix<B>& A, int N)
setupSparsityPattern(A,N);
B diagonal = static_cast<FieldType>(0), bone=static_cast<FieldType>(0),
beps=static_cast<FieldType>(0);
B diagonal(static_cast<FieldType>(0)), bone(static_cast<FieldType>(0)),
beps(static_cast<FieldType>(0));
for(typename B::RowIterator b = diagonal.begin(); b != diagonal.end(); ++b)
b->operator[](b.index())=4;
......
......@@ -359,13 +359,13 @@ void test_Iter ()
t.start();
// build little blocks
MB D=0;
MB D(0.0);
for (int i=0; i<BlockSize; i++)
for (int j=0; j<BlockSize; j++)
if (i==j) D[i][j] = 4+(BlockSize-1);else D[i][j] = -1;
// printmatrix(std::cout,D,"diagonal block","row",10,2);
MB E=0;
MB E(0.0);
for (int i=0; i<BlockSize; i++)
E[i][i] = -1;
// printmatrix(std::cout,E,"offdiagonal block","row",10,2);
......
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