Hi Wolfgang,

In the fe_values.cc, the function 
"FEValuesViews::internal::do_function_derivatives" (for vectors), and in 
the fe_values.h, the type functions "vector::gradient" and 
"vector::symmetric_gradient"; are not clear to me because I'm not familiar 
with the data structure.

Inside the fe_values.cc, there are 3 *do_function_divergences *functions; 
for the vectors, for the tensors, and for the symmetric tensors. For the 
symmetric tensors and the tensors, (snc == -2) and (snc != -1) cases have 
been implemented but the else case is just "Assert (false, 
ExcNotImplemented());". 

For the vectors, the implementation (for the else case) is as following;

      *for* (*unsigned* *int* shape_function=0;

           shape_function<dofs_per_cell; ++shape_function)

        {

            *for* (*unsigned* *int* d=0; d<*spacedim*; ++d)

              *if* 
(shape_function_data[shape_function].is_nonzero_shape_function_component[d])

                {

                  *const* dealii::Tensor<1,*spacedim*> *shape_gradient_ptr =

                    &shape_gradients[shape_function_data[shape_function].

                                     row_index[d]][0];

                  *for* (*unsigned* *int* q_point=0; 
q_point<n_quadrature_points; ++q_point)

                    divergences[q_point] += value * 
(*shape_gradient_ptr++)[d];

                }

          }

To me, it's not clear how the "value and shape_gradient_ptr" is used or in 
general how the (e.g.) u_x+v_y+w_z is done..


For the SymmetricTensor, the code differs as;

              *const* *unsigned* *int* ii = dealii::SymmetricTensor<2,
*spacedim*>::

                                      
unrolled_to_component_indices(comp)[0];

              *const* *unsigned* *int* jj = dealii::SymmetricTensor<2,
*spacedim*>::

                                      
unrolled_to_component_indices(comp)[1];


              *for* (*unsigned* *int* q_point = 0; q_point < 
n_quadrature_points;

                   ++q_point, ++shape_gradient_ptr)

                {

                  divergences[q_point][ii] += value * 
(*shape_gradient_ptr)[jj];


                  *if* (ii != jj)

                    divergences[q_point][jj] += value * 
(*shape_gradient_ptr)[ii];

                }

I again cannot follow it. and what should I understand, that the loop over 
spacedim (or SymmetricTensor<2,*spacedim*>::n_independent_components) not 
implemented or not needed? please see, Assert (false, ExcNotImplemented());


Also, as a general question, how/where does the "Tensor<2, dim, 
spacedim>::divergence" function operate?


I'd appreciate if you could walk me through these, so that I can proceed 
with the gradient function implementation. 

Thank you in advance.

Cheers,
Metin

On Thursday, September 29, 2016 at 6:22:26 PM UTC+2, Wolfgang Bangerth 
wrote:
>
>
> Metin, 
>
> > I need help to figure out some functions in fe_values.h and fe_values.cc 
> > sources. 
> > 
> > Could you please help me understand what's happening in the divergence 
> > function (SymmetricTensor<2, dim, spacedim>::divergence) and the 
> > symmetric_gradient function for the vectors 
> > (Vector<dim,spacedim>::symmetric_gradient), or point out any material 
> > (manual, video etc.)? 
>
> Can you be more specific which functions and which parts within them you 
> have trouble with? 
>
> Best 
>   Wolfgang 
>
> -- 
> ------------------------------------------------------------------------ 
> Wolfgang Bangerth          email:                 bang...@colostate.edu 
> <javascript:> 
>                             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 dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to