diff --git a/dune/tectonic/localnonlinearity.hh b/dune/tectonic/localnonlinearity.hh index fcf0d7b1252427a540bab1f03f09207663787566..6fcefe4c2f0cc7e32e429af797f39361357b4ade 100644 --- a/dune/tectonic/localnonlinearity.hh +++ b/dune/tectonic/localnonlinearity.hh @@ -18,21 +18,21 @@ template <int dimension> class LocalNonlinearity { typedef FieldVector<double, dimension> VectorType; typedef FieldMatrix<double, dimension, dimension> MatrixType; - LocalNonlinearity(shared_ptr<NiceFunction const> func) : func_(func) {} + LocalNonlinearity(shared_ptr<NiceFunction const> func) : func(func) {} double operator()(VectorType const &x) const { double ret; - func_->evaluate(x.two_norm(), ret); + func->evaluate(x.two_norm(), ret); return ret; } double regularity(VectorType const &x) const { - if (!func_->smoothesNorm() && x.two_norm() < 1e-14) // TODO: Make this - // controllable - // (truncationRadius?) + if (!func->smoothesNorm() && x.two_norm() < 1e-14) // TODO: Make this + // controllable + // (truncationRadius?) return std::numeric_limits<double>::infinity(); - return func_->regularity(x.two_norm()); + return func->regularity(x.two_norm()); } // directional subdifferential: at u on the line u + t*v @@ -40,17 +40,17 @@ template <int dimension> class LocalNonlinearity { void directionalSubDiff(VectorType const &u, VectorType const &v, Interval<double> &D) const { if (u.two_norm() == 0) { - D[0] = D[1] = func_->rightDifferential(0) * v.two_norm(); + D[0] = D[1] = func->rightDifferential(0) * v.two_norm(); return; } double const un = u.two_norm(); double const ndotp = (u * v) / un; if (ndotp > 0) { - D[1] = ndotp * func_->rightDifferential(un); - D[0] = ndotp * func_->leftDifferential(un); + D[1] = ndotp * func->rightDifferential(un); + D[0] = ndotp * func->leftDifferential(un); } else { - D[1] = ndotp * func_->leftDifferential(un); - D[0] = ndotp * func_->rightDifferential(un); + D[1] = ndotp * func->leftDifferential(un); + D[0] = ndotp * func->rightDifferential(un); } } @@ -75,8 +75,8 @@ template <int dimension> class LocalNonlinearity { double const normX2 = x.two_norm2(); double const normX = sqrt(normX2); - double const h1ox = func_->rightDifferential(normX) / normX; - double const h2 = func_->second_deriv(normX); + double const h1ox = func->rightDifferential(normX) / normX; + double const h2 = func->second_deriv(normX); for (int i = 0; i < dimension; ++i) for (int j = 0; j < i; ++j) { @@ -91,11 +91,11 @@ template <int dimension> class LocalNonlinearity { void addGradient(VectorType const &x, VectorType &y) const { double const xnorm = x.two_norm(); - if (xnorm == 0 or std::isinf(func_->regularity(xnorm))) + if (xnorm == 0 or std::isinf(func->regularity(xnorm))) return; // left and right differential coincide in this case - y.axpy(func_->rightDifferential(xnorm) / xnorm, x); + y.axpy(func->rightDifferential(xnorm) / xnorm, x); } void upperGradient(VectorType const &x, VectorType &ret) const { @@ -103,7 +103,7 @@ template <int dimension> class LocalNonlinearity { assert(xnorm != 0); ret = x; - ret *= func_->rightDifferential(xnorm) / xnorm; + ret *= func->rightDifferential(xnorm) / xnorm; } void lowerGradient(VectorType const &x, VectorType &ret) const { @@ -111,7 +111,7 @@ template <int dimension> class LocalNonlinearity { assert(xnorm != 0); ret = x; - ret *= func_->leftDifferential(xnorm) / xnorm; + ret *= func->leftDifferential(xnorm) / xnorm; } void directionalDomain(VectorType const &, VectorType const &, @@ -121,7 +121,7 @@ template <int dimension> class LocalNonlinearity { } private: - shared_ptr<NiceFunction const> const func_; + shared_ptr<NiceFunction const> const func; }; } #endif diff --git a/dune/tectonic/mydirectionalconvexfunction.hh b/dune/tectonic/mydirectionalconvexfunction.hh index 70667fee41400884418706ed38c8cfebf89b4122..0a33465bb4b55f60c576ff7d4311447035d6a662 100644 --- a/dune/tectonic/mydirectionalconvexfunction.hh +++ b/dune/tectonic/mydirectionalconvexfunction.hh @@ -13,15 +13,15 @@ template <class NonlinearityType> class MyDirectionalConvexFunction { MyDirectionalConvexFunction(double A, double b, NonlinearityType const &phi, VectorType const &u, VectorType const &v) - : A(A), b(b), phi_(phi), u_(u), v_(v) { - phi_.directionalDomain(u_, v_, dom_); + : A(A), b(b), phi(phi), u(u), v(v) { + phi.directionalDomain(u, v, dom); } /* Just for debugging */ double operator()(double x) const { - VectorType tmp = v_; + VectorType tmp = v; tmp *= x; - return (0.5 * A * x * x) - (b * x) + phi_(tmp); + return (0.5 * A * x * x) - (b * x) + phi(tmp); } double quadraticPart() const { return A; } @@ -29,27 +29,27 @@ template <class NonlinearityType> class MyDirectionalConvexFunction { double linearPart() const { return b; } void subDiff(double x, Interval<double> &D) const { - VectorType tmp = u_; - tmp.axpy(x, v_); - phi_.directionalSubDiff(tmp, v_, D); + VectorType tmp = u; + tmp.axpy(x, v); + phi.directionalSubDiff(tmp, v, D); D[0] += A * x - b; D[1] += A * x - b; } void domain(Interval<double> &domain) const { - domain[0] = this->dom_[0]; - domain[1] = this->dom_[1]; + domain[0] = this->dom[0]; + domain[1] = this->dom[1]; } double A; double b; private: - NonlinearityType const &phi_; - VectorType const &u_; - VectorType const &v_; + NonlinearityType const φ + VectorType const &u; + VectorType const &v; - Interval<double> dom_; + Interval<double> dom; }; #endif diff --git a/dune/tectonic/myvtkwriter.hh b/dune/tectonic/myvtkwriter.hh index 54bd37cb874d4244f923942f37791fa5b5731c19..02097a6fdaffd6373479247a776bd879b2bb825b 100644 --- a/dune/tectonic/myvtkwriter.hh +++ b/dune/tectonic/myvtkwriter.hh @@ -112,11 +112,11 @@ template <class GridView> class MyVTKWriter { }; CellIterator cellBegin() const { - return gridView_.template begin<0, VTK_Partition>(); + return gridView.template begin<0, VTK_Partition>(); } CellIterator cellEnd() const { - return gridView_.template end<0, VTK_Partition>(); + return gridView.template end<0, VTK_Partition>(); } //! Iterate over the grid's vertices @@ -207,14 +207,14 @@ template <class GridView> class MyVTKWriter { }; VertexIterator vertexBegin() const { - return VertexIterator(gridView_.template begin<0, VTK_Partition>(), - gridView_.template end<0, VTK_Partition>(), datamode, + return VertexIterator(gridView.template begin<0, VTK_Partition>(), + gridView.template end<0, VTK_Partition>(), datamode, *vertexmapper); } VertexIterator vertexEnd() const { - return VertexIterator(gridView_.template end<0, VTK_Partition>(), - gridView_.template end<0, VTK_Partition>(), datamode, + return VertexIterator(gridView.template end<0, VTK_Partition>(), + gridView.template end<0, VTK_Partition>(), datamode, *vertexmapper); } @@ -299,14 +299,14 @@ template <class GridView> class MyVTKWriter { }; CornerIterator cornerBegin() const { - return CornerIterator(gridView_.template begin<0, VTK_Partition>(), - gridView_.template end<0, VTK_Partition>(), datamode, + return CornerIterator(gridView.template begin<0, VTK_Partition>(), + gridView.template end<0, VTK_Partition>(), datamode, *vertexmapper, number); } CornerIterator cornerEnd() const { - return CornerIterator(gridView_.template end<0, VTK_Partition>(), - gridView_.template end<0, VTK_Partition>(), datamode, + return CornerIterator(gridView.template end<0, VTK_Partition>(), + gridView.template end<0, VTK_Partition>(), datamode, *vertexmapper, number); } @@ -321,7 +321,7 @@ template <class GridView> class MyVTKWriter { */ explicit MyVTKWriter(const GridView& gridView, VTK::DataMode dm = VTK::conforming) - : gridView_(gridView), datamode(dm) {} + : gridView(gridView), datamode(dm) {} /** * @brief Add a grid function that lives on the cells of the grid to the @@ -366,7 +366,7 @@ template <class GridView> class MyVTKWriter { compName << name; if (ncomps > 1) compName << "[" << c << "]"; - VTKFunction* p = new Function(gridView_, v, compName.str(), ncomps, c); + VTKFunction* p = new Function(gridView, v, compName.str(), ncomps, c); celldata.push_back(VTKFunctionPtr(p)); } } @@ -414,7 +414,7 @@ template <class GridView> class MyVTKWriter { compName << name; if (ncomps > 1) compName << "[" << c << "]"; - VTKFunction* p = new Function(gridView_, v, compName.str(), ncomps, c); + VTKFunction* p = new Function(gridView, v, compName.str(), ncomps, c); vertexdata.push_back(VTKFunctionPtr(p)); } } @@ -441,7 +441,7 @@ template <class GridView> class MyVTKWriter { */ std::string write(const std::string& name, VTK::OutputType type = VTK::ascii) { - return write(name, type, gridView_.comm().rank(), gridView_.comm().size()); + return write(name, type, gridView.comm().rank(), gridView.comm().size()); } /** \brief write output (interface might change later) @@ -473,8 +473,8 @@ template <class GridView> class MyVTKWriter { std::string pwrite(const std::string& name, const std::string& path, const std::string& extendpath, VTK::OutputType type = VTK::ascii) { - return pwrite(name, path, extendpath, type, gridView_.comm().rank(), - gridView_.comm().size()); + return pwrite(name, path, extendpath, type, gridView.comm().rank(), + gridView.comm().size()); } protected: @@ -642,7 +642,7 @@ template <class GridView> class MyVTKWriter { DUNE_THROW(IOError, "Could not write to piecefile file " << fullname); writeDataFile(file); file.close(); - gridView_.comm().barrier(); + gridView.comm().barrier(); // if we are rank 0, write .pvtu/.pvtp parallel header fullname = getParallelHeaderName(name, path, commSize); @@ -653,7 +653,7 @@ template <class GridView> class MyVTKWriter { writeParallelHeader(file, name, relpiecepath, commSize); file.close(); } - gridView_.comm().barrier(); + gridView.comm().barrier(); return fullname; } @@ -757,7 +757,7 @@ template <class GridView> class MyVTKWriter { VTK::VTUWriter writer(s, outputtype, fileType); // Grid characteristics - vertexmapper = new VertexMapper(gridView_); + vertexmapper = new VertexMapper(gridView); if (datamode == VTK::conforming) { number.resize(vertexmapper->size()); for (std::vector<int>::size_type i = 0; i < number.size(); i++) @@ -984,7 +984,7 @@ template <class GridView> class MyVTKWriter { private: // the grid - GridView gridView_; + GridView gridView; // temporary grid information protected: