Hello All,

I am trying to project the initial conditions on the following FE space: 
lsfe(FE_Q<dim>(2), dim). It is quite a straightforward job, but the error 
and plot of the projected vector (especially upon choosing constant initial 
condition to make the error basically 0) doesn't look as it supposed to be. 
I have spent couple of days figuring out what might have gone wrong, but 
couldn't find a reason. Could you check to see what's going on?

Thanks,

  update_constrains_LS(tn);  //below
  initialize_system_LS();        //below

  lsExactSolution<dim> ls_initial_values;    //below
  ls_initial_values.set_time (tn);

  VectorTools::project (ls_dof_handler,
                        ls_constraint_matrix,
                        QGauss<dim>(1+2 /*degree + 2*/),
ls_initial_values,
old_zeta);

If matters, here are the previously defined functions.




  template <int dim>
  void 
deferred_correction_with_AV_approximation1<dim>::update_constrains_LS(double 
tn)
  {
  ls_constraint_matrix.clear();
    {
  lsExactSolution<dim> ls_boundary_values;
  ls_boundary_values.set_time (tn);

  VectorTools::interpolate_boundary_values (ls_dof_handler,
                                                0,
ls_boundary_values,
                                                ls_constraint_matrix);
    }

   ls_constraint_matrix.close();

   std::cout << "Constrain Matrix has been updated for LS approximation at 
tnplus1 = " << tnplus1 << std::endl;
  }




  template <int dim>
  void 
deferred_correction_with_AV_approximation1<dim>::initialize_system_LS()
  {
    ls_system_matrix.clear();
    {
    ls_dof_handler.distribute_dofs(lsfe);

    }
    {
      DynamicSparsityPattern l_dsp (ls_dof_handler.n_dofs());
      DoFTools::make_sparsity_pattern (ls_dof_handler, l_dsp, 
ls_constraint_matrix);
      ls_sparsity_pattern.copy_from (l_dsp);
    }

    ls_system_matrix.reinit (ls_sparsity_pattern);

    zeta.reinit (ls_dof_handler.n_dofs());
    old_zeta.reinit (ls_dof_handler.n_dofs());
}


  template <int dim>
  class lsExactSolution : public Function<dim>
  {
  public:
  lsExactSolution () : Function<dim>(dim) {}
    virtual void vector_value (const Point<dim> &p,
                               Vector<double>   &value) const;
  };
  template <int dim>
  void
  lsExactSolution<dim>::vector_value (const Point<dim> &p,
                                    Vector<double>   &values) const
  {
const double t = this->get_time();
const double x = p[0];
const double y = p[1];

    values[0] = 1;
    values[1] = 0;
  }

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to