From 2de454309f6f18a226fd135513e3ea7741afdf81 Mon Sep 17 00:00:00 2001 From: Elias Pipping <elias.pipping@fu-berlin.de> Date: Sat, 30 Mar 2013 11:23:01 +0100 Subject: [PATCH] typedef -> using --- dune/tectonic/ellipticenergy.hh | 6 ++-- dune/tectonic/globalnonlinearity.hh | 4 +-- dune/tectonic/globalruinanonlinearity.hh | 2 +- dune/tectonic/localnonlinearity.hh | 4 +-- dune/tectonic/minimisation.hh | 10 +++---- dune/tectonic/minimisation2.hh | 4 +-- dune/tectonic/myblockproblem.hh | 24 ++++++++-------- dune/tectonic/myconvexproblem.hh | 8 +++--- dune/tectonic/mydirectionalconvexfunction.hh | 4 +-- src/assemblers.cc | 4 +-- src/assemblers_tmpl.cc | 16 +++++------ src/mysolver.hh | 10 +++---- src/mysolver_tmpl.cc | 10 +++---- src/one-body-sample.cc | 28 +++++++++---------- src/state/compute_state_dieterich_common.hh | 4 +-- src/tests/test-circle.cc | 6 ++-- .../test-gradient-horrible-logarithmic.cc | 6 ++-- src/tests/test-gradient-horrible.cc | 6 ++-- src/tests/test-gradient-identity.cc | 6 ++-- src/tests/test-gradient-kinks.cc | 6 ++-- src/tests/test-gradient-parabola.cc | 6 ++-- src/tests/test-gradient-sample-3d.cc | 6 ++-- src/tests/test-gradient-sample-nonsmooth.cc | 6 ++-- src/tests/test-gradient-sample-steep.cc | 6 ++-- src/tests/test-gradient-sample-steep2.cc | 6 ++-- src/tests/test-gradient-sample-verysteep.cc | 6 ++-- src/tests/test-gradient-sample.cc | 6 ++-- src/tests/test-gradient-sample2.cc | 6 ++-- src/tests/test-gradient-trivial.cc | 6 ++-- src/tests/test-minimise2.cc | 6 ++-- src/timestepping_tmpl.cc | 10 +++---- src/vtk_tmpl.cc | 16 +++++------ 32 files changed, 127 insertions(+), 127 deletions(-) diff --git a/dune/tectonic/ellipticenergy.hh b/dune/tectonic/ellipticenergy.hh index eca04dc6..c63c7a76 100644 --- a/dune/tectonic/ellipticenergy.hh +++ b/dune/tectonic/ellipticenergy.hh @@ -12,10 +12,10 @@ namespace Dune { template <int dim> class EllipticEnergy { public: - typedef FieldVector<double, dim> SmallVector; - typedef FieldMatrix<double, dim, dim> SmallMatrix; + using SmallVector = FieldVector<double, dim>; + using SmallMatrix = FieldMatrix<double, dim, dim>; - typedef LocalNonlinearity<dim> NonlinearityType; + using NonlinearityType = LocalNonlinearity<dim>; EllipticEnergy(SmallMatrix const &A, SmallVector const &b, shared_ptr<NonlinearityType const> phi, int ignore = dim) diff --git a/dune/tectonic/globalnonlinearity.hh b/dune/tectonic/globalnonlinearity.hh index 7ece5eda..2c600b0b 100644 --- a/dune/tectonic/globalnonlinearity.hh +++ b/dune/tectonic/globalnonlinearity.hh @@ -15,8 +15,8 @@ namespace Dune { template <class MatrixTypeTEMPLATE, class VectorTypeTEMPLATE> class GlobalNonlinearity { public: - typedef MatrixTypeTEMPLATE MatrixType; - typedef VectorTypeTEMPLATE VectorType; + using MatrixType = MatrixTypeTEMPLATE; + using VectorType = VectorTypeTEMPLATE; int static const dim = VectorTypeTEMPLATE::block_type::dimension; double operator()(VectorType const &x) const { diff --git a/dune/tectonic/globalruinanonlinearity.hh b/dune/tectonic/globalruinanonlinearity.hh index 8f9c5cd9..f3bd55de 100644 --- a/dune/tectonic/globalruinanonlinearity.hh +++ b/dune/tectonic/globalruinanonlinearity.hh @@ -18,7 +18,7 @@ template <class MatrixType, class VectorType> class GlobalRuinaNonlinearity : public GlobalNonlinearity<MatrixType, VectorType> { private: - typedef BlockVector<FieldVector<double, 1>> const &dataref; + using dataref = BlockVector<FieldVector<double, 1>> const &; public: using GlobalNonlinearity<MatrixType, VectorType>::dim; diff --git a/dune/tectonic/localnonlinearity.hh b/dune/tectonic/localnonlinearity.hh index 148f80dd..ede2c21b 100644 --- a/dune/tectonic/localnonlinearity.hh +++ b/dune/tectonic/localnonlinearity.hh @@ -15,8 +15,8 @@ namespace Dune { template <int dimension> class LocalNonlinearity { public: - typedef FieldVector<double, dimension> VectorType; - typedef FieldMatrix<double, dimension, dimension> MatrixType; + using VectorType = FieldVector<double, dimension>; + using MatrixType = FieldMatrix<double, dimension, dimension>; LocalNonlinearity(shared_ptr<NiceFunction const> func) : func(func) {} diff --git a/dune/tectonic/minimisation.hh b/dune/tectonic/minimisation.hh index 92eb9c0b..83488b0f 100644 --- a/dune/tectonic/minimisation.hh +++ b/dune/tectonic/minimisation.hh @@ -17,8 +17,8 @@ void descentMinimisation(Functional const &J, typename Functional::SmallVector &x, typename Functional::SmallVector const &descDir, Bisection const &bisection) { - typedef typename Functional::SmallVector SmallVector; - typedef typename Functional::NonlinearityType LocalNonlinearityType; + using SmallVector = typename Functional::SmallVector; + using LocalNonlinearityType = typename Functional::NonlinearityType; // {{{ Construct a restriction of J to the line x + t * descDir @@ -75,8 +75,8 @@ void tangentialMinimisation(Functional const &J, typename Functional::SmallVector &x, typename Functional::SmallVector const &descDir, Bisection const &bisection) { - typedef typename Functional::SmallMatrix SmallMatrix; - typedef typename Functional::SmallVector SmallVector; + using SmallMatrix = typename Functional::SmallMatrix; + using SmallVector = typename Functional::SmallVector; // We completely ignore the nonlinearity here -- when restricted // to a circle, it just enters as a constant! @@ -98,7 +98,7 @@ void tangentialMinimisation(Functional const &J, template <class Functional> void minimise(Functional const &J, typename Functional::SmallVector &x, size_t steps, Bisection const &bisection) { - typedef typename Functional::SmallVector SmallVector; + using SmallVector = typename Functional::SmallVector; for (size_t step = 0; step < steps; ++step) { SmallVector descDir; diff --git a/dune/tectonic/minimisation2.hh b/dune/tectonic/minimisation2.hh index c78062c9..86441ed5 100644 --- a/dune/tectonic/minimisation2.hh +++ b/dune/tectonic/minimisation2.hh @@ -13,7 +13,7 @@ namespace Dune { template <class Functional> void minimise2(Functional const &J, typename Functional::SmallVector &x, size_t steps, Bisection const &bisection) { - typedef typename Functional::SmallVector SmallVector; + using SmallVector = typename Functional::SmallVector; minimisationInitialiser(J, bisection, x); { // Make a single step where we already know we're not differentiable @@ -36,7 +36,7 @@ void minimise2(Functional const &J, typename Functional::SmallVector &x, template <class Functional> void minimisationInitialiser(Functional const &J, Bisection const &bisection, typename Functional::SmallVector &startingPoint) { - typedef typename Functional::SmallVector SmallVector; + using SmallVector = typename Functional::SmallVector; std::vector<double> const &kinks = J.get_kinks(); diff --git a/dune/tectonic/myblockproblem.hh b/dune/tectonic/myblockproblem.hh index a55141c0..fe8f229d 100644 --- a/dune/tectonic/myblockproblem.hh +++ b/dune/tectonic/myblockproblem.hh @@ -36,11 +36,11 @@ double computeEnergy( * modified gradient method */ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem { public: - typedef MyConvexProblemTypeTEMPLATE MyConvexProblemType; - typedef typename MyConvexProblemType::VectorType VectorType; - typedef typename MyConvexProblemType::MatrixType MatrixType; - typedef typename MyConvexProblemType::LocalVectorType LocalVectorType; - typedef typename MyConvexProblemType::LocalMatrixType LocalMatrixType; + using MyConvexProblemType = MyConvexProblemTypeTEMPLATE; + using VectorType = typename MyConvexProblemType::VectorType; + using MatrixType = typename MyConvexProblemType::MatrixType; + using LocalVectorType = typename MyConvexProblemType::LocalVectorType; + using LocalMatrixType = typename MyConvexProblemType::LocalMatrixType; int static const block_size = MyConvexProblemType::block_size; int static const coarse_block_size = block_size; @@ -51,13 +51,13 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem { struct Linearization { static const int block_size = coarse_block_size; - typedef typename MyBlockProblem<MyConvexProblemType>::LocalMatrixType - LocalMatrixType; - typedef Dune::BCRSMatrix<typename Linearization::LocalMatrixType> - MatrixType; - typedef Dune::BlockVector< - Dune::FieldVector<double, Linearization::block_size>> VectorType; - typedef Dune::BitSetVector<Linearization::block_size> BitVectorType; + using LocalMatrixType = + typename MyBlockProblem<MyConvexProblemType>::LocalMatrixType; + using MatrixType = + Dune::BCRSMatrix<typename Linearization::LocalMatrixType>; + using VectorType = + Dune::BlockVector<Dune::FieldVector<double, Linearization::block_size>>; + using BitVectorType = Dune::BitSetVector<Linearization::block_size>; typename Linearization::MatrixType A; typename Linearization::VectorType b; typename Linearization::BitVectorType ignore; diff --git a/dune/tectonic/myconvexproblem.hh b/dune/tectonic/myconvexproblem.hh index d630c152..b8917229 100644 --- a/dune/tectonic/myconvexproblem.hh +++ b/dune/tectonic/myconvexproblem.hh @@ -9,10 +9,10 @@ template <class MatrixTypeTEMPLATE, class VectorTypeTEMPLATE> class MyConvexProblem { public: - typedef VectorTypeTEMPLATE VectorType; - typedef MatrixTypeTEMPLATE MatrixType; - typedef typename VectorType::block_type LocalVectorType; - typedef typename MatrixType::block_type LocalMatrixType; + using VectorType = VectorTypeTEMPLATE; + using MatrixType = MatrixTypeTEMPLATE; + using LocalVectorType = typename VectorType::block_type; + using LocalMatrixType = typename MatrixType::block_type; int static const block_size = VectorType::block_type::dimension; diff --git a/dune/tectonic/mydirectionalconvexfunction.hh b/dune/tectonic/mydirectionalconvexfunction.hh index 0b094738..4aa33f0f 100644 --- a/dune/tectonic/mydirectionalconvexfunction.hh +++ b/dune/tectonic/mydirectionalconvexfunction.hh @@ -8,8 +8,8 @@ template <class NonlinearityType> class MyDirectionalConvexFunction { public: - typedef typename NonlinearityType::VectorType VectorType; - typedef typename NonlinearityType::MatrixType MatrixType; + using VectorType = typename NonlinearityType::VectorType; + using MatrixType = typename NonlinearityType::MatrixType; MyDirectionalConvexFunction(double A, double b, NonlinearityType const &phi, VectorType const &u, VectorType const &v) diff --git a/src/assemblers.cc b/src/assemblers.cc index ecaf47d8..283da47e 100644 --- a/src/assemblers.cc +++ b/src/assemblers.cc @@ -35,7 +35,7 @@ template <class GridView, class LocalVectorType, class AssemblerType> Dune::shared_ptr<Dune::BlockVector<Dune::FieldVector<double, 1>>> assemble_frictional(GridView const &gridView, AssemblerType const &assembler, Dune::BitSetVector<1> const &frictionalNodes) { - typedef Dune::FieldVector<double, 1> Singleton; + using Singleton = Dune::FieldVector<double, 1>; BoundaryPatch<GridView> const frictionalBoundary(gridView, frictionalNodes); ConstantFunction<LocalVectorType, Singleton> const constantOneFunction(1); NeumannBoundaryAssembler<typename GridView::Grid, Singleton> @@ -56,7 +56,7 @@ assemble_nonlinearity( Dune::BlockVector<Dune::FieldVector<double, 1>> const &normalStress) { auto const size = nodalIntegrals.size(); - typedef Dune::BlockVector<Dune::FieldVector<double, 1>> SingletonVectorType; + using SingletonVectorType = Dune::BlockVector<Dune::FieldVector<double, 1>>; // {{{ Assemble terms for the nonlinearity SingletonVectorType mu0(size); mu0 = parset.get<double>("mu0"); diff --git a/src/assemblers_tmpl.cc b/src/assemblers_tmpl.cc index 1e42914d..31686a4c 100644 --- a/src/assemblers_tmpl.cc +++ b/src/assemblers_tmpl.cc @@ -10,15 +10,15 @@ #include <dune/fufem/functionspacebases/p1nodalbasis.hh> -typedef Dune::FieldVector<double, DIM> SmallVector; -typedef Dune::FieldMatrix<double, DIM, DIM> SmallMatrix; -typedef Dune::BCRSMatrix<SmallMatrix> MatrixType; -typedef Dune::BlockVector<SmallVector> VectorType; +using SmallVector = Dune::FieldVector<double, DIM>; +using SmallMatrix = Dune::FieldMatrix<double, DIM, DIM>; +using MatrixType = Dune::BCRSMatrix<SmallMatrix>; +using VectorType = Dune::BlockVector<SmallVector>; -typedef Dune::ALUGrid<DIM, DIM, Dune::simplex, Dune::nonconforming> GridType; -typedef GridType::LeafGridView GridView; -typedef P1NodalBasis<GridView, double> P1Basis; -typedef Assembler<P1Basis, P1Basis> AssemblerType; +using GridType = Dune::ALUGrid<DIM, DIM, Dune::simplex, Dune::nonconforming>; +using GridView = GridType::LeafGridView; +using P1Basis = P1NodalBasis<GridView, double>; +using AssemblerType = Assembler<P1Basis, P1Basis>; template void assemble_neumann<GridView, SmallVector, AssemblerType>( GridView const &gridView, AssemblerType const &assembler, diff --git a/src/mysolver.hh b/src/mysolver.hh index 9fb71093..ca422f1b 100644 --- a/src/mysolver.hh +++ b/src/mysolver.hh @@ -19,11 +19,11 @@ template <int dim, class MatrixType, class VectorType, class GridType> class MySolver { private: - typedef MyConvexProblem<MatrixType, VectorType> ConvexProblemType; - typedef MyBlockProblem<ConvexProblemType> BlockProblemType; - typedef GenericNonlinearGS<BlockProblemType> NonlinearSmootherType; - typedef TruncatedNonsmoothNewtonMultigrid<BlockProblemType, - NonlinearSmootherType> SolverType; + using ConvexProblemType = MyConvexProblem<MatrixType, VectorType>; + using BlockProblemType = MyBlockProblem<ConvexProblemType>; + using NonlinearSmootherType = GenericNonlinearGS<BlockProblemType>; + using SolverType = TruncatedNonsmoothNewtonMultigrid<BlockProblemType, + NonlinearSmootherType>; public: MySolver(Dune::ParameterTree const &parset, int refinements, diff --git a/src/mysolver_tmpl.cc b/src/mysolver_tmpl.cc index 2aad5842..5af72f59 100644 --- a/src/mysolver_tmpl.cc +++ b/src/mysolver_tmpl.cc @@ -11,11 +11,11 @@ #include <dune/tectonic/myblockproblem.hh> #include <dune/tectonic/myconvexproblem.hh> -typedef Dune::FieldVector<double, DIM> SmallVector; -typedef Dune::FieldMatrix<double, DIM, DIM> SmallMatrix; -typedef Dune::BlockVector<SmallVector> VectorType; -typedef Dune::BCRSMatrix<SmallMatrix> MatrixType; +using SmallVector = Dune::FieldVector<double, DIM>; +using SmallMatrix = Dune::FieldMatrix<double, DIM, DIM>; +using VectorType = Dune::BlockVector<SmallVector>; +using MatrixType = Dune::BCRSMatrix<SmallMatrix>; -typedef Dune::ALUGrid<DIM, DIM, Dune::simplex, Dune::nonconforming> GridType; +using GridType = Dune::ALUGrid<DIM, DIM, Dune::simplex, Dune::nonconforming>; template class MySolver<DIM, MatrixType, VectorType, GridType>; diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc index ce2d5911..28de6aa4 100644 --- a/src/one-body-sample.cc +++ b/src/one-body-sample.cc @@ -154,13 +154,13 @@ int main(int argc, char *argv[]) { parset); Dune::ParameterTreeParser::readOptions(argc, argv, parset); - typedef Dune::FieldVector<double, dims> SmallVector; - typedef Dune::FieldMatrix<double, dims, dims> SmallMatrix; - typedef Dune::FieldMatrix<double, 1, 1> SmallSingletonMatrix; - typedef Dune::BCRSMatrix<SmallMatrix> MatrixType; - typedef Dune::BCRSMatrix<SmallSingletonMatrix> SingletonMatrixType; - typedef Dune::BlockVector<SmallVector> VectorType; - typedef Dune::BlockVector<Dune::FieldVector<double, 1>> SingletonVectorType; + using SmallVector = Dune::FieldVector<double, dims>; + using SmallMatrix = Dune::FieldMatrix<double, dims, dims>; + using SmallSingletonMatrix = Dune::FieldMatrix<double, 1, 1>; + using MatrixType = Dune::BCRSMatrix<SmallMatrix>; + using SingletonMatrixType = Dune::BCRSMatrix<SmallSingletonMatrix>; + using VectorType = Dune::BlockVector<SmallVector>; + using SingletonVectorType = Dune::BlockVector<Dune::FieldVector<double, 1>>; auto const E = parset.get<double>("body.E"); auto const nu = parset.get<double>("body.nu"); @@ -171,8 +171,8 @@ int main(int argc, char *argv[]) { auto const L = parset.get<double>("boundary.friction.L"); // {{{ Set up grid - typedef Dune::ALUGrid<dims, dims, Dune::simplex, Dune::nonconforming> - GridType; + using GridType = + Dune::ALUGrid<dims, dims, Dune::simplex, Dune::nonconforming>; Dune::FieldVector<typename GridType::ctype, dims> lowerLeft(0); Dune::FieldVector<typename GridType::ctype, dims> upperRight(1); @@ -194,13 +194,13 @@ int main(int argc, char *argv[]) { grid->globalRefine(refinements); size_t const finestSize = grid->size(grid->maxLevel(), dims); - typedef GridType::LeafGridView GridView; + using GridView = GridType::LeafGridView; GridView const leafView = grid->leafView(); // }}} // Set up bases - typedef P0Basis<GridView, double> P0Basis; - typedef P1NodalBasis<GridView, double> P1Basis; + using P0Basis = P0Basis<GridView, double>; + using P1Basis = P1NodalBasis<GridView, double>; P0Basis const p0Basis(leafView); P1Basis const p1Basis(leafView); Assembler<P0Basis, P0Basis> const p0Assembler(p0Basis, p0Basis); @@ -243,7 +243,7 @@ int main(int argc, char *argv[]) { } // Set up functions for time-dependent boundary conditions - typedef Dune::VirtualFunction<double, double> FunctionType; + using FunctionType = Dune::VirtualFunction<double, double>; SharedPointerMap<std::string, FunctionType> functions; initPython(functions); auto const &dirichletFunction = functions.get("dirichletCondition"); @@ -415,7 +415,7 @@ int main(int argc, char *argv[]) { parset.sub("boundary.friction"), *nodalIntegrals, _alpha, surfaceNormalStress); - typedef MyConvexProblem<MatrixType, VectorType> MyConvexProblemType; + using MyConvexProblemType = MyConvexProblem<MatrixType, VectorType>; MyConvexProblemType const myConvexProblem( problem_A, *myGlobalNonlinearity, problem_rhs); MyBlockProblem<MyConvexProblemType> velocityProblem(parset, diff --git a/src/state/compute_state_dieterich_common.hh b/src/state/compute_state_dieterich_common.hh index 39f5f627..3528e820 100644 --- a/src/state/compute_state_dieterich_common.hh +++ b/src/state/compute_state_dieterich_common.hh @@ -4,8 +4,8 @@ class DieterichNonlinearity { public: - typedef Dune::FieldVector<double, 1> VectorType; - typedef Dune::FieldMatrix<double, 1, 1> MatrixType; + using VectorType = Dune::FieldVector<double, 1>; + using MatrixType = Dune::FieldMatrix<double, 1, 1>; DieterichNonlinearity(double _VoL); void directionalSubDiff(VectorType const &u, VectorType const &v, diff --git a/src/tests/test-circle.cc b/src/tests/test-circle.cc index e0b8080d..97d19abf 100644 --- a/src/tests/test-circle.cc +++ b/src/tests/test-circle.cc @@ -22,9 +22,9 @@ int main() { int const dim = 2; - typedef Dune::EllipticEnergy<dim> Functional; - typedef Functional::SmallMatrix SmallMatrix; - typedef Functional::SmallVector SmallVector; + using Functional = Dune::EllipticEnergy<dim>; + using SmallMatrix = Functional::SmallMatrix; + using SmallVector = Functional::SmallVector; SmallMatrix const A = { { 4, 1.5 }, { 1.5, 3 } }; SmallVector const b = { 1, 2 }; diff --git a/src/tests/test-gradient-horrible-logarithmic.cc b/src/tests/test-gradient-horrible-logarithmic.cc index f1a8bcd7..bd2ab106 100644 --- a/src/tests/test-gradient-horrible-logarithmic.cc +++ b/src/tests/test-gradient-horrible-logarithmic.cc @@ -15,9 +15,9 @@ int main() { int const dim = 2; - typedef Dune::EllipticEnergy<dim> Functional; - typedef Functional::SmallMatrix SmallMatrix; - typedef Functional::SmallVector SmallVector; + using Functional = Dune::EllipticEnergy<dim>; + using SmallMatrix = Functional::SmallMatrix; + using SmallVector = Functional::SmallVector; SmallMatrix const A = { { 3, 1.5 }, { 1.5, 4 } }; SmallVector const b = { 1, 2 }; diff --git a/src/tests/test-gradient-horrible.cc b/src/tests/test-gradient-horrible.cc index da5e45ff..8e912b79 100644 --- a/src/tests/test-gradient-horrible.cc +++ b/src/tests/test-gradient-horrible.cc @@ -15,9 +15,9 @@ int main() { int const dim = 2; - typedef Dune::EllipticEnergy<dim> Functional; - typedef Functional::SmallMatrix SmallMatrix; - typedef Functional::SmallVector SmallVector; + using Functional = Dune::EllipticEnergy<dim>; + using SmallMatrix = Functional::SmallMatrix; + using SmallVector = Functional::SmallVector; SmallMatrix const A = { { 3, 1.5 }, { 1.5, 4 } }; SmallVector const b = { 1, 2 }; diff --git a/src/tests/test-gradient-identity.cc b/src/tests/test-gradient-identity.cc index 7010f8a6..906ee532 100644 --- a/src/tests/test-gradient-identity.cc +++ b/src/tests/test-gradient-identity.cc @@ -15,9 +15,9 @@ int main() { int const dim = 2; - typedef Dune::EllipticEnergy<dim> Functional; - typedef Functional::SmallMatrix SmallMatrix; - typedef Functional::SmallVector SmallVector; + using Functional = Dune::EllipticEnergy<dim>; + using SmallMatrix = Functional::SmallMatrix; + using SmallVector = Functional::SmallVector; SmallMatrix const A = { { 3, 1.5 }, { 1.5, 4 } }; SmallVector const b = { 1, 2 }; diff --git a/src/tests/test-gradient-kinks.cc b/src/tests/test-gradient-kinks.cc index a4d17e23..857cd07d 100644 --- a/src/tests/test-gradient-kinks.cc +++ b/src/tests/test-gradient-kinks.cc @@ -15,9 +15,9 @@ int main() { int const dim = 2; - typedef Dune::EllipticEnergy<dim> Functional; - typedef Functional::SmallMatrix SmallMatrix; - typedef Functional::SmallVector SmallVector; + using Functional = Dune::EllipticEnergy<dim>; + using SmallMatrix = Functional::SmallMatrix; + using SmallVector = Functional::SmallVector; SmallMatrix const A = { { 4, 1.5 }, { 1.5, 3 } }; SmallVector const b = { -8, 14 }; diff --git a/src/tests/test-gradient-parabola.cc b/src/tests/test-gradient-parabola.cc index 7226d93b..23f4594e 100644 --- a/src/tests/test-gradient-parabola.cc +++ b/src/tests/test-gradient-parabola.cc @@ -17,9 +17,9 @@ int main() { int const dim = 2; - typedef Dune::EllipticEnergy<dim> Functional; - typedef Functional::SmallMatrix SmallMatrix; - typedef Functional::SmallVector SmallVector; + using Functional = Dune::EllipticEnergy<dim>; + using SmallMatrix = Functional::SmallMatrix; + using SmallVector = Functional::SmallVector; SmallMatrix const A = { { 3, 1.5 }, { 1.5, 4 } }; SmallVector const b = { 1, 2 }; diff --git a/src/tests/test-gradient-sample-3d.cc b/src/tests/test-gradient-sample-3d.cc index 52e4a959..7b928695 100644 --- a/src/tests/test-gradient-sample-3d.cc +++ b/src/tests/test-gradient-sample-3d.cc @@ -15,9 +15,9 @@ int main() { int const dim = 3; - typedef Dune::EllipticEnergy<dim> Functional; - typedef Functional::SmallMatrix SmallMatrix; - typedef Functional::SmallVector SmallVector; + using Functional = Dune::EllipticEnergy<dim>; + using SmallMatrix = Functional::SmallMatrix; + using SmallVector = Functional::SmallVector; SmallMatrix const A = { { 3, 1.5, 0 }, { 1.5, 4, 1.5 }, { 0, 1.5, 5 } }; SmallVector const b = { 1, 2, 3 }; diff --git a/src/tests/test-gradient-sample-nonsmooth.cc b/src/tests/test-gradient-sample-nonsmooth.cc index 9f136978..e8ac1f28 100644 --- a/src/tests/test-gradient-sample-nonsmooth.cc +++ b/src/tests/test-gradient-sample-nonsmooth.cc @@ -16,9 +16,9 @@ int main() { int const dim = 2; - typedef Dune::EllipticEnergy<dim> Functional; - typedef Functional::SmallMatrix SmallMatrix; - typedef Functional::SmallVector SmallVector; + using Functional = Dune::EllipticEnergy<dim>; + using SmallMatrix = Functional::SmallMatrix; + using SmallVector = Functional::SmallVector; SmallMatrix const A = { { 3, 1.5 }, { 1.5, 4 } }; SmallVector const b = { 1, 2 }; diff --git a/src/tests/test-gradient-sample-steep.cc b/src/tests/test-gradient-sample-steep.cc index 3f082c4a..47b87d55 100644 --- a/src/tests/test-gradient-sample-steep.cc +++ b/src/tests/test-gradient-sample-steep.cc @@ -15,9 +15,9 @@ int main() { int const dim = 2; - typedef Dune::EllipticEnergy<dim> Functional; - typedef Functional::SmallMatrix SmallMatrix; - typedef Functional::SmallVector SmallVector; + using Functional = Dune::EllipticEnergy<dim>; + using SmallMatrix = Functional::SmallMatrix; + using SmallVector = Functional::SmallVector; SmallMatrix const A = { { 1, 0 }, { 0, 1 } }; SmallVector const b = { 1, 2.5 }; diff --git a/src/tests/test-gradient-sample-steep2.cc b/src/tests/test-gradient-sample-steep2.cc index 3f082c4a..47b87d55 100644 --- a/src/tests/test-gradient-sample-steep2.cc +++ b/src/tests/test-gradient-sample-steep2.cc @@ -15,9 +15,9 @@ int main() { int const dim = 2; - typedef Dune::EllipticEnergy<dim> Functional; - typedef Functional::SmallMatrix SmallMatrix; - typedef Functional::SmallVector SmallVector; + using Functional = Dune::EllipticEnergy<dim>; + using SmallMatrix = Functional::SmallMatrix; + using SmallVector = Functional::SmallVector; SmallMatrix const A = { { 1, 0 }, { 0, 1 } }; SmallVector const b = { 1, 2.5 }; diff --git a/src/tests/test-gradient-sample-verysteep.cc b/src/tests/test-gradient-sample-verysteep.cc index 4d5f09ad..06af4323 100644 --- a/src/tests/test-gradient-sample-verysteep.cc +++ b/src/tests/test-gradient-sample-verysteep.cc @@ -15,9 +15,9 @@ int main() { int const dim = 2; - typedef Dune::EllipticEnergy<dim> Functional; - typedef Functional::SmallMatrix SmallMatrix; - typedef Functional::SmallVector SmallVector; + using Functional = Dune::EllipticEnergy<dim>; + using SmallMatrix = Functional::SmallMatrix; + using SmallVector = Functional::SmallVector; SmallMatrix const A = { { 1, 0 }, { 0, 1 } }; SmallVector const b = { 1, 2.5 }; diff --git a/src/tests/test-gradient-sample.cc b/src/tests/test-gradient-sample.cc index 245249b7..938c82bc 100644 --- a/src/tests/test-gradient-sample.cc +++ b/src/tests/test-gradient-sample.cc @@ -17,9 +17,9 @@ int main() { int const dim = 2; - typedef Dune::EllipticEnergy<dim> Functional; - typedef Functional::SmallMatrix SmallMatrix; - typedef Functional::SmallVector SmallVector; + using Functional = Dune::EllipticEnergy<dim>; + using SmallMatrix = Functional::SmallMatrix; + using SmallVector = Functional::SmallVector; SmallMatrix const A = { { 3, 1.5 }, { 1.5, 4 } }; SmallVector const b = { 1, 2 }; diff --git a/src/tests/test-gradient-sample2.cc b/src/tests/test-gradient-sample2.cc index a8009a07..8b09f463 100644 --- a/src/tests/test-gradient-sample2.cc +++ b/src/tests/test-gradient-sample2.cc @@ -17,9 +17,9 @@ int main() { int const dim = 2; - typedef Dune::EllipticEnergy<dim> Functional; - typedef Functional::SmallMatrix SmallMatrix; - typedef Functional::SmallVector SmallVector; + using Functional = Dune::EllipticEnergy<dim>; + using SmallMatrix = Functional::SmallMatrix; + using SmallVector = Functional::SmallVector; SmallMatrix const A = { { 1, 0 }, { 0, 1 } }; SmallVector const b = { 1, 1 }; diff --git a/src/tests/test-gradient-trivial.cc b/src/tests/test-gradient-trivial.cc index 28fecb60..044d0c0d 100644 --- a/src/tests/test-gradient-trivial.cc +++ b/src/tests/test-gradient-trivial.cc @@ -16,9 +16,9 @@ int main() { int const dim = 2; - typedef Dune::EllipticEnergy<dim> Functional; - typedef Functional::SmallMatrix SmallMatrix; - typedef Functional::SmallVector SmallVector; + using Functional = Dune::EllipticEnergy<dim>; + using SmallMatrix = Functional::SmallMatrix; + using SmallVector = Functional::SmallVector; SmallMatrix const A = { { 3, 1.5 }, { 1.5, 4 } }; SmallVector const b = { 1, 2 }; diff --git a/src/tests/test-minimise2.cc b/src/tests/test-minimise2.cc index 1646bc0c..a84886cb 100644 --- a/src/tests/test-minimise2.cc +++ b/src/tests/test-minimise2.cc @@ -18,9 +18,9 @@ int main() { int const dim = 2; - typedef Dune::EllipticEnergy<dim> Functional; - typedef Functional::SmallMatrix SmallMatrix; - typedef Functional::SmallVector SmallVector; + using Functional = Dune::EllipticEnergy<dim>; + using SmallMatrix = Functional::SmallMatrix; + using SmallVector = Functional::SmallVector; SmallMatrix const A = { { 4, 1.5 }, { 1.5, 3 } }; diff --git a/src/timestepping_tmpl.cc b/src/timestepping_tmpl.cc index 868daf5e..60ea4faf 100644 --- a/src/timestepping_tmpl.cc +++ b/src/timestepping_tmpl.cc @@ -8,11 +8,11 @@ #include <dune/istl/bcrsmatrix.hh> #include <dune/istl/bvector.hh> -typedef Dune::FieldVector<double, DIM> SmallVector; -typedef Dune::FieldMatrix<double, DIM, DIM> SmallMatrix; -typedef Dune::BCRSMatrix<SmallMatrix> MatrixType; -typedef Dune::BlockVector<SmallVector> VectorType; -typedef Dune::VirtualFunction<double, double> FunctionType; +using SmallVector = Dune::FieldVector<double, DIM>; +using SmallMatrix = Dune::FieldMatrix<double, DIM, DIM>; +using MatrixType = Dune::BCRSMatrix<SmallMatrix>; +using VectorType = Dune::BlockVector<SmallVector>; +using FunctionType = Dune::VirtualFunction<double, double>; template class ImplicitEuler<VectorType, MatrixType, FunctionType, DIM>; template class Newmark<VectorType, MatrixType, FunctionType, DIM>; diff --git a/src/vtk_tmpl.cc b/src/vtk_tmpl.cc index eac4a0cc..4f85e063 100644 --- a/src/vtk_tmpl.cc +++ b/src/vtk_tmpl.cc @@ -10,16 +10,16 @@ #include <dune/fufem/functionspacebases/p0basis.hh> #include <dune/fufem/functionspacebases/p1nodalbasis.hh> -typedef Dune::BlockVector<Dune::FieldVector<double, 1>> SingletonVectorType; +using SingletonVectorType = Dune::BlockVector<Dune::FieldVector<double, 1>>; -typedef Dune::FieldVector<double, DIM> SmallVector; -typedef Dune::FieldMatrix<double, DIM, DIM> SmallMatrix; -typedef Dune::BlockVector<SmallVector> VectorType; +using SmallVector = Dune::FieldVector<double, DIM>; +using SmallMatrix = Dune::FieldMatrix<double, DIM, DIM>; +using VectorType = Dune::BlockVector<SmallVector>; -typedef Dune::ALUGrid<DIM, DIM, Dune::simplex, Dune::nonconforming> GridType; -typedef GridType::LeafGridView GridView; -typedef P1NodalBasis<GridView, double> P1Basis; -typedef P0Basis<GridView, double> MyP0Basis; +using GridType = Dune::ALUGrid<DIM, DIM, Dune::simplex, Dune::nonconforming>; +using GridView = GridType::LeafGridView; +using P1Basis = P1NodalBasis<GridView, double>; +using MyP0Basis = P0Basis<GridView, double>; template void writeVtk<P1Basis, MyP0Basis, VectorType, SingletonVectorType, GridView>(P1Basis const &vertexBasis, -- GitLab