Sumedh,

use DerivativeApproximation::approximate_derivative_tensor(dof_handler, 
solution, cell, cell_grad) or 
DerivativeApproximation::approximate_derivative_tensor(dof_handler, 
solution, cell, cell_grad, 0)

Best,

Bruno

On Wednesday, February 15, 2017 at 10:03:28 AM UTC-5, Sumedh Yadav wrote:
>
> Hey Jean,
> Thank you for the reply.
> I understood what you mean to imply, but I still get compilation errors.
> The modified code-snippet:
>
>         
> DerivativeApproximation::approximate_derivative_tensor(dof_handler, 
> solution, cell, cell_grad, unsigned int a = 0);
>         
> DerivativeApproximation::approximate_derivative_tensor(dof_handler, 
> solution, cell, cell_hessian, const unsigned int a = 0);
>
>  The error:
> solver1.cc:172:102: error: expected primary-expression before ‘unsigned’
>        DerivativeApproximation::approximate_derivative_tensor(dof_handler, 
> solution, cell, cell_grad, unsigned int a = 0);
>                               
>                                                                               
>                                       
> ^
> solver1.cc:174:105: error: expected primary-expression before ‘const’
>        DerivativeApproximation::approximate_derivative_tensor(dof_handler, 
> solution, cell, cell_hessian, const unsigned int a = 0);
>                                                                               
>                                                                         
> ^
> I comprehend that component argument passing should not be a problem since 
> it is by default = 0 (and I have only 1 scalar field). The syntax error 
> shall be coming from the tensors cell_grad and cell_hessian.
>
> On Wednesday, 15 February 2017 16:42:55 UTC+5:30, Sumedh Yadav wrote:
>>
>> 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 
>> <http://dealii.org/developer/doxygen/deal.II/namespaceDerivativeApproximation.html>).
>>  
>> 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!
>>
>

-- 
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