diff --git a/dune/tectonic/ellipticenergy.hh b/dune/tectonic/ellipticenergy.hh index eca04dc67eaa7371989c06b1521dd736efdf5bf4..c63c7a76eee0ba1a9b683c5284f48786c0e18b22 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 7ece5eda1e0ec04637bdd90adc87cbe6f2538b40..2c600b0b4d45d410385790ae702f8ef481354f16 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 8f9c5cd940f2392ee3780696922679bade628cc0..f3bd55dec0e5a80663a93a12595a12c9db247175 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 148f80ddcf2f2204d05cfce3ea974edd7f67b98b..ede2c21bac936451a199713d4ff0ed338e5e9627 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 92eb9c0b146e0dc0c8575e7fd017c01f497538de..83488b0f3fd02c9985160c3a5751dafb30f9be79 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 c78062c9fd4e548bbb1eeb43391adb8f144b24d8..86441ed58bf43ef6db08c2543ff8a67a8e85a923 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 a55141c0d850ef808dc7d46fe862c01edaae5974..fe8f229d689782703370811e1bb2496185c18695 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 d630c152520b3be4fb4378af19b6bd73120383ee..b891722928e41de21006f60210c99af60388b200 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 0b0947380162af5f2662483d9115312e1ccd1f73..4aa33f0fd6d904d941a9960843c6814799bcf809 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 ecaf47d89b347b496a5b52e6fd4399b55fd4ccac..283da47e47591797053aba0814329bad8aebd246 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 1e42914dab143c5b6d98722e7f5507a611b72472..31686a4c270cf6390215298a2fcea6708c589a5a 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 9fb71093021910f179d3f59cf988562e51fb6249..ca422f1b0cad5cdb9eba2dde746f30f27ed8a90b 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 2aad58425f50fc97246528e5ef66afd8bea69cee..5af72f590e796ff34e05bc87597009c74d1c99c0 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 ce2d59119041cfd398c1b5465b7c90bce5067b11..28de6aa48e2534a3d7b9cedf4bd0d2dcd5148a52 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 39f5f62745a7efb022868737a1bef52f4177239c..3528e8206cb43d04908addd60beb9b9660f2308a 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 e0b8080d9fb57cfccaf0ad0ba4b5fd8f9d6fd8d4..97d19abfaa8ea452dab4d6c46c520a086a9caf7e 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 f1a8bcd7fe68507b1d10902f4edeb277e1e1263e..bd2ab10630f3d9695f860f35d760c8cd3f895027 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 da5e45ffe159f36e9582ab6295da315703378055..8e912b7982c5f2b3045b7464c7e240df598e4a91 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 7010f8a6be09e2f0d298821ab7336c4322897141..906ee5324a67282efa8a729a32f01c89d8a85534 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 a4d17e23f00436f03f45eeae9ff4413906381de8..857cd07de2e29818ff77d1c312520e63a3f572da 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 7226d93b18d6cc8fb407334f818883fd978b6357..23f4594eb55de3db3c784acbd05f5c4461da88ef 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 52e4a95933519547fe73c010659c95eafe013b31..7b92869524233f9b9db716164626725be5f5242a 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 9f13697872febbb6f5c183cd36b5e2996b5c8fed..e8ac1f28ad7a71f275e5aac9ceeb3e8ecf710b0b 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 3f082c4a84bcc0b56f800ba911e3f71695b1e9de..47b87d55fc921bf1e4ba2db4168e52667de45e3b 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 3f082c4a84bcc0b56f800ba911e3f71695b1e9de..47b87d55fc921bf1e4ba2db4168e52667de45e3b 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 4d5f09ad3e5c41e033386f747ffffd32a1b17784..06af4323182c427df2b4821b71ee4b1d3cd9bb7f 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 245249b7bfde9f5a7c4a1fc1eb74639919ad758e..938c82bc9555b9c33bbc409228eaee093c9d1fe3 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 a8009a073f9951afed6c7047fec46b6a5c536853..8b09f463ec82ee505fae46d081c81c56626bedce 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 28fecb6056ab75dfa0d238abeee04f0759a21c98..044d0c0dff6c79d76b83fed91249120592840fb9 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 1646bc0ce53733cace53a0cad91256996f5788ba..a84886cb270475a35b3cfdb1282fc53869b81242 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 868daf5ea3759a10262c480c1b49fccbf65f47e0..60ea4faf4d0e2cd27967a65359247af64a2b4cb5 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 eac4a0ccca4f986d0877d60570e680adf55f3f82..4f85e063e12722bda0303526c92195fa61484b21 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,