Metin,

[...]
> 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..
>
Let me just comment on this: 
The divergence at a quadrature point is decomposed into a sum over all 
shape functions and all of their components.
Since the value at a certain quadrature point q_p of a FE function u can be 
written as u(q_p)=\sum_i u_i \phi_i(q_p),
it holds \nabla \cdot u(q_p) = \sum_i u_i \nabla \cdot \phi_i(q_p) = \sum_i 
u_i \sum_c \partial_c \phi_i^c(q_p) where \phi_i^c is the cth component of 
the ith shape function. 
This is exactly what is done in the last line.
shape_gradient_ptr is initialized with the gradient of the dth component of 
the considered shape_function at the first quadrature point.
By "*shape_gradient_ptr++", the gradient at this quadrature point is 
returned and the pointer incremented such that it points to the
gradient at the next quadrature point.

Best,
Daniel

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