From: Wolfgang Bangerth Date: Mon, 22 Jun 2009 15:46:08 +0000 (+0000) Subject: Interpolate potential and put it into the output. Refine once more. X-Git-Tag: v8.0.0~7596 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a34fceb1c61e9fddaa2b39434bf53cae319fdaa6;p=dealii.git Interpolate potential and put it into the output. Refine once more. git-svn-id: https://svn.dealii.org/trunk@18954 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-36/step-36.cc b/deal.II/examples/step-36/step-36.cc index a626278112..c6df42a99b 100644 --- a/deal.II/examples/step-36/step-36.cc +++ b/deal.II/examples/step-36/step-36.cc @@ -101,7 +101,7 @@ template void EigenvalueProblem::make_grid_and_dofs () { GridGenerator::hyper_cube (triangulation, -1, 1); - triangulation.refine_global (4); + triangulation.refine_global (5); dof_handler.distribute_dofs (fe); CompressedSimpleSparsityPattern csp (dof_handler.n_dofs(), @@ -215,6 +215,16 @@ void EigenvalueProblem::output_results () const std::string("solution") + Utilities::int_to_string(i)); + Vector projected_potential (dof_handler.n_dofs()); + FunctionParser potential; + potential.initialize ((dim == 2 ? + "x,y" : + "x,y,z"), + parameters.get ("Potential"), + typename FunctionParser::ConstMap()); + VectorTools::interpolate (dof_handler, potential, projected_potential); + data_out.add_data_vector (projected_potential, "interpolated_potential"); + data_out.build_patches (); std::ofstream output ("eigenvectors.vtk");