From 4b7f7023a8ce2d53e1881550b5e2d30c39c8ff62 Mon Sep 17 00:00:00 2001 From: Olivier Gaboriault Date: Mon, 24 Feb 2025 15:44:58 -0500 Subject: [PATCH] Indent --- include/deal.II/base/parsed_function.h | 2 +- source/base/parsed_function.cc | 5 +- tests/base/function_parser_13.cc | 94 +++++++++++++------------- 3 files changed, 51 insertions(+), 50 deletions(-) diff --git a/include/deal.II/base/parsed_function.h b/include/deal.II/base/parsed_function.h index e643566183..6b3578d06b 100644 --- a/include/deal.II/base/parsed_function.h +++ b/include/deal.II/base/parsed_function.h @@ -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 diff --git a/source/base/parsed_function.cc b/source/base/parsed_function.cc index 6dc9daf29f..784d23059e 100644 --- a/source/base/parsed_function.cc +++ b/source/base/parsed_function.cc @@ -33,7 +33,7 @@ namespace Functions void ParsedFunction::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); } diff --git a/tests/base/function_parser_13.cc b/tests/base/function_parser_13.cc index 0b052c4741..e07da93fc6 100644 --- a/tests/base/function_parser_13.cc +++ b/tests/base/function_parser_13.cc @@ -14,77 +14,77 @@ // This program tests the functionality of imposing a default expression -// when declaring a ParsedFunction. +// when declaring a ParsedFunction. -#include #include +#include -#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 result_2(2); - Vector result_3(3); + const double result_1 = fct_1.value(p); + Vector result_2(2); + Vector 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(); } -- 2.39.5