In the following is a snippet of my code, some remarks for a better
understanding:
(I access my history variables via a CellDataStorage object. The Variable
"comp_0" is the value at the QP of my current mesh, the variable "comp_0_ref"
is the corresponding value of the reference solution on the same QP).
------------------------------------------------------------------------------------------------
Functions::FEFieldFunction<dim> fe_field(dof_handler_scalar_ar,
reference_solution_n[0]);
cell=dof_handler_scalar.begin_active();
for(; cell!=endc; cell++)
{
fe_values.reinit(cell);
std::vector<std::shared_ptr<PointHistory<dim>>> lqph =
quadrature_point_history.get_data(cell);
double error_cell=0;
for(unsigned int q=0; q<qf_cell.size(); q++)
{
const double JxW = fe_values.JxW(q);
Vector<double> projection_variables =
lqph[q]->create_vector_for_projection();
double comp_0 = projection_variables(0);
error_cell += ((comp_0 - comp_0_ref)*(comp_0 - comp_0_ref)*JxW);
}
std::cout<<"Local cell error: "<<std::sqrt(error_cell)<<" , ";
}
------------------------------------------------------------------------------------------
I had a look in the implementation of the integrate_difference function with
case == L2 as well.
However I could not identify any differences to my own implementation.
My question is if there is a mistake in my code snippet, i.e in the way how I
calculate the integrals for the cell errors?
On each cell, I basically multiply the squared abs-value of the difference
with the JxW-Value, sum those values up and finally take the square root.
Yes, this looks correct to me, but I don't know what the PointHistory class
does and what create_vector_for_projection() does or return.
To start figuring out where things go wrong, first determine whether comp_0 or
comp_0_ref are wrong. You could, for example, compute their L2 norms
separately and compare with what you have.
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email: [email protected]
www: http://www.math.colostate.edu/~bangerth/
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/bee4d5a7-abac-75b4-aba3-689bcf611ada%40colostate.edu.