Hi Gabriel,

I think tutorial step-22 (the part about renumbering dofs) discusses what 
you need:

You could do that when setting up your system:

std::vector<unsigned int> block_component(dim + 1, 0);
block_component[dim] = 1;
DoFRenumbering::component_wise 
<https://www.dealii.org/current/doxygen/deal.II/namespaceDoFRenumbering.html#a75c2e3cd2d4fe86e0ec209a41a005cb0>(dof_handler,
 
block_component);

You could then access the velocity component of

     BlockVector<double> 
<https://www.dealii.org/current/doxygen/deal.II/classBlockVector.html> 
solution;

through 

Vector<double> 
<https://www.dealii.org/current/doxygen/deal.II/classBlockVector.html> 
velocity(solution.block(0));

Every second entry (in 2D) should then be your x-component of the velocity. ... 
at least as far as I recall (so better double check that)

Best, Konrad

Hey everyone,
>
> I have the following problem
> I have a classical velocity - pressure Blockvector "soluion" and a 
> FEsystem (initialized via
> *             fe(FE_Q<dim>(degree + 1), dim, FE_Q<dim>(degree), 1)*
>
> For some testing I want to get the velocity compontents of solution in 
> seperate vectors,
> i.e. a vector u_x which contains the velocity values of solution in 
> x-direction.
>
> I am not really sure yet how to get these values.
>
> My attempt is to use FEValues and quadrature points
>
>
> u_x.reinit(n_dofs_in_one_direction);
> *FEValues<dim>                             fe_values(fe, 
> quadrature_formula, update_values);*
> *std::vector<Tensor<1, dim>>          velocity_values(n_q_points);*
> *const FEValuesExtractors::Vector   velocities(0);*
>
> *for (const auto &cell : dof_handler.active_cell_iterators())*
> * {*
> *      fe_values.reinit(cell);*
> *      fe_values[velocities].get_function_values(solution, 
> velocity_values);*
>  
> *    [...]*
>
> *}*
>
> With this procedure I get the vector of Tensors velocity_values, which 
> contains the velocity-values of "solution" in every direction at the 
> quadratue points. So now I an easily get the values of velocity_values in 
> the x-direction at the quadrature points. But how do I get the values of 
> u_x at the dofs?
>
> Does somebody have an idea how to fix this, or a better way to do handle 
> this?
>
>
> Best regards
>
> Gabriel
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/f4b83a6c-e494-4aae-b05d-b7ea88086013%40googlegroups.com.

Reply via email to