After that I imposed boundary condition as exact with u(x,y) = =g
Lastly, I compared my numerical solution with manufactured exact solution using Vectortools::integrate_difference. l2norm
template <int dim>
void msurface<dim>::evaluate_error()
{
Vector<float> difference_per_cell (triangulation.n_active_cells());
VectorTools::integrate_difference (dof_handler,solution,Solution<dim>(),
difference_per_cell,QGauss<dim>(degree+2),VectorTools::L2_norm);
const double L2_error = difference_per_cell.l2_norm();
std::cout << " L2_error : " << L2_error << std::endl;
error=L2_error;
}
However, I the error graph I get was as follow...
I think that I didn't make any mistake on my code lines because at least my numerical solution is converging for the case p=1.
but I couldn't get such convergence for the case p=2, and 3. I have tried to change tolerance number in iterative scheme, but it didn't work.
Are there other things that I failed to consider?
Or did I make wrong way to test the code?
I think that I didn't make any mistake on my code lines because at least my numerical solution is converging for the case p=1.
but I couldn't get such convergence for the case p=2, and 3. I have tried to change tolerance number in iterative scheme, but it didn't work.
Are there other things that I failed to consider?
Or did I make wrong way to test the code?
template <int dim>
void msurface<dim>::assemble_system ()
{
const MappingQ<dim> mapping (degree);
const QGauss<dim> quadrature_formula(degree+2);
FEValues<dim> fe_values (mapping, fe, quadrature_formula,
update_values | update_gradients |
update_quadrature_points | update_JxW_values);
....
I am pretty sure that I am using right quadrature here....
but I am not sure whether I am using right quadrature when I compare my numerical solution to exact solution..
VectorTools::integrate_difference (dof_handler,solution,Solution<dim>(),
difference_per_cell,QGauss<dim>(degree+2),VectorTools::L2_norm);
Thanks again for fast reply!!
[...]
VectorTools::integrate_difference (dof_handler,solution,Solution<dim>(),
difference_per_cell,QGauss<dim>(degree+2),VectorTools::L2_norm);
template <int dim>
void msurface<dim>::evaluate_error()
{
Vector<float> difference_per_cell (triangulation.n_active_cells());
const MappingQ<dim> mapping (degree);
VectorTools::integrate_difference (mapping, dof_handler,solution,Solution<dim>(),
difference_per_cell,QGauss<dim>(degree+2),VectorTools::L2_norm);
const double L2_error = difference_per_cell.l2_norm();
std::cout << " L2_error : " << L2_error << std::endl;
error=L2_error;
}
Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
KellyErrorEstimator<dim>::estimate (dof_handler,
QGauss<dim-1>(3),
typename FunctionMap<dim>::type(),
solution,
estimated_error_per_cell);