From 22058299b4937a1d51babe9b742701d1e63e2f34 Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Fri, 1 Apr 2011 10:02:54 +0000 Subject: [PATCH] avoid compiler warnings [[Imported from SVN: r7047]] --- dune/gfe/rodlocalstiffness.hh | 2 +- dune/gfe/rodwriter.hh | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/dune/gfe/rodlocalstiffness.hh b/dune/gfe/rodlocalstiffness.hh index d443715a..692a604b 100644 --- a/dune/gfe/rodlocalstiffness.hh +++ b/dune/gfe/rodlocalstiffness.hh @@ -519,7 +519,7 @@ assembleGradient(const Entity& element, // Get quadrature rule const QuadratureRule<double, 1>& shearingQuad = QuadratureRules<double, 1>::rule(element.type(), shearQuadOrder); - for (int pt=0; pt<shearingQuad.size(); pt++) { + for (size_t pt=0; pt<shearingQuad.size(); pt++) { // Local position of the quadrature point const FieldVector<double,1>& quadPos = shearingQuad[pt].position(); diff --git a/dune/gfe/rodwriter.hh b/dune/gfe/rodwriter.hh index 7a04dd2f..05a3838a 100644 --- a/dune/gfe/rodwriter.hh +++ b/dune/gfe/rodwriter.hh @@ -7,6 +7,7 @@ #include <dune/common/exceptions.hh> #include <dune/istl/bvector.hh> +#include <dune/solvers/common/numproc.hh> #include "rigidbodymotion.hh" @@ -21,7 +22,7 @@ public: if (!fpRod) DUNE_THROW(SolverError, "Couldn't open file " << filename << " for writing"); - for (int j=0; j<rod.size(); j++) { + for (size_t j=0; j<rod.size(); j++) { for (int k=0; k<3; k++) fwrite(&rod[j].r[k], sizeof(double), 1, fpRod); @@ -81,13 +82,13 @@ void writeRod(const std::vector<RigidBodyMotion<2> >& rod, // /////////////////////////////////////// // The center axis - for (int i=0; i<rod.size(); i++) + for (size_t i=0; i<rod.size(); i++) outfile << i << std::endl; outfile << "-1" << std::endl; // The directors - for (int i=0; i<rod.size(); i++) { + for (size_t i=0; i<rod.size(); i++) { outfile << rod.size()+2*i << std::endl; outfile << rod.size()+2*i+1 << std::endl; outfile << "-1" << std::endl; @@ -100,11 +101,11 @@ void writeRod(const std::vector<RigidBodyMotion<2> >& rod, outfile << std::endl << "@2" << std::endl; // The center axis - for (int i=0; i<rod.size(); i++) + for (size_t i=0; i<rod.size(); i++) outfile << rod[i].r[0] << " " << rod[i].r[1] << " 0" << std::endl; // The directors - for (int i=0; i<rod.size(); i++) { + for (size_t i=0; i<rod.size(); i++) { Dune::FieldVector<double, 2> director; director[0] = -cos(rod[i].q.angle_); @@ -218,7 +219,7 @@ void writeRodElementData(Dune::BlockVector<Dune::FieldVector<double, 1> >& data, // write data // /////////////////////////////////////// - for (int i=0; i<data.size(); i++) + for (size_t i=0; i<data.size(); i++) outfile << data[i] << std::endl; std::cout << "Result written successfully to: " << filename << std::endl; -- GitLab