From 6bb4e7771295288aac22eb6d984ec85050d42ec9 Mon Sep 17 00:00:00 2001 From: nivesh Date: Wed, 20 Jun 2018 20:47:30 +0200 Subject: [PATCH] indentation corrected after git rebase --- source/fe/fe_enriched.cc | 28 +-- tests/fe/fe_enriched_color_01.cc | 6 +- tests/fe/fe_enriched_color_02.cc | 21 ++- tests/fe/fe_enriched_color_03.cc | 11 +- tests/fe/fe_enriched_color_04.cc | 12 +- tests/fe/fe_enriched_color_05.cc | 12 +- tests/fe/fe_enriched_color_06.cc | 14 +- tests/fe/fe_enriched_color_07.cc | 287 +++++++++++++++++-------------- tests/fe/fe_enriched_color_08.cc | 19 +- 9 files changed, 229 insertions(+), 181 deletions(-) diff --git a/source/fe/fe_enriched.cc b/source/fe/fe_enriched.cc index c634611fe4..adf4ea21d4 100644 --- a/source/fe/fe_enriched.cc +++ b/source/fe/fe_enriched.cc @@ -1106,8 +1106,9 @@ namespace ColorEnriched */ for (unsigned int i = 0; i < num_indices; ++i) for (unsigned int j = i + 1; j < num_indices; ++j) - if (internal::find_connection_between_subdomains( - mesh, predicates[i], predicates[j])) + if (internal::find_connection_between_subdomains(mesh, + predicates[i], + predicates[j])) dsp.add(i, j); dsp.symmetrize(); @@ -1200,9 +1201,9 @@ namespace ColorEnriched std::pair(predicate_colors[i], i)); - AssertThrow( - ret.second == 1, - ExcMessage("Only one enrichment function per color")); + AssertThrow(ret.second == 1, + ExcMessage( + "Only one enrichment function per color")); color_list.insert(predicate_colors[i]); } @@ -1430,8 +1431,9 @@ namespace ColorEnriched AssertDimension(vec_fe_enriched.size(), functions.size()); - FE_Enriched fe_component( - &fe_base, vec_fe_enriched, functions); + FE_Enriched fe_component(&fe_base, + vec_fe_enriched, + functions); fe_collection.push_back(fe_component); } } @@ -1444,12 +1446,12 @@ namespace ColorEnriched const FE_Q & fe_base, const FE_Q & fe_enriched, const std::vector> & predicates, - const std::vector>> &enrichments) : - fe_base(fe_base), - fe_enriched(fe_enriched), - fe_nothing(1, true), - predicates(predicates), - enrichments(enrichments) + const std::vector>> &enrichments) + : fe_base(fe_base) + , fe_enriched(fe_enriched) + , fe_nothing(1, true) + , predicates(predicates) + , enrichments(enrichments) {} diff --git a/tests/fe/fe_enriched_color_01.cc b/tests/fe/fe_enriched_color_01.cc index 49d99eab72..fcaa4b3754 100644 --- a/tests/fe/fe_enriched_color_01.cc +++ b/tests/fe/fe_enriched_color_01.cc @@ -39,9 +39,9 @@ using namespace dealii; template struct predicate_template { - predicate_template(const Point p, const int radius) : - p(p), - radius(radius) + predicate_template(const Point p, const int radius) + : p(p) + , radius(radius) {} template diff --git a/tests/fe/fe_enriched_color_02.cc b/tests/fe/fe_enriched_color_02.cc index 3ad1a224b3..3b1511685c 100644 --- a/tests/fe/fe_enriched_color_02.cc +++ b/tests/fe/fe_enriched_color_02.cc @@ -39,9 +39,9 @@ template struct EnrichmentPredicate { - EnrichmentPredicate(const Point origin, const double radius) : - origin(origin), - radius(radius) + EnrichmentPredicate(const Point origin, const double radius) + : origin(origin) + , radius(radius) {} template @@ -105,8 +105,9 @@ main(int argc, char **argv) predicate_colors.resize(vec_predicates.size()); - ColorEnriched::internal::color_predicates( - dof_handler, vec_predicates, predicate_colors); + ColorEnriched::internal::color_predicates(dof_handler, + vec_predicates, + predicate_colors); deallog << "Case 1" << std::endl; for (auto i : predicate_colors) @@ -124,8 +125,9 @@ main(int argc, char **argv) predicate_colors.resize(vec_predicates.size()); - ColorEnriched::internal::color_predicates( - dof_handler, vec_predicates, predicate_colors); + ColorEnriched::internal::color_predicates(dof_handler, + vec_predicates, + predicate_colors); deallog << "Case 2" << std::endl; for (auto i : predicate_colors) @@ -150,8 +152,9 @@ main(int argc, char **argv) predicate_colors.resize(vec_predicates.size()); - ColorEnriched::internal::color_predicates( - dof_handler, vec_predicates, predicate_colors); + ColorEnriched::internal::color_predicates(dof_handler, + vec_predicates, + predicate_colors); deallog << "Case 3" << std::endl; for (auto i : predicate_colors) diff --git a/tests/fe/fe_enriched_color_03.cc b/tests/fe/fe_enriched_color_03.cc index ad0624573c..737038583a 100644 --- a/tests/fe/fe_enriched_color_03.cc +++ b/tests/fe/fe_enriched_color_03.cc @@ -43,9 +43,9 @@ template struct EnrichmentPredicate { - EnrichmentPredicate(const Point origin, const double radius) : - origin(origin), - radius(radius) + EnrichmentPredicate(const Point origin, const double radius) + : origin(origin) + , radius(radius) {} template @@ -108,8 +108,9 @@ main(int argc, char **argv) // Do manual coloring since we are not testing coloring function here! std::vector predicate_colors; predicate_colors.resize(vec_predicates.size()); - ColorEnriched::internal::color_predicates( - dof_handler, vec_predicates, predicate_colors); + ColorEnriched::internal::color_predicates(dof_handler, + vec_predicates, + predicate_colors); // Make required objects to call function set_cellwise_color_set_and_fe_index std::map> diff --git a/tests/fe/fe_enriched_color_04.cc b/tests/fe/fe_enriched_color_04.cc index 58cd190d30..e572ed515a 100644 --- a/tests/fe/fe_enriched_color_04.cc +++ b/tests/fe/fe_enriched_color_04.cc @@ -41,9 +41,9 @@ template struct EnrichmentPredicate { - EnrichmentPredicate(const Point origin, const double radius) : - origin(origin), - radius(radius) + EnrichmentPredicate(const Point origin, const double radius) + : origin(origin) + , radius(radius) {} template @@ -107,8 +107,10 @@ main(int argc, char **argv) // Do manual coloring since we are not testing coloring function here! std::vector predicate_colors; predicate_colors.resize(vec_predicates.size()); - unsigned int num_colors = ColorEnriched::internal::color_predicates( - dof_handler, vec_predicates, predicate_colors); + unsigned int num_colors = + ColorEnriched::internal::color_predicates(dof_handler, + vec_predicates, + predicate_colors); // Make required objects to call function set_cellwise_color_set_and_fe_index diff --git a/tests/fe/fe_enriched_color_05.cc b/tests/fe/fe_enriched_color_05.cc index cfc341bec9..02a4d5b6d4 100644 --- a/tests/fe/fe_enriched_color_05.cc +++ b/tests/fe/fe_enriched_color_05.cc @@ -52,9 +52,9 @@ template struct EnrichmentPredicate { - EnrichmentPredicate(const Point origin, const double radius) : - origin(origin), - radius(radius) + EnrichmentPredicate(const Point origin, const double radius) + : origin(origin) + , radius(radius) {} template @@ -179,8 +179,10 @@ main(int argc, char **argv) // find colors for predicates std::vector predicate_colors; predicate_colors.resize(vec_predicates.size()); - unsigned int num_colors = ColorEnriched::internal::color_predicates( - dof_handler, vec_predicates, predicate_colors); + unsigned int num_colors = + ColorEnriched::internal::color_predicates(dof_handler, + vec_predicates, + predicate_colors); // Make required objects to call function set_cellwise_color_set_and_fe_index std::map> diff --git a/tests/fe/fe_enriched_color_06.cc b/tests/fe/fe_enriched_color_06.cc index 3b48a1b67b..3488db483a 100644 --- a/tests/fe/fe_enriched_color_06.cc +++ b/tests/fe/fe_enriched_color_06.cc @@ -48,9 +48,9 @@ template struct EnrichmentPredicate { - EnrichmentPredicate(const Point origin, const double radius) : - origin(origin), - radius(radius) + EnrichmentPredicate(const Point origin, const double radius) + : origin(origin) + , radius(radius) {} template @@ -121,9 +121,11 @@ main(int argc, char **argv) // Construct helper class to construct fe collection FE_Q fe_base(2); FE_Q fe_enriched(1); - static ColorEnriched::Helper fe_space( - fe_base, fe_enriched, vec_predicates, vec_enrichments); - const hp::FECollection &fe_collection( + static ColorEnriched::Helper fe_space(fe_base, + fe_enriched, + vec_predicates, + vec_enrichments); + const hp::FECollection & fe_collection( fe_space.build_fe_collection(dof_handler)); // check if fe_collection is correctly constructed by function diff --git a/tests/fe/fe_enriched_color_07.cc b/tests/fe/fe_enriched_color_07.cc index 083c61ce30..827d7e3675 100644 --- a/tests/fe/fe_enriched_color_07.cc +++ b/tests/fe/fe_enriched_color_07.cc @@ -79,11 +79,15 @@ class SigmaFunction : public Function FunctionParser func; public: - SigmaFunction() : Function(), func(1) + SigmaFunction() + : Function() + , func(1) {} // to help with resize function. doesn't copy function parser(func)! - SigmaFunction(SigmaFunction &&other) : center(other.center), func(1) + SigmaFunction(SigmaFunction &&other) + : center(other.center) + , func(1) {} void @@ -165,9 +169,9 @@ SigmaFunction::value_list(const std::vector> &points, template struct EnrichmentPredicate { - EnrichmentPredicate(const Point origin, const double radius) : - origin(origin), - radius(radius) + EnrichmentPredicate(const Point origin, const double radius) + : origin(origin) + , radius(radius) {} template @@ -200,28 +204,28 @@ class SplineEnrichmentFunction : public Function public: SplineEnrichmentFunction(const Point & origin, const std::vector &interpolation_points_1d, - const std::vector &interpolation_values_1d) : - Function(1), - origin(origin), - interpolation_points(interpolation_points_1d), - interpolation_values(interpolation_values_1d), - cspline(interpolation_points, interpolation_values) + const std::vector &interpolation_values_1d) + : Function(1) + , origin(origin) + , interpolation_points(interpolation_points_1d) + , interpolation_values(interpolation_values_1d) + , cspline(interpolation_points, interpolation_values) {} - SplineEnrichmentFunction(SplineEnrichmentFunction &&other) : - Function(1), - origin(other.origin), - interpolation_points(other.interpolation_points), - interpolation_values(other.interpolation_values), - cspline(interpolation_points, interpolation_values) + SplineEnrichmentFunction(SplineEnrichmentFunction &&other) + : Function(1) + , origin(other.origin) + , interpolation_points(other.interpolation_points) + , interpolation_values(other.interpolation_values) + , cspline(interpolation_points, interpolation_values) {} - SplineEnrichmentFunction(const SplineEnrichmentFunction &other) : - Function(1), - origin(other.origin), - interpolation_points(other.interpolation_points), - interpolation_values(other.interpolation_values), - cspline(interpolation_points, interpolation_values) + SplineEnrichmentFunction(const SplineEnrichmentFunction &other) + : Function(1) + , origin(other.origin) + , interpolation_points(other.interpolation_points) + , interpolation_values(other.interpolation_values) + , cspline(interpolation_points, interpolation_values) {} @@ -418,9 +422,9 @@ ParameterCollection::ParameterCollection(const std::string &file_name) if (line == "#end-of-dealii parser") break; - AssertThrow( - line == "#end-of-dealii parser", - ExcMessage("line missing in parameter file = \'#end-of-dealii parser\' ")); + AssertThrow(line == "#end-of-dealii parser", + ExcMessage( + "line missing in parameter file = \'#end-of-dealii parser\' ")); // function to read next line not starting with # or empty auto read_next_proper_line = [&](std::string &line) { @@ -515,27 +519,27 @@ ParameterCollection::ParameterCollection( const unsigned int & n_enrichments, const std::vector &points_enrichments, const std::vector &radii_predicates, - const std::vector &sigmas) : - dim(dim), - size(size), - shape(shape), - global_refinement(global_refinement), - cycles(cycles), - fe_base_degree(fe_base_degree), - fe_enriched_degree(fe_enriched_degree), - max_iterations(max_iterations), - tolerance(tolerance), - rhs_value_expr(rhs_value_expr), - boundary_value_expr(boundary_value_expr), - rhs_radial_problem(rhs_radial_problem), - boundary_radial_problem(boundary_radial_problem), - exact_soln_expr(exact_soln_expr), - patches(patches), - debug_level(debug_level), - n_enrichments(n_enrichments), - points_enrichments(points_enrichments), - radii_predicates(radii_predicates), - sigmas(sigmas) + const std::vector &sigmas) + : dim(dim) + , size(size) + , shape(shape) + , global_refinement(global_refinement) + , cycles(cycles) + , fe_base_degree(fe_base_degree) + , fe_enriched_degree(fe_enriched_degree) + , max_iterations(max_iterations) + , tolerance(tolerance) + , rhs_value_expr(rhs_value_expr) + , boundary_value_expr(boundary_value_expr) + , rhs_radial_problem(rhs_radial_problem) + , boundary_radial_problem(boundary_radial_problem) + , exact_soln_expr(exact_soln_expr) + , patches(patches) + , debug_level(debug_level) + , n_enrichments(n_enrichments) + , points_enrichments(points_enrichments) + , radii_predicates(radii_predicates) + , sigmas(sigmas) {} @@ -665,16 +669,16 @@ EstimateEnrichmentFunction::EstimateEnrichmentFunction( const double & sigma, const std::string &rhs_expr, const std::string &boundary_expr, - const double & refinement) : - center(center), - domain_size(domain_size), - sigma(sigma), - rhs_expr(rhs_expr), - boundary_expr(boundary_expr), - debug_level(0), - refinement(refinement), - fe(1), - dof_handler(triangulation) + const double & refinement) + : center(center) + , domain_size(domain_size) + , sigma(sigma) + , rhs_expr(rhs_expr) + , boundary_expr(boundary_expr) + , debug_level(0) + , refinement(refinement) + , fe(1) + , dof_handler(triangulation) { left_bound = center[0] - domain_size / 2; right_bound = center[0] + domain_size / 2; @@ -688,17 +692,17 @@ EstimateEnrichmentFunction::EstimateEnrichmentFunction( const double & sigma, const std::string &rhs_expr, const std::string &boundary_expr, - const double & refinement) : - center(center), - left_bound(left_bound), - right_bound(right_bound), - sigma(sigma), - rhs_expr(rhs_expr), - boundary_expr(boundary_expr), - debug_level(0), - refinement(refinement), - fe(1), - dof_handler(triangulation) + const double & refinement) + : center(center) + , left_bound(left_bound) + , right_bound(right_bound) + , sigma(sigma) + , rhs_expr(rhs_expr) + , boundary_expr(boundary_expr) + , debug_level(0) + , refinement(refinement) + , fe(1) + , dof_handler(triangulation) { domain_size = right_bound - left_bound; } @@ -770,8 +774,9 @@ EstimateEnrichmentFunction::assemble_system() for (unsigned int i = 0; i < dofs_per_cell; ++i) { for (unsigned int j = 0; j < dofs_per_cell; ++j) - system_matrix.add( - local_dof_indices[i], local_dof_indices[j], cell_matrix(i, j)); + system_matrix.add(local_dof_indices[i], + local_dof_indices[j], + cell_matrix(i, j)); system_rhs(local_dof_indices[i]) += cell_rhs(i); } } @@ -779,13 +784,19 @@ EstimateEnrichmentFunction::assemble_system() SigmaFunction<1> boundary_func; boundary_func.initialize(center, sigma, boundary_expr); - VectorTools::interpolate_boundary_values( - dof_handler, 0, boundary_func, boundary_values); - VectorTools::interpolate_boundary_values( - dof_handler, 1, boundary_func, boundary_values); - - MatrixTools::apply_boundary_values( - boundary_values, system_matrix, solution, system_rhs); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + boundary_func, + boundary_values); + VectorTools::interpolate_boundary_values(dof_handler, + 1, + boundary_func, + boundary_values); + + MatrixTools::apply_boundary_values(boundary_values, + system_matrix, + solution, + system_rhs); } @@ -807,8 +818,10 @@ EstimateEnrichmentFunction::refine_grid() typename FunctionMap<1>::type(), solution, estimated_error_per_cell); - GridRefinement::refine_and_coarsen_fixed_number( - triangulation, estimated_error_per_cell, 0.2, 0.01); + GridRefinement::refine_and_coarsen_fixed_number(triangulation, + estimated_error_per_cell, + 0.2, + 0.01); triangulation.execute_coarsening_and_refinement(); } @@ -883,8 +896,10 @@ EstimateEnrichmentFunction::evaluate_at_x_values( // its quadrature points can cause x to be twice! for (unsigned int i = 0; i != interpolation_values.size(); ++i) { - double value = VectorTools::point_value( - dof_handler, solution, Point<1>(interpolation_points[i])); + double value = + VectorTools::point_value(dof_handler, + solution, + Point<1>(interpolation_points[i])); interpolation_values[i] = value; } } @@ -960,8 +975,9 @@ plot_shape_function(hp::DoFHandler &dof_handler, unsigned int patches = 5) hp::MappingCollection hp_mapping; for (unsigned int i = 0; i < dof_handler.get_fe_collection().size(); ++i) hp_mapping.push_back(mapping); - DoFTools::map_dofs_to_support_points( - hp_mapping, dof_handler, support_points); + DoFTools::map_dofs_to_support_points(hp_mapping, + dof_handler, + support_points); const std::string base_filename = "DOFs" + dealii::Utilities::int_to_string(dim) + "_p" + @@ -1111,17 +1127,17 @@ protected: template -LaplaceProblem::LaplaceProblem() : - prm(), - n_enriched_cells(0), - dof_handler(triangulation), - fe_base(prm.fe_base_degree), - fe_enriched(prm.fe_enriched_degree), - fe_nothing(1, true), - mpi_communicator(MPI_COMM_WORLD), - n_mpi_processes(Utilities::MPI::n_mpi_processes(mpi_communicator)), - this_mpi_process(Utilities::MPI::this_mpi_process(mpi_communicator)), - pcout(std::cout, (this_mpi_process == 0)) +LaplaceProblem::LaplaceProblem() + : prm() + , n_enriched_cells(0) + , dof_handler(triangulation) + , fe_base(prm.fe_base_degree) + , fe_enriched(prm.fe_enriched_degree) + , fe_nothing(1, true) + , mpi_communicator(MPI_COMM_WORLD) + , n_mpi_processes(Utilities::MPI::n_mpi_processes(mpi_communicator)) + , this_mpi_process(Utilities::MPI::this_mpi_process(mpi_communicator)) + , pcout(std::cout, (this_mpi_process == 0)) { prm.print(); @@ -1131,17 +1147,17 @@ LaplaceProblem::LaplaceProblem() : template -LaplaceProblem::LaplaceProblem(const ParameterCollection &_par) : - prm(_par), - n_enriched_cells(0), - dof_handler(triangulation), - fe_base(prm.fe_base_degree), - fe_enriched(prm.fe_enriched_degree), - fe_nothing(1, true), - mpi_communicator(MPI_COMM_WORLD), - n_mpi_processes(Utilities::MPI::n_mpi_processes(mpi_communicator)), - this_mpi_process(Utilities::MPI::this_mpi_process(mpi_communicator)), - pcout(std::cout, (this_mpi_process == 0) && (prm.debug_level >= 1)) +LaplaceProblem::LaplaceProblem(const ParameterCollection &_par) + : prm(_par) + , n_enriched_cells(0) + , dof_handler(triangulation) + , fe_base(prm.fe_base_degree) + , fe_enriched(prm.fe_enriched_degree) + , fe_nothing(1, true) + , mpi_communicator(MPI_COMM_WORLD) + , n_mpi_processes(Utilities::MPI::n_mpi_processes(mpi_communicator)) + , this_mpi_process(Utilities::MPI::this_mpi_process(mpi_communicator)) + , pcout(std::cout, (this_mpi_process == 0) && (prm.debug_level >= 1)) { AssertThrow(prm.dim == dim, ExcMessage("parameter file dim != problem dim")); prm.print(); @@ -1301,8 +1317,9 @@ LaplaceProblem::make_enrichment_functions() // construct enrichment function and push Point p; prm.set_enrichment_point(p, i); - SplineEnrichmentFunction func( - p, interpolation_points, interpolation_values); + SplineEnrichmentFunction func(p, + interpolation_points, + interpolation_values); vec_enrichments.push_back( std::make_shared>(func)); } @@ -1340,8 +1357,10 @@ LaplaceProblem::build_fe_space() pcout << "...building fe space" << std::endl; make_enrichment_functions(); - static ColorEnriched::Helper fe_space( - fe_base, fe_enriched, vec_predicates, vec_enrichments); + static ColorEnriched::Helper fe_space(fe_base, + fe_enriched, + vec_predicates, + vec_enrichments); fe_collection = std::make_shared>( fe_space.build_fe_collection(dof_handler)); pcout << "size of fe collection: " << fe_collection->size() << std::endl; @@ -1447,8 +1466,10 @@ LaplaceProblem::setup_system() boundary_value_func.initialize(p, prm.sigmas[0], prm.boundary_value_expr); - VectorTools::interpolate_boundary_values( - dof_handler, 0, boundary_value_func, constraints); + VectorTools::interpolate_boundary_values(dof_handler, + 0, + boundary_value_func, + constraints); constraints.close(); // Initialise the stiffness and mass matrices @@ -1458,11 +1479,15 @@ LaplaceProblem::setup_system() for (unsigned int i = 0; i < n_mpi_processes; ++i) n_locally_owned_dofs[i] = locally_owned_dofs_per_proc[i].n_elements(); - SparsityTools::distribute_sparsity_pattern( - dsp, n_locally_owned_dofs, mpi_communicator, locally_relevant_dofs); + SparsityTools::distribute_sparsity_pattern(dsp, + n_locally_owned_dofs, + mpi_communicator, + locally_relevant_dofs); - system_matrix.reinit( - locally_owned_dofs, locally_owned_dofs, dsp, mpi_communicator); + system_matrix.reinit(locally_owned_dofs, + locally_owned_dofs, + dsp, + mpi_communicator); solution.reinit(locally_owned_dofs, mpi_communicator); system_rhs.reinit(locally_owned_dofs, mpi_communicator); @@ -1622,8 +1647,10 @@ LaplaceProblem::refine_grid() distributed_all_errors(i) = local_error_per_cell(i); distributed_all_errors.compress(VectorOperation::insert); const Vector localized_all_errors(distributed_all_errors); - GridRefinement::refine_and_coarsen_fixed_fraction( - triangulation, localized_all_errors, 0.85, 0); + GridRefinement::refine_and_coarsen_fixed_fraction(triangulation, + localized_all_errors, + 0.85, + 0); triangulation.execute_coarsening_and_refinement(); ++prm.global_refinement; } @@ -1644,8 +1671,9 @@ LaplaceProblem::output_results(const unsigned int cycle) { // create exact solution vector exact_soln_vector.reinit(dof_handler.n_dofs()); - exact_solution.initialize( - Point(), prm.sigmas[0], prm.exact_soln_expr); + exact_solution.initialize(Point(), + prm.sigmas[0], + prm.exact_soln_expr); VectorTools::project(dof_handler, constraints, q_collection, @@ -1697,8 +1725,9 @@ LaplaceProblem::process_solution() pcout << "...using exact solution for error calculation" << std::endl; SigmaFunction exact_solution; - exact_solution.initialize( - Point(), prm.sigmas[0], prm.exact_soln_expr); + exact_solution.initialize(Point(), + prm.sigmas[0], + prm.exact_soln_expr); VectorTools::integrate_difference(dof_handler, localized_solution, @@ -1706,8 +1735,9 @@ LaplaceProblem::process_solution() difference_per_cell, q_collection, VectorTools::L2_norm); - L2_error = VectorTools::compute_global_error( - triangulation, difference_per_cell, VectorTools::L2_norm); + L2_error = VectorTools::compute_global_error(triangulation, + difference_per_cell, + VectorTools::L2_norm); VectorTools::integrate_difference(dof_handler, localized_solution, @@ -1715,8 +1745,9 @@ LaplaceProblem::process_solution() difference_per_cell, q_collection, VectorTools::H1_norm); - H1_error = VectorTools::compute_global_error( - triangulation, difference_per_cell, VectorTools::H1_norm); + H1_error = VectorTools::compute_global_error(triangulation, + difference_per_cell, + VectorTools::H1_norm); } pcout << "refinement h_smallest Dofs L2_norm H1_norm" << std::endl; @@ -1780,8 +1811,10 @@ LaplaceProblem::run() difference_per_cell, q_collection, VectorTools::H1_norm); - norm_soln_new = VectorTools::compute_global_error( - triangulation, difference_per_cell, VectorTools::H1_norm); + norm_soln_new = + VectorTools::compute_global_error(triangulation, + difference_per_cell, + VectorTools::H1_norm); // relative change can only be calculated for cycle > 0 if (cycle > 0) { diff --git a/tests/fe/fe_enriched_color_08.cc b/tests/fe/fe_enriched_color_08.cc index ec12286211..f58cab5ab8 100644 --- a/tests/fe/fe_enriched_color_08.cc +++ b/tests/fe/fe_enriched_color_08.cc @@ -105,8 +105,9 @@ plot_shape_function(hp::DoFHandler &dof_handler, unsigned int patches = 5) hp::MappingCollection hp_mapping; for (unsigned int i = 0; i < dof_handler.get_fe_collection().size(); ++i) hp_mapping.push_back(mapping); - DoFTools::map_dofs_to_support_points( - hp_mapping, dof_handler, support_points); + DoFTools::map_dofs_to_support_points(hp_mapping, + dof_handler, + support_points); const std::string base_filename = "DOFs" + dealii::Utilities::int_to_string(dim) + "_p" + @@ -172,9 +173,9 @@ plot_shape_function(hp::DoFHandler &dof_handler, unsigned int patches = 5) template struct EnrichmentPredicate { - EnrichmentPredicate(const Point origin, const double radius) : - origin(origin), - radius(radius) + EnrichmentPredicate(const Point origin, const double radius) + : origin(origin) + , radius(radius) {} template @@ -249,9 +250,11 @@ main(int argc, char **argv) FE_Q fe_base(2); FE_Q fe_enriched(1); - static ColorEnriched::Helper fe_space( - fe_base, fe_enriched, vec_predicates, vec_enrichments); - hp::FECollection fe_collection( + static ColorEnriched::Helper fe_space(fe_base, + fe_enriched, + vec_predicates, + vec_enrichments); + hp::FECollection fe_collection( fe_space.build_fe_collection(dof_handler)); // check if fe_collection is correctly constructed by function -- 2.39.5