]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Interpolate potential and put it into the output. Refine once more.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 22 Jun 2009 15:46:08 +0000 (15:46 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 22 Jun 2009 15:46:08 +0000 (15:46 +0000)
git-svn-id: https://svn.dealii.org/trunk@18954 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-36/step-36.cc

index a6262781129d14f5e848ee11dd03f1eb520f6521..c6df42a99b99f200f6600d1b5cff8b1d44eeb470 100644 (file)
@@ -101,7 +101,7 @@ template <int dim>
 void EigenvalueProblem<dim>::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<dim>::output_results () const
                              std::string("solution") +
                              Utilities::int_to_string(i));
 
+  Vector<double> projected_potential (dof_handler.n_dofs());
+  FunctionParser<dim> potential;
+  potential.initialize ((dim == 2 ?
+                        "x,y" :
+                        "x,y,z"),
+                       parameters.get ("Potential"),
+                       typename FunctionParser<dim>::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");

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.