Feng, 

in the line 


   std::map<unsigned int,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
           0,
           BoundaryValues<dim>(),
           boundary_values);

you are interpolating boundary values for boundary id 0 (the left side). If you 
also want to have dirichlet bc on the right side, you should call the same 
function again with boundary id 1 (the right side). 

Luca.

--
Luca Heltai <[email protected]>
http://people.sissa.it/~heltai/
Scuola Internazionale Superiore di Studi Avanzati
Phone:  +39 040 3787 449, Office: 732
--
There are no answers, only cross references

On 03/set/2010, at 10.16, 崔峰 wrote:

> 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
> <fem1d.cpp>_______________________________________________
> dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

--
Luca Heltai <[email protected]>
http://people.sissa.it/~heltai/
Scuola Internazionale Superiore di Studi Avanzati
Phone:  +39 040 3787 449, Office: 732
--
There are no answers, only cross references.







_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to