Hello Feng Cui,

this is not surprising, since you did not prescribe any boundary
condition on the right boundary. In 1D the left boundary of the
triangulation has boundary indicator 0 and the right boundary has
boundary indicator 1.

Thus, you have to add the lines

VectorTools::interpolate_boundary_values (dof_handler, 1, 
BoundaryValues<dim>(), boundary_values);
MatrixTools::apply_boundary_values (boundary_values, system_matrix, solution, 
system_rhs);

to your assemble_system function.

Best Regards,
Markus



Am 03.09.10 10:16, schrieb 崔峰:
> Deal all,
> I am a beginner for deal.II, and have studied some examples in tutorial.
> I tried to solve the laplace equation in 1D, but I could not get the
> correct reuslt.
> Especially, the right boundary value doesn`t conform to the value in
> boundary function.
> The source code is put in the attached file.
> Thanks in advance.
> Best
> Feng Cui
>
>
> _______________________________________________
> dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
>   
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to