From: bangerth Date: Thu, 11 Sep 2008 00:53:38 +0000 (+0000) Subject: Have a slightly more interesting testcase. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd172acfc2eb5a1c9d2d68185204a79fb6fee446;p=dealii-svn.git Have a slightly more interesting testcase. git-svn-id: https://svn.dealii.org/trunk@16802 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-32/step-32.cc b/deal.II/examples/step-32/step-32.cc index b4ca72e2a4..6e1112c05a 100644 --- a/deal.II/examples/step-32/step-32.cc +++ b/deal.II/examples/step-32/step-32.cc @@ -123,10 +123,10 @@ namespace EquationData template double - TemperatureInitialValues::value (const Point &, + TemperatureInitialValues::value (const Point &p, const unsigned int) const { - return 0; + return (p.norm() < 0.55+0.02*std::sin(p[0]*20) ? 1 : 0); } @@ -158,25 +158,10 @@ namespace EquationData template double - TemperatureRightHandSide::value (const Point &p, + TemperatureRightHandSide::value (const Point &, const unsigned int /*component*/) const { - static const Point source_centers[3] - = { (dim == 2 ? Point(.3,.1) : Point(.3,.5,.1)), - (dim == 2 ? Point(.45,.1) : Point(.45,.5,.1)), - (dim == 2 ? Point(.75,.1) : Point(.75,.5,.1)) }; - static const double source_radius - = (dim == 2 ? 1./32 : 1./8); - - return ((source_centers[0].distance (p) < source_radius) - || - (source_centers[1].distance (p) < source_radius) - || - (source_centers[2].distance (p) < source_radius) - ? - 1 - : - 0); + return 0; } @@ -933,9 +918,10 @@ void BoussinesqFlowProblem::assemble_stokes_system () - div_phi_u[i] * phi_p[j] - phi_p[i] * div_phi_u[j]) * stokes_fe_values.JxW(q); - - const Point gravity = ( (dim == 2) ? (Point (0,1)) : - (Point (0,0,1)) ); + + // use gravity radially outward + const Point gravity = stokes_fe_values.quadrature_point(q) / + stokes_fe_values.quadrature_point(q).norm(); for (unsigned int i=0; i::solve () time_step = 1./(std::sqrt(2.)*dim*std::sqrt(1.*dim)) / temperature_degree * GridTools::minimal_cell_diameter(triangulation) / - std::max (get_maximal_velocity(), .01); + std::max (get_maximal_velocity(), 1.e-5); temperature_solution = old_temperature_solution; @@ -1481,11 +1467,15 @@ void BoussinesqFlowProblem::refine_mesh (const unsigned int max_grid_level) template void BoussinesqFlowProblem::run () { - const unsigned int initial_refinement = (dim == 2 ? 4 : 2); + const unsigned int initial_refinement = (dim == 2 ? 3 : 2); const unsigned int n_pre_refinement_steps = (dim == 2 ? 4 : 3); + GridGenerator::half_hyper_shell (triangulation, + Point(), 0.5, 1.0); + + static HalfHyperShellBoundary boundary; + triangulation.set_boundary (0, boundary); - GridGenerator::hyper_cube (triangulation); triangulation.refine_global (initial_refinement); setup_dofs();