From a34fceb1c61e9fddaa2b39434bf53cae319fdaa6 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 22 Jun 2009 15:46:08 +0000 Subject: [PATCH] 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 --- deal.II/examples/step-36/step-36.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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"); -- 2.39.5