Commit 889dd5bd authored by Christoph Grüninger's avatar Christoph Grüninger

Fix Wshadow warnings

parent ff5fe3a9
......@@ -260,11 +260,11 @@ namespace Dune
{
FieldType &rii = ret[ i ][ i ];
FieldType x = A[ i ][ i ];
FieldType xDiag = A[ i ][ i ];
for( int j = 0; j < i; ++j )
x -= ret[ i ][ j ] * ret[ i ][ j ];
assert( x > FieldType( 0 ) );
rii = sqrt( x );
xDiag -= ret[ i ][ j ] * ret[ i ][ j ];
assert( xDiag > FieldType( 0 ) );
rii = sqrt( xDiag );
FieldType invrii = FieldType( 1 ) / rii;
for( int k = i+1; k < n; ++k )
......
......@@ -148,9 +148,9 @@ namespace Dune
// Use a quadrature rule as a set of test points and loop over them
///////////////////////////////////////////////////////////////////////////////
const Dune::QuadratureRule<ctype, mydim> & quadrature = Dune::QuadratureRules<ctype, mydim>::rule(geometry.type(), 2);
for( size_t i = 0; i < quadrature.size(); ++i )
for (const auto& ip : quadrature)
{
const typename TestGeometry::LocalCoordinate &x = quadrature[ i ].position();
const typename TestGeometry::LocalCoordinate &x = ip.position();
// Test whether the methods 'local' and 'global' are inverse to each other
if ( (x - geometry.local( geometry.global( x ) )).two_norm() > 1e-8 ) {
......
......@@ -121,21 +121,21 @@ static bool testMultiLinearGeometry ( const Dune::ReferenceElement< ctype, mydim
}
for (int c = 0; c < numCorners; ++c) {
const Dune::FieldMatrix< ctype, mydim, cdim > JT = geometry.jacobianTransposed(refElement.position(c, mydim));
const Dune::FieldMatrix< ctype, mydim, cdim > cornerJT = geometry.jacobianTransposed(refElement.position(c, mydim));
for( int i = 0; i < mydim; ++i ) {
Dune::FieldVector< ctype, mydim > e( ctype( 0 ) );
e[ i ] = ctype( 1 );
const Dune::FieldVector< ctype, cdim > t = map( A, B, e );
if (JT[i] != JT[i])
if (cornerJT[i] != cornerJT[i])
{
std::cerr << "Error: at corner " << c << ": jacobianTransposed["
<< i << "] (" << JT[i] << ") has NaN entry." << std::endl;
<< i << "] (" << cornerJT[i] << ") has NaN entry." << std::endl;
pass = false;
}
if( (t - JT[ i ]).two_norm() > epsilon )
if( (t - cornerJT[ i ]).two_norm() > epsilon )
{
std::cerr << "Error: at corner " << c << ": wrong jacobianTransposed[ "
<< i << " ] (" << JT[ i ] << ", should be " << t << ")."
<< i << " ] (" << cornerJT[ i ] << ", should be " << t << ")."
<< std::endl;
pass = false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment