Skip to content
Snippets Groups Projects
Commit 0240107d authored by Oliver Sander's avatar Oliver Sander Committed by sander
Browse files

fix various compiler warnings

[[Imported from SVN: r5422]]
parent 999578b3
No related branches found
No related tags found
No related merge requests found
...@@ -76,7 +76,7 @@ void MonotoneMGStep<OperatorType, DiscFuncType>::nestedIteration() ...@@ -76,7 +76,7 @@ void MonotoneMGStep<OperatorType, DiscFuncType>::nestedIteration()
// If we start from an infeasible configuration, the restricted // If we start from an infeasible configuration, the restricted
// obstacles may be inconsistent. We do an ad hoc correction here. // obstacles may be inconsistent. We do an ad hoc correction here.
// The true obstacles on the maxlevel are not touched. // The true obstacles on the maxlevel are not touched.
for (int i=0; i<(*obstacles_)[this->level_].size(); i++) { for (size_t i=0; i<(*obstacles_)[this->level_].size(); i++) {
BoxConstraint<field_type,dim>& cO = (*obstacles_)[this->level_][i]; BoxConstraint<field_type,dim>& cO = (*obstacles_)[this->level_][i];
for (int j=0; j<dim; j++) for (int j=0; j<dim; j++)
if (cO.lower(j) > cO.upper(j)) if (cO.lower(j) > cO.upper(j))
...@@ -116,7 +116,7 @@ void MonotoneMGStep<OperatorType, DiscFuncType>::iterate() ...@@ -116,7 +116,7 @@ void MonotoneMGStep<OperatorType, DiscFuncType>::iterate()
// Determine critical nodes (only for debugging) // Determine critical nodes (only for debugging)
const double eps = 1e-12; const double eps = 1e-12;
for (int i=0; i<obstacles[level].size(); i++) { for (size_t i=0; i<obstacles[level].size(); i++) {
for (int j=0; j<dim; j++) { for (int j=0; j<dim; j++) {
...@@ -145,7 +145,7 @@ void MonotoneMGStep<OperatorType, DiscFuncType>::iterate() ...@@ -145,7 +145,7 @@ void MonotoneMGStep<OperatorType, DiscFuncType>::iterate()
std::vector<BoxConstraint<field_type,dim> > obstacleBackup = obstacles[level]; std::vector<BoxConstraint<field_type,dim> > obstacleBackup = obstacles[level];
// Compute defect obstacles // Compute defect obstacles
for (int i=0; i<(*obstacles_)[level].size(); i++) for (size_t i=0; i<(*obstacles_)[level].size(); i++)
obstacles[level][i] -= x[level][i]; obstacles[level][i] -= x[level][i];
// /////////////////////// // ///////////////////////
...@@ -154,7 +154,7 @@ void MonotoneMGStep<OperatorType, DiscFuncType>::iterate() ...@@ -154,7 +154,7 @@ void MonotoneMGStep<OperatorType, DiscFuncType>::iterate()
// Determine critical nodes // Determine critical nodes
const double eps = 1e-12; const double eps = 1e-12;
for (int i=0; i<obstacles[level].size(); i++) { for (size_t i=0; i<obstacles[level].size(); i++) {
for (int j=0; j<dim; j++) { for (int j=0; j<dim; j++) {
......
...@@ -41,7 +41,6 @@ void MultigridStep<MatrixType, VectorType, BitVectorType>::preprocess() ...@@ -41,7 +41,6 @@ void MultigridStep<MatrixType, VectorType, BitVectorType>::preprocess()
std::cout << "Warning: Preprocess has already been called without calling iterate afterwards!" << std::endl; std::cout << "Warning: Preprocess has already been called without calling iterate afterwards!" << std::endl;
preprocessCalled = true; preprocessCalled = true;
int i;
this->level_ = this->numLevels_-1; this->level_ = this->numLevels_-1;
// ////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////
...@@ -51,13 +50,13 @@ void MultigridStep<MatrixType, VectorType, BitVectorType>::preprocess() ...@@ -51,13 +50,13 @@ void MultigridStep<MatrixType, VectorType, BitVectorType>::preprocess()
DUNE_THROW(SolverError, "You requested " << this->numLevels_ << " levels " DUNE_THROW(SolverError, "You requested " << this->numLevels_ << " levels "
<< "but you supplied " << this->mgTransfer_.size() << " transfer operators!"); << "but you supplied " << this->mgTransfer_.size() << " transfer operators!");
for (i=0; i<this->mgTransfer_.size(); i++) for (size_t i=0; i<this->mgTransfer_.size(); i++)
if (this->mgTransfer_[i] == NULL) if (this->mgTransfer_[i] == NULL)
DUNE_THROW(SolverError, "You have not supplied a multigrid restriction operator " DUNE_THROW(SolverError, "You have not supplied a multigrid restriction operator "
"for level " << i); "for level " << i);
// The matrices for the linear correction problems // The matrices for the linear correction problems
for (i=this->numLevels_-2; i>=0; i--) { for (int i=this->numLevels_-2; i>=0; i--) {
// Delete coarse grid matrix if it exists already // Delete coarse grid matrix if it exists already
...@@ -79,7 +78,7 @@ void MultigridStep<MatrixType, VectorType, BitVectorType>::preprocess() ...@@ -79,7 +78,7 @@ void MultigridStep<MatrixType, VectorType, BitVectorType>::preprocess()
// ///////////////////////////////////////////////////// // /////////////////////////////////////////////////////
// Assemble the complete hierarchy of matrices // Assemble the complete hierarchy of matrices
// ///////////////////////////////////////////////////// // /////////////////////////////////////////////////////
for (i=this->mgTransfer_.size()-1; i>=0; i--) for (int i=this->mgTransfer_.size()-1; i>=0; i--)
this->mgTransfer_[i]->galerkinRestrict(*this->mat_[i+1], *(const_cast<MatrixType*>(this->mat_[i]))); this->mgTransfer_[i]->galerkinRestrict(*this->mat_[i+1], *(const_cast<MatrixType*>(this->mat_[i])));
// ///////////////////////////////////////////////////// // /////////////////////////////////////////////////////
...@@ -91,7 +90,7 @@ void MultigridStep<MatrixType, VectorType, BitVectorType>::preprocess() ...@@ -91,7 +90,7 @@ void MultigridStep<MatrixType, VectorType, BitVectorType>::preprocess()
if (this->ignoreNodes_!=0) if (this->ignoreNodes_!=0)
{ {
ignoreNodesHierarchy_[this->numLevels_-1] = const_cast<BitVectorType*>(this->ignoreNodes_); ignoreNodesHierarchy_[this->numLevels_-1] = const_cast<BitVectorType*>(this->ignoreNodes_);
for (i=this->numLevels_-2; i>=0; --i) for (int i=this->numLevels_-2; i>=0; --i)
{ {
ignoreNodesHierarchy_[i] = new BitVectorType(); ignoreNodesHierarchy_[i] = new BitVectorType();
this->mgTransfer_[i]->restrictToFathers(*ignoreNodesHierarchy_[i+1], *ignoreNodesHierarchy_[i]); this->mgTransfer_[i]->restrictToFathers(*ignoreNodesHierarchy_[i+1], *ignoreNodesHierarchy_[i]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment