Thank you for quick reply!!! 

I tried your suggestions but I couldn't resolve the problem.....

The more weird thing is if I commands as..


GridGenerator::hyper_cube (triangulation, 0, 1);

            triangulation.refine_global ();


 for (typename Triangulation<dim>::active_cell_iterator

                 cell=triangulation.begin_active();

                 cell!=triangulation.end(); ++cell)

            {

                for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; 
++f)

                {

                    

                

                    if ( std::abs(cell->face(f)->center()[0]-0.5)< 1e-12 )


                    {


                        cell->face(f)->set_all_boundary_ids(1);

                        

                    }

                    

                    

                }

            }


<https://lh3.googleusercontent.com/-vxXjt_6106w/WCjEWZXkl9I/AAAAAAAAA9M/HtP_S_FZR3wqpaBSHpe7SjgNG9tCnYX5gCLcB/s1600/Screen%2BShot%2B2016-11-13%2Bat%2B1.50.56%2BPM.png>



2016년 11월 13일 일요일 오후 1시 35분 3초 UTC-6, Jean-Paul Pelteret 님의 말:
>
> Hi Jaekwang,
>
> With what you've shown I'm going to guess that your problem might simply 
> be related to numerical / round-off error associated with floating point 
> calculations. 
>
> if ( cell->face(f)->center()[0]==1 ) // The LHS value is a computed 
>> double, and the RHS value is an integer which will be cast to a double for 
>> comparison
>
>
> Take a look at the mesh-generation part in the introduction to step-2 
> <https://www.dealii.org/developer/doxygen/deal.II/step_2.html#Meshgenerationhttps://www.dealii.org/developer/doxygen/deal.II/step_2.html%23Meshgeneration>
>  for 
> how one best implements these types of comparisons. They're particularly 
> relevant when dealing with the geometry, especially in more complex 
> scenarios. Admittedly the step-2 example is for a circular geometry but the 
> same concept applies: 
>
> if ( std::abs(cell->face(f)->center()[0]) < 1e-10 ) ...
>
> if ( std::abs(cell->face(f)->center()[0] - 1.0) < 1e-10 ) ...
>
> You can almost never be certain that any calculated floating point value 
> will be an exact match to an implicitly cast integer value right down to 
> machine precision, which is what will be checked with the equality operator.
>>
>>
> I hope that this fixes your issue.
>
> Regards,
> J-P
>

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