From 7a92c6ab95c44516757b927b54ca7a22035c70fb Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Tue, 1 Sep 2015 09:44:21 -0400 Subject: [PATCH] fix indentation --- tests/benchmarks/test_hp/step.cc | 100 ++++++++++----------- tests/hp/fe_collection_05.cc | 26 +++--- tests/tests.h | 146 +++++++++++++++---------------- 3 files changed, 136 insertions(+), 136 deletions(-) diff --git a/tests/benchmarks/test_hp/step.cc b/tests/benchmarks/test_hp/step.cc index a7f466c2d6..9a637a328c 100644 --- a/tests/benchmarks/test_hp/step.cc +++ b/tests/benchmarks/test_hp/step.cc @@ -117,20 +117,20 @@ private: Triangulation triangulation; - DoFHandler dof_handler; - hp::DoFHandler hpdof_handler; - FE_Q fe; - hp::FECollection hpfe; + DoFHandler dof_handler; + hp::DoFHandler hpdof_handler; + FE_Q fe; + hp::FECollection hpfe; // This is the new variable in the main class. We need an object which holds // a list of constraints to hold the hanging nodes and the boundary // conditions. ConstraintMatrix constraints; - TimerOutput computing_timer; + TimerOutput computing_timer; SparsityPattern sparsity_pattern; SparseMatrix system_matrix; - + Vector solution; Vector system_rhs; }; @@ -204,15 +204,15 @@ void Coefficient::value_list (const std::vector > &points, template Step6::Step6 () : - dof_handler (triangulation), - hpdof_handler (triangulation), - fe (3), - computing_timer (std::cout, - TimerOutput::summary, - TimerOutput::wall_times) - + dof_handler (triangulation), + hpdof_handler (triangulation), + fe (3), + computing_timer (std::cout, + TimerOutput::summary, + TimerOutput::wall_times) + { - hpfe.push_back (FE_Q(3)); + hpfe.push_back (FE_Q(3)); } @@ -307,13 +307,13 @@ Step6::~Step6 () template void Step6::setup_system () { - computing_timer.enter_section ("distribute"); + computing_timer.enter_section ("distribute"); dof_handler.distribute_dofs (fe); - computing_timer.exit_section ("distribute"); + computing_timer.exit_section ("distribute"); - computing_timer.enter_section ("distribute_hp"); + computing_timer.enter_section ("distribute_hp"); hpdof_handler.distribute_dofs (hpfe); - computing_timer.exit_section ("distribute_hp"); + computing_timer.exit_section ("distribute_hp"); solution.reinit (dof_handler.n_dofs()); system_rhs.reinit (dof_handler.n_dofs()); @@ -330,16 +330,16 @@ void Step6::setup_system () // from computations on the previous mesh before the last adaptive // refinement): constraints.clear (); - //computing_timer.enter_section ("hanging"); + //computing_timer.enter_section ("hanging"); DoFTools::make_hanging_node_constraints (dof_handler, constraints); - //computing_timer.exit_section ("hanging"); -/* constraints.clear (); - computing_timer.enter_section ("hanging_hp"); - DoFTools::make_hanging_node_constraints (dof_handler, - constraints); - computing_timer.exit_section ("hanging_hp"); -*/ + //computing_timer.exit_section ("hanging"); + /* constraints.clear (); + computing_timer.enter_section ("hanging_hp"); + DoFTools::make_hanging_node_constraints (dof_handler, + constraints); + computing_timer.exit_section ("hanging_hp"); + */ // Now we are ready to interpolate the ZeroFunction to our boundary with // indicator 0 (the whole boundary) and store the resulting constraints in @@ -429,29 +429,29 @@ void Step6::assemble_system () { system_matrix = 0; const QGauss qformula(fe.degree+1); - + FEValues fe_values (fe, qformula, update_values | update_gradients | update_quadrature_points | update_JxW_values); FullMatrix cell_matrix; - + Vector cell_rhs; - + std::vector local_dof_indices; - + const Coefficient coefficient; std::vector coefficient_values; -typename DoFHandler::active_cell_iterator + typename DoFHandler::active_cell_iterator cell = dof_handler.begin_active(), endc = dof_handler.end(); for (; cell!=endc; ++cell) { const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell; - cell_matrix.reinit (dofs_per_cell, dofs_per_cell); + cell_matrix.reinit (dofs_per_cell, dofs_per_cell); cell_matrix = 0; cell_rhs.reinit (dofs_per_cell); cell_rhs = 0; @@ -459,8 +459,8 @@ typename DoFHandler::active_cell_iterator fe_values.reinit (cell); coefficient_values.resize(fe_values.n_quadrature_points); - - coefficient.value_list (fe_values.get_quadrature_points(), + + coefficient.value_list (fe_values.get_quadrature_points(), coefficient_values); for (unsigned int q_point=0; q_point::assemble_system_hp () // const QGauss quadrature_formula(3); hp::QCollection qformulas; qformulas.push_back(QGauss(fe.degree+1)); - + hp::FEValues hp_fe_values (hpfe, qformulas, - update_values | update_gradients | - update_quadrature_points | update_JxW_values); + update_values | update_gradients | + update_quadrature_points | update_JxW_values); FullMatrix cell_matrix; - + Vector cell_rhs; - + std::vector local_dof_indices; - + const Coefficient coefficient; std::vector coefficient_values; @@ -523,11 +523,11 @@ void Step6::assemble_system_hp () endc = hpdof_handler.end(); for (; cell!=endc; ++cell) { - hp_fe_values.reinit (cell); - const FEValues &fe_values = hp_fe_values.get_present_fe_values (); + hp_fe_values.reinit (cell); + const FEValues &fe_values = hp_fe_values.get_present_fe_values (); const unsigned int dofs_per_cell = cell->get_fe().dofs_per_cell; - cell_matrix.reinit (dofs_per_cell, dofs_per_cell); + cell_matrix.reinit (dofs_per_cell, dofs_per_cell); cell_matrix = 0; cell_rhs.reinit (dofs_per_cell); cell_rhs = 0; @@ -535,8 +535,8 @@ void Step6::assemble_system_hp () // fe_values.reinit (cell); coefficient_values.resize(fe_values.n_quadrature_points); - - coefficient.value_list (fe_values.get_quadrature_points(), + + coefficient.value_list (fe_values.get_quadrature_points(), coefficient_values); for (unsigned int q_point=0; q_point::refine_grid () { Vector estimated_error_per_cell (triangulation.n_active_cells()); - for (unsigned int i=0;i::estimate (dof_handler, QGauss(3), typename FunctionMap::type(), @@ -790,7 +790,7 @@ void Step6::run () << std::endl; std::cout << "setup" << std::endl; - + // computing_timer.enter_section ("setup"); setup_system (); // computing_timer.exit_section ("setup"); @@ -818,7 +818,7 @@ void Step6::run () std::cout << "solve" << std::endl; - solve (); + solve (); // output_results (cycle); std::cout << "done" << std::endl; } diff --git a/tests/hp/fe_collection_05.cc b/tests/hp/fe_collection_05.cc index 278b36f1ba..885a5df921 100644 --- a/tests/hp/fe_collection_05.cc +++ b/tests/hp/fe_collection_05.cc @@ -45,7 +45,7 @@ void test () // {Q1,Q2,Q3,Q4} { - hp::FECollection fe_collection; + hp::FECollection fe_collection; fe_collection.push_back (FE_Q(1)); fe_collection.push_back (FE_Q(2)); fe_collection.push_back (FE_Q(3)); @@ -55,7 +55,7 @@ void test () // {Q1xQ1, Q2xQ2, Q3xQ4, Q4xQ3} { - hp::FECollection fe_collection; + hp::FECollection fe_collection; fe_collection.push_back (FESystem(FE_Q(1),1, FE_Q(1),1)); fe_collection.push_back (FESystem(FE_Q(2),1, @@ -69,7 +69,7 @@ void test () // {Q1xQ1, Q3xQ4, Q4xQ3} { - hp::FECollection fe_collection; + hp::FECollection fe_collection; fe_collection.push_back (FESystem(FE_Q(1),1, FE_Q(1),1)); fe_collection.push_back (FESystem(FE_Q(3),1, @@ -82,9 +82,9 @@ void test () deallog << fe_collection.find_least_face_dominating_fe(fes) << std::endl; } - // {0x0, 0x0, Q1x0, 0xQ1} + // {0x0, 0x0, Q1x0, 0xQ1} { - hp::FECollection fe_collection; + hp::FECollection fe_collection; fe_collection.push_back (FESystem(FE_Nothing(),1, FE_Nothing(),1)); fe_collection.push_back (FESystem(FE_Nothing(),1, @@ -99,11 +99,11 @@ void test () else deallog << ind << std::endl; } - + // dominating FE_Nothing - // {0x0, 0x0, Q1x0, 0xQ1} + // {0x0, 0x0, Q1x0, 0xQ1} { - hp::FECollection fe_collection; + hp::FECollection fe_collection; fe_collection.push_back (FESystem(FE_Nothing(1,true),1, FE_Nothing(1,true),1)); fe_collection.push_back (FESystem(FE_Nothing(1,true),1, @@ -118,8 +118,8 @@ void test () // {Q1xQ1,Q1xQ1,Q2xQ1,Q1,Q2} { - hp::FECollection fe_collection; - fe_collection.push_back (FESystem(FE_Q(1),1, + hp::FECollection fe_collection; + fe_collection.push_back (FESystem(FE_Q(1),1, FE_Q(1),1)); fe_collection.push_back (FESystem(FE_Q(1),1, FE_Q(1),1)); @@ -129,10 +129,10 @@ void test () FE_Q(2),1)); deallog << fe_collection.find_least_face_dominating_fe(fes) << std::endl; } - + // {Q4xQ4, Q5xQ5, Q3xQ4, Q4xQ3 { - hp::FECollection fe_collection; + hp::FECollection fe_collection; fe_collection.push_back (FESystem(FE_Q(4),1, FE_Q(4),1)); fe_collection.push_back (FESystem(FE_Q(5),1, @@ -147,7 +147,7 @@ void test () else deallog << ind << std::endl; } - + // {Q1,Q2,Q4,Q3} { hp::FECollection fe_collection; diff --git a/tests/tests.h b/tests/tests.h index dbc8ab0575..e86eeb3f06 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -56,50 +56,50 @@ using namespace dealii; // we put this into a namespace to not conflict with stdlib namespace Testing { -int rand(bool reseed=false, int seed=1) throw() -{ - static int r[32]; - static int k; - static bool inited=false; - if (!inited || reseed) - { - //srand treats a seed 0 as 1 for some reason - r[0]=(seed==0)?1:seed; - - for (int i=1; i<31; i++) - { - r[i] = (16807LL * r[i-1]) % 2147483647; - if (r[i] < 0) - r[i] += 2147483647; - } - k=31; - for (int i=31; i<34; i++) - { - r[k%32] = r[(k+32-31)%32]; - k=(k+1)%32; - } - - for (int i=34; i<344; i++) - { - r[k%32] = r[(k+32-31)%32] + r[(k+32-3)%32]; - k=(k+1)%32; - } - inited=true; - if (reseed==true) - return 0;// do not generate new no - } + int rand(bool reseed=false, int seed=1) throw() + { + static int r[32]; + static int k; + static bool inited=false; + if (!inited || reseed) + { + //srand treats a seed 0 as 1 for some reason + r[0]=(seed==0)?1:seed; - r[k%32] = r[(k+32-31)%32] + r[(k+32-3)%32]; - int ret = r[k%32]; - k=(k+1)%32; - return (unsigned int)ret >> 1; -} + for (int i=1; i<31; i++) + { + r[i] = (16807LL * r[i-1]) % 2147483647; + if (r[i] < 0) + r[i] += 2147483647; + } + k=31; + for (int i=31; i<34; i++) + { + r[k%32] = r[(k+32-31)%32]; + k=(k+1)%32; + } + + for (int i=34; i<344; i++) + { + r[k%32] = r[(k+32-31)%32] + r[(k+32-3)%32]; + k=(k+1)%32; + } + inited=true; + if (reseed==true) + return 0;// do not generate new no + } + + r[k%32] = r[(k+32-31)%32] + r[(k+32-3)%32]; + int ret = r[k%32]; + k=(k+1)%32; + return (unsigned int)ret >> 1; + } // reseed our random number generator -void srand(int seed) throw() -{ - rand(true, seed); -} + void srand(int seed) throw() + { + rand(true, seed); + } } @@ -169,22 +169,22 @@ std::string unify_pretty_function (const std::string &text) */ #define check_solver_within_range(SOLVER_COMMAND, CONTROL_COMMAND, MIN_ALLOWED, MAX_ALLOWED) \ -{ \ - const unsigned int previous_depth = deallog.depth_file(0); \ - SOLVER_COMMAND; \ - deallog.depth_file(previous_depth); \ - const unsigned int steps = CONTROL_COMMAND; \ - if (steps >= MIN_ALLOWED && steps <= MAX_ALLOWED) \ - { \ - deallog << "Solver stopped within " << MIN_ALLOWED << " - " \ - << MAX_ALLOWED << " iterations" << std::endl; \ - } \ - else \ - { \ - deallog << "Solver stopped after " << steps << " iterations" \ - << std::endl; \ - } \ -} + { \ + const unsigned int previous_depth = deallog.depth_file(0); \ + SOLVER_COMMAND; \ + deallog.depth_file(previous_depth); \ + const unsigned int steps = CONTROL_COMMAND; \ + if (steps >= MIN_ALLOWED && steps <= MAX_ALLOWED) \ + { \ + deallog << "Solver stopped within " << MIN_ALLOWED << " - " \ + << MAX_ALLOWED << " iterations" << std::endl; \ + } \ + else \ + { \ + deallog << "Solver stopped after " << steps << " iterations" \ + << std::endl; \ + } \ + } // ------------------------------ Functions used in initializing subsystems ------------------- @@ -198,7 +198,7 @@ std::string unify_pretty_function (const std::string &text) */ inline unsigned int testing_max_num_threads() { - return 5; + return 5; } struct LimitConcurrency @@ -225,23 +225,23 @@ namespace // stageLog->stageInfo->classLog->classInfo[i].id is always -1, so we look // it up in stageLog->classLog, make sure it has the same number of entries: Assert(stageLog->stageInfo->classLog->numClasses == stageLog->classLog->numClasses, - dealii::ExcInternalError()); + dealii::ExcInternalError()); bool errors = false; - for (int i=0;istageInfo->classLog->numClasses;++i) + for (int i=0; istageInfo->classLog->numClasses; ++i) { - if (stageLog->stageInfo->classLog->classInfo[i].destructions != - stageLog->stageInfo->classLog->classInfo[i].creations) - { - errors = true; - std::cerr << "ERROR: PETSc objects leaking of type '" - << stageLog->classLog->classInfo[i].name << "'" - << " with " - << stageLog->stageInfo->classLog->classInfo[i].creations - << " creations and only " - << stageLog->stageInfo->classLog->classInfo[i].destructions - << " destructions." << std::endl; - } + if (stageLog->stageInfo->classLog->classInfo[i].destructions != + stageLog->stageInfo->classLog->classInfo[i].creations) + { + errors = true; + std::cerr << "ERROR: PETSc objects leaking of type '" + << stageLog->classLog->classInfo[i].name << "'" + << " with " + << stageLog->stageInfo->classLog->classInfo[i].creations + << " creations and only " + << stageLog->stageInfo->classLog->classInfo[i].destructions + << " destructions." << std::endl; + } } if (errors) @@ -449,7 +449,7 @@ struct EnableFPE // enable floating point exceptions feenableexcept(FE_DIVBYZERO|FE_INVALID); #endif - } + } } deal_II_enable_fpe; -- 2.39.5