for(int i = 0; i < sMesh.getNumberOfCells(); ++i)
{
- const double sum_row = sumRow(m, i+1);
+ const double sum_row = sumRow(m, i);
if(!epsilonEqualRelative(sum_row, fabs(sVol[i]), _precision))
{
LOG(1, "Source volume inconsistent : vol of cell " << i << " = " << sVol[i] << " but the row sum is " << sum_row );
for(std::map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
{
int j = iter2->first;
- if(m2.at(j-1).count(i+1) == 0)
+ if(m2.at(j).count(i) == 0)
{
if(!epsilonEqual(iter2->second, 0.0, _precision))
{
- LOG(2, "V1( " << i << ", " << j << ") exists, but V2( " << j - 1 << ", " << i + 1 << ") " << " does not " );
+ LOG(2, "V1( " << i << ", " << j << ") exists, but V2( " << j << ", " << i << ") " << " does not " );
LOG(2, "(" << i << ", " << j << ") fails");
compatitable = false;
}
const double v1 = fabs(iter2->second);
//if(m2[j - 1].count(i+1) > 0)
// {
- std::map<int, double> theMap = m2.at(j-1);
- const double v2 = fabs(theMap[i + 1]);
+ std::map<int, double> theMap = m2.at(j);
+ const double v2 = fabs(theMap[i]);
if(v1 != v2)
{
- LOG(2, "V1( " << i << ", " << j << ") = " << v1 << " which is different from V2( " << j - 1 << ", " << i + 1 << ") = " << v2 << " | diff = " << v1 - v2 );
+ LOG(2, "V1( " << i << ", " << j << ") = " << v1 << " which is different from V2( " << j << ", " << i << ") = " << v2 << " | diff = " << v1 - v2 );
if(!epsilonEqualRelative(v1, v2, _precision))
{
LOG(2, "(" << i << ", " << j << ") fails");
bool MeshTestToolkit<SPACEDIM,MESHDIM>::testDiagonal(const IntersectionMatrix& m) const
{
LOG(1, "Checking if matrix is diagonal" );
- int i = 1;
+ int i = 0;
bool isDiagonal = true;
for(IntersectionMatrix::const_iterator iter = m.begin() ; iter != m.end() ; ++iter)
{
const double vol = iter2->second;
if(vol != 0.0 && (i != j))
{
- LOG(2, "V( " << i - 1 << ", " << j << ") = " << vol << " which is not zero" );
+ LOG(2, "V( " << i << ", " << j << ") = " << vol << " which is not zero" );
if(!epsilonEqual(vol, 0.0, _precision))
{
LOG(2, "(" << i << ", " << j << ") fails");