Dear Wolfgang,

Thank you for your reply.

This problem is solved by adding 
constraints.distribute (solution);
in 
void MixedLaplaceProblem<dim>::solve ()
in my code.

Kind regards,
Jie 

On Thursday, February 15, 2018 at 5:24:44 PM UTC+1, jie liu wrote:
>
>
> Dear all,
>
> I want to solve an 1D Poisson equation with the inhomogeneous boundary 
> condition on the gradient (velocity) using the mixed FEM. The equation reads
>
>
>
> I used step-20 to implement the mixed FEM.
> Since this step cannot deal with the inhomogeneous boundary condtion on 
> the gradient, I added some code of step-22.
> The changes are:
> (1) adding
>     system_matrix.clear ();
>     dof_handler.distribute_dofs (fe);
>     DoFRenumbering::Cuthill_McKee (dof_handler);
>     std::vector<unsigned int> block_component (dim+1,0);
>     block_component[dim] = 1;
>     DoFRenumbering::component_wise (dof_handler, block_component);
>
>     {
>     constraints.clear ();
>     FEValuesExtractors::Vector velocities(0);       
>     DoFTools::make_hanging_node_constraints (dof_handler,
>                                              constraints);
>     
>     VectorTools::interpolate_boundary_values (dof_handler,
>                                               1,
>                                               GradientBoundary<dim>(),
>                                               constraints,
>                                               fe.component_mask(velocities
> )
>                                              );
>                                              
>     }
>     constraints.close ();
> of  step-22 in
>
>> void MixedLaplaceProblem<dim>::make_grid_and_dofs () 
>>
> of step-20;
> (2) adding
>         for (unsigned int i=0; i<dofs_per_cell; ++i)
>           for (unsigned int j=i+1; j<dofs_per_cell; ++j)
>             local_matrix(i,j) = local_matrix(j,i);
>         cell->get_dof_indices (local_dof_indices);
>         
>         constraints.condense (system_matrix, system_rhs);
> of  step-22 in
>   void MixedLaplaceProblem<dim>::assemble_system ()
> of step-20.
>
> Pn elements are used for the solution and Pn+1 elements are used for the 
> gradient.
>     fe (FE_Q<dim>(degree+1), 1,
>         FE_Q<dim>(degree), 1),
>
> Setting 'a' equal or not equal to zero, it works when 'b' is equal to zero 
> (homogeneous Dirichlet boundary condition on the gradient). 
> Specifically, the convergence order of the solution is one order higher 
> than the element degree of the solution, and the convergence order of the 
> gradient is equal to or one order lower than the element degree of the 
> gradient.
> However, when 'b' is not equal to zero ( inhomogeneous Dirichlet boundary 
> condition on the gradient), it does not work for the gradient, i.e. the 
> convergence order of the solution is still one order higher than the 
> element degree, but the convergence order of the gradient keeps 0.5 for 
> different elements. 
>
> Could anyone explain this? Thank you.
>
> Kind regards,
> Jie
>

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