Hey there!
For cell-wise error estimation calculations, I want to use the 'approximate_gradient', 'approximate_derivative_tensor' and similar functionality available in 'DerivativeApproximation' namespace (
here). So I made the appropriate function calls and here is the code-snippet of it -
Tensor<2,2> cell_hessian;
Tensor<1,2> cell_grad;
float magnitude = 0.;
DoFHandler<2>::active_cell_iterator
cell = dof_handler.begin_active(),
endc = dof_handler.end();
for (; cell!=endc; ++cell)
{
DerivativeApproximation::approximate_derivative_tensor(dof_handler, solution, cell, cell_grad, unsigned int);
DerivativeApproximation::approximate_derivative_tensor(dof_handler, solution, cell, cell_hessian, unsigned int);
magnitude = DerivativeApproximation::derivative_norm(cell_grad);
...
I get compilation errors and couldn't find why?
The errors:
solver1.cc:171:98: error: expected primary-expression before ‘unsigned’
DerivativeApproximation::approximate_derivative_tensor(dof_handler, solution, cell, cell_grad, unsigned int);
^
solver1.cc:173:101: error: expected primary-expression before ‘unsigned’
DerivativeApproximation::approximate_derivative_tensor(dof_handler, solution, cell, cell_hessian, unsigned int);
^
I do understand that the tensor argument is passed wrong, but can't figure out? I do have proper dof_handler, solution objects.
Please point out the mistake, thank you in advance!