]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix step-81 warnings
authorJiaqi Zhang <jiaqi2@clemson.edu>
Wed, 1 Jun 2022 19:56:43 +0000 (15:56 -0400)
committerJiaqi Zhang <jiaqi2@clemson.edu>
Wed, 1 Jun 2022 19:56:43 +0000 (15:56 -0400)
examples/step-81/step-81.cc

index d6bb85848b67b7ed7a3185a2af80eff4ab65676b..c47b790e24c5e6d8425ad8a82e2e371ffe4d4045 100644 (file)
@@ -174,8 +174,8 @@ namespace Step81
                   mu_inv_2,
                   "inverse of relative permeability of material 2");
 
-    sigma_tensor[0][0] = 0.001 + 0.2i;
-    sigma_tensor[1][1] = 0.001 + 0.2i;
+    sigma_tensor[0][0] = std::complex<double>(0.001, 0.2);
+    sigma_tensor[1][1] = std::complex<double>(0.001, 0.2);
     add_parameter("sigma",
                   sigma_tensor,
                   "surface conductivity between material 1 and material 2");
@@ -318,7 +318,7 @@ namespace Step81
         const double s =
           strength * ((radius - inner_radius) * (radius - inner_radius)) /
           ((outer_radius - inner_radius) * (outer_radius - inner_radius));
-        return 1.0 + 1.0i * s;
+        return std::complex<double>(1.0, s);
       }
     else
       {
@@ -340,7 +340,7 @@ namespace Step81
            (radius - inner_radius)) /
           (radius * (outer_radius - inner_radius) *
            (outer_radius - inner_radius));
-        return 1.0 + 1.0i * s_bar;
+        return std::complex<double>(1.0, s_bar);
       }
     else
       {

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.