From 74f9bd837cf8d2073876aff1e4639623657ecf64 Mon Sep 17 00:00:00 2001 From: carraro Date: Tue, 9 Aug 2011 05:18:08 +0000 Subject: [PATCH] Fixed problem with initializing xfem fevalues. The test works and the convergence is ~1.7. Check if convergence is OK! git-svn-id: https://svn.dealii.org/trunk@24034 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-47/Makefile | 2 +- deal.II/examples/step-47/step-47.cc | 29 ++++++++++++++++++----------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/deal.II/examples/step-47/Makefile b/deal.II/examples/step-47/Makefile index 926ea1ca23..b994ce8f56 100644 --- a/deal.II/examples/step-47/Makefile +++ b/deal.II/examples/step-47/Makefile @@ -14,7 +14,7 @@ target = $(basename $(shell echo step-*.cc)) # run-time checking of parameters and internal states is performed, so # you should set this value to `on' while you develop your program, # and to `off' when running production computations. -debug-mode = on +debug-mode = off # As third field, we need to give the path to the top-level deal.II diff --git a/deal.II/examples/step-47/step-47.cc b/deal.II/examples/step-47/step-47.cc index 5f5b3a8bd2..a442fb28ba 100644 --- a/deal.II/examples/step-47/step-47.cc +++ b/deal.II/examples/step-47/step-47.cc @@ -148,11 +148,11 @@ void Coefficient::value_list (const std::vector > &points, for (unsigned int i=0; i::assemble_system () plain_fe_values.shape_grad(j,q_point) * plain_fe_values.JxW(q_point)); + cell_rhs(i) += (plain_fe_values.shape_value(i,q_point) * 1.0 * plain_fe_values.JxW(q_point)); @@ -336,8 +337,9 @@ void LaplaceProblem::assemble_system () compute_quadrature(quadrature_formula, cell, level_set_values).second, update_values | update_gradients | - update_quadrature_points | update_JxW_values | - update_support_points); + update_quadrature_points | update_JxW_values ); + + this_fe_values.reinit (cell); coefficient_values.resize (this_fe_values.n_quadrature_points); coefficient.value_list (this_fe_values.get_quadrature_points(), @@ -422,6 +424,7 @@ void LaplaceProblem::assemble_system () system_matrix, system_rhs); } + std::map boundary_values; VectorTools::interpolate_boundary_values (dof_handler, 0, @@ -431,6 +434,7 @@ void LaplaceProblem::assemble_system () system_matrix, solution, system_rhs); + } // To integrate the enriched elements we have to find the geometrical decomposition @@ -987,7 +991,8 @@ void LaplaceProblem::output_results (const unsigned int cycle) const std::string filename = "solution-"; filename += ('0' + cycle); - filename += ".vtk"; + //filename += ".vtk"; + filename += ".gmv"; std::ofstream output (filename.c_str()); @@ -999,7 +1004,8 @@ void LaplaceProblem::output_results (const unsigned int cycle) const data_out.add_data_vector (solution, postprocessor); data_out.build_patches (5); - data_out.write_vtk (output); + //data_out.write_vtk (output); + data_out.write_gmv (output); } @@ -1055,18 +1061,19 @@ void LaplaceProblem::compute_error () const template void LaplaceProblem::run () { - for (unsigned int cycle=0; cycle<8; ++cycle) + for (unsigned int cycle=0; cycle<6; ++cycle) { std::cout << "Cycle " << cycle << ':' << std::endl; if (cycle == 0) { GridGenerator::hyper_ball (triangulation); + //GridGenerator::hyper_cube (triangulation, -1, 1); static const HyperBallBoundary boundary; triangulation.set_boundary (0, boundary); - triangulation.refine_global (3); + triangulation.refine_global (2); } else triangulation.refine_global (1); -- 2.39.5