From 09891a78fb6b23404b3133ed0fb07b00f5d6d60e Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Mon, 23 Mar 2015 09:11:51 +0000 Subject: [PATCH] Remove some debugging code [[Imported from SVN: r10106]] --- dune/gfe/trustregionsolver.cc | 27 +------------------------ dune/gfe/trustregionsolver.hh | 2 -- src/finite-strain-elasticity.cc | 35 ++++----------------------------- 3 files changed, 5 insertions(+), 59 deletions(-) diff --git a/dune/gfe/trustregionsolver.cc b/dune/gfe/trustregionsolver.cc index 6bb1fe48..205b376b 100644 --- a/dune/gfe/trustregionsolver.cc +++ b/dune/gfe/trustregionsolver.cc @@ -277,32 +277,7 @@ void TrustRegionSolver<BasisType,VectorType>::solve() if (mgStep) corr = mgStep->getSol(); - //std::cout << "Correction: " << std::endl << corr_global << std::endl; - - // Output correction for debugging - Dune::VTKWriter<typename GridType::LeafGridView> vtkWriter(grid_->leafGridView()); - - Dune::BlockVector<Dune::FieldVector<double,3> > displacement(x_.size()); - for (size_t j=0; j<x_.size(); j++) - displacement[j] = x_[j] - identity_[j]; - - BasisType basis(grid_->leafGridView()); - Dune::shared_ptr<VTKBasisGridFunction<BasisType,Dune::BlockVector<Dune::FieldVector<double,3> > > > vtkDisplacement - = Dune::make_shared<VTKBasisGridFunction<BasisType,Dune::BlockVector<Dune::FieldVector<double,3> > > > - (basis, displacement, "Displacement"); - - Dune::shared_ptr<VTKBasisGridFunction<BasisType,Dune::BlockVector<Dune::FieldVector<double,3> > > > vtkCorrection - = Dune::make_shared<VTKBasisGridFunction<BasisType,Dune::BlockVector<Dune::FieldVector<double,3> > > > - (basis, corr, "Correction"); - - Dune::shared_ptr<VTKBasisGridFunction<BasisType,Dune::BlockVector<Dune::FieldVector<double,3> > > > vtkGradient - = Dune::make_shared<VTKBasisGridFunction<BasisType,Dune::BlockVector<Dune::FieldVector<double,3> > > > - (basis, rhs, "Gradient"); - - vtkWriter.addVertexData(vtkDisplacement); - vtkWriter.addVertexData(vtkCorrection); - vtkWriter.addVertexData(vtkGradient); - vtkWriter.write("hencky_correction_" + std::to_string(i+1)); + //std::cout << "Correction: " << std::endl << corr << std::endl; if (this->verbosity_ == NumProc::FULL) std::cout << "Infinity norm of the correction: " << corr.infinity_norm() << std::endl; diff --git a/dune/gfe/trustregionsolver.hh b/dune/gfe/trustregionsolver.hh index 8ce1df7c..e371d7e2 100644 --- a/dune/gfe/trustregionsolver.hh +++ b/dune/gfe/trustregionsolver.hh @@ -123,8 +123,6 @@ protected: /** \brief An L2-norm, really. The H1SemiNorm class is badly named */ std::shared_ptr<H1SemiNorm<CorrectionType> > l2Norm_; -public: - VectorType identity_; }; #include "trustregionsolver.cc" diff --git a/src/finite-strain-elasticity.cc b/src/finite-strain-elasticity.cc index 67d15999..681fbc7b 100644 --- a/src/finite-strain-elasticity.cc +++ b/src/finite-strain-elasticity.cc @@ -138,7 +138,7 @@ int main (int argc, char *argv[]) try GridView gridView = grid->leafGridView(); // typedef P1NodalBasis<GridView,double> FEBasis; - typedef P2NodalBasis<GridView,double> FEBasis; + typedef P1NodalBasis<GridView,double> FEBasis; FEBasis feBasis(gridView); // ///////////////////////////////////////// @@ -208,12 +208,6 @@ int main (int argc, char *argv[]) try for (size_t i=0; i<x.size(); i++) x[i] = v[i]; - lambda = std::string("lambda x: (") + parameterSet.get<std::string>("identity") + std::string(")"); - PythonFunction<FieldVector<double,dim>, FieldVector<double,3> > pythonIdentity(Python::evaluate(lambda)); - - SolutionType identity; - Functions::interpolate(feBasis, identity, pythonIdentity); - //////////////////////////////////////////////////////// // Main homotopy loop //////////////////////////////////////////////////////// @@ -292,8 +286,6 @@ int main (int argc, char *argv[]) try baseTolerance ); - solver.identity_ = identity; - //////////////////////////////////////////////////////// // Set Dirichlet values //////////////////////////////////////////////////////// @@ -333,6 +325,9 @@ int main (int argc, char *argv[]) try displacement[idx] = x[idx] - it->geometry().corner(0); } + ///////////////////////////////// + // Output result + ///////////////////////////////// Dune::shared_ptr<VTKBasisGridFunction<FEBasis,BlockVector<FieldVector<double,3> > > > vtkDisplacement = Dune::make_shared<VTKBasisGridFunction<FEBasis,BlockVector<FieldVector<double,3> > > > @@ -342,28 +337,6 @@ int main (int argc, char *argv[]) try } - // ////////////////////////////// - // Output result - // ////////////////////////////// - - // finally: compute the average deformation of the Neumann boundary - // That is what we need for the locking tests - FieldVector<double,3> averageDef(0); - for (size_t i=0; i<x.size(); i++) - if (neumannNodes[i][0]) - { - averageDef += x[i]; - std::cout << "i: " << i << ", pos: " << x[i] << std::endl; - } - averageDef /= neumannNodes.count(); - - if (mpiHelper.rank()==0) - { - std::cout << "Neumann value = " << parameterSet.get<std::string>("neumannValues") << std::endl; - std::cout << "Neumann value = " << parameterSet.get<FieldVector<double,dim> >("neumannValues") << " " - << ", average deflection: " << averageDef << std::endl; - } - } catch (Exception e) { std::cout << e << std::endl; -- GitLab