View Issue Details

IDProjectCategoryView StatusLast Update
0000076OpenFOAM[All Projects] Bugpublic2010-11-10 15:58
Reporteruser15Assigned Tohenry 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
PlatformLinuxOSRHEL OS Version5
Product Version 
Fixed in Version 
Summary0000076: simpleMatrix initialization/destruction error.
DescriptionThere is something wrong with either the initialization or destruction of a simpleMatrix.

Below is a code that writes the simpleMatrix values right after creating it, after it writes the matrix the diagonal elements are set to 1.
It does this 2 times and should produce only zeros, but this is the output

2 2((0 2.96439e-323)(2.122e-314 5.67409e-310))
2{0}
2 2((0 2.96439e-323)(2.122e-314 1))
2{0}

The second time the last element contains a 1
Steps To Reproducejust run this snippet

    label nSize = 2;
    for(label i=0; i<2; i++)
    {
        simpleMatrix<scalar> tt(nSize);
    Info << tt << endl;

    for(label j=0; j<nSize; j++)
    {
        tt[j][j] = 1.0;
    }

    }
Additional InformationI cant get the chemistry solver EulerImplicit to work since it relies on simpleMatrix.
TagsNo tags attached.

Activities

henry

2010-11-10 10:05

manager   ~0000118

simpleMatrix<scalar> tt(nSize);

This does not initialize the matrix.

    Info << tt << endl;

This then prints the uninitialized matrix, so yes the values may well be different each time round the loop and may end up with values from the previous iteration. Try initializing the matrix before printing it.

user15

2010-11-10 11:16

  ~0000119

thanks that is much better :)
so the bug is in this file then.

src/thermophysicalModels/chemistryModel/chemistrySolver/EulerImplicit/EulerImplicit.C

change the line
    simpleMatrix<scalar> RR(nSpecie);
to
    simpleMatrix<scalar> RR(nSpecie, 0.0, 0.0);

henry

2010-11-10 15:58

manager   ~0000120

Thanks for the bug-report and fix.
This is resolved by commit e02bd7dba95110b0af9e59ddc4c3b10dc88e630e

Issue History

Date Modified Username Field Change
2010-11-10 09:56 user15 New Issue
2010-11-10 10:03 henry Assigned To => henry
2010-11-10 10:03 henry Status new => assigned
2010-11-10 10:05 henry Note Added: 0000118
2010-11-10 11:16 user15 Note Added: 0000119
2010-11-10 15:58 henry Note Added: 0000120
2010-11-10 15:58 henry Status assigned => resolved
2010-11-10 15:58 henry Resolution open => fixed