]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Indent
authorOlivier Gaboriault <oliviergabo@gmail.com>
Mon, 24 Feb 2025 20:44:58 +0000 (15:44 -0500)
committerOlivier Gaboriault <oliviergabo@gmail.com>
Thu, 27 Feb 2025 15:35:44 +0000 (10:35 -0500)
include/deal.II/base/parsed_function.h
source/base/parsed_function.cc
tests/base/function_parser_13.cc

index e6435661837545ee82a85b0b4205cc766fba46b4..6b3578d06b702cbaacf0a1253398ea0104590242 100644 (file)
@@ -111,7 +111,7 @@ namespace Functions
     static void
     declare_parameters(ParameterHandler  &prm,
                        const unsigned int n_components = 1,
-                       const std::string  &input_expr   = "");
+                       const std::string &input_expr   = "");
 
     /**
      * Parse parameters needed by this class.  If the number of components
index 6dc9daf29f3fad38f8f50e1af94e0fd7809bf668..784d23059ecf0fa25c851b60a78411bda5bb2a3f 100644 (file)
@@ -33,7 +33,7 @@ namespace Functions
   void
   ParsedFunction<dim>::declare_parameters(ParameterHandler  &prm,
                                           const unsigned int n_components,
-                                          const std::string  &input_expr)
+                                          const std::string &input_expr)
   {
     Assert(n_components > 0, ExcZero());
 
@@ -82,7 +82,8 @@ namespace Functions
       {
         // If the user specified an input expr, the number of component
         // specified need to match n_components.
-        AssertDimension((std::count(expr.begin(), expr.end(), ';') + 1) , n_components);
+        AssertDimension((std::count(expr.begin(), expr.end(), ';') + 1),
+                        n_components);
       }
 
 
index 0b052c47417034c5867817f3e4ad63f44fa5fb27..e07da93fc615e85c0bc467b48942ad3ef32a372a 100644 (file)
 
 
 // This program tests the functionality of imposing a default expression
-// when declaring a ParsedFunction. 
+// when declaring a ParsedFunction.
 
-#include <deal.II/base/parsed_function.h>
 #include <deal.II/base/parameter_handler.h>
+#include <deal.II/base/parsed_function.h>
 
-#include "../tests.h"
 #include "deal.II/matrix_free/matrix_free.h"
 
+#include "../tests.h"
+
 
 void
-test() {
-    // set up problem:
-    ParameterHandler prm;
-    Functions::ParsedFunction<3> fct_1(1);
-    Functions::ParsedFunction<3> fct_2(2);
-    Functions::ParsedFunction<3> fct_3(3);
+test()
+{
+  // set up problem:
+  ParameterHandler             prm;
+  Functions::ParsedFunction<3> fct_1(1);
+  Functions::ParsedFunction<3> fct_2(2);
+  Functions::ParsedFunction<3> fct_3(3);
 
-    std::string expression_1 = "1000";
-    std::string expression_3 = "10;10;10";
+  std::string expression_1 = "1000";
+  std::string expression_3 = "10;10;10";
 
-    // Declare
-    prm.enter_subsection("Function 1");
-    fct_1.declare_parameters(prm, 1, expression_1);
-    prm.leave_subsection();
+  // Declare
+  prm.enter_subsection("Function 1");
+  fct_1.declare_parameters(prm, 1, expression_1);
+  prm.leave_subsection();
 
-    prm.enter_subsection("Function 2");
-    fct_2.declare_parameters(prm, 2);
-    prm.leave_subsection();
+  prm.enter_subsection("Function 2");
+  fct_2.declare_parameters(prm, 2);
+  prm.leave_subsection();
 
-    prm.enter_subsection("Function 3");
-    fct_3.declare_parameters(prm, 3, expression_3);
-    prm.leave_subsection();
+  prm.enter_subsection("Function 3");
+  fct_3.declare_parameters(prm, 3, expression_3);
+  prm.leave_subsection();
 
 
-    // Parse
-    prm.enter_subsection("Function 1");
-    fct_1.parse_parameters(prm);
-    prm.leave_subsection();
+  // Parse
+  prm.enter_subsection("Function 1");
+  fct_1.parse_parameters(prm);
+  prm.leave_subsection();
 
-    prm.enter_subsection("Function 2");
-    fct_2.parse_parameters(prm);
-    prm.leave_subsection();
+  prm.enter_subsection("Function 2");
+  fct_2.parse_parameters(prm);
+  prm.leave_subsection();
 
-    prm.enter_subsection("Function 3");
-    fct_3.parse_parameters(prm);
-    prm.leave_subsection();
+  prm.enter_subsection("Function 3");
+  fct_3.parse_parameters(prm);
+  prm.leave_subsection();
 
 
-    // Dummy point
-    const Point<3> p;
+  // Dummy point
+  const Point<3> p;
 
-    const double result_1 = fct_1.value(p);
-    Vector<double> result_2(2);
-    Vector<double> result_3(3);
+  const double   result_1 = fct_1.value(p);
+  Vector<double> result_2(2);
+  Vector<double> result_3(3);
 
-    fct_2.vector_value(p,result_2);
-    fct_3.vector_value(p,result_3);
+  fct_2.vector_value(p, result_2);
+  fct_3.vector_value(p, result_3);
 
-    deallog << "Function 1 '" << expression_1 << "' is "
-        << result_1 << std::endl;
+  deallog << "Function 1 '" << expression_1 << "' is " << result_1 << std::endl;
 
-    deallog << "Function 2 '' is "
-    << result_2 << std::endl;
+  deallog << "Function 2 '' is " << result_2 << std::endl;
 
-    deallog << "Function 3 '" << expression_3 << "' is "
-    << result_3 << std::endl;
+  deallog << "Function 3 '" << expression_3 << "' is " << result_3 << std::endl;
 }
 
 int
-main() {
-    initlog();
+main()
+{
+  initlog();
 
-    test();
+  test();
 }

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.