]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix two tests missed in #8018.
authorJean-Paul Pelteret <jppelteret@gmail.com>
Fri, 10 May 2019 20:35:31 +0000 (22:35 +0200)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Fri, 10 May 2019 20:37:23 +0000 (22:37 +0200)
tests/adolc/step-44.cc
tests/adolc/tensor_ops_01.cc

index 7e7c78f18d7544953f622e0497440e2bd20144ba..5c505338a2fb56550f4c8a55a93c86def3bd60d4 100644 (file)
@@ -182,7 +182,6 @@ namespace Step44
     {
       std::string type_lin;
       double      tol_lin;
-      double      max_iterations_lin;
       bool        use_static_condensation;
       std::string preconditioner_type;
       double      preconditioner_relaxation;
@@ -204,11 +203,6 @@ namespace Step44
                           "1e-6",
                           Patterns::Double(0.0),
                           "Linear solver residual (scaled by residual norm)");
-        prm.declare_entry(
-          "Max iteration multiplier",
-          "1",
-          Patterns::Double(0.0),
-          "Linear solver iterations (multiples of the system matrix size)");
         prm.declare_entry("Use static condensation",
                           "true",
                           Patterns::Bool(),
@@ -231,7 +225,6 @@ namespace Step44
       {
         type_lin                  = prm.get("Solver type");
         tol_lin                   = prm.get_double("Residual");
-        max_iterations_lin        = prm.get_double("Max iteration multiplier");
         use_static_condensation   = prm.get_bool("Use static condensation");
         preconditioner_type       = prm.get("Preconditioner type");
         preconditioner_relaxation = prm.get_double("Preconditioner relaxation");
@@ -1914,8 +1907,7 @@ namespace Step44
           std::cout << " SLV " << std::flush;
           if (parameters.type_lin == "CG")
             {
-              const int solver_its = tangent_matrix.block(u_dof, u_dof).m() *
-                                     parameters.max_iterations_lin;
+              const int    solver_its = tangent_matrix.block(u_dof, u_dof).m();
               const double tol_sol =
                 parameters.tol_lin * system_rhs.block(u_dof).l2_norm();
               SolverControl solver_control(solver_its, tol_sol, false, false);
@@ -1996,8 +1988,7 @@ namespace Step44
             preconditioner_K_Jp_inv.use_matrix(
               tangent_matrix.block(J_dof, p_dof));
             ReductionControl solver_control_K_Jp_inv(
-              tangent_matrix.block(J_dof, p_dof).m() *
-                parameters.max_iterations_lin,
+              tangent_matrix.block(J_dof, p_dof).m(),
               1.0e-30,
               parameters.tol_lin);
             SolverSelector<Vector<double>> solver_K_Jp_inv;
@@ -2015,8 +2006,7 @@ namespace Step44
             preconditioner_K_con_inv.use_matrix(
               tangent_matrix.block(u_dof, u_dof));
             ReductionControl solver_control_K_con_inv(
-              tangent_matrix.block(u_dof, u_dof).m() *
-                parameters.max_iterations_lin,
+              tangent_matrix.block(u_dof, u_dof).m(),
               1.0e-30,
               parameters.tol_lin);
             SolverSelector<Vector<double>> solver_K_con_inv;
index 11295a53fd56b82425d330eca8af512f484b1ad0..105442fe462e8fcad583c34bbf2c2bafc40b6946 100644 (file)
@@ -90,8 +90,8 @@ test_tensor()
   adt7           = adt1 * t1;
 
   // Outer product
-  const Tensor<1, dim, number_t>    v1;
-  const Tensor<1, dim, ad_number_t> av1;
+  const Tensor<1, dim, number_t>    v1{};
+  const Tensor<1, dim, ad_number_t> av1{};
   const AD_Tensor                   adt8  = outer_product(v1, av1);
   const AD_Tensor                   adt9  = outer_product(av1, v1);
   const AD_Tensor                   adt10 = outer_product(av1, av1);
@@ -168,8 +168,8 @@ test_symmetric_tensor()
   //  const ad_number_t ad_res6 = adt1*t1; // TODO: Overload issue
 
   // Outer product
-  const Tensor<1, dim, number_t>    v1;
-  const Tensor<1, dim, ad_number_t> av1;
+  const Tensor<1, dim, number_t>    v1{};
+  const Tensor<1, dim, ad_number_t> av1{};
   const AD_STensor                  adt8  = symmetrize(outer_product(v1, av1));
   const AD_STensor                  adt9  = symmetrize(outer_product(av1, v1));
   const AD_STensor                  adt10 = symmetrize(outer_product(av1, av1));

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.