Thank you Prof. Bangerth for your quick concern. I am on basic level for 
FEM code programming especially deal.ii and also quite only a bit familiar 
with object oriented programming in C++. 
Sorry if my question was not clear, let me explain it a bit:
Actually, I am trying to follow the tutorial step-8 for extending it to 
applying BC upon the labelled edges during meshing in mesh generator. I am 
quit successful in applying Dirchlet (displacement) BC simply using 
function "interpolate_boundary_values()". Now it is time to apply Neumann 
(force) BC. 
For this yes you guessed right that I am using "FEFaceValues" in following 
code as per tutorials:

     for (unsigned int f=0; f<GeometryInfo<dim> :: faces_per_cell; ++f)  
            if (cell->face(f)->at_boundary() )
            {
                fe_face_values.reinit (cell,f);
                for (unsigned int i=0; i<dofs_per_cell; ++i)
                  {
                    const unsigned int
                    component_i = fe.system_to_component_index(i).first;

                    for (unsigned int q_point=0; q_point<n_face_q_points; 
++q_point)
                      cell_rhs(i) += fe_face_values.shape_value(i,q_point) *
                                     rhs_values[q_point][component_i] *
                                     fe_face_values.JxW(q_point);
                                        }
            }


 Where the *"rhs_values"* are being extracted from my previously mentioned 
function "*right_hand_side (fe_values.get_quadrature_points(), rhs_values, 
cell);"* in a same loop of "*for (; cell!=endc; ++cell)" *and the code for 
this "*right_hand_side" *function is that which I mentioned previously. 
In my limited knowledge I am going through each face in cell as in 2D there 
are four edges are present and I want to choose the edge number 3 (which is 
upper outer edge in my example case). 


*So the problem is how to tell program that which quadrature point is near 
the concerned boundary edge e.g. edge no. 3 so that the force boundary 
value can be applied? *
You can also suggest and make comment in your expert opinion if the idea or 
my methodology is wrong or needs modification. Thank you in advance for 
your concern and expert opinion.                                 

On Wednesday, April 3, 2019 at 5:03:06 PM UTC+2, Wolfgang Bangerth wrote:
>
> On 4/3/19 8:04 AM, Muhammad Mashhood wrote: 
> > 
> >                                     I am trying to apply the Neumann 
> (force) 
> > BC on the edge using the right_hand_side() function which I modified as 
> following: 
> > 
> > 
> > void right_hand_side (const std::vector<Point<dim> > &points,   // the 
> active 
> > cell is also imported when right hand side is called to induce some 
> Neumann BC 
> >                          std::vector<Tensor<1, dim> >   &values, 
> >                          typename DoFHandler<dim>::active_cell_iterator 
> & 
> > cell_in_rhs) 
> > 
> > for (unsigned int f=0; f < GeometryInfo<dim> :: faces_per_cell; ++f) 
> >                  { 
> >                      if (cell_in_rhs->face(f)->at_boundary() && 
> > cell_in_rhs->face(f)->boundary_id() == 3) 
> >                          { 
> >                              std::cout << "points.size(): "<< 
> points.size()<<" 
> > :"<<std::endl; 
> >                              values[0][1] = 2.0; 
> >                              values[2][1] = 2.0; 
> > 
> >                          } 
> >                                       } 
> > 
>
> I don't think I understand this code. The Neumann boundary conditions only 
> appear in *boundary* integrals. How are you using the function you have 
> here? 
> For integrals over cells (using FEValues) or integrals over faces 
> (FEFaceValues)? If it is the latter, you are integrating over *one 
> specific 
> face* of the current cell, so it makes no sense to loop over all faces 
> *within 
> this function*. 
>
> Best 
>   W. 
>
> -- 
> ------------------------------------------------------------------------ 
> Wolfgang Bangerth          email:                 [email protected] 
> <javascript:> 
>                             www: http://www.math.colostate.edu/~bangerth/ 
>
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to